/* ==========================================================================
   BRAHMA — iteration 1 · "Monolith"
   A cinematic scroll: the product in the dark, then the story in chapters.
   Same ground as cojocaru.dev: #0F0F0F, hairlines, Saira for display, Inter for text.
   ========================================================================== */

:root {
  --bg: #0f0f0f;
  --ink: #e2e2e2;
  --ink-soft: #b9b9b6;
  --muted: #929290;
  --dim: #6c6b66;
  --line: rgba(226, 226, 226, .10);
  --line-strong: rgba(226, 226, 226, .24);
  --glow: #dfe6ff;                 /* the white of the backlit letters */

  --display: "Saira", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1280px;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --chapter: clamp(96px, 16vh, 200px);
}
@media (min-width: 1024px) {
  :root { --gutter: clamp(64px, 7vw, 120px); }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 1rem/1.7 var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font: 500 .75rem/1 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.skip:focus { top: 16px; }

/* Small tracked capitals: every label on the page */
.eyebrow,
.nav a,
.by,
.figures dt,
.io__title,
.stats__q,
.stats__k,
.forms__state,
.site-footer__row {
  font-family: var(--display);
  font-weight: 400;
  font-size: .6875rem;
  line-height: 1.4;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.eyebrow { color: var(--muted); }
.sep { color: var(--dim); margin-inline: .5em; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color .5s var(--ease), border-color .5s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(15, 15, 15, .82);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.brand img { width: 112px; height: auto; transition: opacity .4s var(--ease); }
.brand:hover img { opacity: .7; }

.nav { display: flex; gap: clamp(20px, 3.4vw, 48px); }
.nav a,
.by {
  position: relative;
  padding-block: 6px;
  color: var(--ink-soft);
  transition: color .4s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: .24em;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav a:hover,
.nav a.is-current,
.by:hover { color: var(--ink); }
.nav a:hover::after,
.nav a.is-current::after { transform: scaleX(1); transform-origin: left; }
.by { color: var(--muted); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-top: calc(var(--header-h) + clamp(48px, 10vh, 120px));
  text-align: center;
}
.hero__head { position: relative; z-index: 1; }
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 10px rgba(223, 230, 255, .7);
}

.hero__title {
  margin-top: clamp(22px, 3.6vh, 36px);
  margin-right: -.3em;   /* the tracking after the last letter */
  font: 200 clamp(1.9rem, 5vw, 4.6rem)/1.12 var(--display);
  letter-spacing: .3em;
  text-transform: uppercase;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: inline-block; }
.hero__title .line:nth-child(3) > span { color: var(--muted); }
.hero__title .line:nth-child(4) > span { color: var(--dim); }

/* the render's own ground is #0F0F0F, so it melts into the page */
.hero__shot {
  width: min(100%, 1680px);
  margin: clamp(-120px, -7vw, -24px) auto 0;
}
.hero__shot img { width: 100%; }

.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(-80px, -4vw, -8px);
  border-top: 1px solid var(--line);
  text-align: left;
}
.figures > div { padding: 24px clamp(16px, 2vw, 32px) 0; }
.figures > div + div { border-left: 1px solid var(--line); }
.figures > div:first-child { padding-left: 0; }
.figures dt { color: var(--dim); margin-bottom: 10px; }
.figures dd { font: 200 clamp(1.6rem, 3.4vw, 2.8rem)/1.1 var(--display); letter-spacing: .04em; }
.figures dd b { font-weight: 300; }
.figures .figures__note {
  margin-top: 10px;
  font: 300 .875rem/1.5 var(--text);
  letter-spacing: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__head .eyebrow { animation: fade 1.4s var(--ease) .2s both; }
  .hero__title .line > span { animation: rise 1.3s var(--ease) both; }
  .hero__title .line:nth-child(2) > span { animation-delay: .3s; }
  .hero__title .line:nth-child(3) > span { animation-delay: .42s; }
  .hero__title .line:nth-child(4) > span { animation-delay: .54s; }
  .hero__shot img { animation: power-on 2.6s var(--ease) .5s both; }
  .site-header { animation: fade 1.4s var(--ease) .8s both; }
}
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
/* like the panel coming on: out of the dark, the letters brightening */
@keyframes power-on {
  0%   { opacity: 0; filter: brightness(.3); transform: scale(1.03); }
  60%  { opacity: 1; }
  100% { opacity: 1; filter: none; transform: none; }
}

/* --------------------------------------------------------------------------
   Statement
   -------------------------------------------------------------------------- */
.statement { padding-block: var(--chapter); text-align: center; }
.quote {
  max-width: 24ch;
  margin-inline: auto;
  font: 200 clamp(1.7rem, 3.8vw, 3.3rem)/1.25 var(--display);
  letter-spacing: .01em;
}
.quote em { font-style: normal; color: var(--muted); }
.quote--left { margin: 22px 0 0; text-align: left; max-width: 18ch; }

/* --------------------------------------------------------------------------
   Chapters
   -------------------------------------------------------------------------- */
.chapter { padding-bottom: var(--chapter); }

.split {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 28px clamp(32px, 6vw, 96px);
  align-items: end;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.frame + .split { margin-top: clamp(32px, 5vh, 56px); }
.h2 {
  margin-top: 18px;
  font: 300 clamp(1.6rem, 3vw, 2.6rem)/1.15 var(--display);
  letter-spacing: .01em;
}
.h3 {
  margin-top: 36px;
  margin-bottom: 10px;
  font: 400 .8125rem/1.4 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
}
.split__body p,
.duo__text p,
.essay p,
.forms p { color: var(--ink-soft); max-width: 60ch; }

/* full-bleed renders, centred, wider than the text column */
.shot {
  width: min(100%, 1500px);
  margin: clamp(8px, 2vh, 24px) auto 0;
}
.shot--wide { width: min(100%, 1680px); }
.shot img { width: 100%; }

/* render sequences (js): the frames on a canvas over the still */
.turn, .scrub { position: relative; }
.seq__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.is-live > .seq__canvas { opacity: 1; }
.turn.is-live {
  cursor: grab;
  touch-action: pan-y;               /* vertical swipes still scroll the page */
  -webkit-user-select: none;
  user-select: none;
}
.turn.is-dragging { cursor: grabbing; }
.turn:focus-visible { outline: 1px solid var(--line-strong); outline-offset: 8px; }
/* the rotate cue (as cojocaru.dev's scroll cue): a hairline curve under the unit with a light
   running along it, left to right and back; there once the frames can turn, gone after the first drag */
.turn__cue {
  position: absolute;
  left: 50%;
  bottom: 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity .8s var(--ease);
  pointer-events: none;
}
.turn__cue .eyebrow { color: inherit; letter-spacing: .3em; padding-left: .3em; }
.turn__cue svg { display: block; width: clamp(120px, 11vw, 170px); height: auto; overflow: visible; }
.turn__cue path { fill: none; stroke-width: 1; }
.turn__cue .track { stroke: var(--line-strong); }
/* runs whatever the motion setting, like the scroll cue on cojocaru.dev: a small light, not motion of the page */
.turn__cue .run {
  stroke: var(--ink);
  stroke-dasharray: 22 100;
  stroke-dashoffset: 22;
  animation: sweep 3.6s linear infinite alternate;   /* even pace, the same left to right as right to left */
}
@keyframes sweep {
  from { stroke-dashoffset: 22; }
  to   { stroke-dashoffset: -100; }
}
.turn.is-live .turn__cue { opacity: 1; }
.turn.is-touched .turn__cue { opacity: 0; }

/* close-ups that fill their frame: a hairline holds them */
.frame { border: 1px solid var(--line); background: #000; overflow: hidden; }
.frame img { width: 100%; }

/* inputs and outputs */
.io {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0 clamp(32px, 5vw, 80px);
  margin-top: clamp(24px, 4vh, 48px);
}
.io__title { padding-bottom: 14px; color: var(--dim); }
.rows { border-top: 1px solid var(--line); }
.rows > div {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) 3fr;
  gap: 6px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.rows dt { font: 400 .875rem/1.5 var(--display); letter-spacing: .04em; }
.rows dd { font-size: .875rem; line-height: 1.6; color: var(--muted); }

/* controls: image + text */
.duo {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 40px clamp(40px, 7vw, 120px);
  align-items: center;
}
.duo__text .h2 { margin-bottom: 22px; }
.duo__text p + p { margin-top: 1em; }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(16px, 3vw, 40px);
  margin-top: clamp(64px, 10vh, 120px);
}

/* big numbers */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(16px, 3vh, 32px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats figure {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 28px clamp(16px, 2vw, 28px) 30px;
}
.stats figure + figure { border-left: 1px solid var(--line); }
.stats figure:first-child { padding-left: 0; }
.stats__q { color: var(--dim); }
.stats b {
  font: 200 clamp(2.2rem, 4.4vw, 3.8rem)/1 var(--display);
  letter-spacing: .01em;
  white-space: nowrap;
}
.stats b small { margin-left: .2em; font-size: .36em; letter-spacing: .1em; color: var(--muted); }
.stats b sub { font-size: .7em; vertical-align: baseline; }
.stats__k { margin-top: 6px; color: var(--ink-soft); }
.stats__n { font-size: .875rem; color: var(--muted); }
.stats + .io { margin-top: clamp(56px, 8vh, 96px); }

/* the idea */
.idea { padding-top: calc(var(--chapter) * .4); }
.idea .quote {
  font-size: clamp(2rem, 5vw, 4.4rem);
  max-width: none;     /* one line wherever it fits */
  text-wrap: balance;  /* and on a phone two even lines, not "bar." alone */
}
.essay {
  margin-top: clamp(40px, 7vh, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.essay p { max-width: none; }   /* the full width of the column, not the usual 60ch */
.essay p + p { margin-top: 1em; }

/* future forms */
.forms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(32px, 5vh, 56px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.forms article { padding: 30px clamp(16px, 2.4vw, 36px) 36px; }
.forms article + article { border-left: 1px solid var(--line); }
.forms article:first-child { padding-left: 0; }
.forms__state { display: flex; align-items: center; gap: 10px; color: var(--dim); }
.forms__state i { width: 6px; height: 6px; border: 1px solid var(--muted); }
.forms__name {
  margin: 22px 0 6px;
  font: 300 clamp(1.15rem, 1.8vw, 1.5rem)/1.2 var(--display);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.forms__name b { font-weight: 400; color: var(--ink); }
.forms .forms__for { margin-bottom: 16px; color: var(--ink); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { padding: clamp(64px, 10vh, 120px) 0 36px; border-top: 1px solid var(--line); }
.site-footer__marks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
/* the two marks share one height: the wordmark's letters and the AC Design square */
.site-footer__mark,
.site-footer__ac {
  flex: none;
  height: clamp(30px, 4.4vw, 56px);
  width: auto;
  opacity: .9;
}
.site-footer__ac { display: block; aspect-ratio: 1; fill: var(--ink); transition: fill .4s var(--ease); }
.site-footer__ac-link { flex: none; }
.site-footer__ac-link:hover .site-footer__ac,
.site-footer__ac-link:focus-visible .site-footer__ac { fill: var(--muted); }
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: clamp(48px, 8vh, 88px);
}
.site-footer__grid .eyebrow { margin-bottom: 10px; color: var(--dim); }
.site-footer__grid p:not(.eyebrow) { color: var(--ink-soft); font-size: .9375rem; }
.link {
  font: 300 clamp(1rem, 1.4vw, 1.2rem)/1.4 var(--display);
  letter-spacing: .04em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .6s var(--ease);
}
.link:hover { background-size: 100% 1px; }
.site-footer__thanks { max-width: 62ch; margin-top: 48px; color: var(--muted); font-size: .9375rem; }
.site-footer__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(48px, 8vh, 80px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}
.site-footer__row a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Smaller screens
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .by { display: none; }
  .split, .duo, .io { grid-template-columns: 1fr; }
  .io__col + .io__col { margin-top: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats figure:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats figure:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .forms { grid-template-columns: 1fr; }
  .forms article + article { border-left: 0; border-top: 1px solid var(--line); }
  .forms article { padding-left: 0; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .hero { overflow: clip; }
  .hero__title { font-size: clamp(1.25rem, 6.2vw, 2rem); letter-spacing: .16em; margin-right: -.16em; }
  /* the product sits in the middle of a wide frame: crop in so it reads on a phone */
  .hero__shot { width: 128%; margin: -5vw 0 0 -14%; }
  .figures { position: relative; z-index: 1; margin-top: -7vw; }   /* the figures stay above the photo */
  .nav { gap: 14px; }
  .nav a { letter-spacing: .16em; }
  .nav a:nth-child(3) { display: none; }
  .brand img { width: 88px; }
  .figures { grid-template-columns: 1fr; }
  .figures > div { padding-left: 0; padding-bottom: 20px; }
  .figures > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .rows > div { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__row { flex-direction: column; }
}
@media (max-width: 400px) {
  .nav a:nth-child(2) { display: none; }
}
