/* ==========================================================
   MOX — Work. Shared styles for the home page and the three galleries.
   Monolith system: charcoal ground, oxide glow, linen type, one vermillion accent,
   and the letters of the logo as the doors.
   ========================================================== */

@font-face { font-family: "Gyst"; src: url("assets/fonts/Gyst-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Gyst"; src: url("assets/fonts/Gyst.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gyst"; src: url("assets/fonts/Gyst-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gyst"; src: url("assets/fonts/Gyst-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Indivisible"; src: url("assets/fonts/Indivisible-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Indivisible"; src: url("assets/fonts/Indivisible-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --charcoal: #121212;
  --surface: #1a1715;
  --oxide: #460400;
  --vermillion: #b91800;
  --vermillion-bright: #de2c0f;
  --stone: #bdb8b0;
  --stone-deep: #7a756d;
  --linen: #efece6;
  --line: rgba(239,236,230,.16);
  --gyst: "Gyst", Georgia, serif;
  --indi: "Indivisible", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --pad: clamp(18px, 3.2vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--charcoal); color: var(--linen); font-family: var(--indi); line-height: 1.4; -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; position: relative; isolation: isolate; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(70% 55% at 50% 105%, rgba(70,4,0,.7), transparent 65%); }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--vermillion); color: var(--linen); }
:focus-visible { outline: 2px solid var(--vermillion-bright); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.grain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* ---------- type helpers ---------- */
.eyebrow { font: 700 11px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone); }
.lede { font: 400 15px/1.4 var(--indi); color: var(--stone); }
.lede strong { color: var(--linen); font-weight: 700; }
.sign { font: italic 400 15px/1 var(--gyst); color: var(--stone); }

/* ---------- top bar ---------- */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: clamp(18px, 2.4vw, 30px) var(--pad); }
.bar .left { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.logo img { height: clamp(18px, 2vw, 24px); width: auto; }
.cta { display: inline-block; font: 700 12px/1 var(--indi); letter-spacing: .14em; text-transform: uppercase; background: var(--vermillion); color: var(--linen); padding: 14px 20px; border-radius: 999px; transition: background .25s var(--ease-soft); white-space: nowrap; }
.cta:hover { background: var(--vermillion-bright); }
.back { display: inline-flex; align-items: center; gap: 10px; font: 700 12px/1 var(--indi); letter-spacing: .14em; text-transform: uppercase; color: var(--linen); padding: 13px 18px 13px 14px; border-radius: 999px; border: 1px solid rgba(239,236,230,.35); transition: border-color .25s var(--ease-soft), background .25s var(--ease-soft); white-space: nowrap; }
.back::before { content: "←"; font-size: 15px; line-height: 0; transition: transform .35s var(--ease-out); }
.back:hover { border-color: var(--linen); background: rgba(239,236,230,.06); }
.back:hover::before { transform: translateX(-4px); }

/* ---------- the wordmark doors (home, and the "more work" strip) ----------
   Every letter is sized from ONE shared height (--h), with its width derived from the
   logo's own proportions, so M, O and X always scale together. Letters are solid
   vermillion at rest; the work shows through on hover. */
.word { container-type: inline-size; display: flex; justify-content: space-between; align-items: flex-end; width: 100%; --h: 25.1cqw; }
.word.two { --h: 34cqw; max-width: 760px; }
.letter { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.letter.m { width: calc(var(--h) * 1176 / 847); }
.letter.o { width: calc(var(--h) * 914 / 902); }
.letter.x { width: calc(var(--h) * 1110 / 846); }
.letter:focus-visible { outline: none; }
.shape { width: 100%; height: var(--h); position: relative; overflow: hidden; background: var(--vermillion); transition: transform .9s var(--ease-out), background .5s var(--ease-soft); }
.shape.m { aspect-ratio: 1176 / 847; -webkit-mask: url("assets/brand/letter_M_tight.png") center / 100% 100% no-repeat; mask: url("assets/brand/letter_M_tight.png") center / 100% 100% no-repeat; }
.shape.o { aspect-ratio: 914 / 902; -webkit-mask: url("assets/brand/letter_O_solid.png") center / 100% 100% no-repeat; mask: url("assets/brand/letter_O_solid.png") center / 100% 100% no-repeat; }
.shape.x { aspect-ratio: 1110 / 846; -webkit-mask: url("assets/brand/letter_X_tight.png") center / 100% 100% no-repeat; mask: url("assets/brand/letter_X_tight.png") center / 100% 100% no-repeat; }
.shape img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center); opacity: 0; transform: scale(1.06); transition: opacity .55s var(--ease-soft), transform 1.6s var(--ease-out); }
.letter:hover .shape, .letter:focus-visible .shape { transform: translateY(-6px); }
.letter:hover .shape img, .letter:focus-visible .shape img { opacity: 1; transform: scale(1); }
.letter .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.letter .meta::after { content: "→"; font: 400 18px/1 var(--indi); color: var(--stone); opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .4s var(--ease-out); }
.letter:hover .meta::after, .letter:focus-visible .meta::after { opacity: 1; transform: none; color: var(--linen); }
.letter h2 { font: 300 clamp(22px, 2.8vw, 44px)/1 var(--gyst); letter-spacing: -.01em; }
.letter small { font: 700 11px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone); white-space: nowrap; }
.letter small::after { content: "→"; margin-left: 8px; display: inline-block; opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .4s var(--ease-out); }
.letter:hover small, .letter:focus-visible small { color: var(--linen); }
.letter:hover small::after, .letter:focus-visible small::after { opacity: 1; transform: none; }
.letter:focus-visible h2 { text-decoration: underline; text-underline-offset: .14em; }

/* ---------- footer ---------- */
footer { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 24px var(--pad); font: 700 11px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone-deep); border-top: 1px solid var(--line); }
footer a:hover { color: var(--linen); }

/* ==========================================================
   GALLERY PAGES
   ========================================================== */
.hero { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 4px var(--pad) clamp(16px, 2.4vh, 28px); }
.hero h1 { font: 300 clamp(26px, 2.6vw, 40px)/1 var(--gyst); letter-spacing: -.01em; }
.hero .count { font: 700 11px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone-deep); font-variant-numeric: tabular-nums; }
.hero .count b { color: var(--linen); }

