/* CYSTRA — homepage
   Tokens come from the locked logo kit (COLORS.txt). One accent: blue.
   Light: F5F5F5 ground, 111111 ink, 1C4E9C blue deep.
   Dark:  0A0A0A plate,  F5F5F5 white, 2E6CC4 blue. */

:root {
  --ground: #F5F5F5;
  --ground-2: #ECECEC;
  --ink: #111111;
  --ink-2: #4A4A4A;
  --ink-3: #8A8A8A;
  --line: rgba(17, 17, 17, 0.14);
  --blue: #1C4E9C;
  --plate: #0A0A0A;
  --plate-ink: #F5F5F5;
  --plate-ink-2: #A9A9A9;
  --plate-blue: #2E6CC4;
  --plate-line: rgba(245, 245, 245, 0.16);

  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1400px;
  --nav-h: 68px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: #0A0A0A;
  --ground-2: #141414;
  --ink: #F5F5F5;
  --ink-2: #B9B9B9;
  --ink-3: #7A7A7A;
  --line: rgba(245, 245, 245, 0.16);
  --blue: #2E6CC4;
  --plate: #F5F5F5;
  --plate-ink: #111111;
  --plate-ink-2: #4A4A4A;
  --plate-blue: #1C4E9C;
  --plate-line: rgba(17, 17, 17, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .45s var(--ease), color .45s var(--ease);
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin: 0; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ---------- theme-aware SVG ---------- */
.mark .ink, .lockup .ink { fill: var(--ink); }
.mark .dot, .lockup .dot, .lockup .name { fill: var(--blue); }
.plate .mark .ink { fill: var(--plate-ink); }
.plate .mark .dot { fill: var(--plate-blue); }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.nav .lockup { display: block; height: 26px; width: auto; }
.nav-links {
  display: flex;
  gap: 28px;
  justify-content: center;
  font-size: 15px;
  color: var(--ink-2);
}
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 14px; grid-column: 3; justify-self: end; }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 500 12px/1 var(--mono);
  letter-spacing: .04em;
  padding: 9px 12px;
  border-radius: 0;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--ink);
  color: var(--ground);
  font: 500 15px/1 var(--sans);
  border-radius: 0;
  transition: transform .15s var(--ease), background-color .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--blue); color: #F5F5F5; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-ghost:hover { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.nav .btn { padding: 11px 16px; }

/* ---------- speed line (the mark's motion, reused as section rule) ---------- */
.speedline {
  --w: 100%;
  position: relative;
  height: 10px;
  margin-bottom: 40px;
}
.speedline::before {
  content: "";
  position: absolute;
  left: 32px; right: 0; top: 4px;
  height: 2px;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(0);
}
.speedline i {
  position: absolute;
  top: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0;
  transform: translateX(-24px);
}
.speedline i:nth-child(1) { left: 0; }
.speedline i:nth-child(2) { left: 16px; top: 0; }
.in .speedline::before { transition: transform 1.1s var(--ease) .15s; transform: scaleX(1); }
.in .speedline i { transition: transform .8s var(--ease), opacity .4s; opacity: 1; transform: none; }
.in .speedline i:nth-child(2) { transition-delay: .12s; }

/* ---------- reveal ---------- */
.reveal > * { opacity: 0; transform: translateY(22px); }
.in.reveal > * { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .9s var(--ease); }
.in.reveal > *:nth-child(2) { transition-delay: .08s; }
.in.reveal > *:nth-child(3) { transition-delay: .16s; }
.in.reveal > *:nth-child(4) { transition-delay: .24s; }
.in.reveal > *:nth-child(5) { transition-delay: .32s; }
.in.reveal > *:nth-child(6) { transition-delay: .40s; }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100dvh - var(--nav-h));
  display: grid;
  align-items: center;
  padding: clamp(40px, 6vh, 72px) 0 clamp(40px, 8vh, 96px);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 5.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 500;
  max-width: 13ch;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p {
  margin-top: 28px;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 44ch;
}
.hero .cta { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; }

.hero-mark {
  position: relative;
  aspect-ratio: 985 / 788;
  max-width: 600px;
  width: 100%;
  justify-self: end;
}
.hero-mark .layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Arrival. The kit's PNG masters split into three layers. The resting state
   is the plain CSS (visible, untransformed); main.js plays the entrance with
   the Web Animations API from a hidden start, so a failed script or a paused
   tab can never leave the mark invisible.
   1. The C lands: scales up from its own centre with a small overshoot.
   2. The speed lines and dots arrive from the left, stretched by speed,
      and settle against the C. Storytelling: motion arriving at a fixed point. */
.hero-mark .c    { transform-origin: 58.2% 50%; }
.hero-mark .lines{ transform-origin: 51% 50%; }
.hero-mark .dots { transform-origin: 51% 50%; }

/* at rest: dots breathe, nothing else moves */
.hero-mark.done .dots { animation: idle 6s ease-in-out infinite; }
@keyframes idle { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-1.6%); } }

/* hero text follows the mark in */
.hero .reveal.in > * { transition-delay: .55s; }
.hero .reveal.in > *:nth-child(2) { transition-delay: .68s; }
.hero .reveal.in > *:nth-child(3) { transition-delay: .8s; }

