/*
 * The Turing look: one shared layer that gives every page the feel of
 * /turing/ (cinematic near-black page, soft blue and green glow, small
 * blue capital kickers, large heavy headings, roomy sections, rounded
 * cards that lift on hover, pill badges, a blue-to-green reading bar).
 * Loaded last on every page so it wins over older page styles.
 * Motion (reading bar, glide-in) comes from /js/turing-look.js, the same
 * effects the Turing page runs; without it every element simply shows.
 * The /turing/ page itself does not load this file.
 */
:root {
  --tl-bg: #08090c;
  --tl-card: #0e1219;
  --tl-card-2: #131822;
  --tl-line: #1c2536;
  --tl-line-2: #2a3648;
  --tl-ink: #f1f5f9;
  --tl-ink-2: #94a3b8;
  --tl-ink-3: #8ea0b5;
  --tl-blue: #2d7ff9;
  --tl-blue-soft: #7db4ff;
  --tl-green: #00e599;
  --tl-amber: #f59e0b;
  --tl-violet: #a78bfa;
  --tl-radius: 18px;
}

/* ---------- page ---------- */
html, body {
  background-color: var(--tl-bg);
  color: var(--tl-ink);
  /* clip, not hidden: hidden turns the page into its own scroll box and
     the pinned header stops sticking. */
  overflow-x: clip;
}

body {
  background-image:
    radial-gradient(ellipse 70% 42rem at 50% -8rem, rgba(45, 127, 249, 0.13), transparent 70%),
    radial-gradient(ellipse 40% 30rem at 88% 10rem, rgba(0, 229, 153, 0.05), transparent 70%);
  background-repeat: no-repeat;
}

/* The old technical grid gives way to the Turing page's clean field. */
.bg-grid {
  background-image: none !important;
}

/* Reading bar across the top, blue to green, as on /turing/.
   The bar element is added by /js/turing-look.js. */
.tl-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, var(--tl-blue), var(--tl-green));
  pointer-events: none;
}

/* A soft cross-fade when moving from one page to the next. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
}

/* ---------- header ---------- */
.aien-header {
  background: rgba(8, 9, 12, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* ---------- sections ---------- */
.hub-section,
.narr-section,
.rs-section {
  padding-top: 96px;
  padding-bottom: 96px;
}

@media (max-width: 640px) {
  .hub-section,
  .narr-section,
  .rs-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

.section-alt {
  background: transparent;
  border-color: var(--tl-line);
}

/* ---------- kickers: small blue capitals above a heading ---------- */
.kicker,
.blog-kicker,
.rs-kicker,
.hub-kicker,
.narr-kicker,
.section-head .badge,
.theory-fig .fig-kicker {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tl-blue);
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 18px;
}

/* ---------- headings ---------- */
h1,
.blog-title,
.rs-page-title,
.hub-title,
.narr-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--tl-ink);
}

.blog-title,
.rs-page-title,
.hub-title,
.narr-title,
.wrap > header h1,
.page-head h1 {
  font-size: clamp(38px, 6vw, 68px);
}

h2,
.section-head h2,
.hub-h2,
.rs-h2,
.narr-section h2,
.blog-wrap article h2,
.loop-title,
.home-questions-title {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--tl-ink);
}

.section-head h2,
.hub-h2,
.rs-h2,
.narr-section h2,
.loop-title,
.home-questions-title {
  font-size: clamp(30px, 4.4vw, 46px);
  margin-bottom: 18px;
}

h3 {
  letter-spacing: -0.01em;
}

/* Lead paragraphs: larger, calm grey, white for emphasis. */
.section-head p,
.blog-standfirst,
.rs-standfirst,
.hub-standfirst,
.narr-mission p,
.loop-intro,
.rs-section-lede,
p.lead,
.lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--tl-ink-2);
}

.section-head p strong,
.lead strong,
.hub-standfirst strong {
  color: var(--tl-ink);
}

