/* mobile-only forced line breaks (overridden inside @media) */
.m-break { display: none; }

/* =========================================================
   ninaobrecht.com — single source of truth
   black/white editorial scroll-snap, Fraunces only
   ========================================================= */

/* ---- Reset (only what we rely on) ----------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, figure { margin: 0; padding: 0; }
button {
  font: inherit; color: inherit;
  background: none; border: 0; padding: 0; cursor: pointer;
}

/* ---- Tokens --------------------------------------------- */
:root {
  --ink-black: #000000;
  --ink-white: #ffffff;

  /* current foreground / background — swapped via body[data-bg] */
  --bg: var(--ink-black);
  --fg: var(--ink-white);
  --fg-mute: rgba(247, 245, 240, 0.55);

  --font:    "Fraunces", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --w-light: 300;
  --w-book:  340;
  --w-mid:   420;

  --t-eyebrow:    10px;
  --t-body:       clamp(26px, 2.6vw, 36px);
  --t-body-lg:    clamp(37px, 3.7vw, 52px);   /* beat 7 bullets */
  --t-calm:       clamp(26px, 4.5vw,  46px);  /* beat 1 calm    */
  --t-mid:        clamp(48px, 9.2vw, 106px);  /* beat 1 distort */
  --t-quiet:      clamp(34px, 5.4vw,  64px);  /* beat 10        */
  --t-display-xl: clamp(64px, 10vw,  156px);  /* beat 5, 6, 9 punch */

  --pad-beat-y: clamp(48px, 9vh, 110px);
  --pad-beat-x: clamp(28px, 10vw, 160px);
  --gap-stack:  clamp(18px, 2.2vh, 32px);

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --bg-fade:  700ms;
}

body[data-bg="white"] {
  --bg: var(--ink-white);
  --fg: var(--ink-black);
  --fg-mute: rgba(14, 14, 14, 0.55);
}

/* ---- Page chrome ---------------------------------------- */
html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background-color var(--bg-fade) ease,
    color            var(--bg-fade) ease;
}

/* ---- Beat container — every beat is one full screen ---- */
.beat {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--pad-beat-y) var(--pad-beat-x);
}

/* ---- Stack utility — vertical group ---------------------- */
.stack       { display: flex; flex-direction: column; gap: var(--gap-stack); }
.stack--full { max-width: none; width: 100%; }
.stack--soft { gap: 0; }  /* soft-break: natural line-height */

/* ---- Typography primitives ------------------------------- */
.t-eyebrow {
  font-family: var(--font-ui);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.t-body {
  font-size: var(--t-body);
  font-weight: var(--w-light);
  line-height: 1.3;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 36;
  text-wrap: pretty;
}
.t-quiet {
  font-size: var(--t-quiet);
  font-weight: var(--w-light);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
.t-display-xl {
  font-size: var(--t-display-xl);
  font-weight: var(--w-mid);
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  text-wrap: balance;
}

/* =========================================================
   BEAT 1 — animated opening (black)
   ========================================================= */
.beat--1 {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.beat--1 .calm {
  font-variation-settings: normal;   /* hard reset — no wonk/soft leak */
  font-weight: var(--w-light);
  font-size: var(--t-calm);
  line-height: 1.2;
}
.beat--1 .calm.top    { opacity: 0; animation: fadeIn 0.6s ease forwards; }
.beat--1 .calm.bottom { opacity: 0; animation: fadeIn 0.85s ease forwards; animation-delay: 2.0s; }

.beat--1 .midwrap { margin: 30px 0; }
.beat--1 .mid {
  display: block;
  font-weight: var(--w-book);
  font-size: var(--t-mid);
  line-height: 1.1;
  font-variation-settings: "opsz" 144, "wght" 340, "SOFT" 70, "WONK" 1;
  transform-origin: left center;
  opacity: 0;
  will-change: filter, transform, opacity;
}
.beat--1 #m1 { animation: settle     1.1s var(--ease-out) forwards; animation-delay: 0.5s; }
.beat--1 #m2 { animation: settleFast 0.75s var(--ease-out) forwards; animation-delay: 1.4s; }

@keyframes fadeIn { to { opacity: 1; } }
@keyframes settle {
  0%   { opacity: 0; filter: blur(14px); transform: skewX(-16deg) translateX(-40px); }
  35%  { opacity: 1; filter: blur(9px);  transform: skewX(-12deg) translateX(-18px); }
  100% { opacity: 1; filter: blur(0.6px); transform: skewX(-4deg) translateX(0); }
}
@keyframes settleFast {
  0%   { opacity: 0; filter: blur(20px); transform: skewX(-20deg) translateX(-70px); }
  40%  { opacity: 1; filter: blur(10px); transform: skewX(-13deg) translateX(-22px); }
  100% { opacity: 1; filter: blur(0.6px); transform: skewX(-4deg) translateX(0); }
}

/* =========================================================
   Full-bleed image system (beat 2)
   ========================================================= */
.beat--imageFull { padding: 0; align-items: stretch; }
.beat--imageFull .frame { position: absolute; inset: 0; }
.beat--imageFull .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.overlay {
  position: absolute; z-index: 2;
  max-width: 26ch;
  color: var(--ink-white);
  padding: clamp(32px, 6vw, 110px);
}
.overlay .t-body {
  font-weight: var(--w-light);
  font-variation-settings: "opsz" 72;
}
.overlay--centerLeft { inset: 0 auto 0 0; display: flex; align-items: center; }

/* =========================================================
   BEAT 2 — founder portrait
   custom blue vignette tuned to the photo
   ========================================================= */
.beat--2 .overlay {
  max-width: 55%;
  padding: clamp(20px, 3vw, 80px);
  padding-left: clamp(48px, 10vw, 180px);
}
.beat--2 .overlay .t-body { font-size: 50px; line-height: 1.1; }
.beat--2 .frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 90, 175, 0.65) 0%, transparent 45%);
}

