/* MTPLX site — shared styles.
   Tokens mirror the app's Brand.swift: panel #1A1A1A→#101010,
   type tiers EFEFEF/DEDEDE/9A9A9A/6A6A6A, hairline rules,
   mono heavy tracked eyebrows like the dashboard tile headers.
   Media philosophy (from the launch film): raw UI floating on black —
   no frames, no borders, no chrome. The app is the design. */

:root {
  --bg: #0a0a0a;
  --panel-top: #1a1a1a;
  --panel-bot: #101010;
  --hi: #efefef;
  --body: #dedede;
  --sec: #9a9a9a;
  --ter: #6a6a6a;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.16);
  --chrome: #c8d0d5;
  --green: #3ddc84;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, sans-serif;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 14px;
  --r-panel: 18px;
  --wrap: 1120px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(200, 208, 213, 0.25); color: var(--hi); }

a { color: var(--body); text-decoration: none; }

img, video { display: block; max-width: 100%; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

/* ---------- dynamic background ---------- */

.bgfx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}
.bgfx .blob {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.085;
  will-change: transform;
}
.bgfx .b1 {
  background: radial-gradient(circle at 35% 35%, #c8d0d5, transparent 62%);
  top: -24vmax; left: -14vmax;
  animation: drift1 90s ease-in-out infinite alternate;
}
.bgfx .b2 {
  background: radial-gradient(circle at 60% 60%, #8d99a4, transparent 62%);
  bottom: -30vmax; right: -18vmax;
  animation: drift2 110s ease-in-out infinite alternate;
}
.bgfx .b3 {
  background: radial-gradient(circle at 50% 50%, #6f7a85, transparent 60%);
  top: 30%; left: 55%;
  width: 40vmax; height: 40vmax;
  opacity: 0.05;
  animation: drift3 130s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(10vmax, 6vmax, 0) scale(1.15); }
}
@keyframes drift2 {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-8vmax, -7vmax, 0) scale(0.95); }
}
@keyframes drift3 {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-12vmax, 8vmax, 0) scale(1.2); }
}
.bgfx .grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* ---------- glass nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.42);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 0.5px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.nav.scrolled {
  background: rgba(10, 10, 10, 0.72);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav .brand { display: flex; align-items: center; }
.nav .brand img {
  height: 24px;
  width: auto;
  filter: brightness(1.18) drop-shadow(0 1px 6px rgba(0, 0, 0, 0.5));
}
.nav-links {
  display: flex;
  gap: 26px;
  margin-left: 8px;
}
.nav-links a {
  font-size: 13.5px;
  color: var(--sec);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--hi); }
.nav-spacer { flex: 1; }
.nav-gh { display: flex; align-items: center; color: var(--sec); transition: color 0.2s ease; }
.nav-gh:hover { color: var(--hi); }
.nav-gh svg { width: 19px; height: 19px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 11px 20px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--hi);
  color: #0a0a0a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 30px rgba(0, 0, 0, 0.45);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 16px 40px rgba(0, 0, 0, 0.55);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 15px; height: 15px; fill: currentColor; margin-top: -2px; }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--body);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--hi); background: rgba(255, 255, 255, 0.045); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sec);
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.7);
}
h1, h2, h3 { color: var(--hi); font-weight: 700; letter-spacing: -0.035em; }
h1 { font-size: clamp(42px, 5.4vw, 72px); line-height: 1.02; }
h2 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; }
h3 { font-size: 19px; letter-spacing: -0.02em; }
.grad {
  background: linear-gradient(180deg, #ffffff, #dcdcd4 55%, #8e8e86);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--sec); font-size: 17.5px; line-height: 1.65; }
.meta-line {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ter);
}
.meta-line b { color: var(--sec); font-weight: 600; }

/* decode-entrance headline: chunks of tokens land together, MTP-style */
.tok { opacity: 0; display: inline-block; transform: translateY(0.18em); filter: blur(4px); }
.tok.on {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.22s var(--ease-out), transform 0.3s var(--ease-out), filter 0.3s var(--ease-out);
}
.no-js .tok, .tok.static { opacity: 1; transform: none; filter: none; }

/* ---------- borderless media (the app IS the design) ---------- */

.shot {
  position: relative;
  border-radius: var(--r-l);
  overflow: hidden;
  width: fit-content;
  margin: 0 auto;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.62), 0 10px 30px rgba(0, 0, 0, 0.45);
  transform: translateZ(0);
}
.shot video, .shot img { width: 100%; height: auto; }
.shot-tall video { max-height: 620px; width: auto; }

