/* RBC AI landing page. Plain CSS, no build step. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #080b14;
  --panel: #0d1424;
  --tint: #0b1120;
  --line: rgba(170, 185, 220, 0.16);
  --text: #e8ecf5;
  --muted: #9ba7be;
  --crimson: #c41e3a;
  --crimson-hi: #f0536b;
  --stain: #8a7cff;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --section-pad: clamp(72px, 10vw, 128px);
  --header-h: 68px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
svg { display: block; max-width: 100%; }
a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

:focus-visible {
  outline: 3px solid var(--crimson-hi);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px; top: -64px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--ink);
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 11, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.nav a {
  padding: 8px 14px;
  color: var(--muted);
  font-size: 0.97rem;
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav a:hover { color: var(--text); background: rgba(170, 185, 220, 0.1); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-sm { padding: 10px 18px; font-size: 0.95rem; }
.btn-primary {
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(196, 30, 58, 0);
}
.btn-primary:hover {
  background: #d3243f;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -10px rgba(240, 83, 107, 0.65);
}
.btn-ghost {
  color: var(--text);
  border-color: rgba(170, 185, 220, 0.5);
}
.btn-ghost:hover {
  border-color: var(--crimson-hi);
  background: rgba(240, 83, 107, 0.08);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 96px);
  background:
    radial-gradient(60% 70% at 82% 38%, rgba(196, 30, 58, 0.16), transparent 70%),
    var(--ink);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  font-weight: 450;
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 14ch;
  text-wrap: balance;
}
.lede {
  margin-top: 28px;
  max-width: 54ch;
  color: #c3ccdf;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.7;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}
.hero-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-visual { justify-self: center; width: min(100%, 520px); }
.field { width: 100%; height: auto; border-radius: 50%; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); }
.hero-visual figcaption {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Hero motion: cells drift slowly, then the detector boxes lock on in order. */
/* Finite and under 5s, so no pause control is needed (WCAG 2.2.2). */
.drift-a { animation: drift-a 4s ease-out 1 forwards; }
.drift-b { animation: drift-b 4s ease-out 1 forwards; }
@keyframes drift-a { to { transform: translate(7px, 9px); } }
@keyframes drift-b { to { transform: translate(-8px, -6px); } }

.bracket {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.8s ease-out forwards;
}
.b1 { animation-delay: 0.6s; }
.b2 { animation-delay: 1.1s; }
.b3 { animation-delay: 1.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.tag, .cam { opacity: 0; animation: fade-in 0.6s ease-out forwards; }
.t1 { animation-delay: 1.4s; }
.t2 { animation-delay: 1.9s; }
.t3 { animation-delay: 2.4s; }
.cam { animation-duration: 1.4s; animation-delay: 2.8s; mix-blend-mode: screen; }
@keyframes fade-in { to { opacity: 1; } }

/* ---------- Disclaimer band ---------- */

.disclaimer-band {
  background: var(--panel);
  border-block: 1px solid var(--line);
}
.disclaimer-band .wrap {
  padding-block: 20px;
  border-left: 3px solid var(--crimson);
  padding-left: calc(var(--gutter) + 4px);
}
.disclaimer-band p { color: #c9d1e3; font-size: 1rem; max-width: 80ch; }
.disclaimer-band strong { color: var(--text); }

/* ---------- Sections ---------- */

.section { padding-block: var(--section-pad); }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }

h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 450;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.25;
}
.section-intro {
  margin-top: 16px;
  max-width: 58ch;
  color: var(--muted);
}
.section-head { margin-bottom: clamp(36px, 5vw, 64px); }

/* Capabilities */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.split-head { position: sticky; top: calc(var(--header-h) + 32px); }

.cap {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 32px 20px;
  margin-inline: -20px;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  transition: background-color 0.25s ease;
}
.cap:last-child { border-bottom: 1px solid var(--line); }
.cap:hover { background: linear-gradient(90deg, rgba(196, 30, 58, 0.09), transparent 80%); }
.cap-art { width: 148px; height: auto; }
.cap p { margin-top: 8px; color: var(--muted); max-width: 56ch; }

/* Cell classes */