/* =========================================================
   Shared envelope layer — fixed across Beats 3 & 4
   ========================================================= */
.envelope-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000 url("images/envelope_bg.jpg") top left / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}
.envelope-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
}
body.show-envelope .envelope-bg { opacity: 1; }

/* =========================================================
   BEAT 3 — the stop (text on shared envelope layer)
   ========================================================= */
.beat--3 {
  padding: 0;
  align-items: stretch;
  background: transparent;
}
.beat--3 .overlay {
  position: absolute;
  inset: 0 clamp(48px, 10vw, 180px);
  z-index: 3;
  max-width: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.beat--3 .overlay .t-body {
  color: #000000;
  text-wrap: balance;
  font-size: 50px;
  line-height: 1.1;
  font-variation-settings: "opsz" 14;
}
.beat--3 .aster {
  font-size: 0.6em;
  vertical-align: 0.55em;
  color: rgba(0, 0, 0, 0.55);
  margin-right: 0.04em;
}

/* =========================================================
   BEAT 4 — the question (text on shared envelope layer)
   ========================================================= */
.beat--4 {
  position: relative;
  background: transparent;
}
.beat--4 .stack {
  position: relative;
  z-index: 2;
  gap: clamp(20px, 3vh, 36px);
}
.beat--4 .t-body { color: #000000; }
.beat--4 .t-body:first-child { font-size: 50px; line-height: 1.1; }

/* =========================================================
   BEAT 5 — thesis (BLACK → WHITE transition)
   ========================================================= */
.beat--5 .stack--full { gap: clamp(50px, 7vh, 95px); }

/* =========================================================
   BEAT 6 — the AI employee (block / hero / block)
   ========================================================= */
.beat--6 .body-line { max-width: 75%; }
.beat--6 .punchline {
  white-space: nowrap;
  margin-block: clamp(45px, 6.6vh, 80px);
}

/* =========================================================
   BEAT 7 — credentials + logo strip
   ========================================================= */
.beat--7 {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(40px, 7vh, 90px);
}
.beat--7 .credentials {
  text-align: center;
  gap: clamp(40px, 6vh, 80px);
}
.beat--7 .credentials > .lead    { max-width: 36ch; margin-inline: auto; }
.beat--7 .credentials > .bullets { gap: 0; }
.beat--7 .credentials .bullet    { font-size: var(--t-body-lg); }

.logos {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(18px, 2.6vw, 48px);
  width: 100%;
  max-width: 1200px;
  align-items: center;
}
.logos .logo {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logos .logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* =========================================================
   BEAT 8 — Whole Foods (type + 3-photo composition)
   text column left, 3 staggered photos right
   ========================================================= */
.beat--8 .beat8-grid {
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  gap: clamp(40px, 5vw, 90px);
  align-items: center;
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
}
.beat--8 .beat8-copy { max-width: none; }
.beat--8 .beat8-photos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: clamp(14px, 1.6vw, 24px);
  height: min(64vh, 620px);
}
.beat--8 .photo { position: relative; }
.beat--8 .photo--a { grid-column: 1 / span 4; grid-row: 1 / span 4; }
.beat--8 .photo--b { grid-column: 5 / span 2; grid-row: 2 / span 3; }
.beat--8 .photo--c { grid-column: 2 / span 3; grid-row: 5 / span 2; }
.beat--8 .photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================================
   BEAT 9 — the offer (block / hero / block)
   ========================================================= */
.beat--9 .body-line { max-width: 38%; }
.beat--9 .body-line:first-child { max-width: none; white-space: nowrap; }
.beat--9 .punch {
  margin-top: clamp(32px, 5vh, 75px);
  margin-bottom: clamp(40px, 6vh, 90px);
}

/* =========================================================
   BEAT 10 — Who am I really
   full-bleed: subject offset right, type in left negative space
   ========================================================= */
.beat--10 {
  padding: 0;
  align-items: stretch;
  background: #ffffff url("images/whoami.jpg") center / cover no-repeat;
}
.beat--10 .overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: none;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--ink-black);
}
.beat--10 .identity {
  margin-left: clamp(48px, 10vw, 180px);
  max-width: 38ch;
}

