/* APEX.AI — site styles
   Palette and type carried over from the original Squarespace template
   (orange #FF6123, peach #FACF9F, Manrope), set in an editorial system:
   Manrope for display, Newsreader for reading text, IBM Plex Mono for data. */

:root {
  --orange: #ff6123;
  --orange-ink: #c8410f;
  --peach: #facf9f;
  --paper: #f7f4ee;
  --ink: #0d0d0d;
  --ink-2: #3a3833;
  --ink-3: #6b675f;
  --rule: rgba(13, 13, 13, 0.16);
  --night: #0b0b0c;
  --night-2: #17171a;
  --night-rule: rgba(250, 250, 249, 0.14);
  --night-text: #f2efe9;
  --night-muted: #a39f97;

  --display: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --section-y: clamp(72px, 10vw, 160px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--orange); color: var(--ink); }

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

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.on-night :focus-visible { outline-color: var(--peach); }

/* ---------- type primitives ---------- */

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.display {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 0;
}

.h-xl { font-size: clamp(48px, 9.2vw, 148px); }
.h-lg { font-size: clamp(40px, 6.4vw, 96px); }
.h-md { font-size: clamp(30px, 3.6vw, 52px); letter-spacing: -0.03em; line-height: 1.04; }
.h-sm { font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.02em; line-height: 1.15; }

.standfirst {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.9vw, 27px);
  line-height: 1.38;
  letter-spacing: -0.005em;
  margin: 0;
  max-width: 34em;
}

.prose {
  font-family: var(--serif);
  font-size: clamp(18px, 1.35vw, 20px);
  line-height: 1.6;
  color: var(--ink-2);
}
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

.dropcap::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 500;
  font-size: 4.6em;
  line-height: 0.82;
  padding: 0.06em 0.08em 0 0;
  color: var(--orange);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 300px;          /* template: pill buttons */
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #2a2926; }
.btn-orange { background: var(--orange); color: var(--ink); }
.btn-orange:hover { background: #ff7a44; }
.btn-line { border-color: currentColor; color: inherit; background: transparent; }
.btn-line:hover { background: rgba(13,13,13,.06); }
.on-night .btn-line:hover { background: rgba(250,250,249,.08); }
.btn svg { width: 18px; height: 18px; flex: none; }

.textlink {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.textlink:hover { text-decoration-thickness: 2px; }

/* ---------- masthead ---------- */

.folio {
  background: var(--ink);
  color: var(--peach);
}
.folio .wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 9px;
  padding-bottom: 9px;
}
.folio .label { font-size: 11px; }
.folio .hide-sm { display: inline; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--orange);
  transition: box-shadow .2s ease;
}
.masthead.is-stuck { box-shadow: 0 1px 0 rgba(13,13,13,.18); }
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark span { color: var(--paper); padding: 0 .02em; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav a:not(.btn) {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav .btn { height: 42px; padding: 0 20px; font-size: 15px; }

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px 0 10px 10px;
  font: 600 15px var(--display);
  color: var(--ink);
  cursor: pointer;
}

/* ---------- hero (orange, after the template's opener) ---------- */

.hero {
  background: var(--orange);
  color: var(--ink);
  padding: clamp(40px, 6vw, 88px) 0 clamp(48px, 6vw, 96px);
}
.hero-kicker { display: flex; gap: 18px; align-items: center; margin-bottom: clamp(20px, 3vw, 36px); }
.hero-kicker .bar { width: 44px; height: 2px; background: var(--ink); }
.hero h1 { color: var(--paper); max-width: 11.5em; }
.hero h1 em { font-style: normal; color: var(--ink); }

.hero-sub {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gutter);
  align-items: end;
  margin-top: clamp(28px, 4vw, 56px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

.hero-figure {
  position: relative;
  margin: clamp(40px, 5vw, 72px) 0 0;
}
.hero-figure .frame {
  position: relative;
  overflow: hidden;
  background: var(--night);
  aspect-ratio: 16 / 8;
}
.hero-figure .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 55%;
}
.hero-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  color: var(--ink);
}

/* The radio transcript laid over the photograph, where the template put its intro text. */
.radio {
  position: absolute;
  right: clamp(16px, 3vw, 44px);
  bottom: clamp(16px, 3vw, 44px);
  width: min(440px, calc(100% - 32px));
  background: var(--paper);
  color: var(--ink);
  padding: 20px 22px 16px;
}
.radio-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.radio-head .live { display: inline-flex; align-items: center; gap: 8px; }
.radio-head .live::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
}
.radio ol { list-style: none; margin: 0; padding: 0; }
.radio li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.radio li:last-child { border-bottom: 0; padding-bottom: 4px; }
.radio .t { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 3px; }
.radio .m { font-family: var(--serif); font-size: 17px; line-height: 1.4; }

