/* ============================================================
   NorthStack Consulting — chapter-scroll minimal luxury
   One idea per screen · fixed chrome · blurred scene backdrops
   Palette: espresso #171310 · surface #201A13 · cream #EFE8DC
            muted #A99F90 · gold #C99C61 / #E0BB84
   Type:    Clash Display · Satoshi · Cormorant italic · JetBrains Mono
   ============================================================ */

:root {
  --ink: #171310;
  --ink-2: #1C1712;
  --surface: #201A13;
  --raised: #2A2219;
  --line: rgba(239, 232, 220, 0.12);
  --bone: #EFE8DC;
  --muted: #A99F90;
  --star: #C99C61;
  --star-bright: #E0BB84;

  --font-display: "Clash Display", "Avenir Next", sans-serif;
  --font-body: "Satoshi", "Helvetica Neue", sans-serif;
  --font-accent: "Cormorant Garamond", serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-snap: cubic-bezier(0.34, 1.3, 0.5, 1);
  --dur-micro: 220ms;

  --pad: clamp(1.25rem, 5vw, 5rem);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--star); color: var(--ink); }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 5000;
  background: var(--star); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 4px;
  font-weight: 700; transition: top var(--dur-micro) var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.serif-accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  color: var(--star-bright);
}

/* ============ FILM GRAIN ============ */
.grain {
  position: fixed; inset: -10%;
  width: 120%; height: 120%;
  pointer-events: none; z-index: 2000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5%, 1%); }
  50% { transform: translate(1%, -1.2%); }
  75% { transform: translate(-1%, 1.5%); }
  100% { transform: translate(0, 0); }
}

/* ============ PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 4000;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.75s var(--ease-inout);
}
.preloader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.preloader-mark {
  width: clamp(64px, 10vw, 110px); height: auto;
  opacity: 0; transform: scale(0.85);
  animation: pl-mark 0.9s var(--ease-out) forwards;
}
@keyframes pl-mark { to { opacity: 1; transform: scale(1); } }

/* ============ CUSTOM CURSOR ============ */
.cursor { display: none; }

@media (pointer: fine) {
  .cursor { display: block; position: fixed; inset: 0; z-index: 3000; pointer-events: none; }
  .cursor-dot {
    position: absolute; width: 6px; height: 6px; border-radius: 50%;
    background: var(--star-bright); top: 0; left: 0;
    transform: translate(-50%, -50%);
  }
  .cursor-ring {
    position: absolute; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(224, 187, 132, 0.5);
    top: 0; left: 0; transform: translate(-50%, -50%) scale(1);
    transition: width 280ms var(--ease-out), height 280ms var(--ease-out),
                background-color 280ms var(--ease-out), border-color 280ms var(--ease-out);
  }
  .cursor.is-link .cursor-ring { width: 52px; height: 52px; border-color: var(--star); }
  .cursor.is-button .cursor-ring { width: 60px; height: 60px; background: rgba(201,156,97,0.12); border-color: var(--star); }
  .cursor.is-down .cursor-ring { transform: translate(-50%, -50%) scale(0.82); }
}

