/* ============================================================
   EZByte — Idea to MVP. Weeks, not quarters.
   Scroll-driven portfolio & capability site.
   Design tokens and structure per the v3 handoff.
   ============================================================ */

:root {
  --ground: #0c0c0c;
  --accent: #ccff00;
  --text: #f2f2f0;
  --body: #b9b9b3;
  --muted: #8b8b86;
  --rule: #2a2a2a;
  --rule-strong: #3a3a3a;
  --dim-word: #39392f;
  --poster-rule: rgba(12, 12, 12, 0.35);

  /* Single source of truth for the fixed-header height. Every pinned
     frame offsets its content by this so its top line clears the header. */
  --header-h: 68px;

  --mono: "Martian Mono", ui-monospace, monospace;
  --display: "Big Shoulders Display", "Big Shoulders", sans-serif;
  --sans: "Familjen Grotesk", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--ground); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: var(--header-h);
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-header .wordmark { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 26px; }
.site-header .cta { background: var(--accent); color: var(--ground); padding: 9px 16px; }
.site-header .cta:hover { color: var(--ground); filter: brightness(1.05); }
.progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
}

/* ---------- Shared type helpers ---------- */
.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kicker--accent { color: var(--accent); }
.kicker--muted { color: var(--muted); }

.frame-pad { padding: 0 32px; width: 100%; }

/* Pinned frames clear the fixed header. Hero is excluded — it offsets on
   its content row instead so the inset:0 canvas stays full-bleed. */
.scene--statement > .sticky > .frame-pad,
.scene--process > .sticky > .frame-pad,
.scene--poster > .sticky > .frame-pad { padding-top: var(--header-h); }

.sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ---------- Hero ---------- */
.scene--hero { position: relative; height: 250vh; }
.scene--hero .sticky {
  flex-direction: column;
  border-bottom: 1px solid var(--rule);
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero-row {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  pointer-events: none;
}
.hero-eyebrow { color: var(--muted); margin-bottom: 30px; }
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(72px, 10.5vw, 150px);
  line-height: 0.88;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}
.hero h1 span { display: block; }
.hero .dot { color: var(--accent); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  margin-top: 44px;
  align-items: end;
}
.hero-lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--body);
  max-width: 48ch;
}
.hero-buttons { display: flex; gap: 10px; pointer-events: auto; }

.btn {
  font-family: var(--mono);
  text-transform: uppercase;
  display: inline-block;
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--ground); }
.btn--primary:hover { color: var(--ground); filter: brightness(1.05); }
.btn--ghost { border: 1px solid var(--rule-strong); }

.hero-buttons .btn { font-size: 11px; padding: 15px 24px; }

.stat-row {
  position: relative;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--ground);
}
.stat {
  padding: 20px 26px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat .num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 0.9;
}
.stat .num--accent { color: var(--accent); }
.stat .label {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Statement ---------- */
.scene--statement { position: relative; height: 220vh; border-bottom: 1px solid var(--rule); }
.scene--statement .sticky { align-items: center; }
.statement-kicker { color: var(--accent); margin-bottom: 34px; }
.statement {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6.2vw, 96px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  max-width: 24ch;
}
.statement [data-word] { transition: color 0.28s linear; }

/* ---------- Reel ---------- */
.scene--reel { position: relative; height: 640vh; }
.scene--reel .sticky { flex-direction: column; }
.reel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 82px 32px 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.reel-head .left { color: var(--accent); }
.reel-head .count { color: var(--muted); }
.reel-window { flex: 1; overflow: hidden; }
.reel-track {
  display: flex;
  height: 100%;
  width: max-content;
  will-change: transform;
}
.card {
  width: min(88vw, 1220px);
  height: 100%;
  display: grid;
  grid-template-columns: 74px 1fr 1.05fr;
  overflow: hidden;
  border-right: 1px solid var(--rule);
}
.card:last-child { border-right: 0; }
.card .numeral {
  padding: 22px 0 0 22px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 0.85;
  color: var(--rule);
}
.card .text {
  padding: 22px 26px 22px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
  min-width: 0;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
}
.tag { padding: 5px 9px; }
.tag--product { background: var(--accent); color: var(--ground); }
.tag--outline { border: 1px solid var(--rule-strong); color: var(--muted); }
.card h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.1vw, 46px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.card .body {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--body);
  max-width: 40ch;
}
.tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.tech-row span { border: 1px solid var(--rule); padding: 5px 9px; }
.card .outbound {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
}
.card .shot {
  position: relative;
  border-left: 1px solid var(--rule);
  overflow: hidden;
  background: #141414;
}
/* Fill the column absolutely — never let the image size the card. */
.card .shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* show each site's hero/logo, not a mid crop */
}
.reel-rule { height: 2px; background: var(--rule); position: relative; }
.reel-rule .fill { position: absolute; inset: 0; width: 0; background: var(--accent); }

/* ---------- Capabilities ---------- */
.scene--caps { position: relative; border-bottom: 1px solid var(--rule); }
.caps-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
  padding: 0 32px;
}
.caps-left {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.caps-left h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  max-width: 14ch;
}
.caps-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(120px, 18vw, 260px);
  line-height: 0.78;
  color: var(--accent);
}
.caps-right { padding: 26vh 0; }
.cap {
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
.cap:last-child { border-bottom: 1px solid var(--rule); }
.cap h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.cap p {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--body);
  max-width: 44ch;
}