/* two floating decode panels, equal size, synced start */
.duel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  max-width: 1080px;
  margin: 0 auto;
}
.duel-pane { margin: 0; }
.duel-pane figcaption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ter);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.duel-pane figcaption::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--chrome);
  opacity: 0.55;
}
.duel-pane figcaption.on { color: #ffffff; }
.duel-pane figcaption.on::before { background: #ffffff; opacity: 1; }
.duel-pane video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.62), 0 10px 30px rgba(0, 0, 0, 0.45);
  transform: translateZ(0);
}
@media (max-width: 720px) {
  .duel { grid-template-columns: 1fr; gap: 34px; }
}
.glowbase { position: relative; }
.glowbase::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%; bottom: -38px;
  height: 90px;
  background: radial-gradient(ellipse at center, rgba(200, 208, 213, 0.13), transparent 70%);
  filter: blur(24px);
  z-index: -1;
}
.tilt { will-change: transform; transform-style: preserve-3d; }

.caption-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ter);
  padding: 7px 13px;
  border-radius: 999px;
  border: 0.5px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(61, 220, 132, 0.6); }

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

section { padding: 108px 0; scroll-margin-top: 64px; }
.section-head { max-width: 760px; }
.section-head h2 { margin-top: 18px; }
.section-head p { margin-top: 18px; }

.featrow {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 64px;
  align-items: center;
}
.featrow.flip { grid-template-columns: 1.08fr 0.92fr; }
.featrow .copy .ix {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--ter);
  text-transform: uppercase;
}
.featrow .copy h2 { margin-top: 14px; font-size: clamp(26px, 3.4vw, 38px); }
.featrow .copy p { margin-top: 16px; color: var(--sec); max-width: 440px; }
.featrow .copy ul { margin: 18px 0 0; list-style: none; }
.featrow .copy li {
  position: relative;
  padding-left: 22px;
  margin-top: 9px;
  color: var(--sec);
  font-size: 14.5px;
}
.featrow .copy li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 10px; height: 1.5px;
  background: var(--chrome);
  opacity: 0.7;
}
.featrow .copy li b { color: var(--body); font-weight: 600; }

/* ---------- reveal animations ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  filter: blur(10px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; filter: none; }
.reveal.d1 { transition-delay: 0.09s; }
.reveal.d2 { transition-delay: 0.18s; }
.reveal.d3 { transition-delay: 0.27s; }

/* ---------- code block ---------- */

.code {
  border-radius: var(--r-l);
  border: 0.5px solid var(--line);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ter);
}
.code-head .dots { display: flex; gap: 6px; }
.code-head .dot-d { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.code pre {
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--body);
  overflow-x: auto;
}
.code .c { color: var(--ter); }
.code .k { color: var(--chrome); font-weight: 600; }
.code .p { color: var(--hi); }

/* ---------- footer ---------- */

footer {
  border-top: 0.5px solid var(--line);
  padding: 52px 0 64px;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--sec);
}
.foot .links { display: flex; gap: 24px; }
.foot .links a { color: var(--sec); transition: color 0.2s ease; }
.foot .links a:hover { color: var(--hi); }
.foot-mark {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ter);
}

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

@media (max-width: 960px) {
  .nav-links { display: none; }
  .featrow, .featrow.flip { grid-template-columns: 1fr; gap: 34px; }
  .featrow.flip .copy { order: -1; }
  section { padding: 78px 0; }
  .shot-tall video { max-height: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bgfx .blob { animation: none; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .tok { opacity: 1; transform: none; filter: none; }
  .tilt { transform: none !important; }
}
