/* ==========================================================================
   Rhys Wareham · portfolio
   Warm paper, ink outlines and chunky "pressable" shadows: every button and
   card squashes when you click it, like a physical game button.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #F4EFE6;
  --dot: #DCD2C2;
  --surface: #FFFBF5;
  --surface-2: #EEE7DB;
  --ink: #1B1814;
  --ink-2: #463F36;
  --muted: #6A6256;
  --line: #1B1814;
  --shadow: #1B1814;
  --accent: #DF4527;
  --accent-ink: #FFFFFF;
  --accent-soft: #FBD9CF;
  --sun: #FFC93C;
  --mint: #2E9E62;
  --mint-soft: #CDEFD9;
  --violet: #6C4CE0;
  --violet-soft: #E3DBFF;
  --gold-soft: #FFE7A3;

  --rift-bg: #170F2E;
  --rift-ink: #F4EEFF;
  --rift-muted: #BDB0DC;
  --rift-gold: #FFC93C;
  --rift-edge: #07040F;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1200px;
  --gutter: 24px;
  --nav-h: 68px;

  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120F;
    --dot: #2A2620;
    --surface: #1D1A16;
    --surface-2: #29251F;
    --ink: #F3EEE5;
    --ink-2: #D3CBBE;
    --muted: #A39A8B;
    --line: #F3EEE5;
    --shadow: #000000;
    --accent: #FF6747;
    --accent-ink: #1B1814;
    --accent-soft: #4A2219;
    --mint: #5FD394;
    --mint-soft: #173A27;
    --violet: #A592FF;
    --violet-soft: #2C2450;
    --gold-soft: #4A3B12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14120F;
  --dot: #2A2620;
  --surface: #1D1A16;
  --surface-2: #29251F;
  --ink: #F3EEE5;
  --ink-2: #D3CBBE;
  --muted: #A39A8B;
  --line: #F3EEE5;
  --shadow: #000000;
  --accent: #FF6747;
  --accent-ink: #1B1814;
  --accent-soft: #4A2219;
  --mint: #5FD394;
  --mint-soft: #173A27;
  --violet: #A592FF;
  --violet-soft: #2C2450;
  --gold-soft: #4A3B12;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.3px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}
.skip:focus { top: 12px; }

svg { flex: none; }
svg:not(.fill) {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.fill { fill: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  --btn-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 20px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 700 16px/1.1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--btn-shadow);
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--btn-shadow); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--btn-shadow); transition-duration: .05s; }
.btn[disabled] { cursor: not-allowed; }
.btn[disabled]:hover, .btn[disabled]:active { transform: none; box-shadow: 4px 4px 0 var(--btn-shadow); }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--small { min-height: 38px; padding: 8px 14px; font-size: 14px; }

.btn__tag {
  font: 700 11px/1 var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--violet-soft);
  color: var(--violet);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shadow); }
.icon-btn[disabled] { opacity: .35; cursor: default; transform: none; box-shadow: 3px 3px 0 var(--shadow); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--nav-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 16px/1 var(--font-display);
  letter-spacing: -.02em;
  box-shadow: 3px 3px 0 var(--shadow);
  transform: rotate(-4deg);
  transition: transform .2s;
}
.brand:hover .brand__mark { transform: rotate(4deg) scale(1.05); }
.brand__name { font: 800 19px/1 var(--font-display); letter-spacing: -.01em; }

.nav__links { display: flex; gap: 4px; }
.nav__links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink-2);
  transition: background-color .15s, color .15s;
}
.nav__links a:hover { background: var(--surface-2); color: var(--ink); }
.nav__links a.is-active { color: var(--ink); background: var(--surface-2); }

.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.theme-toggle .i-moon { fill: currentColor; stroke: none; }

/* ---------- Shared bits ---------- */
.eyebrow {
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow--light { color: inherit; opacity: .85; }
.eyebrow--rift { color: var(--rift-gold); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
}
.pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 60%, transparent);
  animation: ping 2.2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.cta { display: flex; flex-wrap: wrap; gap: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li, .tag {
  font: 500 12.5px/1 var(--font-mono);
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 24px; }
.hero h1 {
  max-width: 20ch;
  margin: 22px 0 24px;
  font: 800 clamp(42px, 6.8vw, 92px)/0.98 var(--font-display);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.lead {
  max-width: 36em;
  font-size: clamp(17px, 1.55vw, 19.5px);
  color: var(--ink-2);
  margin-bottom: 32px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 64px;
  border-top: 2px solid var(--line);
}
.stats div { padding: 20px 20px 4px 0; }
.stats div + div { padding-left: 20px; border-left: 2px solid var(--line); }
.stats dt { font: 800 clamp(30px, 3.4vw, 44px)/1 var(--font-display); letter-spacing: -.03em; }
.stats dd { margin-top: 8px; font-size: 15px; color: var(--muted); line-height: 1.4; }

/* ---------- Royal Rift ---------- */
.rift {
  position: relative;
  margin-top: 72px;
  padding: 88px 0;
  background-color: var(--rift-bg);
  background-image:
    radial-gradient(#ffffff99 1px, transparent 1.4px),
    radial-gradient(#C8B6FF77 1px, transparent 1.4px),
    radial-gradient(120% 90% at 20% 0%, #3A1F73 0%, transparent 55%),
    radial-gradient(80% 80% at 100% 100%, #2A1458 0%, transparent 60%);
  background-size: 96px 96px, 140px 140px, auto, auto;
  background-position: 12px 20px, 60px 80px, 0 0, 0 0;
  color: var(--rift-ink);
  border-block: 2px solid var(--line);
}
.rift__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.rift__screen {
  border: 3px solid var(--rift-edge);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 10px 10px 0 var(--rift-edge), 0 0 0 1px #ffffff14, 0 30px 80px -20px #8C5CFF66;
  aspect-ratio: 1920 / 1040;
}
.rift__screen img, .pixel {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.rift__thumbs { display: flex; gap: 12px; margin-top: 22px; }
.rift__thumbs button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  border: 2px solid #ffffff33;
  border-radius: 10px;
  background: #0b0716;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, transform .15s;
}
.rift__thumbs button:hover { transform: translateY(-2px); border-color: #ffffff88; }
.rift__thumbs button[aria-pressed="true"] { border-color: var(--rift-gold); }
.rift__thumbs img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; image-rendering: pixelated; }
.rift__thumbs span {
  display: block;
  padding: 7px 10px;
  font: 700 11.5px/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rift-muted);
}
.rift__thumbs button[aria-pressed="true"] span { color: var(--rift-gold); }

.rift__title {
  margin: 14px 0 10px;
  font: 800 clamp(48px, 6vw, 80px)/.95 var(--font-display);
  letter-spacing: -.035em;
  color: #fff;
  text-shadow: 4px 4px 0 var(--rift-edge), 0 0 32px #A07CFF80;
}
.rift__status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #FFC93C1f;
  border: 1.5px solid #FFC93C66;
  color: var(--rift-gold);
  font: 700 12.5px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rift__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--rift-gold); animation: blink 1.2s infinite; }
.rift__copy > p:not(.eyebrow):not(.rift__status) { color: var(--rift-muted); margin-bottom: 14px; max-width: 32em; }
.rift__facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 30px; }
.rift__facts li {
  padding: 7px 11px;
  border: 1.5px solid #ffffff2e;
  border-radius: 8px;
  background: #ffffff0a;
  font: 500 13px/1 var(--font-mono);
  color: var(--rift-ink);
}
.btn--gold {
  --btn-shadow: var(--rift-edge);
  background: var(--rift-gold);
  color: #1A1033;
  border-color: var(--rift-edge);
}
.btn--gold svg { fill: currentColor; stroke: none; }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section--alt {
  background: var(--surface-2);
  background-image: none;
  border-block: 2px solid var(--line);
}
.section__head { max-width: 46em; margin-bottom: 40px; }
.section__head h2 {
  margin: 14px 0 14px;
  font: 800 clamp(38px, 4.8vw, 62px)/1 var(--font-display);
  letter-spacing: -.035em;
}
.section__head p:not(.eyebrow) { color: var(--ink-2); font-size: 18px; }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .12s;
}
.filters button:hover { transform: translateY(-1px); }
.filters button:active { transform: translateY(1px); }
.filters button span {
  font: 700 11.5px/1 var(--font-mono);
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filters button[aria-pressed="true"] span { background: var(--accent); color: var(--accent-ink); }

/* ---------- Project grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 30px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--shadow); }
.card:active { transform: translate(5px, 5px); box-shadow: 1px 1px 0 var(--shadow); transition-duration: .05s; }
.card:focus-visible { outline-offset: 4px; border-radius: var(--radius); }

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-bottom: 2px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.card:hover .card__media img { transform: scale(1.045); }
.card__media img.pixel-img { image-rendering: pixelated; }

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 700 11.5px/1 var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--shadow);
}
.badge--dev { background: var(--sun); color: #1B1814; }
.badge--live { background: var(--mint-soft); color: var(--ink); }
.badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.badge--soon { background: var(--violet); color: #fff; }
.badge--award { background: var(--gold-soft); }
.badge--jam { background: var(--accent-soft); }

.card__play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--shadow);
  transition: transform .2s, background-color .2s;
}
.card__play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; margin-left: 2px; }
.card:hover .card__play { transform: scale(1.1); background: var(--accent); color: var(--accent-ink); }

.card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.card__kicker {
  font: 700 12px/1.3 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.card__title { font: 800 25px/1.08 var(--font-display); letter-spacing: -.02em; }
.card__summary { color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.card__tags .tag { font-size: 11.5px; padding: 5px 8px; }

.grid > li { animation: pop .35s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.more { display: flex; justify-content: center; margin-top: 44px; }
.more .btn[hidden] { display: none; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.about__text > p { font-size: 18px; color: var(--ink-2); margin-bottom: 18px; max-width: 36em; }
.about__text strong { color: var(--ink); }

.timeline { margin-top: 36px; border-top: 2px solid var(--line); }
.timeline li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 2px dashed color-mix(in srgb, var(--line) 30%, transparent);
}
.timeline__when { font: 700 12.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.timeline__when--now { color: var(--mint); }
.timeline__role { font-weight: 700; }
.timeline__note { color: var(--muted); font-size: 15px; }

.skills {
  display: grid;
  gap: 22px;
  padding: 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--shadow);
}
.skills h3 {
  margin-bottom: 10px;
  font: 700 12.5px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  padding: clamp(32px, 6vw, 72px);
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 10px 10px 0 var(--shadow);
  overflow: hidden;
}
.contact::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: .25;
  box-shadow: 0 0 0 30px transparent, 0 0 0 32px currentColor;
  pointer-events: none;
}
.contact h2 {
  margin: 16px 0 14px;
  font: 800 clamp(40px, 6vw, 76px)/.98 var(--font-display);
  letter-spacing: -.035em;
  max-width: 12em;
}
.contact__lead { font-size: 19px; max-width: 30em; opacity: .92; margin-bottom: 28px; }
.contact__email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.contact__address {
  font: 800 clamp(22px, 3.2vw, 36px)/1.1 var(--font-display);
  letter-spacing: -.02em;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  word-break: break-all;
}
.contact__address:hover { text-decoration-style: wavy; }
.btn--light { background: #FFFBF5; color: #1B1814; border-color: #1B1814; --btn-shadow: #1B1814; }

.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background-color .15s, color .15s;
}
.socials a:hover { background: #FFFBF5; color: #1B1814; border-color: #1B1814; }
.socials svg { width: 18px; height: 18px; }

/* ---------- Footer ---------- */
.footer { padding: 28px 0 40px; color: var(--muted); font-size: 14.5px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; }
.footer a { text-decoration: none; font-weight: 600; color: var(--ink-2); }
.footer a:hover { color: var(--accent); }
.kbd { font: 500 12.5px/1 var(--font-mono); padding: 4px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }

/* ---------- Modal ---------- */
.modal {
  width: min(1000px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 10px 10px 0 var(--shadow);
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in .28s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.modal::backdrop { background: rgb(18 14 10 / .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 22px;
  border-bottom: 2px solid var(--line);
  background: var(--surface);
}
.modal__crumb {
  font: 700 12.5px/1.2 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal__nav { display: flex; gap: 8px; }
.modal__nav .icon-btn { width: 38px; height: 38px; }
.modal__body { overflow-y: auto; overscroll-behavior: contain; padding: 28px clamp(20px, 4vw, 44px) 40px; }

.p-head { margin-bottom: 22px; }
.p-head .badge { position: static; box-shadow: none; margin-bottom: 14px; }
.p-title { font: 800 clamp(34px, 5vw, 56px)/1 var(--font-display); letter-spacing: -.035em; }
.p-summary { margin-top: 12px; font-size: 19px; color: var(--ink-2); max-width: 38em; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #000;
  overflow: hidden;
  margin-bottom: 28px;
}
.video iframe, .video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, transparent 50%, rgb(0 0 0 / .45));
  cursor: pointer;
}
.video__play span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 18px;
  border: 2px solid #1B1814;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 700 16px/1 var(--font-body);
  box-shadow: 4px 4px 0 #1B1814;
  transition: transform .15s;
}
.video__play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.video__play:hover span { transform: scale(1.06); }
.video--still img { image-rendering: pixelated; }

.p-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  margin-bottom: 30px;
  border: 2px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.p-meta div { padding: 14px 16px; border-right: 2px solid var(--line); margin-right: -2px; }
.p-meta dt { font: 700 11.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.p-meta dd { font-weight: 600; font-size: 15.5px; line-height: 1.35; }

.p-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; }
.p-cols--single { grid-template-columns: minmax(0, 1fr); max-width: 44em; }
.p-section h3 {
  margin-bottom: 12px;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.p-section p { color: var(--ink-2); margin-bottom: 14px; }
.p-section p a { color: var(--accent); font-weight: 600; }
.p-list li {
  position: relative;
  padding: 0 0 10px 26px;
  color: var(--ink-2);
  line-height: 1.5;
}
.p-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .5em;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 3px;
  background: var(--sun);
  transform: rotate(45deg);
}

.p-award {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 8px 0 24px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--gold-soft);
  font-weight: 600;
}
.p-award svg { width: 26px; height: 26px; color: var(--ink); }

.p-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 8px; }
.p-links svg { width: 18px; height: 18px; }
.p-links .fill { fill: currentColor; stroke: none; }

.p-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  margin-top: 30px;
}
.p-gallery a {
  display: block;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
}
.p-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.p-gallery a:hover img { transform: scale(1.04); }
.p-gallery img.pixel-img { image-rendering: pixelated; }