/* ---------- marquee (template's scrolling headline) ---------- */

.marquee {
  background: var(--peach);
  overflow: hidden;
  padding: clamp(28px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--rule);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee-track span {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(56px, 9vw, 140px);
  letter-spacing: -0.04em;
  line-height: 1;
  padding-right: 0.5em;
  white-space: nowrap;
}
.marquee-track span i { font-style: normal; color: var(--orange); padding-left: 0.5em; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------- sections ---------- */

.section { padding: var(--section-y) 0; }
.section.paper { background: var(--paper); }
.section.peach { background: var(--peach); }
.section.night { background: var(--night); color: var(--night-text); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--gutter);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  margin-bottom: clamp(40px, 6vw, 88px);
}
.night .section-head { border-top-color: var(--night-rule); }
.section-head .num { color: var(--orange); }
.night .section-head .num { color: var(--orange); }
.section-head .label + .label { margin-top: 6px; color: var(--ink-3); }
.night .section-head .label + .label { color: var(--night-muted); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

/* 01 — what it is */
.intro-statement { grid-column: 1 / span 7; }
.intro-body { grid-column: 9 / span 4; padding-top: 10px; }

.facts {
  list-style: none;
  margin: clamp(56px, 7vw, 104px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--gutter);
}
.facts li {
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}
.facts .label { color: var(--orange-ink); display: block; margin-bottom: 18px; }
.facts h3 { margin: 0 0 10px; }
.facts p { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--ink-2); }

/* 02 — the engineer (night) */
.engineer-lede { grid-column: 1 / span 6; }
.engineer-lede .standfirst { color: var(--night-text); margin-top: 28px; }
.engineer-aside { grid-column: 8 / span 5; padding-top: 12px; }
.engineer-aside.prose { color: var(--night-muted); }
.engineer-aside.prose strong { color: var(--night-text); }

.shot {
  margin: clamp(48px, 6vw, 88px) 0 0;
}
.shot .frame {
  background: var(--night-2);
  border: 1px solid var(--night-rule);
  overflow: hidden;
}
.shot img { width: 100%; }
.shot figcaption {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--gutter);
  padding-top: 14px;
  color: var(--night-muted);
}
.shot figcaption .label { color: var(--night-text); }
.shot figcaption p { margin: 0; font-family: var(--serif); font-size: 17px; }

.calls {
  margin-top: clamp(56px, 7vw, 104px);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--gutter);
}
.calls h3 { color: var(--night-text); }
.calls table { width: 100%; border-collapse: collapse; }
.calls th, .calls td {
  text-align: left;
  vertical-align: top;
  padding: 16px 16px 16px 0;
  border-top: 1px solid var(--night-rule);
}
.calls th { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--night-muted); width: 22%; }
.calls td { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--night-text); }
.calls td .src { display: block; margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--night-muted); letter-spacing: .02em; }

/* 03 — how it works */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  counter-reset: step;
}
.steps li { border-top: 2px solid var(--ink); padding-top: 22px; }
.steps .n {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(64px, 7vw, 112px);
  letter-spacing: -0.05em;
  line-height: .9;
  margin-bottom: 28px;
}
.steps h3 { margin: 0 0 12px; }
.steps p { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.steps code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(13,13,13,.08);
  padding: 1px 6px;
}

/* 04 — the games */
.games { width: 100%; border-collapse: collapse; }
.games thead th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-3);
  padding: 0 16px 14px 0;
  border-bottom: 2px solid var(--ink);
}
.games tbody td, .games tbody th {
  text-align: left;
  vertical-align: top;
  padding: 26px 16px 26px 0;
  border-bottom: 1px solid var(--rule);
}
.games tbody th { width: 34%; font-weight: 500; }
.games .game {
  display: block;
  font-family: var(--display);
  font-size: clamp(24px, 2.4vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.games .sub { display: block; margin-top: 8px; font-family: var(--serif); font-size: 17px; color: var(--ink-3); font-weight: 400; }
.games td { font-family: var(--serif); font-size: 18px; line-height: 1.45; color: var(--ink-2); }
.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 9px 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.status.live { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.status.dev { color: var(--orange-ink); }
.status.soon { color: var(--ink-3); }

.games-note {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--gutter);
}
.games-note p { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--ink-3); max-width: 46em; }

.pair {
  margin-top: clamp(56px, 7vw, 104px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}
.pair figure { margin: 0; }
.pair .frame { background: var(--night); overflow: hidden; }
.pair figcaption { padding-top: 12px; display: flex; gap: 14px; }
.pair figcaption p { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--ink-3); }

/* 05 — pricing */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--ink);
}
.plan {
  padding: 28px var(--gutter) 32px 0;
  display: flex;
  flex-direction: column;
}
.plan + .plan { border-left: 1px solid var(--rule); padding-left: var(--gutter); }
.plan .label { color: var(--ink-3); }
.plan h3 { margin: 14px 0 6px; }
.plan .price {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-2);
  margin: 0 0 24px;
}
.plan ul { list-style: none; margin: 0 0 32px; padding: 0; flex: 1; }
.plan li {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}
.plan.featured h3 { color: var(--orange-ink); }
.plan .btn { align-self: flex-start; }

