/* Colour tokens. Dark is the default; the light theme overrides them below.
   The theme is set as <html data-theme> by the inline script in each page's <head> (see /theme.js).
   *-rgb tokens are bare channels for rgba(var(--x-rgb), alpha) tints. */
:root {
  color-scheme: dark;
  --bg: #030814;
  --bg-rgb: 3, 8, 20;
  --veil-rgb: 2, 7, 17;
  --surface-rgb: 8, 20, 40;
  --surface-solid: #08142a;
  --input-bg: #071226;
  --line-rgb: 181, 203, 231;
  --tint-rgb: 20, 92, 170;
  --text: #f4f7fb;
  --text-soft: #dbe5f1;
  --text-muted: #b6c7dc;
  --text-subtle: #9fb1c7;
  --text-dim: #8ea3bd;
  --text-faint: #8296ae;
  --accent: #3f9cff;
  --accent-rgb: 63, 156, 255;
  --accent-glow: #3f9cff;
  --link: #6cb4ff;
  --link-rgb: 108, 180, 255;
  --accent-pale: #94b9e5;
  --btn-bg: #145caa;
  --btn-bg-hover: #1d72cf;
  --btn-text: #f4f7fb;
  --danger: #ff7a7a;
  --danger-rgb: 255, 120, 120;
  --danger-text: #ffc2c2;
  --danger-strong: #ff8a8a;
  --danger-fill: rgba(120, 20, 20, 0.25);
  --ok: #58d68d;
  --ok-rgb: 88, 214, 141;
  --ok-text: #8be0ae;
  --warn-text: #ffc46b;
  --warn-pale: #ffd8a8;
  --warn-rgb: 255, 196, 120;
  --art-opacity: 0.72;
  --grain-opacity: 0.13;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}

/* Light theme: same blues, deepened so text and links pass WCAG AA on the pale background */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-rgb: 244, 247, 251;
  --veil-rgb: 244, 247, 251;
  --surface-rgb: 255, 255, 255;
  --surface-solid: #fcfdfe;
  --input-bg: #ffffff;
  --line-rgb: 30, 58, 95;
  --tint-rgb: 20, 92, 170;
  --text: #0a1628;
  --text-soft: #1c2c42;
  --text-muted: #34495f;
  --text-subtle: #4a5f7a;
  --text-dim: #51667f;
  --text-faint: #586d8a;
  --accent: #2b7fe0;
  --accent-rgb: 43, 127, 224;
  --accent-glow: rgba(43, 127, 224, 0.4);
  --link: #0f5fb8;
  --link-rgb: 15, 95, 184;
  --accent-pale: #2a5d94;
  --btn-bg: #145caa;
  --btn-bg-hover: #0f4f96;
  --btn-text: #ffffff;
  --danger: #c62828;
  --danger-rgb: 198, 40, 40;
  --danger-text: #a3161b;
  --danger-strong: #b3141c;
  --danger-fill: rgba(198, 40, 40, 0.07);
  --ok: #1e9e5a;
  --ok-rgb: 30, 158, 90;
  --ok-text: #137a43;
  --warn-text: #8a5300;
  --warn-pale: #8a5300;
  --warn-rgb: 200, 120, 20;
  --art-opacity: 0.3;
  --grain-opacity: 0.05;
}

/* Short colour fade while switching themes only (theme.js adds the class); never on page load */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    fill 0.25s ease,
    stroke 0.25s ease !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
}

.launch {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 64% 35%, rgba(var(--tint-rgb), 0.22), transparent 32%),
    var(--bg);
}

.brand-art,
.veil {
  position: absolute;
  inset: 0;
}

.brand-art {
  z-index: -3;
  animation: breathe 16s ease-in-out infinite alternate;
}

.brand-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: var(--art-opacity);
  filter: saturate(0.9) contrast(1.08);
}

