/* ===========================================
   findusdoc.ch · home page
   Structure follows jensapp.ch: hero, numbered sections, contact instead
   of download. Look follows the FINDUS app: table first.
   =========================================== */

/* ---------- Hero ---------- */
.hero { padding: calc(var(--nav-h) + 72px) 0 0; border-bottom: 1px solid var(--rule); }
.hero-meta { margin-bottom: 40px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero-meta .label b { color: var(--accent-text); font-weight: 400; }
.hero-body {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px;
    align-items: end; padding-bottom: 56px;
}
.hero h1 {
    font-weight: 800;
    font-size: clamp(2.6rem, 7.6vw, 7.4rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 1.06rem; line-height: 1.6; color: var(--ink-2); max-width: 52ch; }
.lead strong { color: var(--ink); }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* The run panel: what Record looks like while it shoots */
.run {
    border: 1px solid var(--rule-strong);
    background: var(--bg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    margin-bottom: 72px;
}
.run-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
    padding: 0 12px; min-height: 36px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--rule-strong);
    font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em;
}
.run-head .tab { color: var(--bg); background: var(--ink); padding: 3px 8px; }
.run-head .what { color: var(--ink-2); }
.run-head .count { margin-left: auto; color: var(--ink); }
.run-head .count b { color: var(--accent-text); font-weight: 400; }

.run-chain { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--rule-strong); }
.run-chain div {
    position: relative; padding: 8px 10px;
    border-left: 1px solid var(--rule);
    font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--muted);
    overflow: hidden;
}
.run-chain div:first-child { border-left: 0; }
.run-chain div span { position: relative; z-index: 1; }
.run-chain div::before {
    content: ''; position: absolute; inset: 0 100% 0 0;
    background: var(--accent-soft);
    transition: right 0.42s linear;
}
.run-chain div.on { color: var(--ink); }
.run-chain div.on::before { right: 0; }
.run-chain div.done { color: var(--ink-2); }
.run-chain div.done::before { right: 0; background: var(--bg-2); transition: none; }

.run-body { display: grid; grid-template-columns: 1fr 1.25fr; min-height: 252px; }
.run-steps { border-right: 1px solid var(--rule-strong); overflow: hidden; }
.run-steps table { width: 100%; border-collapse: collapse; }
.run-steps th, .run-steps td {
    text-align: left; padding: 4px 8px; height: 26px;
    border-bottom: 1px solid var(--rule);
    white-space: nowrap; font-weight: 400;
}
.run-steps th {
    font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--muted); background: var(--bg-2);
}
.run-steps td.name { font-family: var(--font-ui); font-size: var(--text-base); color: var(--ink); overflow: hidden; text-overflow: ellipsis; max-width: 0; width: 100%; }
.run-steps td.num, .run-steps td.t { color: var(--ink-2); }
.run-steps tr.cur td { background: var(--accent-soft); }
.run-steps tr.cur td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.run-steps tr.done td { color: var(--muted); }
.run-steps tr.done td.name { color: var(--muted); }

.run-log { padding: 8px 12px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.run-log .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.85; color: var(--ink-2); }
.run-log .line .addr { color: var(--muted); }
.run-log .line.file { color: var(--muted); }
.run-log .line.file b { color: var(--ok); font-weight: 400; }

/* OSC syntax colouring, same roles as the app's log */
.kw { color: var(--osc-kw); }
.tg { color: var(--osc-target); }
.lv { color: var(--osc-level); }
.tm { color: var(--osc-time); }
.cq { color: var(--osc-cue); }
.op { color: var(--osc-op); }
.st { color: var(--ink-2); }

/* ---------- Sections ---------- */
.section { padding: 88px 0; border-bottom: 1px solid var(--rule); }
.section--alt { background: var(--bg-2); }
.section-head {
    display: grid; grid-template-columns: 200px 1fr; gap: 48px;
    margin-bottom: 44px; align-items: start;
}
.section-num { padding-top: 10px; color: var(--accent-text); }
.section-head h2 {
    font-weight: 800;
    font-size: clamp(2rem, 4.6vw, 3.6rem);
    line-height: 0.98; letter-spacing: -0.035em;
    margin-bottom: 16px;
}
.section-head p { color: var(--ink-2); max-width: 60ch; }
.section-body { display: grid; grid-template-columns: 200px 1fr; gap: 48px; }
.section-body > .aside { padding-top: 2px; }
.section-body > .aside p { font-size: var(--text-md); color: var(--muted); }

/* Dense tables, the app's own idiom */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--rule-strong); background: var(--bg); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 7px 12px; border-bottom: 1px solid var(--rule); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th {
    font-family: var(--font-mono); font-weight: 400;
    font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--ink); background: var(--bg-3);
    border-bottom: 1px solid var(--rule-strong);
    white-space: nowrap;
}
.tbl td + td, .tbl th + th { border-left: 1px solid var(--rule); }
.tbl tbody tr:nth-child(even) td { background: var(--bg-2); }
.tbl tbody tr:hover td { background: var(--accent-soft); }
.tbl td.n { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); width: 1%; white-space: nowrap; }
.tbl td.k { font-weight: 700; white-space: nowrap; }
.tbl td.r { color: var(--ink-2); }
.tbl code { color: var(--ink); }
.tbl .hl td { box-shadow: inset 0 0 0 1px var(--accent); }

