/* ═══════════════════════════════════════════════════
   OracyAI Impact Study page
   Loaded after landing.css, which supplies the tokens,
   nav, footer, pressable buttons, stats band and CTA.
   ═══════════════════════════════════════════════════ */

:root {
  --study-accent: var(--brand-purple-700);
  --study-accent-wash: rgba(128, 78, 155, 0.1);
  /* The landing's --fg-muted (#718096) and --fg-subtle (#9CA3AF) fall below
     WCAG AA 4.5:1 for the small secondary text a report is full of;
     --fg-2 clears it on white and on every tinted panel below. */
  --study-muted: var(--fg-2);
  --study-muted-bar: #C9C0D3;
  --study-track: #F4F1F7;
  --study-grid: #ECE9F0;
  --study-panel: #FAF9FB;
  --study-nav-offset: 88px;
}

html { scroll-padding-top: var(--study-nav-offset); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.study-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.study-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: #fff;
  font-weight: 700;
}
.study-skip:focus { top: 12px; }

.study-page .nav-link[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline 2px var(--brand-purple-500);
  text-underline-offset: 8px;
}

/* landing.css removes the outline from .pressable; links styled as
   pressables still need a visible keyboard focus ring. */
.study-page a.pressable:focus-visible .pressable__surface {
  outline: 3px solid var(--brand-purple-500);
  outline-offset: 3px;
}
.study-page .cta-section a.pressable:focus-visible .pressable__surface { outline-color: #fff; }

/* The landing pins every major section full-screen and stacks them.
   A long report has to scroll normally, so the reused sections opt out. */
.study-page .stats-section,
.study-page .cta-section {
  position: relative;
  min-height: 0;
}

/* ═════════════════════ HERO ═════════════════════ */

.study-hero {
  padding: 72px 32px 64px;
  background:
    radial-gradient(ellipse 1200px 700px at 80% -10%, rgba(175,91,206,0.12), transparent 60%),
    radial-gradient(ellipse 900px 500px at -10% 30%, rgba(136,211,229,0.18), transparent 55%),
    linear-gradient(180deg, #FFFFFF 0%, #FAF9FB 100%);
}
.study-hero-inner {
  max-width: 880px;
  margin: 0 auto;
}

.study-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 20px 0 12px;
  text-wrap: balance;
}
.study-subtitle {
  font-size: 20px;
  font-weight: 700;
  color: var(--study-accent);
  margin: 0 0 24px;
}
.study-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--fg-2);
  max-width: 720px;
  margin: 0 0 40px;
}

.study-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 40px;
  margin: 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.study-meta dt {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--study-muted);
  margin-bottom: 4px;
}
.study-meta dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--fg-1);
}

/* ═════════════════════ HEADLINE NUMBERS ═════════════════════ */

.study-page .study-stats {
  width: calc(100% - 48px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 32px;
  border-radius: 32px;
}

/* ═════════════════════ VERDICTS ═════════════════════ */

.study-verdicts {
  max-width: 1240px;
  margin: 40px auto 0;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.study-verdict {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.study-verdict p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-2);
}
.study-verdict-tag {
  display: flex;
  width: fit-content;
  align-items: center;
  margin-bottom: 16px;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.study-verdict-tag svg { width: 14px; height: 14px; flex-shrink: 0; }
.study-verdict--evidenced .study-verdict-tag { background: #F4FBF5; color: #2E7D32; }
.study-verdict--signal .study-verdict-tag { background: #FFF4E5; color: #B45309; }
.study-verdict--goal .study-verdict-tag { background: #F8EFFB; color: var(--study-accent); }
.study-verdict-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 10px;
}

/* ═════════════════════ BODY: CONTENTS + ARTICLE ═════════════════════ */

.study-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 32px 120px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.study-toc {
  position: sticky;
  top: var(--study-nav-offset);
}
.study-toc-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--study-muted);
  margin: 0 0 14px;
}
.study-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.study-toc-list a {
  display: flex;
  gap: 10px;
  margin-left: -2px;
  padding: 8px 0 8px 14px;
  border-left: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--study-muted);
  transition: color 0.15s, border-color 0.15s;
}
.study-toc-list a:hover { color: var(--fg); }
.study-toc-list a[aria-current="true"] {
  color: var(--fg);
  border-left-color: var(--brand-purple-500);
}
.study-toc-num {
  flex-shrink: 0;
  min-width: 18px;
  font-weight: 800;
  color: var(--study-accent);
  font-variant-numeric: tabular-nums;
}

.study-article {
  max-width: 780px;
  min-width: 0;
}
.study-article p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--fg-1);
  margin: 0 0 20px;
}
.study-article strong { color: var(--fg); font-weight: 800; }
.study-page sub { font-size: 0.75em; line-height: 0; }

