/* Red Brick Studio. Tokens are documented in BRAND.md. */

:root {
  color-scheme: dark;
  --charcoal: #0b0b0d;
  --charcoal-2: #111114;
  --surface: #151518;
  --surface-2: #1c1c20;
  --line: rgba(246, 245, 242, 0.08);
  --linen: #f6f5f2;
  --linen-2: rgba(246, 245, 242, 0.64);
  --slate: #6b6b73;
  --red: #ff4b3a;
  --red-light: #ff6b52;
  --red-deep: #e2382a;
  --red-grad: linear-gradient(160deg, var(--red-light), var(--red-deep));
  --red-glow: rgba(255, 75, 58, 0.45);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Satoshi', 'Manrope', system-ui, sans-serif;
  --radius-xl: 30px;
  --radius-l: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--linen);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

::selection { background: var(--red); color: #fff; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.035em; }

.eyebrow { margin: 0 0 18px; font-size: 12px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; color: var(--red); }

.sub { margin: 22px auto 0; max-width: 32em; font-size: clamp(17px, 2vw, 21px); font-weight: 400; line-height: 1.5; color: var(--linen-2); }

.muted { color: var(--slate); font-size: 15px; }

.red { color: var(--red); }

/* Buttons */

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  box-shadow: 0 10px 30px -10px var(--red-glow);
  transition: transform 0.45s var(--spring), box-shadow 0.3s ease, background-color 0.2s ease;
}

.pill:hover { background: var(--red-light); transform: scale(1.04); box-shadow: 0 14px 40px -10px var(--red-glow); }

.pill:active { transform: scale(0.96); }

.pill-small { min-height: 30px; padding: 0 14px; font-size: 13px; box-shadow: none; }

.link { color: var(--linen); font-weight: 500; font-size: 16px; opacity: 0.8; transition: opacity 0.2s ease; }

.link:hover { opacity: 1; }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 38px; }

/* Nav */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgba(11, 11, 13, 0.62);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; gap: 24px; max-width: 1120px; height: 54px; margin: 0 auto; padding: 0 22px; }

.brand { display: flex; align-items: center; gap: 10px; }

.wordmark-inline { font-size: 12px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; white-space: nowrap; }

.wordmark-inline b { font-weight: 300; color: var(--linen-2); }

.nav-links { display: flex; gap: 28px; margin-left: auto; }

.nav-links a { font-size: 13px; color: var(--linen-2); transition: color 0.2s ease; }

.nav-links a:hover { color: var(--linen); }

/* Reveal on scroll */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(10px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
}

.js .reveal.in { opacity: 1; transform: none; filter: none; }

.js [data-split] .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  filter: blur(12px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--i) * 80ms + 900ms);
}

.js [data-split].in .w { opacity: 1; transform: none; filter: none; }

.js .contact [data-split] .w { transition-delay: calc(var(--i) * 80ms); }

/* Hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 22px 96px;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}

.embers { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }

.hero-glow {
  position: absolute;
  top: 18%;
  left: 50%;
  z-index: -2;
  width: min(900px, 120vw);
  aspect-ratio: 1;
  transform: translate(-50%, -30%);
  background: radial-gradient(circle, rgba(255, 75, 58, 0.22), rgba(255, 75, 58, 0.05) 40%, transparent 65%);
  animation: breathe 7s ease-in-out infinite;
}

@keyframes breathe {
  50% { opacity: 0.6; transform: translate(-50%, -30%) scale(0.92); }
}

.mark3d { perspective: 900px; margin-bottom: 34px; animation: float 6s ease-in-out 2s infinite; }

.mark3d-glyph {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  width: clamp(120px, 15vw, 168px);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.7s var(--ease);
}

.b {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  border-radius: 14% / 22%;
  background: var(--red-grad);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -4px 8px rgba(120, 10, 0, 0.35),
    0 0 40px rgba(255, 75, 58, 0.35);
  transform: translateZ(calc(var(--i) * -6px));
  animation: brickIn 1s var(--spring) both;
  animation-delay: calc(200ms + var(--i) * 110ms);
}

.b-top { clip-path: polygon(0 32%, 100% 0, 100% 100%, 0 100%); border-radius: 10% / 20%; }

@keyframes brickIn {
  from { opacity: 0; transform: translateY(-160%) translateZ(120px) rotateX(40deg); }
  to { opacity: 1; transform: translateZ(calc(var(--i) * -6px)); }
}

@keyframes float {
  50% { transform: translateY(-10px); }
}

.wordmark { display: grid; gap: 10px; justify-items: center; margin-bottom: 46px; }

.wm-1 { padding-left: 0.42em; font-size: clamp(22px, 3.2vw, 34px); font-weight: 500; letter-spacing: 0.42em; text-transform: uppercase; }

.wm-2 { padding-left: 0.62em; font-size: clamp(13px, 1.6vw, 17px); font-weight: 300; letter-spacing: 0.62em; text-transform: uppercase; color: var(--linen-2); }

.headline { font-size: clamp(44px, 7.6vw, 92px); line-height: 1.02; max-width: 11em; }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--red), transparent);
  transform-origin: top;
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* Story: archive photographs behind a pinned phone */