/* ---------- cards: dark, rounded, lift on hover ---------- */
.glow-box,
.blog-card,
.hub-card,
.narr-card,
.rs-card,
.rs-attempt,
.rs-impl-item,
.home-q,
.receipt,
.pdf-callout,
.hub-callout,
.hub-data,
.theory-fig,
.entry,
.card,
.step-card,
.doc {
  background: var(--tl-card);
  border: 1px solid var(--tl-line);
  border-radius: var(--tl-radius);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glow-box:hover,
.blog-card:hover,
.hub-card:hover,
.narr-card:hover,
.rs-card:hover,
.home-q:hover,
.entry:hover,
.card:hover {
  border-color: var(--tl-blue);
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(45, 127, 249, 0.14);
}

/* Status cards keep their verdict colour on the border. */
.rs-card--fail:hover { border-color: var(--rs-fail, #f87171); }

/* Feature panels: the Turing "big stat" gradient. */
.pdf-callout,
.hub-callout,
.receipt {
  background: linear-gradient(135deg, rgba(45, 127, 249, 0.1), rgba(0, 229, 153, 0.06)), var(--tl-card);
}

/* Code and formula blocks sit on the page colour, as on /turing/. */
pre,
.narr-formula,
.narr-formula pre,
.data-table-wrap {
  border-radius: 14px;
}

pre,
.narr-formula pre {
  background: var(--tl-bg);
  border: 1px solid var(--tl-line);
}

/* ---------- badges: pills ---------- */
.badge,
.rs-badge,
.home-q-badge,
.source-tag {
  border-radius: 999px;
  letter-spacing: 0.06em;
}

/* ---------- buttons: the Turing page's two button styles ---------- */
.home-cta,
.hub-button,
.pdf-button,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--tl-line);
  background: transparent;
  color: var(--tl-ink-2);
  transition: 0.25s;
}

.home-cta-primary,
.hub-button,
.pdf-button,
.btn:not(.ghost):not(.secondary) {
  border-color: var(--tl-blue);
  background: rgba(45, 127, 249, 0.14);
  color: var(--tl-blue-soft);
}

.home-cta:hover,
.hub-button:hover,
.pdf-button:hover,
.btn:hover {
  border-color: var(--tl-blue);
  color: var(--tl-ink);
  transform: translateY(-2px);
}

.home-cta-primary:hover,
.hub-button:hover,
.pdf-button:hover,
.btn:not(.ghost):not(.secondary):hover {
  background: rgba(45, 127, 249, 0.28);
  color: var(--tl-blue-soft);
  box-shadow: 0 12px 40px rgba(45, 127, 249, 0.25);
}

/* Inline "read more" links in the Turing blue. */
.readmore,
.blog-read-more,
.prose-link {
  color: var(--tl-blue-soft);
}

/* ---------- tables ---------- */
.data-table th,
.status-table th {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tl-ink-3);
}

/* ---------- footer ---------- */
.aien-footer {
  border-top: 1px solid var(--tl-line);
  background: transparent;
}

/* ---------- glide up and fade in once, as on /turing/ ----------
   The script adds .tl-reveal only to things below the first screen and
   .tl-in when they come into view. "translate" is used so the hover lift
   ("transform") still works on revealed cards. */
:root .tl-reveal {
  opacity: 0;
  translate: 0 34px;
  transition: opacity 0.8s ease, translate 0.8s ease, border-color 0.3s ease,
    transform 0.3s ease, box-shadow 0.3s ease;
}

:root .tl-reveal.tl-in {
  opacity: 1;
  translate: none;
}

@media (prefers-reduced-motion: reduce) {
  :root .tl-reveal {
    opacity: 1;
    translate: none;
    transition: none;
  }
  @view-transition {
    navigation: none;
  }
}

/* ---------- research and paper pages ---------- */
/* Their sections set their own margin; the site-wide .section padding
   stacked on top of it and left large empty gaps. */
.research-wrap .section {
  padding: 0;
  margin: 64px 0;
}

.research-wrap {
  padding-top: 72px;
}

.research-wrap .section > h2 {
  font-size: clamp(24px, 3vw, 30px);
  margin-bottom: 16px;
}

.research-wrap .paper-sub {
  font-size: 19px;
  line-height: 1.6;
  color: var(--tl-ink-2);
}

.research-wrap .artifact {
  border-radius: 14px;
  background: var(--tl-card);
  border-color: var(--tl-line);
  transition: border-color 0.3s ease;
}

.research-wrap .artifact:hover {
  border-color: var(--tl-blue);
}

.research-wrap .btn.forthcoming:hover {
  transform: none;
  border-color: var(--tl-line);
  color: var(--tl-ink-2);
}

/* ---------- every box is a link to its evidence on GitHub ----------
   Each box carries one a.box-link in its footer. The anchor's ::after is
   stretched over the whole box, so the box is the click target; links
   inside the box sit above it (z-index 2) and keep working. */
.mx-card,
.mx-row,
.glow-box,
.lineage-card,
.lineage-role,
.status-row,
.live-row,
.receipt,
.rs-card,
.rs-step,
.rs-impl-item,
.hub-card,
.narr-card,
.blog-card,
.now-card,
.now-queue-row,
.now-tl {
  position: relative;
}