.identity {
  display: flex; flex-direction: column;
  gap: clamp(20px, 2.6vh, 36px);
}
.identity__list {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: var(--w-light);
  line-height: 1.5;
  font-variation-settings: "opsz" 36;
  text-wrap: pretty;
}
.identity__list p { margin: 0; }

/* =========================================================
   BEAT 11 — closing (split: portrait + contact)
   ========================================================= */
.beat--split { padding: 0; align-items: stretch; }
.beat--split .col {
  flex: 1 1 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad-beat-y) var(--pad-beat-x);
}
.beat--split .col--image { padding: 0; }

.beat--11 .closing { gap: clamp(40px, 6vh, 90px); }
.beat--11 .closing-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.contact {
  display: flex; flex-direction: column;
  gap: clamp(10px, 1.6vh, 20px);
}
.contact a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
  font-size: clamp(20px, 1.9vw, 28px);
  transition: opacity 200ms ease;
}
.contact a:hover { opacity: 0.55; }

/* =========================================================
   Navigation chrome — progress dots + scroll cue
   inverts via var(--fg)
   ========================================================= */
.dots {
  position: fixed;
  right: clamp(20px, 2.4vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px;
  z-index: 50;
  opacity: 0;
  animation: fadeIn 1.0s ease forwards;
  animation-delay: 3.0s;
}
.dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid var(--fg-mute);
  background: transparent;
  display: block;
  transition:
    background-color 250ms ease,
    border-color     250ms ease,
    transform        250ms ease;
}
.dots .dot:hover     { transform: scale(1.25); }
.dots .dot.is-active { background: var(--fg); border-color: var(--fg); }

.scrollcue {
  position: fixed;
  bottom: clamp(22px, 3.4vh, 36px);
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 50;
  opacity: 0;
  animation: fadeIn 1.0s ease forwards;
  animation-delay: 3.2s;
  pointer-events: none;
  transition: opacity 600ms ease;
}
body.is-scrolled .scrollcue { opacity: 0 !important; }