/* The flow strip under the workflow table */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; margin-top: 24px; }
.flow-box {
    border: 1px solid var(--rule-strong); background: var(--bg);
    padding: 10px 14px; min-width: 120px;
}
.flow-box .label { display: block; margin-bottom: 2px; }
.flow-box strong { font-size: var(--text-md); }
.flow-box--file { border-style: dashed; }
.flow-box--file strong { font-family: var(--font-mono); font-weight: 400; font-size: var(--text-sm); }
.flow-arrow {
    display: flex; align-items: center; padding: 0 10px;
    font-family: var(--font-mono); color: var(--accent-text);
}
.flow-aside { margin-left: auto; }

/* Step rows (the five beats) */
.beats { border-top: 1px solid var(--rule-strong); }
.beat {
    display: grid; grid-template-columns: 56px 130px 1fr 150px; gap: 24px;
    padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.beat .n { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent-text); }
.beat .name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.beat .desc { color: var(--ink-2); }
.beat .tick { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); text-align: right; text-transform: uppercase; letter-spacing: 0.08em; }

/* Command block */
.cmd {
    margin-top: 32px;
    border: 1px solid var(--rule-strong); background: var(--bg);
}
.cmd-head {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 8px 12px; background: var(--bg-3); border-bottom: 1px solid var(--rule-strong);
}
.cmd pre {
    font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.9;
    padding: 12px; overflow-x: auto; color: var(--ink-2);
}
.cmd pre .c { color: var(--muted); }
.cmd pre .addr { color: var(--muted); }
.cmd-foot { padding: 10px 12px; border-top: 1px solid var(--rule); font-size: var(--text-md); color: var(--ink-2); }

/* Cells grid (cameras, view) */
.cells {
    display: grid; grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong);
}
.cells--3 { grid-template-columns: repeat(3, 1fr); }
.cell {
    padding: 22px 22px 24px;
    border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
    background: var(--bg);
}
.cell .label { display: block; margin-bottom: 10px; color: var(--accent-text); }
.cell h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 8px; }
.cell p { font-size: var(--text-md); color: var(--ink-2); }
.cell p + p { margin-top: 8px; }
.cell code { color: var(--ink); }

.note {
    margin-top: 24px; padding: 12px 14px;
    border: 1px solid var(--rule-strong); border-left: 3px solid var(--accent);
    background: var(--bg); font-size: var(--text-md); color: var(--ink-2);
}
.note .label { color: var(--accent-text); margin-right: 8px; }
.note--warn { border-left-color: var(--warn); }
.note--warn .label { color: var(--warn); }

/* Ground rules */
.rules { list-style: none; border-top: 1px solid var(--rule-strong); }
.rules li {
    display: grid; grid-template-columns: 56px 1fr; gap: 24px;
    padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.rules li .n { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent-text); padding-top: 3px; }
.rules li strong { display: block; font-size: 1.08rem; margin-bottom: 2px; }
.rules li span { color: var(--ink-2); }

/* Contact */
.contact { padding: 104px 0; border-bottom: 1px solid var(--rule); background: var(--ink); color: var(--bg); }
.contact .section-num { color: var(--accent); }
.contact h2 {
    font-weight: 800; font-size: clamp(2.4rem, 6.4vw, 5.6rem);
    line-height: 0.92; letter-spacing: -0.045em;
}
.contact h2 em { font-style: normal; color: var(--accent); }
.contact p { color: var(--bg-4); max-width: 56ch; margin-top: 20px; }
.contact-mail {
    display: inline-block; margin-top: 36px;
    font-family: var(--font-mono); font-size: clamp(1rem, 2.6vw, 1.6rem);
    color: var(--bg); text-decoration: none;
    border-bottom: 2px solid var(--accent); padding-bottom: 4px;
    overflow-wrap: anywhere;
}
.contact-mail:hover { color: var(--accent); }
.contact-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.contact .btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.contact .btn:hover { background: var(--bg); border-color: var(--bg); color: var(--ink); }
.contact .btn--ghost { background: transparent; color: var(--bg); border-color: var(--muted); }
.contact .btn--ghost:hover { background: transparent; color: var(--bg); border-color: var(--bg); }
.contact-list { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--muted); }
.contact-list div { padding: 16px 20px 0 0; }
.contact-list .label { color: var(--accent); display: block; margin-bottom: 4px; }
.contact-list span { color: var(--bg-4); font-size: var(--text-md); }

/* Reveal on scroll (only when JS runs and motion is fine) */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .run-chain div::before { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .hero-body { grid-template-columns: 1fr; gap: 28px; }
    .section-head, .section-body { grid-template-columns: 1fr; gap: 16px; }
    .section-num { padding-top: 0; }
    .beat { grid-template-columns: 40px 1fr; gap: 4px 16px; }
    .beat .desc, .beat .tick { grid-column: 2; }
    .beat .tick { text-align: left; }
    .cells--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .hero { padding-top: calc(var(--nav-h) + 40px); }
    .run-body { grid-template-columns: 1fr; }
    .run-steps { border-right: 0; border-bottom: 1px solid var(--rule-strong); }
    .run-steps tr.extra { display: none; }
    .run-log { min-height: 150px; }
    .run-chain div { padding: 8px 6px; letter-spacing: 0.06em; }
    .cells, .cells--3 { grid-template-columns: 1fr; }
    .flow { flex-direction: column; }
    .flow-arrow { padding: 4px 14px; transform: rotate(90deg); align-self: flex-start; }
    .flow-aside { margin-left: 0; margin-top: 12px; }
    .contact-list { grid-template-columns: 1fr; }
    .section { padding: 64px 0; }
    .rules li { grid-template-columns: 40px 1fr; gap: 16px; }
}
