/* /state-of-generative-ai — a clean reference-report page. Light by default,
   follows the system dark scheme. */

:root {
  color-scheme: light dark;
  --paper: #f7f6f2;
  --panel: #ffffff;
  --panel-soft: #efede7;
  --ink: #1b1d20;
  --ink-soft: #4c5157;
  --ink-faint: #70767d;
  --accent: #0b6b5d;
  --accent-deep: #084f45;
  --accent-wash: #dcefea;
  --amber: #a3650f;
  --amber-wash: #f6e8cf;
  --rule: rgba(27, 29, 32, 0.14);
  --rule-strong: rgba(27, 29, 32, 0.3);
  --shadow: 0 1px 2px rgba(27, 29, 32, 0.05), 0 16px 36px -26px rgba(27, 29, 32, 0.35);
  --display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Inter", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 42rem;
  --page: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15181c;
    --panel: #1d2126;
    --panel-soft: #242930;
    --ink: #e9eaec;
    --ink-soft: #b4b9c0;
    --ink-faint: #8b9199;
    --accent: #5fc3b2;
    --accent-deep: #8adacb;
    --accent-wash: #1f3b36;
    --amber: #e0a85a;
    --amber-wash: #3a2f1a;
    --rule: rgba(233, 234, 236, 0.14);
    --rule-strong: rgba(233, 234, 236, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -26px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 4px;
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; margin-top: 1.8rem; }

p { margin: 0 0 1rem; }
strong { font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.75rem; padding: 0.55rem 1.2rem; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; font-family: inherit; line-height: 1.2;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn-solid { background: var(--accent); color: #fff; }
.btn-solid:hover { background: var(--accent-deep); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-solid { color: #10211d; }
  .btn-solid:hover { color: #10211d; }
}
.btn-line { background: transparent; color: var(--accent-deep); border-color: var(--rule-strong); }
.btn-line:hover { border-color: var(--accent); background: var(--accent-wash); }

/* ── Masthead ─────────────────────────────────────────── */
.masthead { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { font-family: var(--display); font-size: 1.5rem; font-weight: 600; text-decoration: none; color: var(--ink); display: inline-flex; align-items: baseline; gap: 0.6rem; }
.brand small { font-family: var(--text); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.masthead-nav { display: flex; align-items: center; gap: 1.1rem; }
.masthead-nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.masthead-nav a:not(.btn):hover { color: var(--accent); }
@media (max-width: 36rem) {
  .masthead-nav a:not(.btn) { display: none; }
  .brand small { display: none; }
}

/* ── Hero ─────────────────────────────────────────────── */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 56rem) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.hero-copy, .summary { min-width: 0; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: var(--measure); margin-top: 1.2rem; }
.hero-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 1.5rem; margin: 1.6rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.hero-meta div { margin: 0; }
.hero-meta dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.hero-meta dd { margin: 0.2rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }

.summary { background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.summary h2 { font-size: 1.1rem; font-family: var(--text); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem; }
.summary ul { margin: 0; padding: 0; list-style: none; }
.summary li { position: relative; padding-left: 1.3rem; margin-bottom: 0.65rem; font-size: 0.98rem; }
.summary li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }

/* ── Body grid with sticky contents ───────────────────── */
.body-grid { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); padding-top: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 56rem) { .body-grid { grid-template-columns: minmax(0, 1fr); } }

.toc { position: sticky; top: 4.5rem; align-self: start; font-size: 0.92rem; }
@media (max-width: 56rem) { .toc { position: static; border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.2rem; background: var(--panel); } }
.toc-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.6rem; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
@media (max-width: 56rem) { .toc ol { columns: 2; column-gap: 1.5rem; } }
.toc li { counter-increment: toc; break-inside: avoid; }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.8rem; color: var(--ink-soft); text-decoration: none; border-left: 2px solid transparent; }
.toc a::before { content: counter(toc, decimal-leading-zero) " "; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); margin-right: 0.3rem; }
.toc a:hover { color: var(--accent); }
.toc a.current { color: var(--accent-deep); border-left-color: var(--accent); font-weight: 600; }

.article { max-width: 52rem; min-width: 0; counter-reset: chapter; }
.chapter { padding: 0 0 clamp(2rem, 5vw, 3.5rem); margin-bottom: clamp(2rem, 5vw, 3rem); border-bottom: 1px solid var(--rule); counter-increment: chapter; }
.chapter > h2 { margin-bottom: 1rem; }
.chapter > h2::before { content: counter(chapter, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.4rem; }
.chapter > p { max-width: var(--measure); }
.note { font-size: 0.95rem; color: var(--ink-soft); border-left: 3px solid var(--accent); padding: 0.4rem 0 0.4rem 1rem; margin-top: 1.4rem; }
.cross { font-size: 0.95rem; color: var(--ink-soft); margin-top: 1.2rem; }

/* ── Tiles and tables ─────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.9rem; margin: 1.4rem 0 1.6rem; }
.tile { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.tile strong { font-family: var(--display); font-size: 2.1rem; line-height: 1; color: var(--accent); font-weight: 600; }
.tile span { font-size: 0.92rem; color: var(--ink-soft); }
.tile small { font-size: 0.75rem; color: var(--ink-faint); letter-spacing: 0.04em; margin-top: auto; }

.table-scroll { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); }
.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 38rem; }
.data caption { text-align: left; font-weight: 600; padding: 0.9rem 1rem 0.5rem; color: var(--ink); caption-side: top; }
.data th, .data td { text-align: left; vertical-align: top; padding: 0.65rem 1rem; border-top: 1px solid var(--rule); }
.data thead th { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); border-top: 0; background: var(--panel-soft); }
.data tbody th, .data td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.landscape-table td:first-child { white-space: normal; }
.landscape-table td:last-child { color: var(--ink); }
.data td:last-child { color: var(--ink-soft); }
@media (max-width: 40rem) {
  /* Phones: let the tables wrap instead of scrolling sideways. */
  .data { min-width: 0; font-size: 0.86rem; }
  .data th, .data td { padding: 0.55rem 0.6rem; }
  .data td:first-child { white-space: normal; }
}

/* ── Lists ────────────────────────────────────────────── */
.works, .weak, .steps { margin: 0.6rem 0 0; padding-left: 0; list-style: none; max-width: 48rem; }
.works li, .weak li { position: relative; padding-left: 1.8rem; margin-bottom: 0.75rem; }
.works li::before, .weak li::before { position: absolute; left: 0; top: 0.1em; width: 1.2rem; height: 1.2rem; border-radius: 50%; font-size: 0.72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.works li::before { content: "✓"; background: var(--accent-wash); color: var(--accent-deep); }
.weak li::before { content: "–"; background: var(--amber-wash); color: var(--amber); }
.steps { counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 2.2rem; margin-bottom: 0.7rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.05em; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--rule-strong); font-family: var(--mono); font-size: 0.78rem; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); }

.prompt-card { margin: 1.6rem 0 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.prompt-card figcaption { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.6rem; }
.prompt-card p { font-family: var(--display); font-size: 1.15rem; line-height: 1.5; margin-bottom: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 0.4rem; }
.copied { font-size: 0.88rem; color: var(--accent-deep); }

.use-grid { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.8rem; }
.use-grid a { display: block; height: 100%; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color 160ms ease, transform 160ms ease; }
.use-grid a:hover { border-color: var(--accent); transform: translateY(-2px); }
.use-grid strong { display: block; color: var(--accent-deep); margin-bottom: 0.25rem; }
.use-grid span { font-size: 0.9rem; color: var(--ink-soft); }

.pick { margin-top: 1.8rem; background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 14px; padding: 1.4rem 1.5rem 1.5rem; }
.pick h3 { margin-top: 0; color: var(--accent-deep); }
.pick ul { margin: 0.8rem 0 1rem; padding-left: 1.2rem; }
.pick li { margin-bottom: 0.55rem; }

.facts { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.25rem; font-family: var(--mono); font-size: 0.84rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); margin: 1.2rem 0 0.4rem; }

.glossary { margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.9rem 1.4rem; }
.glossary div { margin: 0; padding: 0.8rem 0 0; border-top: 1px solid var(--rule); }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0.2rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }

.faq { margin-top: 1.2rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 0.95rem 2rem 0.95rem 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.8rem; font-family: var(--mono); color: var(--accent); font-size: 1.1rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 1rem; color: var(--ink-soft); max-width: var(--measure); }

.sources ol { padding-left: 1.3rem; font-size: 0.95rem; color: var(--ink-soft); }
.sources li { margin-bottom: 0.6rem; }

.closing { padding: 0.5rem 0 clamp(2rem, 5vw, 3rem); }
.closing h2 { margin-bottom: 0.6rem; }
.closing p { color: var(--ink-soft); max-width: var(--measure); }

.colophon { border-top: 1px solid var(--rule); padding: 1.4rem 0 2.2rem; font-size: 0.88rem; color: var(--ink-faint); }
.colophon .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem 1.5rem; }
.colophon nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.colophon a { color: var(--ink-soft); text-decoration: none; }
.colophon a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .use-grid a { transition: none; }
  .use-grid a:hover { transform: none; }
}

@media print {
  .masthead, .toc, .actions, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .body-grid { display: block; }
  .table-scroll { overflow: visible; border: 0; }
  .data { min-width: 0; }
  a { color: inherit; text-decoration: none; }
}
