/* ─────────────────────────────────────────────────────────────
   Best AEO Experts — independent editorial ranking
   Palette: light-dominant (warm editorial paper) · Skeleton: topbar-stack
   Fonts: Newsreader (display) · Schibsted Grotesk (body) · Spline Sans Mono (labels)
   ───────────────────────────────────────────────────────────── */

/* ── TOKENS ── */
:root {
    --paper: #f7f5f0;
    --paper-2: #efece4;
    --card: #fffdf8;
    --ink: #16161c;
    --ink-soft: #45454f;
    --faint: #83817a;
    --rule: rgba(22, 22, 28, 0.14);
    --rule-2: rgba(22, 22, 28, 0.30);
    --rank: #b21e3b;
    --rank-ink: #8f1730;
    --rank-soft: rgba(178, 30, 59, 0.09);
    --gold: #b0842a;
    --silver: #7f828b;
    --bronze: #a4632e;
    --display: "Newsreader", Georgia, "Times New Roman", serif;
    --body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --wrap: 1120px;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.62;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--rank); color: #fff; }

.ledger { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

.kicker {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--rank);
}

/* ── BUTTONS ── */
.act {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--body); font-weight: 600; font-size: 15px;
    padding: 13px 24px; border-radius: 3px; cursor: pointer;
    transition: transform 0.18s, background 0.18s, color 0.18s, border-color 0.18s;
}
.act-fill { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.act-fill:hover { background: var(--rank); border-color: var(--rank); transform: translateY(-2px); }
.act-line { color: var(--ink); border-bottom: 2px solid var(--rank); border-radius: 0; padding: 2px 0 3px; }
.act-line:hover { color: var(--rank); }

/* ── MASTHEAD (topbar-stack) ── */
.masthead-bar {
    background: var(--ink); color: var(--paper);
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.masthead-bar .ledger { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 18px; }
.masthead-bar .mb-note { color: #c9c6bd; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.masthead-bar .mb-issue { color: var(--paper); flex: none; }
.masthead-bar .mb-issue b { color: #e7b34d; font-weight: 400; }

.masthead {
    position: sticky; top: 0; z-index: 100;
    background: rgba(247, 245, 240, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule-2);
}
.masthead .ledger { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 74px; }

.crest { display: flex; align-items: center; gap: 12px; }
.crest-mark { width: 42px; height: 42px; flex: none; }
.crest-word { display: flex; flex-direction: column; line-height: 1; }
.crest-word b { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.crest-word b em { font-style: italic; color: var(--rank); }
.crest-word span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }

.masthead-nav { display: flex; align-items: center; gap: 28px; list-style: none; }
.mn-link { font-size: 15px; color: var(--ink-soft); position: relative; padding: 4px 0; transition: color 0.2s; }
.mn-link::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 0; height: 1.5px; background: var(--rank); transition: width 0.25s; }
.mn-link:hover { color: var(--ink); }
.mn-link:hover::after { width: 100%; }
.mn-cta { margin-left: 4px; }

.beacon { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; }
.beacon span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px auto; transition: transform 0.3s, opacity 0.3s; }
.beacon.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.beacon.is-open span:nth-child(2) { opacity: 0; }
.beacon.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── FRONTISPIECE (hero — poster typography, light) ── */
.frontis {
    position: relative; overflow: hidden;
    padding: 74px 0 66px;
    border-bottom: 1px solid var(--rule);
}
.frontis-ghost {
    position: absolute; inset: auto 0 -3%; z-index: 0;
    font-family: var(--display); font-weight: 600;
    font-size: clamp(5rem, 17vw, 13rem); line-height: 1; letter-spacing: -0.04em;
    color: transparent; -webkit-text-stroke: 1.4px rgba(22, 22, 28, 0.10);
    white-space: nowrap; pointer-events: none; user-select: none;
}
.frontis .ledger { position: relative; z-index: 1; }
.frontis-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }

.frontis-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.frontis-kicker .rule { height: 1px; width: 46px; background: var(--rank); }
.frontis-title {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(44px, 7.2vw, 88px); line-height: 1.0; letter-spacing: -0.015em;
    max-width: 15ch; margin-bottom: 24px;
}
.frontis-title em { font-style: italic; color: var(--rank); }
.frontis-title mark { background: linear-gradient(transparent 60%, rgba(178, 30, 59, 0.18) 60%); color: inherit; padding: 0 0.06em; }
.frontis-lede { font-size: clamp(16px, 2.2vw, 20px); color: var(--ink-soft); max-width: 58ch; margin-bottom: 30px; }
.frontis-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-bottom: 46px; }