/* ============ FIXED CHROME ============ */
.chrome-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1.2rem var(--pad);
  pointer-events: none;
}
.chrome-top > * { pointer-events: auto; }
.chrome-logo { flex: 0 0 auto; }
.chrome-mark {
  width: 30px; height: 30px;
  transition: transform 600ms var(--ease-snap);
}
.chrome-logo:hover .chrome-mark { transform: rotate(90deg) scale(1.1); }
.chapter-label {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.chapter-label.is-switching { opacity: 0; transform: translateY(6px); }
.chapter-label #chapterNum { color: var(--star); }
.chrome-phone {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em;
  color: var(--bone);
  padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(23, 19, 16, 0.5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.chrome-phone:hover { border-color: var(--star); color: var(--star-bright); }
.chrome-phone svg { width: 14px; height: 14px; }

/* Side chapter ticks */
.chrome-side {
  position: fixed; left: calc(var(--pad) * 0.4); top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.side-tick {
  width: 18px; height: 2px; background: rgba(239, 232, 220, 0.25);
  border-radius: 1px; padding: 0; position: relative;
  transition: background-color 300ms var(--ease-out), width 300ms var(--ease-out);
}
.side-tick::after {
  content: ""; position: absolute; inset: -8px 0; /* larger hit area */
}
.side-tick:hover { background: var(--bone); }
.side-tick.is-active { width: 30px; background: var(--star); }

/* Bottom persistent icons */
.chrome-bottom {
  position: fixed; left: var(--pad); bottom: 1.6rem; z-index: 100;
  display: flex; flex-direction: column; gap: 1rem;
}
.chrome-bottom a {
  color: var(--muted);
  transition: color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.chrome-bottom a:hover { color: var(--star-bright); transform: translateY(-2px); }
.chrome-bottom svg { width: 20px; height: 20px; }
.chrome-down svg { animation: nudge 2.6s var(--ease-inout) infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  padding: 0.95rem 1.7rem; border-radius: 999px; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out),
              box-shadow var(--dur-micro) var(--ease-out);
  will-change: transform;
}
.btn-solid { background: var(--star); color: var(--ink); }
.btn-solid:hover { box-shadow: 0 0 0 1px var(--star), 0 8px 32px rgba(201, 156, 97, 0.3); }
.btn-ghost { border: 1px solid var(--line); color: var(--bone); }
.btn-ghost:hover { border-color: var(--star); color: var(--star-bright); }
.btn-arrow { width: 15px; height: 15px; transition: transform var(--dur-micro) var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ============ SCENES ============ */
.scene {
  position: relative; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6.5rem var(--pad);
  overflow: hidden;
}

/* Blurred image backdrops (scrolls two & three) */
.scene-bg {
  position: absolute; inset: -6%;
  background-size: cover; background-position: center;
  filter: blur(26px) brightness(0.5) saturate(1.05);
  transform: scale(1.06);
  animation: bg-drift 36s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes bg-drift {
  from { transform: scale(1.06) translateY(-0.8%); }
  to { transform: scale(1.14) translateY(0.8%); }
}
.scene-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--ink) 0%, rgba(23,19,16,0.55) 22%, rgba(23,19,16,0.5) 78%, var(--ink) 100%),
    radial-gradient(ellipse at center, rgba(23,19,16,0.15), rgba(23,19,16,0.55) 95%);
}

.reveal-line { opacity: 0; transform: translateY(22px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); }
.reveal-line.in-view, .is-loaded .hero .reveal-line { opacity: 1; transform: none; }
.reveal-block { opacity: 0; transform: translateY(36px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }
.reveal-block.in-view { opacity: 1; transform: none; }

/* ============ 000 · HERO ============ */
.hero-media { position: absolute; inset: 0; }
.hero-video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06);
  animation: hero-settle 2.4s var(--ease-out) forwards;
}
@keyframes hero-settle { to { transform: scale(1); } }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(23,19,16,0.78) 0%, rgba(23,19,16,0.45) 40%, rgba(23,19,16,0.6) 75%, var(--ink) 100%),
    radial-gradient(ellipse at center 45%, rgba(23,19,16,0.2), rgba(23,19,16,0.66) 95%);
}

.hero-inner {
  position: relative; display: flex; flex-direction: column;
  align-items: center; text-align: center;
  max-width: 900px;
}
.hero-badge, .contact-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--star-bright);
  border: 1px solid rgba(224, 187, 132, 0.35); border-radius: 999px;
  padding: 0.55rem 1.1rem; margin-bottom: 2rem;
  background: rgba(23, 19, 16, 0.4);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-badge svg, .contact-badge svg { width: 13px; height: 13px; animation: badge-glint 5s var(--ease-inout) infinite; }