.scrollcue__label {
  font-family: var(--font-ui);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.scrollcue__chev {
  width: 22px; height: 22px;
  animation: bob 1.8s ease-in-out infinite;
  color: var(--fg-mute);
}
.scrollcue__chev svg { display: block; width: 100%; height: 100%; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .beat--1 .mid  { opacity: 1; filter: none; transform: none; }
  .beat--1 .calm { opacity: 1; }
  .dots, .scrollcue { opacity: 1; }
}

/* =========================================================
   MOBILE — portrait phones (≤ 720px)
   ========================================================= */
@media (max-width: 720px) {

  /* mobile-only line breaks */
  .m-break { display: inline; }

  /* ---- Global mobile tuning ---- */
  :root {
    --pad-beat-x: clamp(44px, 14vw, 72px);  /* match envelope slide margins */
    --pad-beat-y: clamp(56px, 9vh, 90px);
    --t-body:     20px;        /* unified small-text size on mobile */
  }

  /* ---- BEAT 1 — opening ---- */
  .beat--1 .calm { font-size: clamp(22px, 5.6vw, 28px); }
  .beat--1 .mid  { font-size: clamp(46px, 13vw, 64px); }
  .beat--1 .midwrap { margin: 22px 0; }

  /* ---- BEAT 2 — founder portrait (new mobile composition) ---- */
  /* Lighter studio blue; subject lower-right, top-left clear for type */
  .beat--2 { background: #a9cce5; }
  .beat--2 .frame { inset: 0; }
  .beat--2 .frame img { object-position: center bottom; }
  .beat--2 .overlay {
    inset: 0;
    max-width: 100%;
    align-items: flex-start;
    padding: clamp(36px, 6vh, 72px) clamp(28px, 8vw, 48px) 0 clamp(32px, 9vw, 56px);
    color: var(--ink-white);
  }
  .beat--2 .overlay .t-body {
    font-size: clamp(37px, 11.2vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.018em;
    max-width: 18ch;
    text-wrap: balance;
    font-variation-settings: "opsz" 72, "wght" 340;
  }
  /* No vignette — the empty blue handles the contrast */
  .beat--2 .frame::after { background: none; }

  /* ---- BEAT 3 — the stop ---- */
  .beat--3 .overlay {
    inset: 0 clamp(44px, 14vw, 72px);
  }
  .beat--3 .overlay .t-body {
    font-size: clamp(30px, 7.2vw, 40px);
    line-height: 1.18;
  }

  /* ---- BEAT 4 — the question ---- */
  .beat--4 .stack { gap: 22px; }
  .beat--4 .t-body:first-child {
    font-size: clamp(30px, 7.2vw, 40px);
    line-height: 1.18;
  }

  /* ---- BEAT 5 — thesis ---- */
  .beat--5 .stack--full { gap: clamp(28px, 5vh, 48px); }

  /* ---- BEAT 6 — AI employee ---- */
  .beat--6 .body-line { max-width: none; }
  .beat--6 .punchline {
    white-space: normal;
    text-wrap: balance;
    margin-block: clamp(24px, 4vh, 40px);
  }

  /* ---- BEAT 7 — credentials + logos ---- */
  .beat--7 {
    gap: clamp(28px, 5vh, 50px);
    justify-content: center;
  }
  .beat--7 .credentials { gap: clamp(22px, 4vh, 40px); }
  .beat--7 .credentials > .lead {
    max-width: 32ch;
    font-size: 20px;
    line-height: 1.45;
  }
  .beat--7 .credentials .bullet { font-size: clamp(28px, 6.8vw, 38px); }
  .logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px 32px;
    max-width: 430px;
    grid-template-columns: none;
  }
  .logos .logo {
    flex: 0 0 auto;
    width: calc((100% - 64px) / 3);   /* 3 per row, matches gap */
    aspect-ratio: 5 / 3;
  }
  .logos .logo img { max-width: 100%; max-height: 100%; }
  /* clear desktop spans so flow stays natural */
  .logos .logo:nth-child(4),
  .logos .logo:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    max-width: none;
  }

  /* ---- BEAT 8 — Whole Foods (stack copy over collage, vertically centered) ---- */
  .beat--8 { align-items: center; justify-content: center; }
  .beat--8 .beat8-grid {
    grid-template-columns: 1fr;
    gap: clamp(20px, 3vh, 32px);
    align-items: start;
    height: auto;
  }
  .beat--8 .beat8-copy { padding-top: 0; }
  .beat--8 .beat8-photos {
    height: min(48vh, 460px);
    gap: 10px;
    margin-top: clamp(8px, 1.4vh, 16px);
  }

  /* ---- BEAT 9 — the offer ---- */
  .beat--9 .body-line,
  .beat--9 .body-line:first-child { max-width: none; white-space: normal; }
  .beat--9 .punch {
    font-size: clamp(56px, 13vw, 78px);
    margin-top: clamp(20px, 3.5vh, 36px);
    margin-bottom: clamp(24px, 4.5vh, 48px);
  }

  /* ---- BEAT 10 — Who am I really (new mobile crop: subject low-center, type stacked above) ---- */
  .beat--10 {
    background-image: url("images/whoami-mobile.jpg");
    background-position: center bottom;
    background-size: cover;
    align-items: flex-start;
  }
  .beat--10 .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: clamp(36px, 6vh, 64px);
    padding-left: var(--pad-beat-x);
    padding-right: var(--pad-beat-x);
  }
  .beat--10 .identity {
    margin: 0;
    max-width: none;
    width: auto;
    text-align: left;
    align-items: flex-start;
    gap: clamp(16px, 2.4vh, 28px);
  }
  .beat--10 .t-quiet {
    font-size: clamp(32px, 8vw, 44px);
    line-height: 1.1;
  }
  .identity__list {
    font-size: 20px;
    line-height: 1.2;
    max-width: 32ch;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .identity__list p { margin: 0; }

  /* ---- BEAT 11 — closing (stack portrait over contact) ---- */
  .beat--split { flex-direction: column; }
  .beat--split .col { flex: 0 0 auto; }
  .beat--split .col--image { height: 50%; }
  .beat--split .col--text  {
    height: 50%;
    padding: clamp(28px, 5vh, 44px) var(--pad-beat-x);
    justify-content: flex-start;
  }
  .beat--11 .closing { gap: clamp(20px, 3.5vh, 36px); }
  .beat--11 .closing-portrait { object-position: center 25%; }
  .contact a { font-size: 20px; }

  /* ---- Shared envelope (Beats 3 & 4): use portrait-cropped art ---- */
  .envelope-bg {
    background-image: url("images/envelope_bg-mobile.jpg");
  }

  /* ---- Nav chrome: tuck dots tighter, hide scroll cue earlier ---- */
  .dots { right: 14px; gap: 11px; }
  .dots .dot { width: 6px; height: 6px; }
}
