/* ============================================================
   DOMINIC STROHMEIER — LINKS
   TONEGRID CI V 1.0: Inter + JetBrains Mono labels, monochrome
   ink ramp, one signal, 8 px base, hairlines, square corners.
============================================================ */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --black: #000000;
  --ink-700: #2A2B2E;
  --ink-500: #6B6D72;
  --ink-300: #A8ABB1;
  --ink-100: #DFE1E4;
  --paper: #F6F6F4;
  --signal: #D8261C;

  --rule: rgba(246, 246, 244, .14);
  --rule-strong: rgba(246, 246, 244, .32);
  --glass: rgba(0, 0, 0, .42);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-shutter: cubic-bezier(.77, 0, .18, 1);
  --bar: clamp(24px, 6vh, 56px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100svh;
  background: var(--black);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Cinematic backdrop ---------- */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--black); }
.stage video, .stage img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(var(--film-gray, .35)) contrast(1.08) brightness(var(--film-light, .62));
  transform: scale(1.08);
  animation: drift 24s var(--ease) both;
}
@keyframes drift { from { transform: scale(1.18); } to { transform: scale(1.04); } }
.stage::after {
  content: ""; position: absolute; inset: 0; opacity: var(--shade, 1);
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 0%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.92) 100%),
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 30%, rgba(0,0,0,.7) 75%, #000 100%);
}
/* film grain */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: var(--grain, .09);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); }
}
/* letterbox bars that close in on load */
.bar { position: fixed; left: 0; right: 0; z-index: 3; height: 50vh; background: var(--black); pointer-events: none; }
.bar--top { top: 0; transform-origin: top; animation: barTop 1.5s var(--ease-shutter) .15s both; }
.bar--bottom { bottom: 0; transform-origin: bottom; animation: barBottom 1.5s var(--ease-shutter) .15s both; }
@keyframes barTop { from { height: 50vh; } to { height: 0; } }
@keyframes barBottom { from { height: 50vh; } to { height: 0; } }

/* ---------- Frame ---------- */
.frame {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.meta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-300);
  padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.rec { display: inline-flex; align-items: center; gap: 8px; color: var(--paper); }
.rec i { width: 7px; height: 7px; background: var(--signal); border-radius: 50%; animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.tc { font-variant-numeric: tabular-nums; }

/* ---------- Identity ---------- */
.id { align-self: end; padding: clamp(24px, 6vh, 112px) 0 24px; }
.wordmark { width: 120px; height: auto; opacity: .92; margin-bottom: 16px; }
.who {
  margin-bottom: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-300);
}
/* same headline treatment as the portfolio hero: masked lines slide up */
.display {
  font-weight: 600;
  font-size: calc(clamp(44px, 12.4vw, 68px) * var(--display-scale, 1));
  line-height: .93;
  letter-spacing: -.052em;
}
.display .ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.display .ln > span { display: block; animation: lineUp 1.2s var(--ease) both; }
.display .ln:nth-child(1) > span { animation-delay: 1s; }
.display .ln:nth-child(2) > span { animation-delay: 1.12s; }
@keyframes lineUp { from { transform: translateY(112%); } to { transform: none; } }
.line {
  margin-top: 16px; max-width: 34ch;
  color: var(--ink-100); font-size: 15px; line-height: 1.5;
  text-wrap: balance;
}
.stats {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 24px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.stat { padding: 12px 0; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--rule); }
.stat b { display: block; font-weight: 600; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-300); }

/* ---------- Links ---------- */
.links { display: grid; gap: 8px; padding-bottom: 32px; }
.link {
  position: relative; display: block; overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--glass);
  border-radius: var(--radius, 0);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  transition: border-color .4s var(--ease), background .4s var(--ease);
}
.link::before { /* signal sweep */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; z-index: 2;
  background: var(--signal); transform: scaleY(0); transform-origin: bottom;
  transition: transform .5s var(--ease);
}
.link:hover, .link:focus-visible { border-color: var(--rule-strong); background: rgba(0,0,0,.6); }
.link:hover::before, .link:focus-visible::before { transform: scaleY(1); }
.link:focus-visible { outline: 1px solid var(--paper); outline-offset: 3px; }