@keyframes badge-glint {
  0%, 82%, 100% { transform: rotate(0deg) scale(1); }
  88% { transform: rotate(180deg) scale(1.25); }
  94% { transform: rotate(360deg) scale(1); }
}
.hero-lockup {
  width: clamp(280px, 46vw, 620px); height: auto;
  margin-bottom: 2.4rem;
  filter: drop-shadow(0 6px 40px rgba(23, 19, 16, 0.6));
}
.hero-type {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--font-mono); font-size: clamp(0.85rem, 2vw, 1.05rem);
  letter-spacing: 0.08em; color: var(--star-bright);
  margin-bottom: 2.6rem; min-height: 1.7em;
}
.type-prompt { color: var(--muted); }
.type-caret {
  display: inline-block; width: 0.55em; height: 1.1em;
  background: var(--star); transform: translateY(0.18em);
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.hero-micro {
  margin-top: 1.5rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.hero .reveal-line { transition-delay: 300ms; }
.hero-ctas.reveal-line { transition-delay: 500ms; }
.hero-micro.reveal-line { transition-delay: 650ms; }

/* ============ 001 · STUDIO ============ */
.studio-para {
  position: relative;
  max-width: 46rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.55; font-weight: 400;
  color: var(--bone);
}
.key {
  font-style: normal; color: var(--star-bright); position: relative;
  white-space: nowrap;
}
.key::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--star);
  transform: scaleX(0); transform-origin: left;
  transition: transform 900ms var(--ease-out);
}
.studio-para.in-view .key::after { transform: scaleX(1); }
.studio-para.in-view .key:nth-of-type(1)::after { transition-delay: 300ms; }
.studio-para.in-view .key:nth-of-type(2)::after { transition-delay: 500ms; }
.studio-para.in-view .key:nth-of-type(3)::after { transition-delay: 700ms; }
.studio-para.in-view .key:nth-of-type(4)::after { transition-delay: 900ms; }
.studio-para.in-view .key:nth-of-type(5)::after { transition-delay: 1100ms; }

/* ============ 002 · CRAFT ============ */
.craft-list {
  position: relative;
  list-style: none; width: 100%; max-width: 1000px;
}
.craft-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  grid-template-areas: "num name" "num desc";
  align-items: baseline; column-gap: 1rem;
  padding: clamp(1.6rem, 4vh, 2.6rem) 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: padding-left 400ms var(--ease-out);
}
.craft-row:first-child { border-top: 1px solid var(--line); }
.craft-row:hover { padding-left: 1.6rem; }
.craft-num {
  grid-area: num;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--star);
  letter-spacing: 0.1em;
}
.craft-name {
  grid-area: name;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.1;
  letter-spacing: -0.015em;
  transition: color 300ms var(--ease-out);
}
.craft-row:hover .craft-name { color: var(--star-bright); }
.craft-desc {
  grid-area: desc;
  color: var(--muted); font-size: 0.98rem; max-width: 34rem;
  margin-top: 0.4rem;
}
.craft-row.reveal-block:nth-child(2) { transition-delay: 120ms; }
.craft-row.reveal-block:nth-child(3) { transition-delay: 240ms; }

/* ============ 003 · PACKAGE (receipt) ============ */
.receipt {
  width: min(560px, 100%);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(1.8rem, 4vw, 3rem);
  box-shadow: 0 40px 100px rgba(10, 7, 4, 0.6);
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  will-change: transform;
}
.receipt-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.4rem); letter-spacing: 0.02em;
  margin-bottom: 1.2rem;
}
.receipt-rule {
  border-top: 1.5px dashed rgba(239, 232, 220, 0.18);
  margin: 1.1rem 0;
}
.receipt-meta { display: flex; flex-direction: column; gap: 0.3rem; }
.receipt-meta div { display: flex; gap: 1rem; }
.receipt-meta dt {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  min-width: 88px; letter-spacing: 0.06em;
}
.receipt-meta dd { font-family: var(--font-mono); font-size: 0.78rem; color: var(--bone); letter-spacing: 0.06em; }
.receipt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.receipt-head h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.1rem; }
.receipt-start { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }
.receipt-start em { color: var(--star); font-style: normal; }
.receipt-items { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.receipt-items li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-size: 0.95rem;
}
.receipt-items li span { color: var(--bone); position: relative; padding-left: 1.2rem; }
.receipt-items li span::before {
  content: "✦"; position: absolute; left: 0; top: 0.1em;
  font-size: 0.55rem; color: var(--star);
}
.receipt-items li i {
  font-style: normal; font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.14em; color: var(--star);
}
.receipt-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.receipt-total span {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.04em;
}
.receipt-total em { font-size: clamp(1.5rem, 4vw, 2rem); }
.receipt-note { font-size: 0.88rem; color: var(--muted); }
.receipt-note strong { color: var(--star-bright); font-weight: 700; }
.receipt-cta {
  display: inline-flex; margin-top: 1.4rem;
  font-weight: 700; font-size: 1rem; color: var(--ink);
  background: var(--star); border-radius: 999px;
  padding: 0.85rem 1.6rem;
  transition: box-shadow var(--dur-micro) var(--ease-out);
  will-change: transform;
}
.receipt-cta:hover { box-shadow: 0 0 0 1px var(--star), 0 8px 32px rgba(201, 156, 97, 0.3); }

