/* ============================================================
   CRIMSON CREATIVE — style.css  (v2: lush + sectioned)
   Canon: docs/brand/brand-guide-v1.md
   Grounds cycle: hills → ink ticker → deep green → paper → crimson → lush green → ink.
   Red stays a scalpel inside sections; the process section IS the red.
   PC-first; downsizing at the bottom.
   ============================================================ */

:root {
  --crimson: #B60117;
  --crimson-deep: #8E0112;
  --ink: #020202;
  --paper: #FAFAF6;
  --cream: #F2EFE6;
  --green-forest: #16301E;
  --green-deep: #1E4027;
  --green-lush: #2E5C36;
  --green-grass: #4F7B44;
  --silver: #D1D1D1;
  --mute: #8a8a86;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-serif: 'DM Serif Display', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--crimson); color: var(--paper); }

.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; }
.serif-accent { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------- shared furniture */
.barcode {
  display: inline-block; width: 74px; height: 16px;
  background: repeating-linear-gradient(90deg,
    currentColor 0 1px, transparent 1px 3px,
    currentColor 3px 5px, transparent 5px 6px,
    currentColor 6px 7px, transparent 7px 10px,
    currentColor 10px 12px, transparent 12px 13px);
  opacity: 0.75;
}
.ghost {
  position: absolute; top: 40px; right: 30px;
  font-size: clamp(160px, 22vw, 380px);
  line-height: 0.8; font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.10);
  pointer-events: none; user-select: none;
  letter-spacing: -0.04em;
}
.ghost-light { -webkit-text-stroke-color: rgba(2,2,2,0.07); }
.ghost-red { -webkit-text-stroke-color: rgba(255,255,255,0.16); }
.ghost-cta { -webkit-text-stroke-color: rgba(255,255,255,0.10); }

.frame-section { position: relative; overflow: hidden; }
/* thin inner frame, magazine-margin style */
.frame-section::after {
  content: ""; position: absolute; inset: 22px;
  border: 1px solid currentColor;
  opacity: 0.10; pointer-events: none;
}

.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid currentColor;
  padding-bottom: 14px; margin-bottom: 80px;
  position: relative;
}
.section-head::after { /* small tick */
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 56px; height: 3px; background: var(--crimson);
}
.sh-index { opacity: 0.55; }