/* wax seal */
.seal { width: 148px; height: 148px; flex: none; animation: seal-turn 42s linear infinite; }
@keyframes seal-turn { to { transform: rotate(360deg); } }

/* tally / stat row */
.tally { display: flex; flex-wrap: wrap; gap: 20px 54px; }
.tally-cell { display: flex; flex-direction: column; gap: 3px; }
.tally-fig { font-family: var(--display); font-weight: 500; font-size: clamp(38px, 5vw, 52px); line-height: 1; }
.tally-cap { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

/* ── THE ROLL (ranking) ── */
.roll { padding: 78px 0 40px; }
.section-head { max-width: 720px; margin-bottom: 14px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 50px); line-height: 1.03; letter-spacing: -0.01em; }
.section-head h2 em { font-style: italic; color: var(--rank); }
.section-head p { color: var(--ink-soft); margin-top: 12px; font-size: 16px; }
.roll-note { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 22px 0 8px; padding-top: 20px; border-top: 1px solid var(--rule); display: flex; gap: 18px; flex-wrap: wrap; }
.roll-note .pip { display: inline-flex; align-items: center; gap: 7px; }
.roll-note .dot { width: 10px; height: 10px; border-radius: 2px; }
.dot.g { background: var(--gold); } .dot.s { background: var(--silver); } .dot.b { background: var(--bronze); }

.entry {
    display: grid; grid-template-columns: 92px 1fr; gap: 8px 26px; align-items: start;
    padding: 26px 0; border-top: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry-rank {
    font-family: var(--display); font-weight: 400; font-size: 58px; line-height: 0.9;
    color: var(--rule-2); letter-spacing: -0.03em; font-variant-numeric: lining-nums;
}
.entry.is-gold .entry-rank { color: var(--gold); }
.entry.is-silver .entry-rank { color: var(--silver); }
.entry.is-bronze .entry-rank { color: var(--bronze); }
.entry.is-gold, .entry.is-silver, .entry.is-bronze { border-left: 3px solid; padding-left: 20px; margin-left: -23px; }
.entry.is-gold { border-left-color: var(--gold); }
.entry.is-silver { border-left-color: var(--silver); }
.entry.is-bronze { border-left-color: var(--bronze); }

.medal { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.is-gold .medal { color: var(--gold); background: rgba(176, 132, 42, 0.12); }
.is-silver .medal { color: var(--silver); background: rgba(127, 130, 139, 0.14); }
.is-bronze .medal { color: var(--bronze); background: rgba(164, 99, 46, 0.12); }

.entry-name { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 3.4vw, 31px); line-height: 1.08; letter-spacing: -0.01em; }
.entry-role { color: var(--rank-ink); font-size: 15px; font-weight: 600; margin: 6px 0 12px; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--rule); padding: 4px 10px; border-radius: 999px; }

.dossier { border-top: 1px dotted var(--rule-2); }
.dossier-sum { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding-top: 13px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-soft); transition: color 0.2s; }
.dossier-sum::-webkit-details-marker { display: none; }
.dossier-sum:hover { color: var(--rank); }
.dossier-sum .sign { color: var(--rank); font-size: 16px; line-height: 1; transition: transform 0.3s; }
.dossier[open] .dossier-sum .sign { transform: rotate(45deg); }
.dossier-body { padding-top: 14px; max-width: 66ch; }
.dossier-body p { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 12px; }
.dossier-body p:last-child { margin-bottom: 0; }
.pts { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--rule); }
.pts li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.pts li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--rank); }
.dossier[open] .dossier-body p { animation: rise 0.3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }

/* ── COUNT BAND (by the numbers) ── */
.count-wrap { padding: 46px 0 78px; }
.count-band { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; background: var(--rule); gap: 1px; }
.count-cell { background: var(--card); padding: 30px 26px; position: relative; }
.count-cell.tier { background: linear-gradient(180deg, rgba(176, 132, 42, 0.06), var(--card)); }
.count-fig { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 6vw, 60px); line-height: 0.92; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 3px; }
.count-fig .suf { font-size: 0.45em; color: var(--rank); }
.count-cell.tier .count-fig .suf { color: var(--gold); }
.count-lbl { margin-top: 12px; font-size: 15px; color: var(--ink); }
.count-src { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-top: 5px; }
.count-cell::after { content: ""; position: absolute; left: 26px; bottom: 0; height: 3px; width: 38px; background: var(--rank); transform: scaleX(0); transform-origin: left; transition: transform 0.6s cubic-bezier(.2, .7, .2, 1); }
.count-cell.tier::after { background: var(--gold); }
.count-band.is-in .count-cell::after { transform: scaleX(1); }

