/* ==========================================================================
   Roberto Marco Sánchez — Portfolio
   Tokens · Base · Components · Sections · Ornaments · Overlays · Motion
   ========================================================================== */

:root {
  --ink: #0a0a0a;
  --ink-2: #141414;
  --line: #2a2a2a;
  --bone: #edeae4;
  --ash: #8c8a86;
  --crimson: #b80f2e;
  --crimson-deep: #7a0a1f;

  --bg: var(--ink);
  --fg: var(--bone);
  --muted: var(--ash);
  --rule: var(--line);

  --gutter: clamp(16px, 4vw, 64px);
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --black: "Pirata One", "UnifrakturCook", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--display);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.2rem);
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
em { font-style: normal; font-family: var(--black); font-weight: 400; letter-spacing: 0; text-transform: none; }
::selection { background: var(--crimson); color: var(--bone); }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 4px; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

.mono {
  font-family: var(--mono);
  font-size: clamp(0.66rem, 0.62rem + 0.15vw, 0.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

.skip { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 10px 14px; background: var(--bone); color: var(--ink); transform: translateY(-200%); }
.skip:focus { transform: none; }

.theme-bone { --bg: var(--bone); --fg: var(--ink); --muted: #5c5a56; --rule: #cfcbc3; background: var(--bg); color: var(--fg); }

/* ---------- Display type ---------- */
.display {
  font-weight: 900;
  font-variation-settings: "wdth" 72;
  font-size: clamp(2.6rem, 9.5vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.display .w { display: inline-block; overflow: hidden; vertical-align: top; padding-top: 0.12em; margin-top: -0.12em; }
.display .c { display: inline-block; }

.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 6vw, 88px); }
.section-head__tag { color: var(--crimson); }
.section-head--row { align-items: end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid currentColor;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn:hover { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn--solid { background: var(--crimson); border-color: var(--crimson); color: var(--bone); }
.btn--solid:hover { background: var(--bone); border-color: var(--bone); color: var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 5px 9px; border: 1px solid var(--rule); color: var(--muted); }

/* ---------- Image frames + strips ---------- */
.frame { position: relative; overflow: hidden; background: var(--ink-2); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--paper { background: #fff; }
.zoom { cursor: zoom-in; }
.wd { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.wd > span { display: inline-block; }
.zoom img { transition: transform 1.6s var(--ease); }
@media (hover: hover) { .zoom:hover img { transform: scale(1.035); } }

/* A strip is a row of frames that all share one height and keep their own ratio,
   so nothing is cropped and nothing overlaps. */
.strip {
  --fh: clamp(190px, 56vw, 300px);
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter);
}
.strip::-webkit-scrollbar { display: none; }
.strip .frame, .strip .deco { flex: none; height: var(--fh); width: calc(var(--fh) * var(--arn, 0.8)); scroll-snap-align: start; }
.strip .deco .frame { width: 100%; height: 100%; }

/* ---------- Global overlays ---------- */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 110; background: var(--crimson); transform: scaleX(0); transform-origin: 0 50%; }

.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor {
    display: grid; place-items: center;
    position: fixed; top: 0; left: 0; z-index: 160; pointer-events: none;
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: var(--crimson);
    transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), opacity 0.3s;
  }
  .cursor__label { color: var(--bone); font-size: 0.6rem; opacity: 0; transition: opacity 0.2s; }
  .cursor.is-active { width: 78px; height: 78px; margin: -39px 0 0 -39px; }
  .cursor.is-active .cursor__label { opacity: 1; }
  .cursor.is-link { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--crimson); }
}

/* ---------- Preloader ---------- */
.preloader { display: none; }
.js .preloader {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--ink); color: var(--bone);
}
.preloader__mark { font-family: var(--black); font-size: clamp(4rem, 14vw, 9rem); line-height: 1; color: var(--crimson); }
.preloader__count { color: var(--ash); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 28px;
  padding: 16px var(--gutter);
  color: var(--bone); background: linear-gradient(rgba(10, 10, 10, 0.78), rgba(10, 10, 10, 0));
  transition: transform 0.6s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__mark { font-family: var(--black); font-size: 1.7rem; line-height: 1; margin-right: auto; }
.nav__links { display: none; gap: 28px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.nav__links a { position: relative; padding: 6px 0; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: 100% 50%; transition: transform 0.5s var(--ease); }
.nav__links a:hover::after, .nav__links a.is-current::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__cta { display: none; padding: 10px 16px; border: 1px solid currentColor; }
.nav__toggle { min-height: 44px; padding: 0 4px; }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-block; }
  .nav__toggle { display: none; }
}

.menu { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; justify-content: space-between; padding: 96px var(--gutter) 28px; background: var(--ink); }
.menu a { display: flex; align-items: baseline; gap: 14px; padding: 6px 0; font-weight: 900; font-variation-settings: "wdth" 70; font-size: clamp(2.6rem, 13vw, 5rem); line-height: 1; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.menu a .mono { color: var(--crimson); }
.menu__foot { color: var(--ash); }

/* ==========================================================================
   HERO — Scene 1: The Void
   ========================================================================== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 84px var(--gutter) clamp(20px, 4vh, 40px);
  overflow: hidden; isolation: isolate;
}
.void { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.void__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(42vmax 42vmax at var(--mx, 68%) var(--my, 38%), rgba(184, 15, 46, 0.42), transparent 62%),
    radial-gradient(60vmax 30vmax at 50% 108%, rgba(122, 10, 31, 0.5), transparent 70%);
}
.void__fog { position: absolute; width: 90vmax; height: 46vmax; border-radius: 50%; opacity: 0.1; will-change: transform; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.22) 45%, transparent 72%); }
.void__fog--a { left: -30vmax; bottom: -22vmax; animation: fog 26s ease-in-out infinite alternate; }
.void__fog--b { right: -36vmax; bottom: -26vmax; animation: fog 34s ease-in-out infinite alternate-reverse; }
@keyframes fog { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(12vmax, -3vmax, 0) scale(1.18); } }

.ring { position: absolute; top: 50%; left: 50%; width: min(118vmin, 1100px); height: min(118vmin, 1100px); margin: calc(min(118vmin, 1100px) / -2) 0 0 calc(min(118vmin, 1100px) / -2); opacity: 0.5; }
.ring svg { width: 100%; height: 100%; animation: ring-spin 150s linear infinite; will-change: transform; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.ring__line { fill: none; stroke: var(--bone); stroke-width: 0.6; opacity: 0.35; }
.ring__text { font-family: var(--black); font-size: 44px; fill: var(--bone); opacity: 0.55; }
.ring__spikes path { fill: var(--bone); opacity: 0.5; }

.hero__frame { position: absolute; inset: 0; z-index: -1; clip-path: circle(0% at 50% 50%); }
.hero__frame picture, .hero__frame img, .hero__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 10, 10, 0.86), rgba(10, 10, 10, 0.1) 55%, rgba(10, 10, 10, 0.35)); }

.hero__meta { position: absolute; top: 76px; left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; color: var(--ash); }
.hero__title {
  font-weight: 900; font-variation-settings: "wdth" 80;
  font-size: min(21vw, 22vh); font-size: min(21vw, 22svh);
  line-height: 0.8; letter-spacing: -0.035em; text-transform: uppercase;
  margin-bottom: clamp(16px, 3vh, 36px);
}
.line { display: block; overflow: hidden; padding-top: 0.14em; margin-top: -0.14em; }
.line__in { display: block; }
.line:nth-child(2) .line__in { color: transparent; -webkit-text-stroke: 1.5px var(--bone); }

.hero__foot { display: grid; gap: 20px; }
.hero__sub { max-width: 34ch; font-size: clamp(1rem, 0.9rem + 0.5vw, 1.35rem); line-height: 1.35; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__actions .btn { flex: 1 1 150px; }
.hero__scroll { display: none; }
.hero__tagline {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 8vh, 80px);
  font-weight: 900; font-variation-settings: "wdth" 72; text-transform: uppercase;
  font-size: clamp(2.4rem, 9vw, 8.5rem); line-height: 0.88; letter-spacing: -0.02em;
  opacity: 0; pointer-events: none;
}
.hero__tagline em { color: var(--crimson); font-size: 1.12em; }

@media (min-width: 900px) {
  .hero__foot { grid-template-columns: 1fr auto; align-items: end; }
  .hero__actions .btn { flex: 0 0 auto; }
  .hero__scroll { display: block; position: absolute; right: var(--gutter); top: 50%; writing-mode: vertical-rl; color: var(--ash); }
  .hero__scroll::after { content: ""; display: block; width: 1px; height: 64px; margin: 12px auto 0; background: linear-gradient(var(--bone), transparent); animation: drip 2.2s var(--ease) infinite; transform-origin: 50% 0; }
}
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ==========================================================================
   KINETIC
   ========================================================================== */
.kinetic { padding: clamp(40px, 9vw, 130px) 0; overflow: hidden; border-top: 1px solid var(--line); }
.kinetic__track {
  --wdth: 88;
  display: flex; align-items: center; gap: 0.3em; white-space: nowrap; width: max-content;
  font-weight: 900; font-variation-settings: "wdth" var(--wdth);
  font-size: clamp(3.4rem, 13vw, 13rem); line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase;
  will-change: transform;
}
.kinetic__track .is-outline { color: transparent; -webkit-text-stroke: 1.5px var(--bone); }
.kinetic__star { color: var(--crimson); font-size: 0.5em; }

/* ==========================================================================
   STATS
   ========================================================================== */
.stats { padding: clamp(48px, 8vw, 120px) var(--gutter); }
.stats__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 20px; }
.stats__grid li { border-top: 1px solid var(--ink); padding-top: 14px; }
.stats__num { display: block; font-weight: 900; font-variation-settings: "wdth" 66; font-size: clamp(3.6rem, 13vw, 11rem); line-height: 0.85; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats__grid p { margin-top: 12px; max-width: 22ch; font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.2rem); line-height: 1.25; font-weight: 600; }
@media (min-width: 900px) { .stats__grid { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   PILLARS
   ========================================================================== */
.pillars { position: relative; padding: clamp(72px, 12vw, 180px) var(--gutter) 0; }
.pillar { display: grid; gap: 18px; padding: clamp(24px, 4vw, 56px) 0; border-top: 1px solid var(--line); }
.pillar:last-child { border-bottom: 1px solid var(--line); }
.pillar__num { color: var(--crimson); }
.pillar h3 { font-weight: 900; font-variation-settings: "wdth" 72; font-size: clamp(2rem, 6vw, 5.2rem); line-height: 0.9; text-transform: uppercase; letter-spacing: -0.02em; }
.pillar p { margin: 16px 0 20px; max-width: 46ch; color: #c9c6c0; }
@media (min-width: 1024px) {
  .pillar { grid-template-columns: 90px minmax(0, 1fr); gap: 28px 32px; }
  .pillar__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; align-items: start; }
  .pillar__body h3 { grid-row: span 2; }
  .pillar__body p { margin-top: 6px; }
  .pillar .strip { grid-column: 2; --fh: clamp(200px, 17vw, 280px); flex-wrap: wrap; justify-content: center; overflow: visible; margin-right: 0; padding-right: 0; gap: 14px; }
}

/* ==========================================================================
   STORY
   ========================================================================== */
.story { position: relative; padding: clamp(72px, 12vw, 180px) var(--gutter); border-top: 1px solid var(--line); display: grid; gap: 24px; }
.story { padding-top: clamp(56px, 7vw, 100px); }
.story__aside .section-head { margin-bottom: clamp(20px, 3vw, 40px); }
.story__intro { font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem); line-height: 1.18; font-weight: 500; font-variation-settings: "wdth" 88; max-width: 24ch; }
.story__meter { display: none; }
.chapter { padding: 26px 0; border-top: 1px solid var(--line); }
.chapter__date { color: var(--crimson); }
.chapter h3 { margin: 8px 0 8px; font-weight: 800; font-variation-settings: "wdth" 78; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.9rem); line-height: 1; text-transform: uppercase; }
.chapter p { max-width: 48ch; color: #c9c6c0; }
.chapter--next h3 { font-family: var(--black); font-weight: 400; text-transform: none; font-size: clamp(2.6rem, 2rem + 4vw, 6rem); color: var(--crimson); }
@media (min-width: 1024px) {
  .story { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 130px); align-items: start; }
  .story__aside { position: sticky; top: 110px; }
  .story__aside .display { font-size: clamp(3rem, 6.4vw, 7rem); }
  .story__meter { display: grid; gap: 10px; margin-top: clamp(28px, 5vh, 60px); color: var(--ash); max-width: 320px; }
  .story__bar { height: 1px; background: var(--line); }
  .story__bar span { display: block; height: 100%; background: var(--crimson); transform: scaleX(0); transform-origin: 0 50%; }
  .js .chapter { opacity: 0.4; transition: opacity 0.6s var(--ease); }
  .js .chapter.is-active { opacity: 1; }
  .chapter { padding: 5vh 0; }
  .chapter:first-child { border-top: 0; padding-top: 0; }
}

/* ==========================================================================
   MARKO ARCHIVE
   ========================================================================== */
.ma { border-top: 1px solid var(--line); overflow: hidden; }
.ma__track { display: flex; flex-direction: column; }
.ma__panel { position: relative; padding: clamp(40px, 8vw, 80px) var(--gutter); border-bottom: 1px solid var(--line); display: grid; gap: 18px; align-content: start; }
.ma__panel header { display: flex; align-items: baseline; gap: 14px; }
.ma__panel header .mono { color: var(--crimson); }
.ma__panel h3 { font-weight: 900; font-variation-settings: "wdth" 72; font-size: clamp(2rem, 6vw, 4.4rem); line-height: 0.9; text-transform: uppercase; }
.ma__panel > p { max-width: 44ch; color: #c9c6c0; }
.ma__title { position: relative; font-weight: 900; font-variation-settings: "wdth" 70; font-size: clamp(4rem, 19vw, 15rem); line-height: 0.78; letter-spacing: -0.03em; text-transform: uppercase; }
.ma__title em { display: block; color: var(--crimson); font-size: 1.05em; margin-top: -0.08em; }
.ma__lede { font-size: clamp(1.2rem, 1rem + 1.4vw, 2.2rem); line-height: 1.1; color: var(--bone) !important; }
.ma__lede em { color: var(--crimson); font-size: 1.2em; }
.ma__hint { display: none; color: var(--ash); }
.ma__big { font-weight: 900; font-variation-settings: "wdth" 64; font-size: clamp(8rem, 44vw, 26rem); line-height: 0.78; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 2px var(--crimson); }
.ma__big sup { font-size: 0.3em; vertical-align: top; -webkit-text-stroke: 1px var(--crimson); margin-left: 0.05em; }
.ma__bigcap { color: var(--bone) !important; }
.ma__criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.ma__criteria li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ash); }
.ma__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ma__bar { display: none; }

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .js .ma__viewport { height: 100vh; position: relative; }
  .js .ma__track { flex-direction: row; height: 100%; width: max-content; will-change: transform; }
  /* Every panel is exactly as wide as its own content, so panels never run into each other. */
  .js .ma__panel { flex: none; width: auto; min-width: 36vw; height: 100%; padding: 104px 3.4vw 76px; border-bottom: 0; border-right: 1px solid var(--line); grid-template-rows: auto auto 1fr; }
  .js .ma__panel--intro { width: 72vw; padding-left: var(--gutter); align-content: center; grid-template-rows: none; }
  .js .ma__panel--type { width: 42vw; grid-template-rows: auto auto 1fr auto; }
  .js .ma__panel--last { width: 50vw; padding-right: var(--gutter); }
  .js .ma__hint { display: block; margin-top: 20px; }
  .js .ma .strip { --fh: min(52vh, 560px); overflow: visible; margin: 0; padding: 0; gap: 18px; align-self: end; width: max-content; }
  .js .ma__big { font-size: min(34vh, 22vw); align-self: end; }
  .js .ma__bar { display: block; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 30px; height: 1px; background: var(--line); }
  .js .ma__bar span { display: block; height: 100%; background: var(--crimson); transform: scaleX(0); transform-origin: 0 50%; }
}