.story { position: relative; height: 420vh; background: var(--charcoal); }

/* The reel stays on screen behind the pin: one photograph per step, sepia and grain like a
   newsreel, under a charcoal veil that keeps the copy legible. It zooms with the scroll only. */
.reel { position: sticky; top: 0; height: 100svh; margin-bottom: -100svh; overflow: hidden; background: #0d0b08; }

.reel-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(calc(1.04 + var(--s, 0) * 0.1)); transition: opacity 1.2s ease; }

.reel-shot.is-active { opacity: 1; }

.reel::before { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(120, 92, 52, 0.3); mix-blend-mode: color; }

.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
    linear-gradient(90deg, rgba(11, 11, 13, 0.94) 0%, rgba(11, 11, 13, 0.82) 45%, rgba(11, 11, 13, 0.55) 100%),
    linear-gradient(180deg, var(--charcoal) 0%, transparent 18%, transparent 82%, var(--charcoal) 100%);
}

.story-pin {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 74px 22px 24px;
}

.story-title { font-size: clamp(44px, 6vw, 76px); line-height: 1; }

.story-lead { margin: 12px 0 0; font-size: clamp(20px, 2.2vw, 26px); color: var(--linen-2); letter-spacing: -0.02em; }

.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 18px; }

.step { position: relative; display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; opacity: 0.4; transition: opacity 0.6s var(--ease); }

.step-n { grid-row: span 2; padding-top: 4px; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--slate); transition: color 0.6s var(--ease); }

.step.is-active { opacity: 1; }

.step.is-active .step-n { color: var(--red); }

.step h3 { font-size: 22px; line-height: 1.25; }

.step-btn { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer; }

.step:not(.is-active):hover { opacity: 0.75; }

.step-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }

/* only the active step shows its text, so four steps fit a laptop screen */
.step p { margin: 6px 0 0; max-width: 30em; color: var(--linen-2); font-size: 16px; }

.js .step p { max-height: 0; margin: 0; overflow: hidden; opacity: 0; transition: max-height 0.6s var(--ease), margin 0.6s var(--ease), opacity 0.6s var(--ease); }

.js .step.is-active p { max-height: 9em; margin-top: 6px; opacity: 1; }

.story .cta { justify-content: flex-start; }

.phone-stage { display: flex; align-items: center; justify-content: center; gap: 22px; perspective: 1400px; }

