/* ════════════════════════════════════════════════════════════════════
   AI Visibility Index — Figma frame "ai-visibility-index" (node 350:4).

   Nav (351:367) and Footer (350:295) in that frame come from base.html
   and are out of scope for this rebuild.

   Every value below was read off the frame and is pinned by
   tests/test_ai_visibility_index_design_fidelity.py against
   tests/design/ai_visibility_index_tokens.json. Do not adjust a number
   without changing the frame and re-extracting: the test will fail, by
   design.

   THE FRAME IS NOT THE SOURCE OF TRUTH FOR ITS NUMBERS. Its chart
   figures are mock content and several contradict their own captions —
   "Publishes robots.txt" is drawn at 78.7% with "355 of 418" beside it
   (that is 84.9%), "Blocks at least one AI crawler" at 8.1% with "38 of
   418" (9.1%). The page prints what ai_visibility_index_view derived
   from public.reports_external, which is the rule status_view.py and
   ai_audit_view.py already state. This stylesheet owns pixels only.

   Five things that are easy to get wrong, and so are called out:

     - THREE bar palettes, not one. The assistant chart cycles four hues
       in ROW order; the crawler chart is semantic (training amber,
       retrieval cyan); the readiness chart is accent cyan except the one
       bad-news row, which is danger red. Collapsing them to a single
       accent throws away the finding the crawler chart exists to make.
     - The track is #1e293b, NOT the card's #0f172a. An unfilled track
       the colour of the card it sits on is the chart gone at a glance.
     - base.css sets line-height 1.6 on body. Most nodes here are
       leading-normal, and inheriting 1.6 adds ~5px to every bar row —
       which over ten rows is a visibly taller card than the frame draws.
       Roles whose frame leading is NOT 1.6 restate it below.
     - Three radii that look alike: chart/finding cards 16px, the small
       boxes (limitations, update history) 12px, hero stat cards 14px.
     - The 56px h1 is the only node on the page with negative tracking
       (-1.12px). Dropping it widens the headline by ~10px.

   No inline styles anywhere: style-src-attr is hash-pinned
   (chaos_tester_csp_style_hashes.py), so a data-driven inline style
   would silently fail to apply in production. Bar widths are SVG
   geometry instead.
   ════════════════════════════════════════════════════════════════════ */

/* The frame's own background fill. Sampled off the 350:4 render: the glow
   peaks near the top on #173948 and settles onto the flat base, which is the
   SAME ellipse /contact, /status, /api, /changelog and /ai-website-audit use.
   A Figma frame is a static 5957px canvas and cannot express
   background-attachment: fixed; the fixed viewport-relative gradient the other
   interior pages ship is what reproduces it in a browser. Scoped to the body
   class so it cannot leak onto any other page. */
body.study-doc {
    background:
        radial-gradient(ellipse 60% 30% at 50% 30%, #173948 0%, #0e1a2c 55%, rgba(6, 9, 20, 0) 100%),
        #020617;
    background-attachment: fixed;
}

.study {
    /* The frame's content column is 1120 (1280 less 80px gutters);
       base.css's .container already yields 1100, so no widening override —
       copying /contact's would move the header and footer too. */
    max-width: 100%;
}

/* Body copy is held to the frame's 900px measure while headings and the
   card grids span the full column. */
.study-prose {
    max-width: 900px;
}

/* ── Hero (350:15) ──────────────────────────────────────────── */

.study-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 80px 0 64px;
    text-align: center;
}

.study-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 6px;
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.25);
    color: #00bfff;
    font-size: 12px;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.study-header h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.12px;
    color: #fff;
    margin: 0;
}

.study-headline-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.study-lede {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #b0b8c8;
    max-width: 840px;
    margin: 0;
}

.study-byline {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #64748b;
    max-width: 720px;
    margin: 0;
}

/* Hero stat cards (350:23) */
.study-topline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 900px;
    padding-top: 24px;
    margin: 0;
    list-style: none;
    text-align: left;
}
.study-topline li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 14px;
}
.study-topline-value {
    font-size: 36px;
    font-weight: 800;
    line-height: normal;
    color: #00bfff;
    font-variant-numeric: tabular-nums;
}
.study-topline-label {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #b0b8c8;
}

/* ── Sections ───────────────────────────────────────────────── */

.study-section {
    padding: 64px 0;
}
.study-section h2 {
    font-size: 36px;
    font-weight: 800;
    line-height: normal;
    color: #fff;
    margin: 0 0 16px;
}
.study-section h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
    margin: 0 0 12px;
}
.study-section p {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #b0b8c8;
    max-width: 900px;
    margin: 0 0 16px;
}
.study-section a {
    color: #00bfff;
}
.study-section a:hover {
    color: #38ccff;
}
.study-block {
    margin-bottom: 24px;
}
.study-block:last-child {
    margin-bottom: 0;
}

/* ── Key findings (350:44) ──────────────────────────────────── */

.study-findings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.study-finding {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 16px;
}
/* Tag-qualified: `.study-section p` above is (0,0,1,1), so a bare class
   would lose to it and every card would render at body size. */
p.study-finding-stat {
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 1px;
    color: #00bfff;
    font-variant-numeric: tabular-nums;
    max-width: none;
    margin: 0;
}
p.study-finding-headline {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    max-width: none;
    margin: 0;
}
p.study-finding-claim {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: #b0b8c8;
    max-width: none;
    margin: 0;
}

/* ── Charts (350:74) ────────────────────────────────────────── */