.no { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-300); }
.label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-300); }
.title { font-weight: 600; font-size: 18px; letter-spacing: -.015em; line-height: 1.2; }
.sub { font-size: 13.5px; color: var(--ink-300); line-height: 1.4; }
.arrow {
  width: 20px; height: 20px; flex: none;
  transition: transform .5s var(--ease);
}
.link:hover .arrow, .link:focus-visible .arrow { transform: translate(3px, -3px); }

/* featured card */
.link--feature .media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; }

/* a card's photos and videos ("shots"): stacked, one on at a time; the rotation runs in script.js */
.frames { position: absolute; inset: 0; transition: transform 1.2s var(--ease), filter .6s var(--ease); }
.shot { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 1.1s var(--ease); }
.shot.is-on { opacity: 1; z-index: 1; }
.frames[data-transition="cut"] .shot { transition: none; }
.frames[data-transition="slide"] .shot { opacity: 1; transform: translateX(100%); transition: transform 1s var(--ease-shutter); }
.frames[data-transition="slide"] .shot.is-on { transform: none; }
.frames[data-transition="slide"] .shot.is-out { transform: translateX(-100%); }
.shot > img, .shot > video {
  display: block; width: 100%; height: 100%; object-fit: cover;
  object-position: var(--x, 50%) var(--y, 50%);
  transform-origin: var(--x, 50%) var(--y, 50%);
  transform: scale(var(--z, 1));
}
/* slow push-in while a shot is on screen */
.frames[data-motion] .shot.is-on > * { animation: push calc(var(--t, 4s) + 1.2s) linear both; }
@keyframes push { from { transform: scale(var(--z, 1)); } to { transform: scale(calc(var(--z, 1) * 1.09)); } }

.link--feature .frames { filter: saturate(.9) contrast(1.04); transform: scale(1.02); }
.link--feature:hover .frames { transform: scale(1.06); filter: saturate(1.05) contrast(1.06); }

/* progress hairlines along the bottom edge, one per shot */
.ticks { position: absolute; left: 16px; right: 16px; bottom: 10px; z-index: 2; display: flex; gap: 4px; }
.ticks i { flex: 1; height: 2px; background: rgba(246, 246, 244, .22); overflow: hidden; }
.ticks i::after { content: ""; display: block; height: 100%; background: var(--paper); transform: scaleX(0); transform-origin: left; }
.ticks i.is-done::after { transform: scaleX(1); }
.ticks i.is-on::after { animation: tick var(--t, 4s) linear both; }
@keyframes tick { to { transform: scaleX(1); } }
.link--feature .media:has(.ticks) .cap { padding-bottom: 24px; }

.link--feature .media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 35%, transparent 55%, rgba(0,0,0,.85) 100%);
}
.chip {
  border-radius: calc(var(--radius, 0px) * .6);
  position: absolute; top: 12px; left: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
}
.chip i { width: 6px; height: 6px; background: var(--signal); border-radius: 50%; }
.link--feature .cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 16px;
}
.link--feature .no { color: var(--ink-100); }
@media (max-width: 420px) { .link--feature .media { aspect-ratio: 16 / 10; } }
.link--feature .title { font-size: clamp(22px, 6vw, 28px); letter-spacing: -.025em; margin-top: 6px; }
.link--feature .sub { color: var(--ink-100); margin-top: 4px; }

/* row cards */
.link--row { display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 16px; padding: 8px 16px 8px 8px; }
.link--row .thumb { position: relative; border-radius: calc(var(--radius, 0px) * .6); width: 88px; aspect-ratio: 1; overflow: hidden; background: var(--ink-700); }
.link--row .thumb .frames { filter: grayscale(.2); transition: transform 1s var(--ease), filter .6s var(--ease); }
.link--row:hover .thumb .frames { transform: scale(1.08); filter: none; }
.link--row .text { min-width: 0; display: grid; gap: 2px; }
.link--row .text .no { margin-bottom: 2px; }

/* switched off in the Look section */
.no-ticks .ticks { display: none; }
.no-ticks .link--feature .media .cap { padding-bottom: 16px; }

/* ---------- Footer ---------- */
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-300);
}
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { transition: color .3s var(--ease); }
.foot a:hover, .foot a:focus-visible { color: var(--paper); }

/* ---------- Entrance ---------- */
.rise { opacity: 0; transform: translateY(16px); animation: rise 1.1s var(--ease) both; animation-delay: calc(.9s + var(--d, 0) * 90ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  .frame { padding-top: 32px; padding-bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise, .display .ln > span { opacity: 1; transform: none; }
  .bar { display: none; }
}