/* ── BRIEF (what is AEO — light zone panel) ── */
.brief { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 78px 0; }
.brief-lede { font-family: var(--display); font-weight: 400; font-size: clamp(21px, 3vw, 28px); line-height: 1.32; max-width: 22ch; margin-bottom: 34px; }
.brief-lede em { font-style: italic; color: var(--rank); }
.brief-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 46px; align-items: start; }
.brief-cols p { color: var(--ink-soft); margin-bottom: 15px; }
.brief-cols h3 { font-family: var(--display); font-weight: 500; font-size: 22px; margin: 24px 0 10px; }
.brief-cols h3:first-child { margin-top: 0; }
.brief-facts { border-left: 2px solid var(--rank); padding-left: 24px; }
.brief-facts dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rank); margin-bottom: 4px; }
.brief-facts dd { margin-bottom: 20px; color: var(--ink); font-size: 15.5px; }
.brief-facts dd:last-child { margin-bottom: 0; }

/* ── METHOD (methodology) ── */
.method { padding: 78px 0; }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 44px; margin-top: 32px; }
.method-step { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 22px 0; border-top: 1px solid var(--rule); }
.ms-num { font-family: var(--mono); font-size: 13px; color: var(--rank); font-weight: 500; padding-top: 4px; }
.ms-body h3 { font-family: var(--display); font-weight: 500; font-size: 20px; margin-bottom: 6px; }
.ms-body p { color: var(--ink-soft); font-size: 15px; }
.method-note { margin-top: 30px; font-size: 14px; color: var(--faint); font-style: italic; max-width: 62ch; }

/* ── ASKED (FAQ — editorial, italic-serif questions) ── */
.asked { background: var(--paper-2); border-top: 1px solid var(--rule); padding: 78px 0; }
.asked-inner { max-width: 780px; }
.ask { border-top: 1px solid var(--rule); }
.ask:last-of-type { border-bottom: 1px solid var(--rule); }
.ask-sum { display: flex; flex-direction: column; gap: 6px; padding: 20px 36px 20px 0; cursor: pointer; list-style: none; position: relative; }
.ask-sum::-webkit-details-marker { display: none; }
.ask-sum::after { content: "+"; position: absolute; right: 2px; top: 20px; font-family: var(--mono); font-size: 18px; color: var(--faint); transition: transform 0.25s ease; }
.ask[open] .ask-sum::after { transform: rotate(45deg); color: var(--rank); }
.ask-prov { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.ask-q { font-family: var(--display); font-weight: 400; font-style: italic; font-size: clamp(19px, 2.6vw, 24px); line-height: 1.24; letter-spacing: -0.005em; }
.ask-q::before { content: "\201C"; } .ask-q::after { content: "\201D"; }
.ask-a { padding: 0 0 24px; max-width: 60ch; }
.ask-a p { font-size: 15.5px; line-height: 1.66; color: var(--ink-soft); margin-bottom: 10px; }
.ask-a p:last-child { margin-bottom: 0; }
.ask-a b { color: var(--ink); font-weight: 600; }
.ask[open] .ask-a p { animation: rise 0.3s ease both; }

/* ── DESK (editorial / placement form) ── */
.desk { padding: 82px 0; }
.desk-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 56px; align-items: start; }
.desk-copy h2 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 48px); line-height: 1.04; margin: 14px 0 16px; }
.desk-copy h2 em { font-style: italic; color: var(--rank); }
.desk-copy p { color: var(--ink-soft); max-width: 44ch; margin-bottom: 14px; }
.desk-copy .direct { font-family: var(--mono); font-size: 14px; margin-top: 22px; }
.desk-copy .direct a { color: var(--rank); border-bottom: 1px solid var(--rule-2); }

