:root {
  --night: #0d0d0d;
  --paper: #F2F1EC;
  --ink: #141414;
  --muted: #b9b8b2;
  --soft: #c9c8c2;
  --line: #2c2c2c;
  --beacon: #E0362C;
  --link-hover: #ffb4ad;
  --max: 1200px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--paper); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; border-radius: 4px; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 6px;
}
.skip-link:focus { top: 16px; }

.mono { font-family: var(--mono); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Header */
.site-header { position: absolute; inset: 0 0 auto; z-index: 3; }
.site-header .wrap {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding-block: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand span { font-weight: 600; font-size: 17px; letter-spacing: .04em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 15px; }
.nav a { text-decoration: none; padding: 10px 0; }
.nav .pill { padding: 10px 18px; border: 1px solid var(--paper); border-radius: 999px; }

/* Hero */
.hero {
  --px: 0; --py: 0; --sy: 0;
  position: relative; overflow: hidden;
  padding: 132px 24px 120px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  text-align: center;
}
.hero > * { position: relative; }
.hero .parallax { position: absolute; transition: transform .4s ease-out; }
.stars {
  inset: -40px;
  transform: translate3d(calc(var(--px) * -8px), calc(var(--py) * -5px + var(--sy) * .08px), 0);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 62%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 47% 12%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 38%, #fff5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 22%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 58%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 44%, #fff5 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 36% 30%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 70%, #fff4 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 94% 8%, #fff8 50%, transparent 51%);
  background-size: 420px 420px;
}
.glow {
  left: 50%; bottom: -120px; width: 1400px; height: 420px; margin-left: -700px;
  background: radial-gradient(ellipse 50% 70% at 50% 100%, #E0362C33, transparent);
  transform: translate3d(calc(var(--px) * -18px), calc(var(--py) * -11px + var(--sy) * .18px), 0);
}
.floor {
  left: 50%; bottom: 0; width: 2400px; height: 340px; margin-left: -1200px;
  perspective: 500px;
  transform: translate3d(calc(var(--px) * -36px), calc(var(--py) * -22px + var(--sy) * .36px), 0);
}
.floor::before {
  content: ""; position: absolute; inset: 0;
  transform: rotateX(62deg); transform-origin: 50% 100%;
  background-image: linear-gradient(#ffffff14 1px, transparent 1px), linear-gradient(90deg, #ffffff14 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 85%);
  mask-image: linear-gradient(to top, #000, transparent 85%);
}

.logo-stage { perspective: 1100px; transform: translateY(calc(var(--sy) * .25px)); }
.float { animation: float 9s ease-in-out infinite; }
.logo3d {
  position: relative;
  width: min(340px, 72vw); aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--py) * -14deg)) rotateY(calc(var(--px) * 22deg));
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.logo3d > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo3d .slice { transform: translateZ(calc(var(--i) * -2px)); }
.logo3d .t3 { transform: translateZ(16px); filter: drop-shadow(0 6px 8px rgba(0,0,0,.55)); }
.logo3d .t2 { transform: translateZ(28px); filter: drop-shadow(0 6px 8px rgba(0,0,0,.55)); }
.logo3d .t1 { transform: translateZ(42px); filter: drop-shadow(0 8px 10px rgba(0,0,0,.55)); }
.logo3d .t0 { transform: translateZ(60px); }
.logo3d .t0 img { width: 100%; height: 100%; filter: drop-shadow(0 10px 12px rgba(0,0,0,.6)); }
.beacon-glow {
  position: absolute; left: 32.5%; top: 8.33%; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle, var(--beacon) 0%, transparent 70%);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse {
  0%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(.8); }
  50% { opacity: .9; transform: translate(-50%, -50%) scale(1.15); }
}

.wordmark { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; }
.wordmark .name { font-weight: 600; font-size: 20px; letter-spacing: .24em; }
.wordmark .sub { font-family: var(--mono); font-size: 12px; letter-spacing: .5em; color: var(--muted); }
.hero h1 {
  margin-top: 20px; max-width: 900px;
  font-size: clamp(36px, 5.6vw, 70px); line-height: 1.04; font-weight: 700; letter-spacing: -.025em;
}
.hero .lede { font-size: 20px; color: var(--soft); max-width: 600px; }
.button {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 28px; margin-top: 8px;
  background: var(--beacon); color: #fff; text-decoration: none; border-radius: 999px; font-weight: 600;
}
.button:hover { color: #fff; background: #c42b22; }

/* Apps: the skyline */
.apps .wrap { padding-block: 120px 112px; display: flex; flex-direction: column; gap: 64px; }
.section-head { display: flex; flex-wrap: wrap; gap: 12px 48px; align-items: flex-end; justify-content: space-between; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
.section-head p { font-family: var(--mono); font-size: 14px; color: var(--muted); }

.apps .section-head { justify-content: center; text-align: center; }
.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 64px 40px;
}
.app {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; text-decoration: none; color: var(--paper);
}
.app:hover { color: var(--paper); }
.app img {
  width: 132px; height: 132px; border-radius: 30px; margin-bottom: 18px;
  box-shadow: 0 0 0 1px #ffffff14, 0 24px 48px -12px var(--glow);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.app:hover img, .app:focus-visible img { transform: translateY(-6px); }
.app h3 { font-size: 24px; line-height: 1.2; font-weight: 600; }
.app .desc { font-size: 16px; color: var(--soft); max-width: 280px; }
.app .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.app .cta { margin-top: 6px; font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }

/* Studio */
.studio .wrap { padding-block: 104px; }
.studio .copy { max-width: 620px; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; color: var(--muted); }
.studio h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
.studio p:not(.eyebrow) { font-size: 19px; color: var(--soft); }

/* Support */
.support { border-top: 1px solid var(--line); }
.support .wrap {
  padding-block: 96px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
}
.support h2 { font-size: clamp(30px, 4vw, 52px); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; }
.support p { color: var(--soft); max-width: 520px; }
.email { font-family: var(--mono); font-size: clamp(18px, 2.4vw, 26px); text-underline-offset: 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .wrap {
  padding-block: 20px; display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.site-footer a { color: var(--muted); padding: 10px 0; display: inline-block; }
.site-footer a:hover { color: var(--paper); }

/* Simple pages (privacy, 404) */
.page { padding: 140px 24px 96px; }
.page .wrap { max-width: 760px; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.page h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; }
.page h2 { font-size: 24px; margin-top: 20px; }
.page p, .page li { color: var(--soft); }
.page ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

.not-found { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 120px 24px; text-align: center; }
.not-found img { width: 200px; height: 200px; }
.not-found h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; font-weight: 700; }
.not-found p { color: var(--soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float, .beacon-glow { animation: none; }
  .hero .parallax, .logo3d, .app img { transition: none; }
}