.study-chapter + .study-chapter {
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
}
/* Lives inside the chapter's h2 so headings read "01 Students got…". */
.study-chapter-num {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--study-accent);
}
.study-chapter-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 24px;
  text-wrap: balance;
}
.study-subhead {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--fg);
  margin: 44px 0 14px;
}
.study-article .study-fineprint {
  font-size: 14px;
  color: var(--study-muted);
}

/* ═════════════════════ FIGURES ═════════════════════ */

.study-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 20px;
  margin: 32px 0 12px;
}
.study-figure {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.study-figure--wide { margin: 32px 0 12px; }
.study-figure-title {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 4px;
}
.study-article .study-figure-sub {
  font-size: 14px;
  line-height: 1.45;
  color: var(--study-muted);
  margin: 0;
}
.study-figure-note {
  margin-top: auto;
  padding-top: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--study-muted);
}

.study-article .study-axis-title {
  margin: 6px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--study-muted);
}

/* Line charts are drawn by impact-study.js from the figure's data table. */
.study-line-chart {
  position: relative;
  height: 260px;
  margin-top: 16px;
}
.study-line-chart--short { height: 220px; }
html:not(.js) .study-line-chart { display: none; }

.study-line-chart svg {
  display: block;
  overflow: visible;
  border-radius: var(--radius-sm);
}
.study-line-chart svg:focus { outline: none; }
.study-line-chart svg:focus-visible {
  outline: 2px solid var(--brand-purple-500);
  outline-offset: 6px;
}
.study-chart-grid { stroke: var(--study-grid); stroke-width: 1; }
.study-chart-tick {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  fill: var(--study-muted);
  font-variant-numeric: tabular-nums;
}
.study-chart-axis-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  fill: var(--study-muted);
}
.study-chart-area { fill: var(--study-accent-wash); }
.study-chart-line {
  fill: none;
  stroke: var(--study-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.study-chart-dot {
  fill: var(--study-accent);
  stroke: #fff;
  stroke-width: 2;
}
.study-chart-end-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  fill: var(--fg);
}
.study-chart-crosshair { stroke: var(--border-dark); stroke-width: 1; }

.study-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 132px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-floating);
  /* Sits above the value labels drawn 12px over each end point. */
  transform: translate(-50%, calc(-100% - 30px));
  white-space: nowrap;
}
.study-tooltip[hidden] { display: none; }
.study-tooltip-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.study-tooltip-value::before {
  content: '';
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--study-accent);
}
.study-tooltip-label {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--study-muted);
}

.study-figure-data {
  margin-top: 14px;
  font-size: 13px;
}
.study-figure-data summary {
  cursor: pointer;
  width: fit-content;
  font-weight: 700;
  color: var(--study-accent);
}
.study-figure-data table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.study-figure-data th,
.study-figure-data td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.study-figure-data th:first-child,
.study-figure-data td:first-child { text-align: left; }
.study-figure-data th {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--study-muted);
}

/* Column chart: every value is labelled on its cap, so it has no y-axis. */
.study-columns {
  --plot-height: 180px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
}
.study-columns li {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.study-column-value {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.study-column-bar {
  width: min(24px, 70%);
  height: calc(var(--value) / var(--max) * var(--plot-height));
  border-radius: 4px 4px 0 0;
  background: var(--study-accent);
}
.study-column-label {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-dark);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.study-column-label small {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--study-muted);
}

/* Horizontal bars on a fixed 0–100 track. */
.study-bars {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.study-bars li {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}
.study-bar-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  text-align: right;
}
.study-bar-track {
  grid-column: 2;
  grid-row: 1;
  height: 20px;
  border-radius: 4px;
  background: var(--study-track);
}
.study-bar-fill {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--study-muted-bar);
}
.study-bars .is-emphasis .study-bar-fill { background: var(--study-accent); }
/* Sits in the track's grid cell; a percentage margin resolves against
   that cell's width, which puts the value just past the bar's tip. */
.study-bar-value {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  margin-left: calc(var(--value) * 1% + 8px);
  font-size: 14px;
  font-weight: 800;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ═════════════════════ BEFORE / AFTER ═════════════════════ */

.study-student {
  margin: 32px 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: #fff;
}
.study-student-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 20px;
}
.study-student-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--fg);
  margin: 0;
}
.study-student-name span { font-weight: 600; color: var(--study-muted); }
.study-article .study-student-dates {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--study-muted);
}
.study-article .study-student-metric {
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #F8EFFB;
  font-size: 14px;
  line-height: 1.4;
  color: var(--brand-purple-900);
}
.study-article .study-student-metric strong { color: var(--brand-purple-900); font-variant-numeric: tabular-nums; }