.desk-form { background: var(--card); border: 1px solid var(--rule-2); border-radius: 8px; padding: 30px; box-shadow: 0 22px 60px rgba(22, 22, 28, 0.09); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.field input, .field select, .field textarea {
    font-family: var(--body); font-size: 16px; color: var(--ink);
    background: var(--paper); border: 1px solid var(--rule-2); border-radius: 5px;
    padding: 12px 13px; transition: border-color 0.2s, background 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--rank); background: #fff; }
.field textarea { resize: vertical; min-height: 126px; }
.desk-form .act-fill { width: 100%; justify-content: center; margin-top: 4px; }
.desk-form .act-fill:disabled { opacity: 0.6; cursor: not-allowed; }
.desk-note { margin-top: 14px; font-size: 12.5px; color: var(--faint); text-align: center; }
.hp-field { position: absolute; left: -5000px; }

#form-message { margin-bottom: 6px; }
#form-message.success, #form-message.error { border-radius: 5px; padding: 13px 15px; font-size: 15px; }
#form-message.success { background: rgba(30, 130, 76, 0.10); border: 1px solid rgba(30, 130, 76, 0.4); color: #1c6b3f; }
#form-message.error { background: var(--rank-soft); border: 1px solid rgba(178, 30, 59, 0.4); color: var(--rank-ink); }
.btn-spinner { width: 17px; height: 17px; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── COLOPHON (footer) ── */
.colophon { background: var(--ink); color: #d8d5cc; padding: 58px 0 30px; }
.colophon-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.colophon-brand .crest-word b { color: var(--paper); }
.colophon-brand .crest-word b em { color: #e7b34d; }
.colophon-brand .crest-word span { color: #9a978e; }
.colophon-brand p { margin-top: 16px; font-size: 14.5px; color: #b4b1a8; max-width: 40ch; }
.colophon h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8f8c83; margin-bottom: 16px; }
.colophon-col a { display: block; color: #d8d5cc; font-size: 15px; padding: 5px 0; transition: color 0.2s; }
.colophon-col a:hover { color: #e7b34d; }
.colophon-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: #8f8c83; }
.colophon-bottom a { color: #8f8c83; }
.colophon-bottom a:hover { color: #d8d5cc; }

/* ── BACK TO TOP ── */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--paper); border: 0; cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; z-index: 90; }
.to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--rank); }
.to-top svg { width: 20px; height: 20px; }

/* ── LEGAL PAGES ── */
.legal { padding: 60px 0 84px; }
.legal-inner { max-width: 760px; }
.legal h1 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 6vw, 58px); line-height: 1.03; margin-bottom: 8px; }
.legal .updated { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 36px; }
.legal-lead { font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.legal h2 { font-family: var(--display); font-weight: 500; font-size: 25px; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--ink-soft); margin-bottom: 13px; }
.legal ul { padding-left: 22px; margin-bottom: 13px; }
.legal li { margin-bottom: 7px; }
.legal a { color: var(--rank); border-bottom: 1px solid rgba(178, 30, 59, 0.4); }
.legal .back { display: inline-block; margin-top: 36px; font-family: var(--mono); font-size: 13px; border: 0; color: var(--rank); }

/* ── REVEAL ── */
.rise-in { opacity: 0; transform: translateY(16px); transition: opacity 0.6s, transform 0.6s; }
.rise-in.seen { opacity: 1; transform: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .frontis-grid { grid-template-columns: 1fr; }
    .seal { display: none; }
    .brief-cols { grid-template-columns: 1fr; gap: 28px; }
    .brief-facts { border-left: 0; border-top: 2px solid var(--rank); padding-left: 0; padding-top: 22px; }
    .method-grid { grid-template-columns: 1fr; }
    .desk-grid { grid-template-columns: 1fr; gap: 34px; }
}
@media (max-width: 720px) {
    .masthead-nav { display: none; }
    .masthead-nav.is-drawer {
        display: flex; position: fixed; inset: 74px 0 auto 0; flex-direction: column; gap: 0;
        background: var(--paper); border-bottom: 1px solid var(--rule-2); padding: 8px 28px 20px; z-index: 99;
    }
    .masthead-nav.is-drawer li { width: 100%; }
    .masthead-nav.is-drawer .mn-link { padding: 14px 0; border-bottom: 1px solid var(--rule); width: 100%; display: block; }
    .masthead-nav.is-drawer .mn-cta { margin: 12px 0 0; }
    .beacon { display: block; }
    .count-band { grid-template-columns: 1fr; }
    .masthead-bar .mb-note { display: none; }
}
@media (max-width: 560px) {
    .entry { grid-template-columns: 1fr; gap: 4px; }
    .entry-rank { font-size: 34px; }
    .entry.is-gold, .entry.is-silver, .entry.is-bronze { margin-left: 0; padding-left: 16px; }
    .field-row { grid-template-columns: 1fr; }
    .tally { gap: 18px 34px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; scroll-behavior: auto; }
    .rise-in { opacity: 1; transform: none; transition: none; }
    .count-cell::after { transition: none; transform: scaleX(1); }
    .act:hover { transform: none; }
}