/* ---------------------------------------------- preloader */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s;
}
.preloader-mark img { display: block; opacity: 0; animation: breathe 1.2s var(--ease-out) forwards; mix-blend-mode: multiply; }
.preloader-line {
  opacity: 0; animation: breathe 1.2s 0.15s var(--ease-out) forwards;
  letter-spacing: 0.4em; color: var(--mute);
  text-align: center; padding: 0 24px; text-indent: 0.4em; /* balances the trailing letter-space */
}
@keyframes breathe { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.preloader.done { opacity: 0; visibility: hidden; }

/* ---------------------------------------------- grain
   fine-structure film grain: high-frequency noise, tiny irregular jumps
   (each keyframe HOLDS via steps(1,end) so there is no directional slide) */
.grain {
  position: fixed; inset: -40px; z-index: 90; pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 520 520' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 260px 260px;
  animation: grain-shift 1.1s steps(1, end) infinite;
}
@keyframes grain-shift {
  0%    { transform: translate(0, 0); }
  12.5% { transform: translate(-6px, 4px); }
  25%   { transform: translate(4px, -7px); }
  37.5% { transform: translate(-3px, -5px); }
  50%   { transform: translate(7px, 3px); }
  62.5% { transform: translate(-8px, -2px); }
  75%   { transform: translate(2px, 6px); }
  87.5% { transform: translate(5px, -4px); }
  100%  { transform: translate(0, 0); }
}

/* ---------------------------------------------- chrome
   over the hero: white text, white knot, red CTA pill.
   once scrolled past the hero: paper backdrop, ink text, red knot. */
.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 40px;
  color: #fff;
  transition: transform 0.5s var(--ease-out), color 0.4s, background 0.4s;
}
.chrome.hidden { transform: translateY(-110%); }
.chrome.scrolled { background: rgba(250,250,246,0.88); backdrop-filter: blur(10px); color: var(--ink); }
.chrome-mark { display: flex; align-items: center; gap: 12px; }
.chrome-mark img { filter: brightness(0) invert(1); transition: filter 0.4s; }
.chrome.scrolled .chrome-mark img { filter: none; }
.chrome-word { font-size: 15px; letter-spacing: -0.01em; font-weight: 400; }
.chrome-word b { font-weight: 600; }
.chrome-nav { display: flex; gap: 30px; }
.chrome-nav a { position: relative; padding: 4px 0; opacity: 0.9; transition: opacity 0.3s; }
.chrome-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.chrome-nav a:hover { opacity: 1; }
.chrome-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.chrome-cta {
  color: #fff; background: var(--crimson);
  padding: 10px 18px;
  border: 1px solid var(--crimson);
  border-radius: 999px;
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out), border-color 0.35s;
}
.chrome-cta:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------------------------------------- hero */
.hero {
  position: relative;
  height: 100svh; min-height: 680px;
  overflow: hidden;
  color: #fff;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 112%;
  object-fit: cover; object-position: center 38%;
  /* no baseline scale: it resamples the image and costs sharpness;
     the 112% height alone gives the parallax headroom */
  will-change: transform;
}
.hero-wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(80% 70% at 16% 22%, rgba(2,2,2,0.28) 0%, rgba(2,2,2,0) 60%),
    linear-gradient(180deg, rgba(2,2,2,0.18) 0%, rgba(2,2,2,0) 26%),
    linear-gradient(0deg, rgba(2,2,2,0.34) 0%, rgba(2,2,2,0) 26%);
}
.hero-corners i {
  position: absolute; width: 22px; height: 22px; z-index: 3;
  border-color: rgba(255,255,255,0.65); border-style: solid; border-width: 0;
}
.hero-corners i:nth-child(1) { top: 88px; left: 40px; border-top-width: 1px; border-left-width: 1px; }
.hero-corners i:nth-child(2) { top: 88px; right: 40px; border-top-width: 1px; border-right-width: 1px; }
.hero-corners i:nth-child(3) { bottom: 88px; left: 40px; border-bottom-width: 1px; border-left-width: 1px; }
.hero-corners i:nth-child(4) { bottom: 88px; right: 40px; border-bottom-width: 1px; border-right-width: 1px; }

