/* One bundle of threads, re-woven for every project.
   Ground: oxblood. Thread and ink: pale rose. Accent: vermilion (inside the drawings only). */

@font-face {
  font-family: "Funnel Display";
  src: url(fonts/funnel-display.woff2) format("woff2");
  font-weight: 300 600;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Sans";
  src: url(fonts/funnel-sans.woff2) format("woff2");
  font-weight: 300 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #3a0611;
  --ink: #f6d9cf;
  --gutter: max(5vw, 20px);
  --display: "Funnel Display", "Segoe UI", sans-serif;
}
:root.light {
  color-scheme: light;
  --ground: #f0cdc2;
  --ink: #3a0611;
}

* { box-sizing: border-box; min-width: 0; margin: 0; }

html { scroll-behavior: smooth; background: var(--ground); transition: background-color .9s; }
body {
  color: var(--ink);
  font: 400 18px/1.5 "Funnel Sans", "Segoe UI", sans-serif;
  overflow-x: clip;
  transition: color .6s;
  -webkit-font-smoothing: antialiased;
}
a, button { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; border-radius: 4px; }
::selection { background: #ff6a3d; color: #2a040c; }

#threads { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 300; line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(38px, 5.3vw, 84px); }

section { padding-inline: var(--gutter); }

/* Header */
.top { position: absolute; inset: 0 0 auto; padding: 30px var(--gutter); z-index: 2; }
.mark { font: 500 21px/1 var(--display); letter-spacing: -.02em; text-decoration: none; display: inline-block; padding-block: 6px; }
.pill {
  position: fixed; z-index: 3;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: var(--gutter);
  display: flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 20px 0 16px;
  border-radius: 23px;
  background: var(--ink); color: var(--ground);
  font-size: 16px; font-weight: 500; text-decoration: none;
  transition: background-color .6s, color .6s, scale .3s cubic-bezier(.2, .8, .2, 1);
}
.pill:hover { scale: 1.05; }
.pill:active { scale: .98; }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding-bottom: clamp(32px, 5vw, 64px); }
.hero .slot { margin-inline: calc(var(--gutter) * -1); min-height: 260px; }
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr) 17em; gap: 32px 6vw; align-items: end; }
.hero h1 { max-width: 14.5em; }

/* Projects */
.work { height: 480vh; height: 480svh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4vw; }
.stage .slot { order: 2; height: min(76svh, 48vw); }
.index { list-style: none; padding: 0; }
.index :is(h2, h3) { font-size: clamp(30px, min(5.4vw, 9svh), 88px); }
.index button {
  all: unset; cursor: pointer; display: block; padding-block: .09em;
  opacity: .52; transition: opacity .5s, translate .6s cubic-bezier(.2, .8, .2, 1);
}
.index button:hover { opacity: .8; }
.index button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }
.index .on button { opacity: 1; }
.more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .6s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.more p { overflow: hidden; max-width: 27em; font-size: 19px; }
.more p::before { content: ""; display: block; height: 8px; }
.more p::after { content: ""; display: block; height: 20px; }
.on .more p { min-height: calc(3em + 28px); }
.on .more { grid-template-rows: 1fr; opacity: 1; }

/* Event games: the same reel, mirrored */
.events { height: 400vh; height: 400svh; }
.events .stage { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.events .stage .slot { order: 0; }
.events .stage h2 { font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -.015em; margin-bottom: clamp(12px, 2.4vw, 34px); }

/* Guidance */
.guide { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; padding-top: clamp(110px, 16svh, 180px); padding-bottom: 8svh; }
.guide-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 4vw; align-items: start; }
.guide h2 { font-size: clamp(38px, 4.8vw, 80px); }
.guide p { font-size: clamp(18px, 1.6vw, 23px); max-width: 28em; padding-top: .5em; }
.guide .slot { margin-inline: calc(var(--gutter) * -1); min-height: 300px; }

/* Contact */
.contact { min-height: 100svh; display: grid; grid-template-rows: 1fr auto; }
.contact-copy { align-self: center; padding-top: 80px; }
.contact h2 { font-size: clamp(42px, 7vw, 116px); max-width: 9em; }
.contact .slot { height: 40px; margin: clamp(36px, 7svh, 76px) calc(var(--gutter) * -1) clamp(24px, 4svh, 44px); }
.ways { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 4vw; }
.ways dt { font-size: 16px; }
.ways dd { font: 400 clamp(23px, 2.3vw, 38px)/1.3 var(--display); letter-spacing: -.02em; }
.ways a {
  display: inline-block; padding-block: 6px; text-decoration: none; white-space: nowrap;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 6px) / 0 1.5px no-repeat;
  transition: background-size .5s cubic-bezier(.2, .8, .2, 1);
}
.ways a:hover { background-size: 100% 1.5px; }
footer { padding-block: 28px; font-size: 15px; }

@media (max-width: 760px) {
  .ways { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .top { padding-top: 24px; }
  .hero-copy { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px; padding-block: 84px 28px; }
  .stage .slot { order: 0; height: 100%; }
  .index :is(h2, h3) { font-size: clamp(30px, min(9.6vw, 5.6svh), 48px); }
  .more p { font-size: 17px; }
  .events .stage { grid-template-columns: minmax(0, 1fr); }
  .guide-copy { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