/* 06 — FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: var(--gutter); }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(20px, 1.8vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  color: var(--orange-ink);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 28px; max-width: 44em; }

/* ---------- contact / footer (peach, after the template) ---------- */

.contact { background: var(--peach); padding: var(--section-y) 0 0; }
.contact-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gutter); align-items: end; }
.contact-cols {
  margin-top: clamp(56px, 7vw, 104px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  border-top: 2px solid var(--ink);
  padding-top: 22px;
}
.contact-cols .label { display: block; color: var(--ink-3); margin-bottom: 14px; }
.contact-cols p, .contact-cols li { font-family: var(--serif); font-size: 19px; line-height: 1.5; margin: 0; }
.contact-cols ul { list-style: none; padding: 0; margin: 0; }
.contact-cols a { text-decoration: none; }
.contact-cols a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.colophon {
  margin-top: clamp(72px, 9vw, 140px);
  overflow: hidden;
}
.colophon .giant {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(88px, 23.5vw, 360px);
  letter-spacing: -0.065em;
  line-height: .8;
  margin: 0 0 0.05em -0.045em;
  white-space: nowrap;
}
.colophon .giant span { color: var(--orange); }
.colophon .base {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .intro-statement { grid-column: 1 / -1; }
  .intro-body { grid-column: 1 / span 9; }
  .engineer-lede, .engineer-aside { grid-column: 1 / -1; }
  .engineer-aside { padding-top: 0; }
  .plans { grid-template-columns: 1fr; }
  .plan, .plan + .plan { padding: 28px 0 32px; border-left: 0; }
  .plan + .plan { border-top: 1px solid var(--rule); }
  .contact-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--orange);
    padding: 8px var(--gutter) 24px;
    border-top: 1px solid rgba(13,13,13,.18);
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { font-size: 22px; padding: 12px 0; width: 100%; border-bottom: 1px solid rgba(13,13,13,.14); }
  .nav .btn { margin-top: 18px; height: 50px; }

  .hero-sub { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
  .hero-figure .frame { aspect-ratio: 4 / 5; }
  .hero-figure .frame img { object-position: 34% 55%; }

  .section-head,
  .shot figcaption,
  .calls,
  .games-note,
  .faq-grid,
  .contact-head { grid-template-columns: 1fr; }
  .section-head { row-gap: 6px; }
  .shot figcaption { row-gap: 6px; }

  .facts, .steps { grid-template-columns: 1fr; row-gap: 44px; }
  .intro-body { grid-column: 1 / -1; }
  .pair { grid-template-columns: 1fr; row-gap: 40px; }

  /* games table becomes stacked rows */
  .games thead { display: none; }
  .games, .games tbody, .games tr, .games th, .games td { display: block; width: 100%; }
  .games tr { border-bottom: 1px solid var(--rule); padding: 22px 0; }
  .games tbody th, .games tbody td { border: 0; padding: 4px 0; width: 100%; }
  .games tbody th { padding-bottom: 12px; }
  .games td[data-k]::before {
    content: attr(data-k);
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 10px 0 4px;
  }

  .calls th { width: 30%; }
}

@media (max-width: 560px) {
  .folio .hide-sm { display: none; }
  .radio { position: static; width: 100%; padding: 18px 16px 12px; }
  .hero-figure .frame { aspect-ratio: auto; overflow: visible; background: none; }
  .hero-figure .frame img { aspect-ratio: 4 / 3; height: auto; }
  .hero-figure figcaption { flex-direction: column; gap: 4px; }
  .calls table, .calls tbody, .calls tr, .calls th, .calls td { display: block; width: 100%; }
  .calls th { padding: 16px 0 4px; }
  .calls td { border-top: 0; padding: 0 0 16px; }
  .contact-cols { grid-template-columns: 1fr; }
  .btn { height: 50px; }
}