.p-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
}
.p-foot a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
  text-decoration: none;
}
.p-foot a:last-child { text-align: right; margin-left: auto; }
.p-foot small { font: 700 11.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.p-foot span { font: 800 20px/1.15 var(--font-display); letter-spacing: -.01em; }
.p-foot a:hover span { color: var(--accent); }


/* ---------- Toast & cheat ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--accent);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), opacity .2s;
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  border: 2px solid #1B1814;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .rift__grid, .about { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 2px solid var(--line); }
  .p-cols { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; --nav-h: 60px; }
  body { font-size: 16.5px; }
  .brand__name, .nav__rift { display: none; }
  .nav__links a { padding: 8px 9px; font-size: 15px; }
  .hero { padding-top: 36px; }
  .pill { font-size: 13.5px; padding: 7px 12px 7px 10px; gap: 8px; }
  .stats { margin-top: 48px; }
  .stats div { padding-right: 12px; }
  .stats div + div { padding-left: 14px; }
  .stats dd { font-size: 14px; }
  .rift { padding: 64px 0; margin-top: 48px; }
  .rift__thumbs { gap: 8px; }
  .rift__thumbs span { font-size: 10px; padding: 6px 7px; }
  .section { padding: 72px 0; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 8px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; }
  .grid { gap: 24px; }
  .timeline li { grid-template-columns: 72px 1fr; }
  .modal {
    width: 100vw;
    max-height: none;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .p-meta div { border-right: 0; border-bottom: 2px solid var(--line); margin: 0 0 -2px; }
  .p-foot span { font-size: 17px; }
  .footer__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