a.box-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tl-blue-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.box-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.box-link .box-arrow {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(.22,.61,.36,1);
}

a.box-link-source {
  color: var(--tl-ink-3);
}

/* Narrow cards let the words wrap rather than clip. */
.hub-card a.box-link,
.rs-card a.box-link,
.lineage-card a.box-link,
.lineage-role a.box-link {
  white-space: normal;
  line-height: 1.5;
}

/* Inline links and controls inside a box stay above the stretched link. */
.mx-card a:not(.box-link),
.mx-row a:not(.box-link),
.glow-box a:not(.box-link),
.glow-box button,
.glow-box #turing-game,
.status-row a:not(.box-link),
.live-row a:not(.box-link),
.receipt a:not(.box-link),
.rs-card a:not(.box-link),
.rs-step a:not(.box-link),
.rs-impl-item a:not(.box-link),
.rs-impl-item details,
.hub-card a:not(.box-link),
.narr-card a:not(.box-link),
.blog-card a:not(.box-link),
.now-card a:not(.box-link),
.now-queue-row a:not(.box-link),
.now-tl a:not(.box-link) {
  position: relative;
  z-index: 2;
}

/* Hover: the existing lift, and the border goes to the blue accent. */
.mx-card:hover,
.mx-row:hover,
.lineage-card:hover,
.lineage-role:hover,
.status-row:hover,
.live-row:hover,
.receipt:hover,
.rs-step:hover .rs-step-body,
.rs-impl-item:hover,
.now-card:hover,
.now-queue-row:hover,
.now-tl:hover {
  border-color: var(--tl-blue);
}

.lineage-role,
.status-row,
.rs-impl-item,
.now-queue-row,
.now-tl {
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.mx-row:hover td,
.live-row:hover td {
  background: rgba(45, 127, 249, 0.05);
}

.mx-card:hover .box-link,
.mx-row:hover .box-link,
.glow-box:hover .box-link,
.lineage-card:hover .box-link,
.lineage-role:hover .box-link,
.status-row:hover .box-link,
.live-row:hover .box-link,
.receipt:hover .box-link,
.rs-card:hover .box-link,
.rs-step:hover .box-link,
.rs-impl-item:hover .box-link,
.hub-card:hover .box-link,
.narr-card:hover .box-link,
.blog-card:hover .box-link,
.now-card:hover .box-link,
.now-queue-row:hover .box-link,
.now-tl:hover .box-link {
  color: var(--tl-green);
}

.mx-card:hover .box-arrow,
.glow-box:hover .box-arrow,
.rs-card:hover .box-arrow,
.hub-card:hover .box-arrow,
.now-card:hover .box-arrow {
  transform: translate(2px, -2px);
}

.box-link:focus-visible {
  outline: none;
}

.box-link:focus-visible::after {
  outline: 2px solid var(--tl-blue);
  outline-offset: 2px;
}

/* Where the footer sits in each kind of box. */
.mx-card .box-link,
.rs-card .box-link,
.hub-card .box-link,
.narr-card .box-link,
.blog-card .box-link,
.now-card .box-link {
  display: flex;
  width: fit-content;
  margin-top: 14px;
}

.narr-card .box-link {
  margin-bottom: 16px;
}

.lineage-card .box-link,
.lineage-role .box-link {
  margin-top: 10px;
}

.status-row .box-link,
.rs-impl-item .box-link,
.rs-step .box-link {
  margin-top: 8px;
}

/* Implementation items are cards in this look; give the words room. */
.rs-impl-item {
  padding: 16px 20px;
}

.rs-impl-list {
  gap: 10px;
}

.rs-step .box-link {
  display: inline-flex;
}

.mx-row .box-link,
.live-row .box-link,
.status-table td.name .box-link {
  margin-top: 6px;
  display: inline-flex;
  color: var(--tl-blue-soft);
  font-weight: 600;
  white-space: nowrap;
}

.now-queue-row .box-link {
  grid-column: 2 / -1;
  margin-top: 2px;
}

.now-tl .box-link {
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .box-link,
  .box-link .box-arrow {
    transition: none;
  }
}

/* Links to /omega/ wherever the site names Omega in running text. */
a.omega-link {
  color: var(--tl-blue-soft);
  text-decoration: underline;
  text-decoration-color: rgba(125, 180, 255, 0.4);
  text-underline-offset: 3px;
}
a.omega-link:hover { text-decoration-color: var(--tl-blue-soft); }