.classes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 48px 36px;
}
.classes svg { width: 104px; height: 104px; margin-bottom: 14px; }
.classes p { margin-top: 6px; color: var(--muted); font-size: 0.98rem; line-height: 1.6; }

/* Workflow: a true sequence, so the steps are numbered */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding-top: 64px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0; left: 0;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  background: var(--panel);
  border: 1px solid var(--crimson);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
}
.steps li::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 56px;
  right: -20px;
  height: 1px;
  background: linear-gradient(90deg, var(--crimson), var(--line));
}
.steps li:last-child::after { display: none; }
.steps p { margin-top: 8px; color: var(--muted); font-size: 0.98rem; }

/* Research */

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 88px);
}
.facts { margin-top: 20px; }
.facts > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { color: var(--muted); font-size: 0.98rem; }

.limits { margin-top: 20px; }
.limits li {
  position: relative;
  padding: 14px 0 14px 26px;
  border-top: 1px solid var(--line);
  color: #c3ccdf;
  font-size: 0.98rem;
}
.limits li:last-child { border-bottom: 1px solid var(--line); }
.limits li::before {
  content: "";
  position: absolute;
  left: 2px; top: 1.35em;
  width: 8px; height: 8px;
  background: var(--crimson);
  border-radius: 50%;
}

.disclaimer-panel {
  margin-top: clamp(40px, 6vw, 72px);
  padding: clamp(24px, 4vw, 40px);
  background: linear-gradient(135deg, rgba(196, 30, 58, 0.2), rgba(196, 30, 58, 0.05));
  border: 1px solid rgba(240, 83, 107, 0.45);
  border-radius: 14px;
}
.disclaimer-panel p { margin-top: 10px; max-width: 70ch; color: #dbe1ef; }

/* Links */

.link-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.link-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(24px, 3.5vw, 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}
.link-tile:hover {
  border-color: var(--crimson-hi);
  background: #111a2e;
  transform: translateY(-2px);
}
.link-title { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.link-desc { color: var(--muted); }
.link-url {
  margin-top: 8px;
  color: var(--crimson-hi);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 56px;
  border-top: 1px solid var(--line);
  background: var(--tint);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 32px 64px;
  align-items: start;
}
.footer-brand { font-family: var(--serif); font-size: 1.5rem; }
.footer-sub { margin-top: 4px; color: var(--muted); }
.footer-legal { color: var(--muted); font-size: 0.93rem; max-width: 62ch; }

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.notfound-inner { max-width: 520px; }
.notfound h1 { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); font-weight: 450; line-height: 1.1; }
.notfound p { margin-top: 16px; color: var(--muted); }
.notfound .btn { margin-top: 28px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 18ch; }
  .hero-visual { width: min(100%, 440px); }
  .split { grid-template-columns: 1fr; }
  .split-head { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .steps li:nth-child(2)::after { display: none; }
  .research-grid { grid-template-columns: 1fr; }
}

/* Two-row header: the one-row nav needs about 900px, so switch early. */
@media (max-width: 900px) {
  .bar { grid-template-columns: 1fr auto; gap: 0 12px; padding-block: 10px 6px; }
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: calc(var(--gutter) - 14px);
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a:focus-visible { outline-offset: -3px; }
  :root { --header-h: 104px; }
}

@media (max-width: 720px) {
  .link-pair { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cap { grid-template-columns: 1fr; gap: 16px; padding-inline: 0; margin-inline: 0; }
  .cap-art { width: 128px; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-height: 520px) {
  .site-header { position: static; }
}

@media (max-width: 400px) {
  .tags { display: none; }
}

@media (max-width: 480px) {
  .classes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 20px; }
  .classes svg { width: 88px; height: 88px; }
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .actions .btn { width: 100%; }
}

/* ---------- Reduced motion: show the finished state, no movement ---------- */

@media (prefers-reduced-motion: reduce) {
  .drift-a, .drift-b { animation: none; }
  .bracket { animation: none; stroke-dashoffset: 0; }
  .tag, .cam { animation: none; opacity: 1; }
  .btn, .link-tile, .cap, .nav a { transition: none; }
  .btn:hover, .link-tile:hover { transform: none; }
}