.hero-copy {
  position: absolute; z-index: 2;
  left: 7vw; top: 24vh;
  text-shadow: 0 2px 30px rgba(2,2,2,0.25);
}
.hero-line {
  font-size: clamp(56px, 7.2vw, 120px);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.03;
}
.hero-line .w {
  display: inline-block;
  opacity: 0; transform: translateY(0.55em);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.hero-line.in .w { opacity: 1; transform: none; }
.hero-line .w:nth-child(1) { transition-delay: 0.10s; }
.hero-line .w:nth-child(2) { transition-delay: 0.22s; }
.hero-line .w:nth-child(3) { transition-delay: 0.34s; }
.hero-line .w:nth-child(5) { transition-delay: 0.46s; }
.hero-line .w:nth-child(6) { transition-delay: 0.58s; }
.hero-line .serif-accent { color: #FF2338; }
.hero-sub {
  margin-top: 26px;
  font-size: clamp(16px, 1.35vw, 21px);
  font-weight: 300; line-height: 1.55;
  color: rgba(255,255,255,0.92);
  max-width: 40ch;
}
.vtext {
  position: absolute; z-index: 2;
  right: 54px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5em;
}
.hero-strip {
  position: absolute; z-index: 3;
  left: 40px; right: 40px; bottom: 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  color: rgba(255,255,255,0.88);
}
.hero-strip i { flex: 1; height: 1px; background: rgba(255,255,255,0.28); }
.scroll-cue {
  position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 52px; overflow: hidden; z-index: 3;
}
.scroll-cue i { display: block; width: 1px; height: 100%; background: rgba(255,255,255,0.7); animation: cue 2.2s var(--ease-out) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }

/* ---------------------------------------------- ticker */
.ticker {
  background: var(--ink); color: var(--paper);
  overflow: hidden; white-space: nowrap;
  padding: 13px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ticker-track { display: inline-flex; animation: tick 115s linear infinite; /* 6 copies; -50% = 3 identical spans = seamless on any width */ }
.ticker-track span { letter-spacing: 0.22em; padding-right: 2em; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------------------------------------- THE DEAL (deep green) */
.deal {
  background:
    radial-gradient(120% 90% at 85% -10%, var(--green-deep) 0%, var(--green-forest) 55%);
  color: var(--cream);
  padding: 150px 7vw 170px;
}
.deal .section-head { border-color: rgba(242,239,230,0.35); }
.deal .sh-tag { color: var(--cream); }
.deal .sh-index { color: var(--cream); }
.deal-grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 90px;
  align-items: start;
}
.ml {
  font-size: clamp(34px, 3.9vw, 62px);
  font-weight: 300; letter-spacing: -0.03em; line-height: 1.16;
  overflow: hidden;
}
.ml span { display: block; transform: translateY(110%); transition: transform 1.1s var(--ease-out); }
.ml.in span { transform: none; }
.red-on-dark { color: #FF2338; font-style: normal; }
.ml-note {
  margin-top: 40px;
  font-size: clamp(16px, 1.3vw, 20px);
  color: rgba(242,239,230,0.75);
  max-width: 52ch; line-height: 1.7;
}
.deal-side { display: flex; flex-direction: column; gap: 52px; padding-top: 12px; }
.stat { border-left: 2px solid rgba(242,239,230,0.28); padding-left: 26px; }
.stat-v {
  display: block;
  font-size: clamp(48px, 4.8vw, 80px);
  font-weight: 500; letter-spacing: -0.03em; line-height: 1;
  color: var(--cream);
}
.stat-v em { font-style: normal; font-size: 0.42em; font-weight: 400; opacity: 0.65; letter-spacing: 0; }
.stat-red { color: #FF2338; }
.stat-l { display: block; margin-top: 14px; color: rgba(242,239,230,0.62); max-width: 34ch; line-height: 1.8; }

/* ---------------------------------------------- SHOWCASE (paper + subtle marble flow) */
.showcase {
  background: var(--paper);
  color: var(--ink);
  padding: 150px 7vw 170px;
}
/* smoke-marbling: generated texture (assets/marble.jpg) - white ink wisps with
   faint crimson blushes on paper; one seamless cover layer, multiply keeps it airy */
.showcase { isolation: isolate; }
.marble-gl {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  pointer-events: none;
}
.showcase.gl-on::before { display: none; } /* shader replaces the static texture */
.showcase::before {
  content: ""; position: absolute; inset: -6%;
  z-index: -1;
  background-image: url('/assets/marble.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  mix-blend-mode: multiply;
  opacity: 0.85;
  animation: marble-drift 120s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes marble-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-1.8%, -1.4%) scale(1.05); }
}
.showcase .section-head { border-color: rgba(2,2,2,0.25); }
.showcase .sh-index, .showcase .sh-tag { color: var(--ink); }
.showcase-note {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: 300; color: var(--mute);
  max-width: 52ch; margin: -30px 0 90px;
}
.work-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 34px 34px;
}
.piece { position: relative; }
.p-a { grid-column: 1 / span 6; }
.p-b { grid-column: 8 / span 5; margin-top: 120px; }
.p-c { grid-column: 2 / span 4; margin-top: 90px; }
.p-d { grid-column: 7 / span 6; margin-top: 170px; }
.piece-frame {
  border: 1px solid rgba(2,2,2,0.2);
  padding: 10px;
  background: #fff;
  transition: transform 0.7s var(--ease-out), box-shadow 0.7s var(--ease-out);
}
.piece:hover .piece-frame { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(2,2,2,0.35); }
.piece-img { overflow: hidden; background: #ECECE7; }
.piece-img img {
  display: block; width: 100%; height: auto;
  transform: scale(1.01);
  transition: transform 1.4s var(--ease-out);
  will-change: transform;
}
.piece:hover .piece-img img { transform: scale(1.055); }
.piece-data {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 2px 0;
  color: var(--mute);
}
.piece-data span:first-child { color: var(--crimson); }

/* ---------------------------------------------- PROCESS (crimson) */
.process {
  background: linear-gradient(160deg, var(--crimson) 0%, var(--crimson-deep) 100%);
  color: var(--paper);
  padding: 150px 7vw 150px;
}
.process .section-head { border-color: rgba(250,250,246,0.4); }
.process .section-head::after { background: var(--ink); }
.steps {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(250,250,246,0.35);
}
.step {
  padding: 44px 36px 52px;
  border-right: 1px solid rgba(250,250,246,0.35);
  background: rgba(2,2,2,0.05);
}
.step:last-child { border-right: none; }
.step-n {
  display: block; margin-bottom: 30px;
  font-size: 13px; font-weight: 700;
  color: var(--paper);
  opacity: 0.85;
}
.step h3 { font-size: clamp(22px, 1.8vw, 28px); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 16px; }
.step p { color: rgba(250,250,246,0.82); font-size: 16px; line-height: 1.7; }
.process-strip {
  margin-top: 60px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  color: rgba(250,250,246,0.9);
}
.process-strip i { font-style: normal; opacity: 0.6; }
.ps-red {
  background: var(--paper); color: var(--crimson);
  padding: 4px 10px; font-weight: 700;
}

/* ---------------------------------------------- CTA (lush green) */
.cta {
  background:
    radial-gradient(140% 100% at 15% 110%, var(--green-lush) 0%, var(--green-deep) 60%, var(--green-forest) 100%);
  color: var(--cream);
  padding: 170px 7vw 190px;
  text-align: left;
}
.cta .section-head { border-color: rgba(242,239,230,0.35); }
.cta-line {
  font-size: clamp(48px, 6vw, 104px);
  font-weight: 300; letter-spacing: -0.035em; line-height: 1.05;
  overflow: hidden;
}
.cta-line span { display: block; transform: translateY(110%); transition: transform 1.1s var(--ease-out); }
.cta-line.in span { transform: none; }
.cta-line .serif-accent { color: var(--cream); opacity: 0.95; }
.cta-actions {
  margin-top: 64px;
  display: flex; align-items: center; gap: 38px; flex-wrap: wrap;
}
.btn-primary {
  position: relative; display: inline-block;
  padding: 22px 54px; border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  overflow: hidden;
  transition: transform 0.45s var(--ease-out), color 0.35s var(--ease-out),
              background 0.2s 0.28s; /* base goes red mid-slide so no paper ring peeks at the rounded edge */
  will-change: transform;
}
.btn-primary span { position: relative; z-index: 2; }
.btn-primary::after {
  content: ""; position: absolute; inset: -1px;
  background: var(--crimson);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
  border-radius: inherit;
}
.btn-primary:hover { color: var(--paper); background: var(--crimson); }
.btn-primary:hover::after { transform: none; }
.btn-ghost { color: rgba(242,239,230,0.8); transition: color 0.35s; }
.btn-ghost:hover { color: var(--cream); }
.cta-spec { margin-top: 70px; color: rgba(242,239,230,0.55); }

/* ---------------------------------------------- footer (ink) */
.footer { background: var(--ink); color: var(--paper); }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 50px;
  padding: 80px 7vw 60px;
}
.f-mark { display: flex; align-items: center; gap: 12px; }
.footer .f-mark img { filter: brightness(0) invert(1); opacity: 0.9; }
.f-tag { margin-top: 18px; font-family: var(--font-serif); font-style: italic; font-size: 22px; color: rgba(250,250,246,0.85); }
.f-col { display: flex; flex-direction: column; gap: 12px; }
.f-h { color: rgba(250,250,246,0.45); margin-bottom: 6px; }
.f-col a { color: rgba(250,250,246,0.85); transition: color 0.3s; }
.f-col a:hover { color: #FF2338; }
.f-col span { color: rgba(250,250,246,0.65); }
.footer-base {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  border-top: 1px solid rgba(250,250,246,0.14);
  padding: 26px 7vw 34px;
  color: rgba(250,250,246,0.5);
}
.barcode-light { color: rgba(250,250,246,0.7); }

/* ---------------------------------------------- reveal system */
[data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .ticker-track { animation: none; }
  .hero-line .w, .ml span, .cta-line span, [data-reveal] {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .scroll-cue { display: none; }
}

/* ---------------------------------------------- downsizing */
@media (max-width: 1100px) {
  .chrome-nav { display: none; }
}
@media (max-width: 900px) {
  .chrome { padding: 16px 20px; }
  .preloader-line { font-size: 9px; letter-spacing: 0.22em; text-indent: 0.22em; white-space: normal; line-height: 2; max-width: 300px; }
  .hero { min-height: 560px; }
  /* portrait crop: keep the subject (center-left of the frame) in view */
  .hero-media img { height: 104%; object-position: 38% 52%; }
  .hero-copy { left: 20px; right: 20px; top: 15vh; }
  .hero-line { font-size: clamp(42px, 11.5vw, 56px); }
  .hero-sub { font-size: 16px; margin-top: 20px; }
  .hero-corners, .vtext, .scroll-cue { display: none; }
  .hero-strip { left: 20px; right: 20px; bottom: 22px; flex-wrap: wrap; gap: 7px 16px; font-size: 9px; }
  .hero-strip i, .hero-strip .barcode { display: none; }
  .ticker { padding: 11px 0; }
  .ticker-track span { font-size: 10px; }
  .frame-section::after { inset: 10px; }
  .ghost { font-size: 120px; top: 24px; right: 14px; }
  .section-head { margin-bottom: 56px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .deal, .showcase, .process, .cta {
    padding-left: 24px; padding-right: 24px;
    padding-top: 96px; padding-bottom: 110px;
  }
  .deal-grid { grid-template-columns: 1fr; gap: 60px; }
  .ml { font-size: clamp(30px, 8.4vw, 40px); }
  .ml-note { margin-top: 30px; font-size: 16px; }
  .deal-side { gap: 40px; }
  .stat-v { font-size: clamp(44px, 13vw, 60px); }
  .showcase-note { margin: -18px 0 64px; font-size: 18px; }
  .work-grid { display: block; }
  .piece { margin: 0 0 58px !important; }
  .piece-data { flex-wrap: wrap; gap: 6px 14px; font-size: 9px; }
  .process .steps { grid-template-columns: 1fr; }
  .step { padding: 34px 24px 40px; border-right: none; border-bottom: 1px solid rgba(250,250,246,0.35); }
  .step:last-child { border-bottom: none; }
  .process-strip { margin-top: 44px; font-size: 10px; gap: 10px 12px; }
  .cta-line { font-size: clamp(34px, 10vw, 48px); }
  .cta-actions { margin-top: 46px; gap: 26px; }
  .btn-primary { padding: 19px 40px; font-size: 16px; }
  .cta-spec { margin-top: 50px; font-size: 9px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 24px; padding: 56px 24px 40px; }
  .f-brand { grid-column: 1 / -1; }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 24px 30px; }
}