/* ==========================================================================
   SELECTED WORK — editorial grid
   ========================================================================== */
.work { position: relative; padding: clamp(72px, 12vw, 180px) var(--gutter); overflow-x: clip; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); color: var(--ash); transition: all 0.3s var(--ease); }
.filters button:hover { color: var(--bone); border-color: var(--bone); }
.filters button.is-active { background: var(--bone); border-color: var(--bone); color: var(--ink); }
@media (min-width: 900px) { .section-head--row { grid-template-columns: 1fr auto; } }

.index { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row__btn { width: 100%; display: grid; grid-template-columns: 34px 1fr; gap: 6px 12px; padding: 18px 0; text-align: left; align-items: start; }
.row__num { color: var(--crimson); padding-top: 0.5em; }
.row__title { font-weight: 900; font-variation-settings: "wdth" 72; font-size: clamp(1.7rem, 7vw, 5.4rem); line-height: 0.92; letter-spacing: -0.02em; text-transform: uppercase; }
.row__meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ash); }
.row__thumb { grid-column: 1 / -1; aspect-ratio: 16 / 10; margin-top: 10px; overflow: hidden; background: var(--ink-2); }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.row__thumb.is-paper { background: #fff; }
.row__thumb.is-paper img { object-fit: contain; }
.work__noscript { color: var(--ash); padding: 24px 0; }

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .row__btn { grid-template-columns: 70px 1fr auto; align-items: center; padding: 22px 0; }
  .row__num { padding-top: 0; }
  .row__meta { grid-column: 3; justify-content: flex-end; text-align: right; max-width: 30ch; }
  .row__thumb { display: none; }
  /* Dim the children, not the button: GSAP animates the button's own opacity. */
  .row__btn > * { transition: opacity 0.5s var(--ease), transform 0.8s var(--ease); }
  .index:hover .row__btn > * { opacity: 0.3; }
  .index .row__btn:hover > *, .index .row__btn:focus-visible > * { opacity: 1; }
  .row__btn:hover .row__title { transform: translateX(22px); }
}