/* ============ 004 · CONTACT ============ */
.contact { text-align: center; }
.contact-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.contact-sky::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 70vw; height: 70vw; max-width: 1000px; max-height: 1000px;
  background: radial-gradient(circle, rgba(201,156,97,0.08) 0%, transparent 60%);
}
.beams { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.beam {
  position: absolute; bottom: 0; top: 0;
  background: linear-gradient(to top, transparent 0%, var(--star) 45%, var(--star-bright) 50%, transparent 100%);
  opacity: 0;
  filter: blur(0.5px);
  animation: beam-rise linear infinite;
}
@keyframes beam-rise {
  0% { transform: translateY(105%); opacity: 0; }
  12% { opacity: var(--beam-alpha, 0.32); }
  85% { opacity: var(--beam-alpha, 0.32); }
  100% { transform: translateY(-105%); opacity: 0; }
}
.beams-soft .beam { --beam-alpha: 0.14; }

.contact-badge { position: relative; }
.contact-title {
  font-size: clamp(3rem, 9vw, 6.5rem); line-height: 1.1;
  margin-bottom: 2rem; position: relative;
}
.line-mask { display: block; overflow: hidden; padding-bottom: 0.15em; margin-bottom: -0.05em; }
.line-mask .line {
  display: block; transform: translateY(115%);
  transition: transform 1000ms var(--ease-out);
}
.contact-title.in-view .line-mask .line { transform: translateY(0); }

.contact-phone {
  position: relative;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 6.5vw, 4.2rem); letter-spacing: 0.01em;
  color: var(--bone);
  padding: 0.2em 0.4em;
  transition: color 350ms var(--ease-out);
  will-change: transform;
  font-variant-numeric: tabular-nums;
}
.contact-phone::after {
  content: ""; position: absolute; left: 0.4em; right: 0.4em; bottom: 0.05em; height: 2px;
  background: var(--star);
  transform: scaleX(0); transform-origin: right;
  transition: transform 450ms var(--ease-out);
}
.contact-phone:hover { color: var(--star-bright); }
.contact-phone:hover::after { transform: scaleX(1); transform-origin: left; }

.contact-alt { margin-top: 1.6rem; color: var(--muted); font-size: 0.95rem; }
.contact-alt a {
  color: var(--star-bright);
  border-bottom: 1px solid rgba(224, 187, 132, 0.35);
}
.contact-alt a:hover { border-bottom-color: var(--star-bright); }

.footer {
  position: absolute; bottom: 1.6rem; left: 0; right: 0;
  font-size: 0.78rem; color: var(--muted);
}

/* ============================================================
   MOBILE — designed, not shrunk
   ============================================================ */
@media (max-width: 900px) {
  .chrome-side { display: none; }
  .chapter-label { display: none; }
  .chrome-phone span { display: none; }
  .chrome-phone { padding: 0.6rem; border-radius: 50%; }
  .chrome-bottom { display: none; }

  .scene { padding: 5.5rem 1.5rem; }

  .hero-lockup { width: min(85vw, 420px); }
  .hero-ctas { flex-direction: column; align-items: stretch; width: 100%; max-width: 22rem; }
  .hero-ctas .btn { justify-content: center; }

  .studio-para { font-size: 1.3rem; }

  .craft-row { grid-template-columns: 2.4rem 1fr; }
  .craft-row:hover { padding-left: 0.5rem; }
  .craft-name { font-size: 2rem; }

  .receipt { padding: 1.6rem 1.4rem; }
  .receipt-meta dt { min-width: 76px; }

  .contact-phone { font-size: clamp(1.7rem, 9.5vw, 2.6rem); }
  .footer { position: static; margin-top: 3rem; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .grain, .beam { display: none !important; }
  .preloader { display: none !important; }
  .hero-video { animation: none; transform: none; }
  .scene-bg { animation: none; transform: scale(1.06); }
  .reveal-line, .reveal-block, .line-mask .line { opacity: 1; transform: none; }
  .studio-para .key::after { transform: scaleX(1); }
  .type-caret { animation: none; }
  .cursor { display: none !important; }
}