/* ---------- Process ---------- */
.scene--process { position: relative; height: 380vh; }
.scene--process .sticky { flex-direction: column; justify-content: center; }
.process-kicker { color: var(--accent); margin-bottom: 28px; }
.process h2 {
  margin: 0 0 48px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(44px, 6vw, 92px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  max-width: 20ch;
}
.process-rule {
  height: 2px;
  background: var(--rule);
  position: relative;
  margin-bottom: 34px;
}
.process-rule .fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.step {
  padding: 0 26px;
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step:first-child { padding-left: 0; border-left: 0; }
.step:last-child { padding-right: 0; }
.step .n { font-family: var(--mono); font-size: 10.5px; color: var(--accent); }
.step h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.step p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--body); }

/* ---------- Poster ---------- */
.scene--poster { position: relative; height: 190vh; background: var(--accent); color: var(--ground); }
.scene--poster .sticky { align-items: center; }
.poster-inner { padding: 0 32px; width: 100%; }
.poster-kicker { margin-bottom: 30px; }
.poster p.headline {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(52px, 8.4vw, 132px);
  line-height: 0.86;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  max-width: 20ch;
}
.poster-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  margin-top: 52px;
  border-top: 2px solid var(--poster-rule);
  padding-top: 26px;
}
.poster-three h4 { margin: 0; font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.poster-three p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; }

/* ---------- Contact ---------- */
.scene--contact { border-bottom: 1px solid var(--rule); }
.contact-inner { padding: 120px 32px; }
.contact-kicker { color: var(--accent); margin-bottom: 26px; }
.contact h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 10vw, 168px);
  line-height: 0.86;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  max-width: 16ch;
}
.contact h2 .dot { color: var(--accent); }
.contact p {
  margin: 32px 0 0;
  max-width: 50ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--body);
}
.contact-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.contact-buttons .btn { font-size: 11.5px; padding: 17px 28px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer .links { display: flex; gap: 22px; }

/* ============================================================
   MOBILE / TABLET — below 900px the pinned scroll-jacking,
   the 7-card horizontal reel and the huge display sizes do not
   work. Drop the pinning, let acts stack, turn the reel into a
   normal vertical list. The rAF engine is disabled below 900px.
   ============================================================ */
@media (max-width: 900px) {
  :root { --header-h: 58px; }

  .site-header { padding: 14px 20px; }
  .site-header nav { gap: 16px; }
  /* Keep the primary CTA; hide secondary nav labels on the narrowest bar. */
  .frame-pad, .caps-grid, .poster-inner { padding-left: 20px; padding-right: 20px; }

  /* Un-pin every act: natural height, static flow, no clipping. */
  .scene--hero,
  .scene--statement,
  .scene--reel,
  .scene--process,
  .scene--poster { height: auto; }

  .sticky,
  .caps-left {
    position: static;
    height: auto;
    overflow: visible;
    display: block;
  }

  /* Hero */
  .scene--hero .sticky { min-height: 100svh; display: flex; }
  .hero-canvas { display: none; }
  .hero-row { padding-top: calc(var(--header-h) + 40px); padding-bottom: 40px; }
  .hero h1 { font-size: clamp(48px, 15vw, 96px); }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .hero-buttons { flex-wrap: wrap; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--rule); }

  /* Statement */
  .scene--statement .sticky { padding: 80px 0; }
  .statement { font-size: clamp(32px, 8vw, 56px); }
  /* On mobile the word-lighting engine is off, so show the statement lit. */
  .statement [data-word] { color: var(--text) !important; }

  /* Reel → vertical list */
  .scene--reel .sticky { padding-bottom: 40px; }
  .reel-head { padding: 96px 20px 18px; }
  .reel-head .count { display: none; }
  .reel-window { overflow: visible; }
  .reel-track {
    flex-direction: column;
    width: 100%;
    transform: none !important;
    will-change: auto;
  }
  .card {
    width: 100%;
    height: auto;
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .card .numeral { padding: 24px 20px 0; }
  .card .text { padding: 16px 20px 28px; }
  .card .shot {
    position: relative;
    border-left: 0;
    border-top: 1px solid var(--rule);
    aspect-ratio: 16 / 10;
    order: 3;
  }
  .card .shot img { position: absolute; }
  .reel-rule { display: none; }

  /* Capabilities */
  .caps-grid { grid-template-columns: 1fr; gap: 0; }
  .caps-left { padding: 96px 0 8px; gap: 18px; }
  .caps-left h2 { font-size: clamp(40px, 11vw, 64px); }
  .caps-num { display: none; }
  .caps-right { padding: 8px 0 40px; }

  /* Process */
  .scene--process .sticky { padding: 80px 0; }
  .process h2 { font-size: clamp(36px, 9vw, 64px); }
  .process-grid { grid-template-columns: 1fr; gap: 28px; }
  .step { padding: 0; border-left: 0; }
  .step + .step { border-top: 1px solid var(--rule); padding-top: 28px; }
  /* Engine off on mobile — show every step fully lit. */
  .step { opacity: 1 !important; }
  .process-rule .fill { transform: scaleX(1) !important; }

  /* Poster */
  .scene--poster .sticky { padding: 80px 0; }
  .poster p.headline { font-size: clamp(40px, 11vw, 72px); }
  .poster-inner { transform: none !important; }

  /* Contact */
  .contact-inner { padding: 80px 20px; }
  .contact h2 { font-size: clamp(44px, 13vw, 96px); }

  .site-footer { padding: 24px 20px; }
}

@media (max-width: 560px) {
  .site-header nav a:not(.cta) { display: none; }
  .stat-row { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--rule); }
  .stat:last-child { border-bottom: 0; }
}

/* Reduced motion: the engine already no-ops, ensure everything is legible. */
@media (prefers-reduced-motion: reduce) {
  .statement [data-word] { color: var(--text) !important; }
  .step { opacity: 1 !important; }
  .process-rule .fill { transform: scaleX(1) !important; }
}