.study-turns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.study-turns-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--study-muted);
}
.study-turns-col--last .study-turns-label { color: var(--study-accent); }
.study-turn {
  margin: 0 0 10px;
  padding: 14px 16px;
  border-radius: 4px 16px 16px 16px;
  background: #F3F4F6;
}
.study-turns-col--last .study-turn { background: #F8EFFB; }
.study-article .study-turn p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
}
.study-article .study-turn .study-turn-translation {
  margin-top: 6px;
  font-size: 14px;
  font-style: italic;
  color: var(--study-muted);
}
.study-article .study-student-note {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

/* ═════════════════════ REPORT QUOTES ═════════════════════ */

.study-quotes {
  display: grid;
  gap: 16px;
  margin: 24px 0 28px;
}
.study-quote {
  margin: 0;
  padding: 24px 28px;
  border-left: 4px solid var(--brand-purple-500);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--study-panel);
}
.study-quote blockquote { margin: 0; }
.study-article .study-quote p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg);
}
.study-quote figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--study-muted);
}

/* ═════════════════════ NULL RESULTS TABLE ═════════════════════ */

.study-table-wrap {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.study-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.study-table thead th {
  padding: 14px 18px;
  background: var(--study-panel);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--study-muted);
}
.study-table tbody th,
.study-table tbody td {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.study-table tbody th { width: 30%; font-weight: 700; color: var(--fg); }
.study-table tbody td { color: var(--fg-1); }
.study-table tbody td:nth-child(2) { width: 22%; color: var(--study-muted); font-weight: 600; }

/* ═════════════════════ YEAR TWO STEPS ═════════════════════ */

.study-steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.study-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--study-panel);
}
.study-step-num {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-purple-700), var(--brand-purple-500));
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}
.study-step-title {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--fg);
  margin: 8px 0 8px;
}
.study-article .study-step p { margin: 0; font-size: 17px; }

/* ═════════════════════ METHODS ═════════════════════ */

.study-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 36px;
}
/* Limitations is the longest block; a full row keeps the columns even. */
.study-methods-limitations { grid-column: 1 / -1; }
.study-methods-head {
  font-size: 15px;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 8px;
}
.study-article .study-methods-grid p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
}
.study-article .study-provenance {
  margin: 36px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
  font-style: italic;
  color: var(--study-muted);
}

/* ═════════════════════ RESPONSIVE ═════════════════════ */

@media (max-width: 1080px) {
  .study-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-top: 56px;
  }
  .study-toc {
    position: static;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--study-panel);
  }
  .study-article { max-width: none; }
}

@media (max-width: 980px) {
  .study-verdicts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .study-meta { grid-template-columns: minmax(0, 1fr); }
  .study-turns { grid-template-columns: minmax(0, 1fr); }
  .study-methods-grid { grid-template-columns: minmax(0, 1fr); }

  /* Null-results table becomes one card per metric. */
  .study-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .study-table,
  .study-table tbody,
  .study-table tr,
  .study-table th,
  .study-table td { display: block; width: auto; }
  .study-table tbody tr { padding: 16px 18px; }
  .study-table tbody tr + tr { border-top: 1px solid var(--border); }
  .study-table tbody th,
  .study-table tbody td,
  .study-table tbody td:nth-child(2) { width: auto; padding: 0; border-top: 0; }
  .study-table tbody td { margin-top: 8px; }
  .study-table tbody td::before {
    content: attr(data-label);
    content: attr(data-label) / "";
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--study-muted);
  }
}

@media (max-width: 600px) {
  .study-hero { padding: 48px 20px 48px; }
  .study-page .study-stats { width: calc(100% - 32px); padding: 44px 20px; border-radius: 24px; }
  .study-verdicts { padding: 0 16px; margin-top: 24px; }
  .study-verdict { padding: 22px; }
  .study-body { padding: 40px 16px 96px; }
  .study-article p { font-size: 17px; }
  .study-figure { padding: 18px; }
  .study-student { padding: 20px; }
  .study-quote { padding: 20px; }
  .study-step { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px; }
  .study-bars li { grid-template-columns: 92px minmax(0, 1fr); column-gap: 10px; }
  .study-bar-label { font-size: 13px; }
  .study-column-value { font-size: 12px; }
}

@media (forced-colors: active) {
  .study-column-bar,
  .study-bar-fill {
    forced-color-adjust: none;
    background: CanvasText;
  }
  .study-bars .is-emphasis .study-bar-fill { background: Highlight; }
  .study-bar-track { outline: 1px solid CanvasText; }
}

/* ═════════════════════ PRINT ═════════════════════ */

@media print {
  .nav,
  .study-skip,
  .study-toc,
  .study-cta,
  .footer,
  .study-figure-data { display: none; }

  .study-body { display: block; padding: 24px 0; }
  .study-page .study-stats { background: none; color: var(--fg); padding: 24px 0; }
  .study-page .study-stats::before { display: none; }
  .study-page .study-stats .stat-value { background: none; color: var(--fg); }
  .study-page .study-stats .stat-label { color: var(--fg-2); }
  .study-figure,
  .study-student,
  .study-step,
  .study-table tr { break-inside: avoid; }
}