.preview { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .js .preview { --pw: clamp(180px, 15vw, 250px); display: block; position: fixed; top: 0; left: 0; z-index: 80; width: var(--pw); aspect-ratio: 4 / 5; margin: calc(var(--pw) * -0.625) 0 0 calc(var(--pw) * -0.5); pointer-events: none; overflow: hidden; opacity: 0; visibility: hidden; background: var(--ink-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
  .preview img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
  .preview.is-paper { background: #fff; }
  .preview.is-paper img { object-fit: contain; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about { padding: clamp(72px, 12vw, 180px) var(--gutter); }
.about__grid { display: grid; gap: 56px; }
.about__portrait { aspect-ratio: 4 / 5; max-width: 420px; background: #cfcbc3; }
.about__portrait img { filter: grayscale(1) contrast(1.08); }
.about__portrait figcaption { position: absolute; right: 12px; top: 12px; color: #fff; mix-blend-mode: difference; }
.about__text p { max-width: 54ch; margin-bottom: 1.1em; color: #2b2a28; }
.about__lead { font-size: clamp(1.3rem, 1rem + 1.6vw, 2.3rem); line-height: 1.18; font-weight: 500; font-variation-settings: "wdth" 88; color: var(--ink) !important; max-width: 27ch !important; }
.about__cols { display: grid; gap: 28px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--ink); }
.about__cols h3 { color: var(--crimson); margin-bottom: 12px; }
.about__cols li { padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; line-height: 1.3; }
.about__cols li span { color: var(--muted); }
@media (min-width: 700px) { .about__cols { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) {
  .about__grid { grid-template-columns: minmax(260px, 28vw) 1fr; gap: clamp(60px, 8vw, 140px); align-items: start; }
  .about__portrait { position: sticky; top: 120px; max-width: none; }
}

/* ==========================================================================
   CONTACT — Scene 3: The Archive + The Sealed Letter
   ========================================================================== */
.contact { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; isolation: isolate; display: grid; place-items: center; padding: 96px var(--gutter) 56px; }
.corridor { position: absolute; inset: 0; z-index: -1; perspective: 900px; overflow: hidden; }
.corridor__wall {
  position: absolute; top: -10%; bottom: -10%; width: 70%;
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(237, 234, 228, 0.07) 34px 35px, transparent 35px 44px, rgba(0, 0, 0, 0.7) 44px 96px),
    linear-gradient(#060606, #151515 50%, #060606);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  opacity: 0.9;
}
.corridor__wall--l { left: 0; transform-origin: 0 50%; transform: rotateY(64deg); }
.corridor__wall--r { right: 0; transform-origin: 100% 50%; transform: rotateY(-64deg); }
.corridor__floor { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(to top, rgba(122, 10, 31, 0.28), transparent); }
.corridor__glow { position: absolute; inset: 0; background: radial-gradient(34vmax 44vmax at 50% 46%, rgba(184, 15, 46, 0.6), rgba(122, 10, 31, 0.18) 45%, transparent 70%); }

.contact__stage { position: relative; width: min(680px, 100%); display: grid; justify-items: center; gap: 22px; }
.contact__tag { color: var(--crimson); }
.contact__hint { color: var(--ash); }
html:not(.js) .contact__hint, html:not(.js) .seal { display: none; }

.letter { position: relative; width: 100%; }
.letter__paper {
  position: relative; background: var(--bone); color: var(--ink);
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.6), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .36  0 0 0 0 .25  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 60px rgba(90, 60, 30, 0.22), 0 30px 80px rgba(0, 0, 0, 0.6);
}
.letter__inner { padding: clamp(40px, 7vw, 64px) clamp(22px, 6vw, 60px); display: grid; gap: 14px; }
.letter__title { font-family: var(--black); font-weight: 400; font-size: clamp(3.4rem, 13vw, 6.4rem); line-height: 0.9; color: var(--crimson-deep); margin-bottom: 6px; }
.letter__line { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.18rem); line-height: 1.42; max-width: 46ch; }
.letter__sign { margin-top: 6px; }
.letter__sign span { font-family: var(--black); font-size: 1.7em; line-height: 1; }
.letter__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 18px; border-top: 1px solid rgba(10, 10, 10, 0.25); }
.letter__mail { display: flex; flex: 1 1 100%; gap: 8px; }
.stamp {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px;
  border: 1.5px solid var(--crimson-deep); color: var(--crimson-deep);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.stamp:hover { background: var(--crimson-deep); color: var(--bone); }
.stamp--main { flex: 1 1 auto; padding: 0 10px; background: var(--crimson-deep); color: var(--bone); text-transform: none; letter-spacing: 0; font-size: clamp(0.58rem, 2.7vw, 0.92rem); white-space: nowrap; }
.stamp--main:hover { background: var(--ink); border-color: var(--ink); }

.letter__roller {
  position: absolute; left: -14px; right: -14px; height: 26px; z-index: 2; border-radius: 13px;
  background: linear-gradient(to bottom, #8f897d, #f6f3ec 32%, #d8d2c6 58%, #77716a);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.5);
}
.letter__roller::before, .letter__roller::after { content: ""; position: absolute; top: -3px; bottom: -3px; width: 16px; border-radius: 6px; background: linear-gradient(to bottom, #3a0410, var(--crimson) 40%, #3a0410); }
.letter__roller::before { left: -8px; } .letter__roller::after { right: -8px; }
.letter__roller--top { top: -13px; }
.letter__roller--bottom { bottom: -13px; }
html:not(.js) .letter__roller { display: none; }

.seal { position: absolute; top: 50%; left: 50%; z-index: 3; width: clamp(120px, 26vw, 170px); aspect-ratio: 1; margin: calc(clamp(120px, 26vw, 170px) / -2) 0 0 calc(clamp(120px, 26vw, 170px) / -2); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)); }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal__crack { fill: none; stroke: #2a030b; stroke-width: 2; stroke-linejoin: round; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { position: relative; padding: 40px var(--gutter) 28px; border-top: 1px solid var(--line); }
.footer__row { display: grid; gap: 18px; padding-bottom: 28px; }
.footer__row nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer__row a { padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.footer__row a:hover { border-color: var(--crimson); }
.footer__row--sm { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 0 0; border-top: 1px solid var(--line); color: var(--ash); }
@media (min-width: 900px) { .footer__row { grid-template-columns: 1fr auto auto; align-items: center; gap: 40px; } }

/* ==========================================================================
   PROJECT PANEL
   ========================================================================== */
.panel { position: fixed; inset: 0; z-index: 130; background: var(--ink); display: flex; flex-direction: column; }
.panel__bar { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); }
.panel__num { color: var(--crimson); }
.panel__close { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); }
.panel__close:hover { background: var(--bone); color: var(--ink); }
.panel__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: clamp(28px, 6vw, 80px) var(--gutter) 80px; }
.panel__head { display: grid; gap: 24px; margin-bottom: 28px; }
.panel__meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-content: start; }
.panel__meta dt { color: var(--ash); }
.panel__text { max-width: 60ch; font-size: clamp(1.05rem, 1rem + 0.5vw, 1.4rem); line-height: 1.4; }
.panel__note { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--crimson-deep); color: var(--ash); max-width: 70ch; text-transform: none; letter-spacing: 0.02em; }
.panel__gallery { column-count: 1; column-gap: 14px; margin: clamp(32px, 5vw, 64px) 0; }
.panel__gallery figure { break-inside: avoid; margin-bottom: 14px; background: #fff; overflow: hidden; }
.panel__gallery img { width: 100%; }
@media (min-width: 700px) { .panel__gallery { column-count: 2; } }
@media (min-width: 1200px) { .panel__gallery { column-count: 3; } .panel__head { grid-template-columns: 1fr auto; align-items: end; } }

/* ==========================================================================
   IMAGE VIEWER
   ========================================================================== */
.lightbox { position: fixed; inset: 0; z-index: 140; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; align-items: center; background: rgba(8, 8, 8, 0.96); }
.lightbox__stage { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; width: 100%; height: 100%; padding: 64px clamp(12px, 6vw, 96px); cursor: zoom-out; }
.lightbox__stage img { max-width: min(100%, 88vw); max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); width: auto; height: auto; object-fit: contain; background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); cursor: default; will-change: transform, opacity; }
.lightbox__close { grid-column: 3; grid-row: 1; z-index: 2; margin: 18px var(--gutter) 0 0; min-height: 44px; padding: 0 2px; color: var(--ash); border-bottom: 1px solid transparent; transition: color 0.3s var(--ease), border-color 0.3s var(--ease); }
.lightbox__close:hover { color: var(--bone); border-color: var(--crimson); }
.lightbox__nav { grid-row: 2; z-index: 2; width: clamp(48px, 7vw, 96px); height: 96px; display: grid; place-items: center; color: var(--bone); opacity: 0.55; transition: opacity 0.4s var(--ease), transform 0.6s var(--ease), color 0.3s; }
.lightbox__nav svg { width: clamp(26px, 3vw, 44px); overflow: visible; }
.lightbox__nav path { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__nav--prev { grid-column: 1; margin-left: clamp(2px, 1.5vw, 24px); }
.lightbox__nav--next { grid-column: 3; margin-right: clamp(2px, 1.5vw, 24px); justify-self: end; }
.lightbox__nav:hover { opacity: 1; color: var(--crimson); }
.lightbox__nav--prev:hover { transform: translateX(-8px); }
.lightbox__nav--next:hover { transform: translateX(8px); }
.lightbox__cap { grid-column: 1 / -1; grid-row: 3; z-index: 2; text-align: center; padding: 0 16px 18px; color: var(--ash); }
.lightbox.is-single .lightbox__nav { visibility: hidden; }

/* A grid strip gives every image the same cell, whatever its own ratio. */
.strip--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; margin-right: 0; padding-right: 0; }
.strip--grid .frame { width: auto; height: auto; aspect-ratio: 5 / 4; }
.strip--grid .frame img { object-fit: contain; }
@media (min-width: 1024px) { .pillar .strip--grid { gap: 14px; } }

.seal-flash { position: absolute; top: 50%; left: 50%; z-index: 2; width: clamp(120px, 26vw, 170px); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--crimson); box-shadow: 0 0 40px 6px rgba(184, 15, 46, 0.55), inset 0 0 30px rgba(184, 15, 46, 0.5); opacity: 0; pointer-events: none; }
html:not(.js) .seal-flash { display: none; }

/* Phase 2: Higgsfield clips mounted by script.js */
.scene-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.corridor .scene-video { opacity: 0.6; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .void__fog, .ring svg, .hero__scroll::after { animation: none; }
  .js .preloader, .seal, .seal-flash, .contact__hint, .letter__roller, .cursor { display: none !important; }
  .js .chapter { opacity: 1; }
  .hero__frame { clip-path: none; opacity: 0.28; }
}
