/* exn1.uk — styles for the scrolling sections, case files and field notes.
   Loaded after style.min.css (the original coming-soon theme). */

@font-face { font-family: "Open Sauce Sans"; font-weight: 400; font-style: normal; font-display: swap;
    src: url("/assets/fonts/open-sauce-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Sans"; font-weight: 400; font-style: italic; font-display: swap;
    src: url("/assets/fonts/open-sauce-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Sans"; font-weight: 600; font-style: normal; font-display: swap;
    src: url("/assets/fonts/open-sauce-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sauce Sans"; font-weight: 700; font-style: normal; font-display: swap;
    src: url("/assets/fonts/open-sauce-sans-latin-700-normal.woff2") format("woff2"); }

:root {
    --ink: #e8edf2;
    --ink-muted: rgba(232, 237, 242, 0.64);
    --ink-faint: rgba(232, 237, 242, 0.38);
    --hair: rgba(232, 237, 242, 0.14);
    --glow: #fddba3;
    --glow-rgb: 253, 219, 163;
    --panel: rgba(10, 15, 26, 0.86);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --sans: "Open Sauce Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- page frame ---------- */

html, body { height: auto; min-height: 100%; }
body { background-color: #0a0f1a; overflow-x: hidden; }

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

@media (min-width: 992px) {
    .masthead { height: 100vh; height: 100dvh; }
}

.scroll-cue { white-space: nowrap; }

.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ---------- sections ---------- */

.sections, .site-footer, .doc-main, .back {
    position: relative;
    z-index: 3;
    color: var(--ink);
    font-family: var(--sans);
}

.section {
    padding: 7rem 1.5rem;
    background: var(--panel);
    border-top: 1px solid var(--hair);
}
.section.cases {
    background: linear-gradient(to bottom, rgba(10, 15, 26, 0.35), rgba(10, 15, 26, 0.6));
    border-top: 0;
}

.wrap { max-width: 64rem; margin: 0 auto; }

.kicker {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--glow);
    margin-bottom: 0.9rem;
}

.sections h2 {
    color: var(--ink);
    font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    max-width: 38rem;
    margin-bottom: 1rem;
}

.section-lede { color: var(--ink-muted); font-size: 1.1rem; max-width: 36rem; margin-bottom: 0; }

.sections a, .site-footer a, .doc-main a { color: var(--ink); text-decoration: none; }

.more {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--glow) !important;
}
.more:hover { text-decoration: underline; }

/* ---------- firefly case files ---------- */

.firefield {
    position: relative;
    list-style: none;
    margin: 3.5rem auto 1rem;
    padding: 0;
    max-width: 72rem;
    height: 34rem;
}

.ff {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transition: opacity 900ms ease-out, transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--i) * 220ms);
}
.js .firefield:not(.lit) .ff { opacity: 0; transform: scale(0.4); }

.ff a {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    max-width: 22rem;
    padding: 0.4rem;
    border-radius: 6px;
    outline-offset: 4px;
}

.ff-dot {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 0.5rem;
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 10px 3px rgba(var(--glow-rgb), 0.55), 0 0 32px 10px rgba(var(--glow-rgb), 0.18);
    animation: ffPulse 2.6s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.7s);
}

.ff-label { font-size: 1.08rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.ff-num {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--glow);
    margin-bottom: 0.15rem;
}

.ff-teaser {
    position: absolute;
    left: calc(12px + 1.3rem);
    top: 100%;
    width: 20rem;
    padding: 0.8rem 1rem;
    background: rgba(10, 15, 26, 0.95);
    border-left: 2px solid var(--glow);
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 200ms, transform 200ms;
    z-index: 5;
}

.ff a:hover, .ff a:focus-visible { z-index: 6; }
.ff:hover, .ff:focus-within { z-index: 6; }
.ff a:hover .ff-label, .ff a:focus-visible .ff-label { color: var(--glow); }
.ff a:hover .ff-dot, .ff a:focus-visible .ff-dot { transform: scale(1.5); animation-play-state: paused; }
.ff a:hover .ff-teaser, .ff a:focus-visible .ff-teaser { opacity: 1; transform: none; }

@keyframes ffPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px 3px rgba(var(--glow-rgb), 0.55), 0 0 32px 10px rgba(var(--glow-rgb), 0.18); }
    50% { opacity: 0.7; box-shadow: 0 0 6px 2px rgba(var(--glow-rgb), 0.35), 0 0 18px 6px rgba(var(--glow-rgb), 0.08); }
}

@media (max-width: 767.98px) {
    .firefield { height: auto; display: grid; gap: 1.6rem; padding: 0 1.1rem; margin-top: 2.5rem; }
    .ff { position: static; }
    .ff a { max-width: none; }
    .ff-label { display: block; }
    .ff-teaser {
        position: static;
        display: block;
        width: auto;
        padding: 0.35rem 0 0;
        background: none;
        border: 0;
        opacity: 1;
        transform: none;
    }
    .ff a { display: grid; grid-template-columns: 12px 1fr; column-gap: 0.9rem; }
    .ff-dot { grid-row: 1; grid-column: 1; }
    .ff-label { grid-column: 2; }
    .ff-teaser { grid-column: 2; }
}

/* ---------- services ---------- */

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 2rem 3rem;
    margin: 3rem 0 2.5rem;
}
.services dt { font-weight: 600; font-size: 1.1rem; color: var(--ink); margin-bottom: 0.35rem; }
.services dd { color: var(--ink-muted); margin: 0; line-height: 1.6; }
.where { color: var(--ink-faint); font-size: 0.95rem; margin: 0; }

/* ---------- lists (notes, case index) ---------- */