.grid { padding: 0 var(--pad) clamp(40px, 8vh, 96px); columns: 3; column-gap: clamp(12px, 1.6vw, 24px); }
.grid.video { columns: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 1.6vw, 24px); }
.piece { display: block; width: 100%; break-inside: avoid; margin-bottom: clamp(12px, 1.6vw, 24px); position: relative; overflow: hidden; background: var(--surface); text-align: left; }
.grid.video .piece { margin: 0; aspect-ratio: 16 / 9; }
.piece img { width: 100%; height: auto; transition: transform 1.4s var(--ease-out), filter .5s var(--ease-soft); filter: brightness(.92); }
.grid.video .piece img { height: 100%; object-fit: cover; }
.piece:hover img, .piece:focus-visible img { transform: scale(1.03); filter: none; }
.piece:focus-visible { outline-offset: -3px; }
.piece .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 14px 12px; font: 700 11px/1.3 var(--indi); letter-spacing: .12em; text-transform: uppercase; color: var(--linen); background: linear-gradient(to top, rgba(18,18,18,.8), transparent); opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease-soft), transform .4s var(--ease-out); }
.piece:hover .cap, .piece:focus-visible .cap { opacity: 1; transform: none; }
.piece .play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(18,18,18,.55); border: 1px solid rgba(239,236,230,.4); backdrop-filter: blur(8px); transition: background .3s, transform .4s var(--ease-out); }
.piece .play::after { content: ""; position: absolute; left: 55%; top: 50%; transform: translate(-50%, -50%); border-left: 16px solid var(--linen); border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.piece:hover .play { background: var(--vermillion); border-color: var(--vermillion); transform: translate(-50%, -50%) scale(1.08); }
.grid.video .piece .cap { opacity: 1; transform: none; }

/* more work strip */
.more { padding: clamp(32px, 6vh, 72px) var(--pad); border-top: 1px solid var(--line); display: grid; gap: 28px; }
.more .head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.more h2 { font: 300 clamp(28px, 3.4vw, 48px)/1 var(--gyst); letter-spacing: -.01em; }
.more .head a { font: 700 11px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone); }
.more .head a:hover { color: var(--linen); }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(10,9,8,.985); display: none; }
.lb.open { display: grid; grid-template-rows: auto 1fr auto; }
.lb .top { display: flex; justify-content: space-between; align-items: center; padding: 18px var(--pad); }
.lb .counter { font: 700 11px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone); font-variant-numeric: tabular-nums; }
.lb .close { display: inline-flex; align-items: center; gap: 10px; font: 700 12px/1 var(--indi); letter-spacing: .14em; text-transform: uppercase; color: var(--linen); padding: 12px 16px; border-radius: 999px; border: 1px solid rgba(239,236,230,.35); }
.lb .close:hover { background: rgba(239,236,230,.08); border-color: var(--linen); }
.lb .stage { position: relative; display: grid; place-items: center; padding: 0 clamp(56px, 8vw, 120px); min-height: 0; }
.lb .media { width: 100%; height: 100%; display: grid; place-items: center; min-height: 0; }
.lb .stage img, .lb .stage video, .lb .stage iframe { max-width: 100%; max-height: calc(100dvh - 160px); width: auto; height: auto; object-fit: contain; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); }
.lb .stage iframe, .lb .stage video { width: min(100%, calc((100dvh - 160px) * 16 / 9)); aspect-ratio: 16 / 9; height: auto; border: 0; background: #000; }
.lb .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(239,236,230,.3); color: var(--linen); font-size: 20px; display: grid; place-items: center; transition: background .25s, border-color .25s; }
.lb .nav:hover { background: var(--vermillion); border-color: var(--vermillion); }
.lb .prev { left: var(--pad); }
.lb .next { right: var(--pad); }
.lb .bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px var(--pad) 22px; font: 400 14px/1.4 var(--indi); color: var(--stone); }
.lb .bottom b { color: var(--linen); font-weight: 700; }
.lb .hint { font: 700 10px/1 var(--indi); letter-spacing: .16em; text-transform: uppercase; color: var(--stone-deep); }
body.lb-open { overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .grid { columns: 2; } }
@media (max-width: 760px) {
  .cta, .back { padding: 11px 14px; font-size: 11px; }
  .back { padding-left: 11px; }
  .word { flex-direction: column; align-items: flex-start; gap: 36px; --h: 56cqw; }
  .word.two { flex-direction: row; align-items: flex-end; --h: 36cqw; }
  .word.two .letter h2 { font-size: 20px; }
  .word.two .letter small { display: none; }
  .letter .meta::after { opacity: 1; transform: none; }
  .grid { columns: 2; }
  .grid.video { grid-template-columns: 1fr; }
  .piece .cap { opacity: 1; transform: none; }
  .lb .stage { padding: 0 8px; }
  .lb .nav { width: 40px; height: 40px; top: auto; bottom: 64px; transform: none; }
  .lb .hint { display: none; }
}
@media (hover: none) {
  /* no hover on touch: show the work inside the letters */
  .shape img { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