/* theme-paired images (img and svg image) */
.theme-dark { display: none; }
:root[data-theme="dark"] .theme-light { display: none; }
:root[data-theme="dark"] .theme-dark { display: block; }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 12vh, 160px) 0; }
.section h2 {
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
  max-width: 22ch;
}
.section .lead {
  margin-top: 22px;
  font-size: clamp(17px, 1.3vw, 20px);
  color: var(--ink-2);
  max-width: 56ch;
}

/* ledger */
.ledger { margin-top: 64px; display: grid; gap: 0; }
.ledger-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.ledger-head span:last-child { color: var(--blue); }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.row .them {
  color: var(--ink-3);
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--ink-3), var(--ink-3));
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: 0 58%;
  transition: background-size .8s var(--ease) .35s;
}
.row .us { color: var(--ink); opacity: 0; transform: translateX(18px); transition: opacity .7s var(--ease) .45s, transform .9s var(--ease) .45s; }
.row.in .them { background-size: 100% 1.5px; }
.row.in .us { opacity: 1; transform: none; }
.row .us strong { color: var(--blue); font-weight: 500; }

/* owning it: numbered running text */
.owning { margin-top: 64px; }
.own {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.own:last-child { border-bottom: 1px solid var(--line); }
.own .n { font: 400 15px/1 var(--mono); color: var(--blue); }
.own h3 {
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.own p { margin-top: 10px; color: var(--ink-2); max-width: 60ch; font-size: clamp(16px, 1.2vw, 19px); }
@media (min-width: 900px) {
  .own { grid-template-columns: 96px minmax(0, 5fr) minmax(0, 6fr); }
  .own p { margin-top: 6px; }
}

/* the plate (the one theme flip on the page; it is the logo kit's dark plate
   in light mode and the paper sheet in dark mode) */
.plate {
  background: var(--plate);
  color: var(--plate-ink);
  padding: clamp(96px, 16vh, 200px) 0;
  transition: background-color .45s var(--ease), color .45s var(--ease);
}
.plate .wrap {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.plate h2 {
  font-size: clamp(40px, 6.4vw, 104px);
  line-height: .98;
  letter-spacing: -0.04em;
  font-weight: 500;
  max-width: 11ch;
}
.plate h2 em { font-style: normal; color: var(--plate-blue); }
.plate p { color: var(--plate-ink-2); font-size: clamp(17px, 1.35vw, 21px); max-width: 40ch; }
.plate .mark { width: clamp(96px, 13vw, 180px); height: auto; margin-bottom: 28px; }

/* principals */
.people { margin-top: 64px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); }
.person figure { margin: 0; }
.person .photo {
  aspect-ratio: 4 / 5;
  background: var(--ground-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font: 400 12px/1.4 var(--mono);
  color: var(--ink-3);
  text-align: center;
  padding: 24px;
  overflow: hidden;
}
.person .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; filter: grayscale(1) contrast(1.04); }
.person .photo:has(img) { padding: 0; border-color: transparent; }
.person figcaption { margin-top: 18px; }
.person .name { font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: -0.02em; }
.person .role { color: var(--ink-2); margin-top: 4px; }
.person .bio { color: var(--ink-2); margin-top: 12px; max-width: 42ch; font-size: 16px; }

/* scale */
.scale h2 { max-width: 18ch; }
.facts {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  border-top: 1px solid var(--line);
}
.fact { padding-top: 22px; }
.fact .k { font: 400 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fact .v { margin-top: 12px; font-size: clamp(20px, 2vw, 30px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.fact .v span { color: var(--blue); }

/* contact */
.contact { padding: clamp(96px, 16vh, 200px) 0 clamp(60px, 10vh, 120px); }
.contact h2 { font-size: clamp(32px, 4.2vw, 60px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 500; }
.contact p.small { margin-top: 22px; }
.contact p.small { color: var(--ink-2); font-size: clamp(17px, 1.3vw, 20px); max-width: 46ch; }
.contact .mail {
  display: inline-block;
  margin-top: 28px;
  font-size: clamp(30px, 7vw, 112px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
  border-bottom: 3px solid var(--blue);
  padding-bottom: .06em;
  transition: color .2s;
  word-break: break-all;
}
.contact .mail:hover { color: var(--blue); }

.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 14px;
}
.foot .lockup { height: 22px; width: auto; display: block; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav .wrap { grid-template-columns: auto 1fr auto; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-mark { justify-self: start; max-width: 360px; order: -1; }
  .plate .wrap { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .fact { padding: 18px 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .people { grid-template-columns: 1fr; }
  .row, .ledger-head { grid-template-columns: 1fr; gap: 8px; }
  .ledger-head span:last-child { display: none; }
  .row .them::before { content: "Ticket shop"; display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
  .row .us::before { content: "CYSTRA"; display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; margin-top: 12px; }
  .own { grid-template-columns: 1fr; gap: 8px; }
  .nav .btn { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal > *, .row .us, .row .them, .speedline::before, .speedline i { opacity: 1 !important; transform: none !important; transition: none !important; }
  .row .them { background-size: 100% 1.5px; }
  .hero-mark .layer { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
}

/* screenshot mode (?capture): fixed hero height, everything revealed */
.capture .hero { min-height: calc(900px - var(--nav-h)); }