.list { list-style: none; padding: 0; margin: 2.5rem 0 0; border-bottom: 1px solid var(--hair); }
.list li { border-top: 1px solid var(--hair); }
.list a { display: block; padding: 1.4rem 0; }
.li-kicker { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glow); margin-bottom: 0.3rem; }
.li-title { display: block; font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.li-sub { display: block; color: var(--ink-muted); margin-top: 0.3rem; line-height: 1.55; }
.list a:hover .li-title { color: var(--glow); }

/* ---------- proof ---------- */

.proof {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
}
.proof a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    padding: 1.4rem 1.3rem;
    border: 1px solid var(--hair);
    border-radius: 6px;
    transition: border-color 200ms, background 200ms;
}
.proof a:hover { border-color: rgba(var(--glow-rgb), 0.6); background: rgba(var(--glow-rgb), 0.04); }
.proof-verb { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow); }
.proof-what { font-size: 1.1rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.proof-where { font-size: 0.88rem; color: var(--ink-faint); margin-top: auto; }

/* ---------- diagnosis form ---------- */

.diag {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem 1.5rem;
    margin-top: 2.5rem;
    max-width: 44rem;
}
.diag label { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.9rem; color: var(--ink-muted); }
.diag .full { grid-column: 1 / -1; }
.diag .opt { color: var(--ink-faint); }
.diag input, .diag select, .diag textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: rgba(232, 237, 242, 0.05);
    border: 1px solid var(--hair);
    border-radius: 4px;
    padding: 0.7rem 0.8rem;
}
.diag select option { background: #0a0f1a; }
.diag textarea { resize: vertical; }
.diag input::placeholder, .diag textarea::placeholder { color: var(--ink-faint); }
.diag input:focus, .diag select:focus, .diag textarea:focus { outline: 2px solid rgba(var(--glow-rgb), 0.7); outline-offset: 1px; border-color: transparent; }
.diag button {
    justify-self: start;
    font: inherit;
    font-weight: 600;
    color: #0a0f1a;
    background: var(--glow);
    border: 0;
    border-radius: 4px;
    padding: 0.8rem 1.4rem;
    cursor: pointer;
}
.diag button:hover { background: #ffe8c2; }
.diag-note { grid-column: 1 / -1; font-size: 0.85rem; color: var(--ink-faint); margin: 0; }
.diag-note a { text-decoration: underline !important; }

@media (max-width: 575.98px) {
    .diag { grid-template-columns: 1fr; }
    .section { padding: 5rem 1.1rem; }
}

/* ---------- footer ---------- */

.site-footer {
    background: #070a12;
    border-top: 1px solid var(--hair);
    padding: 3rem 1.5rem;
    color: var(--ink-faint);
    font-size: 0.9rem;
}
.site-footer p { margin: 0.3rem 0; }
.site-footer .ex { color: var(--ink-muted); font-style: italic; }
.site-footer a:hover { color: var(--glow); }

/* ---------- case file + field note pages ---------- */

body.doc { background: #0a0f1a; }
body.doc #canvas { opacity: 0.6; }
@media (pointer: coarse) and (hover: none) { body.doc { background: #0a0f1a; } }

.back {
    position: absolute;
    top: 1.6rem;
    left: 1.6rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink) !important;
    text-decoration: none;
}
.back::before { content: "← "; color: var(--glow); font-weight: 400; }

.doc-main { max-width: 42rem; margin: 0 auto; padding: 7rem 1.5rem 4rem; background: #0a0f1a; box-shadow: 0 0 80px 60px #0a0f1a; }
.doc-main h1 { color: var(--ink); font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 700; letter-spacing: -0.015em; margin-bottom: 1rem; }
.doc-main h2 { color: var(--ink); font-size: 1.3rem; font-weight: 600; margin: 2.8rem 0 1rem; }
.doc-main .lede { font-size: 1.25rem; color: var(--ink-muted); line-height: 1.55; }
.doc-main .stack { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 0.7rem 0; margin: 2rem 0; }
.doc-main article p, .doc-main article li { color: rgba(232, 237, 242, 0.86); font-size: 1.06rem; line-height: 1.75; }
.doc-main article ol, .doc-main article ul { padding-left: 1.3rem; }
.doc-main article li { margin-bottom: 1rem; }
.doc-main article li::marker { color: var(--glow); font-family: var(--mono); font-size: 0.9em; }
.doc-main article strong { color: var(--ink); }
.doc-main article a { text-decoration: underline !important; text-decoration-color: rgba(var(--glow-rgb), 0.6) !important; }
.doc-main blockquote { margin: 2.5rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 2px solid var(--glow); }
.doc-main blockquote p { font-size: 1.2rem !important; font-style: italic; color: var(--ink) !important; }
.signoff { font-size: 0.9rem !important; color: var(--ink-faint) !important; font-style: italic; margin-top: 3rem; }

.cta { margin: 3.5rem 0 2rem; padding: 1.5rem 1.6rem; border: 1px solid rgba(var(--glow-rgb), 0.35); border-radius: 6px; background: rgba(var(--glow-rgb), 0.04); }
.cta p { margin: 0; color: var(--ink-muted); }
.cta .cta-title { color: var(--ink); font-weight: 600; font-size: 1.1rem; margin-bottom: 0.4rem; }
.cta a { color: var(--glow) !important; white-space: nowrap; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.85rem; padding-top: 1.5rem; border-top: 1px solid var(--hair); }
.pager a { color: var(--ink-muted) !important; }
.pager a:hover { color: var(--glow) !important; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .ff, .ff-dot, .ff-teaser { transition: none !important; animation: none !important; }
    .js .firefield:not(.lit) .ff { opacity: 1; transform: none; }
}