.veil {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(var(--veil-rgb), 0.96) 0%, rgba(var(--veil-rgb), 0.72) 36%, rgba(var(--veil-rgb), 0.08) 70%),
    linear-gradient(180deg, rgba(var(--veil-rgb), 0.18) 44%, rgba(var(--veil-rgb), 0.96) 100%);
}

.page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 22%, rgba(var(--tint-rgb), 0.2), transparent 38%),
    var(--bg);
}

.launch::after,
.page::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

.masthead {
  position: absolute;
  top: clamp(1.5rem, 4vw, 3.5rem);
  left: clamp(1.5rem, 6vw, 6.5rem);
  right: clamp(1.5rem, 6vw, 6.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.26);
  opacity: 0;
  animation: arrive 0.85s 0.1s ease-out forwards;
}

/* The nav takes the free space so the theme toggle sits at the far right */
.masthead .nav {
  margin-left: auto;
}

.wordmark {
  color: inherit;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  font-weight: 720;
  letter-spacing: 0.19em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav ul {
  display: flex;
  gap: clamp(1.1rem, 2.4vw, 2.4rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav .nav-yt {
  display: inline-flex;
  align-items: center;
}

.nav-yt svg {
  width: 1.15rem;
  height: 1.15rem;
}

.yt-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(1.5rem, 3.5vh, 2.25rem);
  padding: 0.7rem 1.05rem;
  border: 1px solid rgba(var(--line-rgb), 0.35);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(var(--bg-rgb), 0.45);
  opacity: 0;
  animation: arrive 0.8s 1.05s ease-out forwards;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.yt-cta svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--link);
}

.yt-cta:hover {
  border-color: var(--accent);
  background: rgba(var(--tint-rgb), 0.22);
}

/* Theme toggle (top right of the masthead); the icon shows the theme it switches to */
.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: -0.75rem;
  padding: 0;
  border: 1px solid rgba(var(--line-rgb), 0.35);
  border-radius: 50%;
  color: var(--text-muted);
  background: rgba(var(--bg-rgb), 0.45);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(var(--tint-rgb), 0.22);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle .icon-sun,
:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.theme-toggle .icon-moon,
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

/* Without the head script (no JS) there is nothing to toggle */
:root:not([data-theme]) .theme-toggle {
  display: none;
}

.wordmark:focus-visible,
.yt-cta:focus-visible,
.nav a:focus-visible {
  outline: 1px solid var(--link);
  outline-offset: 0.35rem;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.announcement {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(1.5rem, 6vw, 6.5rem);
  width: min(43rem, 58vw);
  transform: translateY(-42%);
}

.eyebrow {
  margin: 0 0 clamp(1.25rem, 3vh, 2.2rem);
  color: var(--accent-pale);
  font-size: clamp(0.62rem, 0.9vw, 0.82rem);
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: rise 0.8s 0.25s ease-out forwards;
}

h1 {
  margin: 0;
  max-width: 7ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5rem, 10.5vw, 11rem);
  font-weight: 400;
  letter-spacing: -0.072em;
  line-height: 0.7;
  text-wrap: balance;
  opacity: 0;
  animation: rise 0.9s 0.38s cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

h1 em {
  color: var(--link);
  font-weight: 400;
}

.rule {
  display: block;
  width: min(18rem, 58%);
  height: 1px;
  margin-top: clamp(2rem, 5vh, 4rem);
  overflow: hidden;
  background: rgba(var(--line-rgb), 0.35);
  transform: scaleX(0);
  transform-origin: left;
  animation: draw 1.1s 0.85s ease-out forwards;
}

.section-intro {
  padding: clamp(10rem, 28vh, 16rem) clamp(1.5rem, 6vw, 6.5rem) 5rem;
}

.section-intro h1 {
  max-width: none;
  font-size: clamp(3.4rem, 8vw, 7.5rem);
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.lede {
  max-width: 34rem;
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  opacity: 0;
  animation: rise 0.9s 0.5s ease-out forwards;
}

.section-intro .yt-cta {
  display: flex;
  width: fit-content;
}

.section-intro .status {
  margin-top: 2rem;
  opacity: 0;
  animation: arrive 0.8s 0.75s ease-out forwards;
}

.founder {
  position: absolute;
  z-index: 1;
  right: clamp(-4rem, -1vw, -1rem);
  bottom: 0;
  width: min(41vw, 40rem);
  height: min(82vh, 54rem);
  margin: 0;
  opacity: 0;
  transform: translate3d(2rem, 1.5rem, 0);
  animation: founder-in 1.05s 0.55s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}

.founder::before {
  position: absolute;
  z-index: 1;
  inset: 45% 0 0;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(var(--veil-rgb), 0.9));
  pointer-events: none;
}

.founder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: contrast(1.02) saturate(0.9);
  /* The portrait is a cut-out; the dark theme keeps its original black studio backdrop */
  background: #000;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 16%, black 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 16%, black 100%);
}

:root[data-theme="light"] .founder img {
  background: none;
}

.founder figcaption {
  position: absolute;
  z-index: 2;
  right: clamp(1.5rem, 6vw, 6.5rem);
  bottom: clamp(1.5rem, 5vh, 3.5rem);
  display: grid;
  gap: 0.35rem;
  min-width: 11.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(var(--line-rgb), 0.4);
  text-align: right;
}

.founder strong {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.founder span {
  color: var(--text-subtle);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@keyframes arrive {
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes draw {
  to {
    transform: scaleX(1);
  }
}

@keyframes founder-in {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes breathe {
  from {
    transform: scale(1.01);
  }
  to {
    transform: scale(1.045);
  }
}

@media (max-width: 760px) {
  .brand-art img {
    object-position: 54% center;
    opacity: calc(var(--art-opacity) * 0.8);
  }

  .veil {
    background:
      linear-gradient(180deg, rgba(var(--veil-rgb), 0.3) 10%, rgba(var(--veil-rgb), 0.9) 70%, rgb(var(--veil-rgb)) 100%),
      linear-gradient(90deg, rgba(var(--veil-rgb), 0.78), rgba(var(--veil-rgb), 0.12));
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
  }

  .nav ul {
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.95rem;
    row-gap: 0.25rem;
  }

  .nav a {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
  }

  /* YouTube icon and theme toggle sit beside the wordmark so the four tabs keep one row */
  .nav li:last-child {
    position: absolute;
    top: -0.3rem;
    right: 0;
  }

  .theme-toggle {
    position: absolute;
    top: -0.5rem;
    right: 1.95rem;
    margin: 0;
  }

  .yt-cta {
    padding: 0.6rem 0.85rem;
    font-size: 0.66rem;
  }

  .announcement {
    top: 24%;
    right: 1.5rem;
    width: auto;
    transform: none;
  }

  .eyebrow {
    max-width: 24rem;
    line-height: 1.7;
  }

  h1 {
    font-size: clamp(4.8rem, 24vw, 7.2rem);
    line-height: 0.74;
  }

  .founder {
    right: -2.5rem;
    width: min(88vw, 30rem);
    height: 46vh;
  }

  .founder figcaption {
    right: auto;
    left: 2.5rem;
    text-align: left;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .announcement {
    transform: translateY(-34%);
  }

  h1 {
    font-size: clamp(4rem, 9vw, 7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Site footer (every page) ---------- */
.site-foot {
  padding: 2.5rem clamp(1.5rem, 6vw, 6.5rem) 2rem;
  border-top: 1px solid rgba(var(--line-rgb), 0.18);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  max-width: 76rem;
  margin: 0 auto;
}
.site-foot .wordmark { color: var(--text); }
.site-foot p { margin: 0.5rem 0 0; color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.08em; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1rem 3rem; }
.site-foot ul { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.site-foot a { color: var(--text-muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); text-decoration: underline; }
.site-foot .foot-note { max-width: 76rem; margin: 2rem auto 0; color: var(--text-faint); font-size: 0.78rem; letter-spacing: 0; }
@media print { .site-foot { display: none !important; } }