.study-figure {
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* 32, not 24: the frame stacks the three chart cards at y=0, 339 and 852
       with heights 307 and 481 — a 32px gutter both times. */
    margin: 0 0 32px;
    padding: 32px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 16px;
}
.study-figure:last-child {
    margin-bottom: 0;
}
.study-figure figcaption {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.study-figure-title {
    font-size: 18px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
}
.study-figure-sub {
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
p.study-figure-note {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #b0b8c8;
    max-width: none;
    margin: 0;
}

.study-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* 350:82 — label 180, track 400, value 60, note takes the rest. */
.study-bar-row {
    display: grid;
    grid-template-columns: 180px 400px 60px 1fr;
    align-items: center;
    gap: 16px;
}
.study-bar-label {
    font-size: 13px;
    font-weight: 600;
    line-height: normal;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The crawler rows keep <code> because a user-agent token IS a literal, and
   that is worth saying to a screen reader and to a machine — but the frame
   draws them in Inter SemiBold like every other bar label (350:113), not in
   the mono face, so the element inherits rather than restyling. */
.study-bar-label code {
    font: inherit;
    color: inherit;
}
.study-bar-track {
    display: block;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #1e293b;
    overflow: hidden;
}
.study-bar-value {
    font-size: 13px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.study-bar-note {
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

/* Three palettes, three different claims — see the header note.
   1. Assistant panel: a hue per row, cycling in row order (350:85/91/97/103). */
.chart-bar--series-0 { fill: #60a5fa; }
.chart-bar--series-1 { fill: #4ade80; }
.chart-bar--series-2 { fill: #fbbf24; }
.chart-bar--series-3 { fill: #ef4444; }
/* 2. Crawler chart: what the crawler DOES, which is the finding (350:115 vs
      350:151). The row text names it too, so greyscale and screen readers get
      the same distinction. */
.chart-bar--training  { fill: #fbbf24; }
.chart-bar--retrieval { fill: #00bfff; }
/* 3. Readiness: accent, except the one signal where a longer bar is worse. */
.chart-bar--signal        { fill: #00bfff; }
.chart-bar--signal-danger { fill: #f87171; }

/* ── Methodology (350:226) ──────────────────────────────────── */

p.study-body-sm {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #b0b8c8;
}
.study-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* The frame draws the marker as its own dimmer text node (350:236), not as a
   list bullet — hence the explicit grid rather than list-style. */
.study-list li {
    display: grid;
    grid-template-columns: 8px 1fr;
    gap: 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #b0b8c8;
}
.study-list li::before {
    content: "\2022";
    color: #64748b;
    line-height: normal;
}
.study-list strong {
    color: #fff;
    font-weight: 600;
}

/* The limitations box (350:253) is the one list the frame puts on a surface:
   these are the caveats that decide whether a figure is safe to quote. */
.study-limitations {
    gap: 10px;
    padding: 24px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 12px;
}
.study-limitations li {
    padding: 4px 0;
}

/* ── Citation (350:272) ─────────────────────────────────────── */

p.study-citation {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    max-width: 900px;
    margin: 0;
}

/* ── Update history (350:277) ───────────────────────────────── */

.study-section--history h2 {
    font-size: 32px;
}
.study-changelog {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 900px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.study-changelog-entry {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 12px;
}
p.study-changelog-date {
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    color: #00bfff;
    max-width: none;
    margin: 0;
}
p.study-changelog-summary {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #b0b8c8;
    max-width: none;
    margin: 0;
}

/* ── Closing CTA (350:283) ──────────────────────────────────── */

.study-cta {
    display: flex;
    justify-content: center;
    padding: 80px 0;
}
.study-cta-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 960px;
    padding: 48px 64px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 16px;
    text-align: center;
}
.study-cta-box h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
    margin: 0;
}
p.study-cta-sub {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: #b0b8c8;
    max-width: 600px;
    margin: 0;
}
/* #0d121a on #00bfff is ~8.8:1, matching the landing .btn-audit treatment. */
.study-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 15px 36px;
    border-radius: 12px;
    background: #00bfff;
    color: #0d121a !important;
    font-size: 15px;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    min-height: 44px;
}
.study-cta-btn:hover {
    background: #38ccff;
    color: #0d121a !important;
}
p.study-cta-note {
    font-size: 13px;
    font-weight: 400;
    line-height: normal;
    color: #b0b8c8;
    max-width: none;
    margin: 0;
}
.study-cta-note a {
    font-weight: 600;
    text-decoration: underline;
}

/* ── Narrow screens ─────────────────────────────────────────────
   The frame is desktop-only at 1280, so this follows the project's
   existing convention rather than inventing one. */

@media (max-width: 900px) {
    .study-header h1 {
        font-size: 40px;
        letter-spacing: -0.8px;
    }
    .study-section h2,
    .study-section--history h2,
    .study-cta-box h2 {
        font-size: 28px;
    }
    .study-topline,
    .study-findings {
        grid-template-columns: 1fr;
    }
    /* 180 + 400 + 60 + a note does not fit: the bar takes its own row so the
       track never collapses, with the label and value on the line above. */
    .study-bar-row {
        grid-template-columns: 1fr auto;
        gap: 4px 12px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(51, 65, 85, 0.35);
    }
    .study-bar-label {
        white-space: normal;
    }
    .study-bar-track {
        grid-column: 1 / -1;
        order: 3;
    }
    .study-bar-note {
        grid-column: 1 / -1;
        order: 4;
    }
    .study-figure,
    .study-cta-box {
        padding: 24px;
    }
    .study-cta {
        padding: 48px 0;
    }
}

@media (max-width: 600px) {
    .study-header {
        padding: 48px 0 40px;
        gap: 24px;
    }
    .study-header h1 {
        font-size: 32px;
    }
    .study-lede {
        font-size: 16px;
    }
    .study-section {
        padding: 40px 0;
    }
    .study-finding {
        padding: 20px;
    }
}