.phone {
  --p: 0;
  position: relative;
  width: min(300px, 70vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 54px;
  padding: 11px;
  background: linear-gradient(145deg, #3a3a3e, #121214 40%, #2a2a2e);
  box-shadow: 0 0 0 1.5px #3a3a3e, 0 60px 120px -40px rgba(255, 75, 58, 0.35), 0 40px 80px -30px #000;
  transform: rotateY(calc((1 - var(--p)) * -24deg)) rotateX(calc((1 - var(--p)) * 10deg)) scale(calc(0.88 + var(--p) * 0.12));
  will-change: transform;
}

.phone-screen { position: relative; height: 100%; overflow: hidden; border-radius: 44px; background: radial-gradient(120% 70% at 50% 0%, #1d1d22, var(--charcoal) 70%); }

.status { position: absolute; inset: 18px 26px auto; z-index: 2; display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }

.status-icons { display: flex; gap: 4px; align-items: center; }

.status-icons i { width: 14px; height: 9px; border-radius: 2px; background: var(--linen); }

.status-icons i:first-child { width: 10px; }

.island { position: absolute; top: 22px; left: 50%; width: 30%; height: 26px; transform: translateX(-50%); border-radius: 20px; background: #000; }

.screen { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(0.94); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }

.screen.is-active { opacity: 1; transform: none; }

/* Phone screens: real captures of the app, under the status bar (they are shot without the safe area) */

img.screen { top: 5.6%; width: 100%; height: 94.4%; object-fit: cover; object-position: top; }

.progress { display: grid; gap: 10px; }

.progress span { cursor: pointer; width: 6px; height: 6px; border-radius: 3px; background: rgba(246, 245, 242, 0.18); transition: height 0.5s var(--spring), background-color 0.3s ease; }

.progress span.is-active { height: 26px; background: var(--red); }

/* Studio: copy over a generated cinematic plate */

.studio { position: relative; display: grid; justify-items: center; align-content: start; min-height: 110svh; padding: 18vh 22px 22vh; text-align: center; overflow: hidden; isolation: isolate; }

/* Generated cinematic plates: they sit behind the copy and melt into the charcoal at the edges. */
.backdrop { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.studio .backdrop { object-position: 60% 60%; -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); opacity: 0.9; }

.studio::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 11, 13, 0.8), rgba(11, 11, 13, 0) 50%); }

.studio-title { max-width: 14em; font-size: clamp(36px, 5.4vw, 64px); line-height: 1.06; }

.studio .sub { max-width: 30em; }

.section-title { font-size: clamp(40px, 6vw, 72px); line-height: 1.04; }

/* Contact */

.contact { position: relative; padding: 140px 22px 170px; text-align: center; overflow: hidden; isolation: isolate; }

.contact .backdrop { object-position: 70% 70%; opacity: 0.55; -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%); mask-image: linear-gradient(180deg, transparent, #000 35%); }

.contact::before { content: ''; position: absolute; left: 50%; bottom: -40%; z-index: -1; width: 900px; height: 600px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255, 75, 58, 0.18), transparent); }

.mail { display: inline-block; margin-top: 40px; font-size: clamp(24px, 4.4vw, 54px); font-weight: 500; letter-spacing: -0.03em; color: var(--linen); border-bottom: 2px solid var(--red); overflow-wrap: anywhere; transition: color 0.3s ease; }

.mail:hover { color: var(--red); }

/* Footer */

.footer { border-top: 1px solid var(--line); color: var(--slate); font-size: 12px; }

.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; max-width: 1120px; margin: 0 auto; padding: 22px; }

.footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.footer a:hover { color: var(--linen); }

/* Inner pages (legal, 404) */

.page { max-width: 1120px; margin: 0 auto; padding: 140px 22px 100px; }

.page-narrow { max-width: 720px; }

.page h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; }

.page h2 { margin-top: 44px; font-size: 24px; }

.page p { color: var(--linen-2); }

.page a { color: var(--red); }

.todo { padding: 0 5px; border-radius: 5px; background: rgba(255, 75, 58, 0.14); color: var(--red-light); }

/* Tablet and phone */

@media (max-width: 900px) {
  .story-pin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 12px; padding-top: 66px; text-align: center; }
  .story-copy { order: 2; }
  .story-title, .story .eyebrow, .story-lead { display: none; }
  .reel::after { background-size: 160px 160px, auto, auto; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"), linear-gradient(180deg, rgba(11, 11, 13, 0.7), rgba(11, 11, 13, 0.88) 55%), linear-gradient(180deg, var(--charcoal) 0%, transparent 14%, transparent 86%, var(--charcoal) 100%); }
  .steps { margin: 0; display: block; min-height: 204px; position: relative; }
  .step { position: absolute; inset: 0; display: block; padding: 0; transform: translateY(10px); opacity: 0; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
  .step-n { display: block; padding: 0 0 4px; }
  .step.is-active { transform: none; opacity: 1; }
  .step h3 { font-size: 19px; }
  .js .step p, .js .step.is-active p { max-height: none; margin: 6px auto 0; font-size: 14.5px; line-height: 1.5; opacity: 1; }
  .story .cta { justify-content: center; margin-top: 12px; }
  .story .cta .muted { display: none; }
  .phone { width: auto; height: min(52svh, 480px); border-radius: 44px; padding: 9px; }
  .phone-screen { border-radius: 36px; }
  .island { top: 17px; height: 20px; }
  .status { top: 14px; font-size: 11px; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .pill-small { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal, .js [data-split] .w { opacity: 1; transform: none; filter: none; }
  .phone { transform: none; }
  .embers { display: none; }
}
