/* ompawar.com
   Editorial, not dashboard. The page commits to one idea: very large condensed
   type against quiet graphite, with thin rules doing the structural work that
   bordered cards used to. Colour stays out of the way so the photographs and
   the name carry the page.

   Type: Archivo, run condensed and heavy for display, normal width for
   sentences. Geist for reading, Geist Mono for labels. */

:root {
  --void:    #060708;
  --base:    #0b0c0e;
  --raised:  #131417;
  --raised2: #1a1b1f;

  --line:    rgba(255, 255, 255, 0.09);
  --line-2:  rgba(255, 255, 255, 0.2);

  --text:   #ecebe7;
  --muted:  #a3a29d;
  --faint:  #7f7f7b;

  --accent:  #b9cde2;
  --accent-2:#6f93b8;
  --live:    #7bd88f;
  --paper:   #f2f2ef;

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body:    "Geist", system-ui, -apple-system, sans-serif;
  --mono:    "Geist Mono", ui-monospace, "SFMono-Regular", monospace;

  --gut: clamp(1.1rem, 3vw, 2.5rem);
  --sec: clamp(5rem, 11vw, 10rem);
  --max: 1440px;
  --rail: 14rem;

  --r-card: 10px;
  --r-ctrl: 8px;
  --r-chip: 6px;
  --r-img: 6px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { background: var(--base); -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; overflow-x: clip; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
html:focus-within { scroll-behavior: smooth; }

body {
  margin: 0; background: var(--base); color: var(--text);
  font-family: var(--body); font-size: 1rem; line-height: 1.6;
  font-synthesis-weight: none; -webkit-font-smoothing: antialiased;
  position: relative;
}

img, svg, video { max-width: 100%; display: block; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--void); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.k {
  display: block; font: 400 0.6875rem/1.4 var(--mono); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
}

.skip {
  position: absolute; left: -9999px; z-index: 200;
  background: var(--accent); color: var(--void);
  padding: 0.8rem 1.1rem; border-radius: var(--r-ctrl); font: 500 0.875rem var(--body);
}
.skip:focus { left: var(--gut); top: 0.8rem; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; }

/* ============================================================ atmosphere == */

.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.06; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/>\
<feColorMatrix type='saturate' values='0'/></filter>\
<rect width='220' height='220' filter='url(%23n)'/></svg>");
  animation: grain 7s steps(6) infinite;
}
@keyframes grain {
  0%   { background-position:   0px   0px; }
  20%  { background-position: -13px   9px; }
  40%  { background-position:   9px -11px; }
  60%  { background-position:  -7px  -6px; }
  80%  { background-position:  11px   7px; }
  100% { background-position:   0px   0px; }
}

.progress {
  position: fixed; left: 0; top: 0; right: 0; height: 2px; z-index: 60; pointer-events: none;
  background: var(--text); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

main, header, footer { position: relative; z-index: 2; }

/* ================================================================== nav === */

.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background 0.4s var(--ease); }
.nav[data-stuck="true"] {
  background: rgba(11, 12, 14, 0.72);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.nav__in {
  max-width: var(--max); margin-inline: auto; padding: 1.1rem var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.nav__mark {
  font: 800 1.05rem/1 var(--display); font-stretch: 62%; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--text); text-decoration: none;
}
.nav__links { display: flex; gap: clamp(1rem, 2.4vw, 2.1rem); }
.nav__links a {
  position: relative; color: var(--muted); text-decoration: none;
  font: 400 0.8125rem/1 var(--body); padding-block: 0.35rem; transition: color 0.3s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.45s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a[data-active="true"] { color: var(--text); }
.nav__links a[data-active="true"]::after { transform: scaleX(1); }
@media (max-width: 760px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .nav__links a.nav__cta { color: var(--text); }
}

/* ============================================================ links ======= */

.arrow {
  position: relative; display: inline-flex; align-items: baseline; gap: 0.35em;
  color: var(--text); text-decoration: none; font: 400 0.9rem/1.3 var(--body);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.3s var(--ease);
  padding-bottom: 2px;
}
.arrow::after {
  content: "\2197"; font-size: 0.85em; color: var(--faint);
  transition: transform 0.45s var(--ease), color 0.3s var(--ease);
}
.arrow--up::after { content: "\2191"; }
.arrow:hover { background-size: 100% 1px; }
.arrow:hover::after { transform: translate(2px, -2px); color: var(--text); }
.arrow--up:hover::after { transform: translateY(-3px); }

/* ================================================================= hero === */

.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr);
  max-width: var(--max); margin-inline: auto;
  padding: clamp(4.5rem, 9vh, 5.5rem) var(--gut) 0;
}

.hero__meta {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem;
  border-top: 1px solid var(--line); padding-top: 0.9rem;
}
.hero__meta > div { display: grid; gap: 0.3rem; align-content: start; }
.hero__meta > div > span:last-child { font-size: 0.875rem; line-height: 1.4; color: var(--muted); max-width: 24ch; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.5rem;
  background: var(--live); vertical-align: 0.05em;
  box-shadow: 0 0 0 0 rgba(123, 216, 143, 0.5); animation: live 2.4s ease-out infinite;
}
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(123, 216, 143, 0.45); } 100% { box-shadow: 0 0 0 9px rgba(123, 216, 143, 0); } }

@media (min-width: 1100px) {
  .hero { height: 100svh; min-height: 680px; }
  .hero__stage { min-height: 0; }
}
.hero__stage {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 2rem); align-items: end;
}

.hero__lede { position: relative; z-index: 3; display: grid; gap: 1.1rem; max-width: 22rem; padding-bottom: clamp(1rem, 2.5vh, 2rem); }
.hero__title {
  font: 500 clamp(1.55rem, 2.25vw, 2.2rem)/1.06 var(--display);
  letter-spacing: -0.03em; color: var(--text); text-wrap: balance;
}
.hero__sub { font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
.hero__links { display: flex; flex-wrap: wrap; gap: 0.45rem 1.2rem; }
.hero__links .arrow { font-size: 0.84rem; }

/* The portrait stands behind the name: its shoulders run under the letters, so
   the name reads as set in front of a person rather than beside a picture. */
.hero__portrait {
  position: relative; z-index: 1; justify-self: center; align-self: end;
  height: min(calc(100% + var(--name-fs, 22vw) * 0.5), 54vw); aspect-ratio: 900 / 879; width: auto;
  margin-bottom: calc(var(--name-fs, 22vw) * -0.5);
  cursor: pointer; perspective: 1000px; -webkit-tap-highlight-color: transparent;
}
.hero__portrait::before {
  content: ""; position: absolute; inset: -8% -14% 10%; z-index: -1;
  background: radial-gradient(ellipse 48% 46% at 50% 42%,
              rgba(185, 205, 226, 0.12) 0%, rgba(185, 205, 226, 0.035) 50%, transparent 72%);
}
.hero__photo, .hero__gl {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transition: opacity 0.7s var(--ease);
  transform: rotateX(var(--tilt, 0deg)) translateY(var(--lift, 0px));
  transform-origin: 50% 60%;
}
.hero__photo { object-fit: contain; opacity: 1; }
.hero__gl { opacity: 0; }
.hero__portrait[data-mode="model"] .hero__photo { opacity: 0; }
.hero__portrait[data-mode="model"] .hero__gl { opacity: 1; }
.hero__portrait[data-mode="loading"] { cursor: progress; }

.hero__hint {
  position: absolute; left: 50%; top: 4%; translate: -50% 0;
  font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap;
  opacity: 0; transition: opacity 0.45s var(--ease), color 0.45s var(--ease);
}
.hero__portrait:focus-visible .hero__hint { opacity: 1; color: var(--accent); }
.hero__portrait[data-mode="loading"] .hero__hint { opacity: 1; }
.hero__portrait[data-mode="model"] .hero__hint { opacity: 0; }
@media (hover: none) { .hero__hint { opacity: 1; } }

.certstrip {
  position: relative; z-index: 3; justify-self: end;
  display: grid; gap: 1rem; justify-items: end;
  padding-bottom: clamp(1rem, 2.5vh, 2rem);
}
.certstrip__label { font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.certstrip__row { display: flex; align-items: center; gap: clamp(1.1rem, 2vw, 1.9rem); list-style: none; margin: 0; padding: 0; }
.certstrip__row img { width: auto; height: clamp(24px, 2.2vw, 30px); opacity: 0.72; transition: opacity 0.4s var(--ease); }
.certstrip__row li:nth-child(2) img { height: clamp(34px, 3.2vw, 44px); }
.certstrip__row li:nth-child(3) img { height: clamp(26px, 2.4vw, 32px); }
.certstrip:hover .certstrip__row img { opacity: 0.95; }

.hero__name {
  position: relative; z-index: 2; pointer-events: none;
  margin: 0 calc(var(--gut) * -1); padding: 0 var(--gut) clamp(0.4rem, 1.2vw, 1.1rem);
  font-family: var(--display); font-weight: 800; font-stretch: 62%;
  font-size: var(--name-fs, 22vw); line-height: 0.8; letter-spacing: -0.005em;
  text-transform: uppercase; white-space: nowrap; color: var(--text);
}
.hero__fit { display: inline-block; }
.hero__name .ch { display: inline-block; animation: rise 1.25s var(--ease) both; }
.hero__name .ch:nth-child(1) { animation-delay: 0.05s; }
.hero__name .ch:nth-child(2) { animation-delay: 0.1s; }
.hero__name .ch:nth-child(3) { animation-delay: 0.2s; }
.hero__name .ch:nth-child(4) { animation-delay: 0.25s; }
.hero__name .ch:nth-child(5) { animation-delay: 0.3s; }
.hero__name .ch:nth-child(6) { animation-delay: 0.35s; }
.hero__name .ch:nth-child(7) { animation-delay: 0.4s; }
@keyframes rise { from { transform: translateY(45%); opacity: 0; } }

.hero__photo { animation: fadeUp 1.4s 0.15s var(--ease) both; }
.hero__meta, .hero__lede, .certstrip { animation: fade 1.2s 0.55s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade { from { opacity: 0; } }

/* Narrow screens: the three-column stage cannot fit a head between two text
   columns, so the stage dissolves into the hero grid and everything stacks. */
@media (max-width: 1099px) {
  .hero { grid-template-rows: none; min-height: 0; }
  .hero__stage { display: contents; }
  .hero__meta { order: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
  .hero__portrait { order: 2; height: auto; width: min(92vw, 520px, 62svh); margin-top: 1.5rem; }
  .hero__name { order: 3; }
  .hero__lede { order: 4; max-width: 34rem; padding-top: 2rem; }
  .certstrip { order: 5; justify-self: start; justify-items: start; padding-block: 1.5rem 0; }
}
@media (max-width: 520px) {
  .hero__meta > div:nth-child(1), .hero__meta > div:nth-child(3) { display: none; }
}

/* ============================================================ sections ==== */

section { padding-block: var(--sec); position: relative; }
section + section { padding-top: calc(var(--sec) * 0.55); }

.sec-head { display: grid; gap: 1rem; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.sec-head--row { display: flex; align-items: end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.sec-head--row > div { display: grid; gap: 1rem; }
.idx {
  font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
  display: flex; align-items: center; gap: 0.75rem;
}
.idx::after { content: ""; height: 1px; width: 3rem; background: var(--line-2); }

.h-display {
  font-family: var(--display); font-weight: 800; font-stretch: 62%;
  font-size: clamp(4.25rem, 15.5vw, 15rem); line-height: 0.8; letter-spacing: -0.005em;
  text-transform: uppercase;
}
.h-sentence {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2.1rem, 5.4vw, 5rem); line-height: 1; letter-spacing: -0.04em;
  max-width: 17ch; text-wrap: balance;
}
.drag-note { font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }

/* ================================================================ media === */

.shot { position: relative; overflow: hidden; background: var(--void); border-radius: var(--r-img); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.shot:hover img { transform: scale(1.03); }
.shot--fit { background: var(--paper); }
.shot--fit img { object-fit: contain; }

.plate { background: var(--paper); border-radius: var(--r-img); padding: 0.7rem; }
.plate img { width: 100%; max-height: 340px; object-fit: contain; margin-inline: auto; border-radius: 3px; }

.cap { font: 400 0.6875rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

.shot--video { position: relative; display: block; cursor: pointer; }
.shot--video::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 7, 8, 0) 40%, rgba(6, 7, 8, 0.5) 100%);
  opacity: 0.7; transition: opacity 0.4s var(--ease);
}
.shot--video:hover::after { opacity: 0.3; }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 1;
  width: 64px; height: 64px; border-radius: 999px;
  background: rgba(236, 235, 231, 0.94); display: grid; place-items: center;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
  transition: transform 0.45s var(--ease);
}
.shot--video:hover .play { transform: scale(1.1); }
.play > span {
  width: 0; height: 0; margin-left: 4px;
  border-left: 15px solid var(--void); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}

.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.bullets li { position: relative; padding-left: 1.25rem; color: var(--muted); font-size: 0.92rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--faint); }

.stack { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; row-gap: 0.2rem; }
.stack li { font: 400 0.75rem/1.5 var(--mono); color: var(--muted); }
.stack li + li::before { content: "/"; color: var(--line-2); margin-inline: 0.55rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; align-items: baseline; }
.links .faint { font-size: 0.9rem; }

.figs { display: grid; grid-template-columns: repeat(2, max-content); gap: 1.25rem 3.5rem; margin: 0; padding: 0; }
.figs--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; }
#studying { padding-top: clamp(2rem, 4vw, 3.5rem); }
#contact .sec-head .muted { font-size: 1rem; }
.figs div { display: grid; gap: 0.35rem; }
.figs dt { font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.figs dd {
  margin: 0; font-family: var(--display); font-weight: 700; font-stretch: 75%;
  font-size: clamp(1.9rem, 3.2vw, 2.75rem); line-height: 1; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ================================================================ about === */

.about { display: grid; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
@media (min-width: 900px) { .about { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); } }
.about__pic { margin: 0; border-radius: var(--r-img); overflow: hidden; max-width: 420px; }
.about__pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__text { display: grid; gap: 1.4rem; max-width: 46rem; }
.about__text .muted { max-width: 38rem; }
.big { font-size: clamp(1.3rem, 2.15vw, 1.9rem); line-height: 1.32; letter-spacing: -0.018em; color: var(--text); }
.about .figs { margin-top: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ================================================================== uni === */

.uni { display: grid; gap: clamp(1.25rem, 3vw, 3rem); align-items: end; border-top: 1px solid var(--line); padding-top: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 800px) { .uni { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); } }
.uni__img { border-radius: var(--r-img); overflow: hidden; }
.uni__img img { width: 100%; aspect-ratio: 21 / 10; object-fit: cover; }
.uni__text { display: grid; gap: 0.75rem; }
.uni h3 { font: 600 clamp(1.6rem, 3vw, 2.6rem)/1.02 var(--display); letter-spacing: -0.035em; }

/* ============================================================ experience == */

.xp {
  display: grid; gap: 1.5rem 2.5rem;
  border-top: 1px solid var(--line); padding-block: clamp(2rem, 4vw, 3.25rem);
}
.xp:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 1000px) {
  .xp { grid-template-columns: var(--rail) minmax(0, 1fr) minmax(0, 0.82fr); }
  .xp__media { position: sticky; top: 6rem; }
}
.xp__when { display: grid; gap: 0.3rem; align-content: start; font: 400 0.78rem/1.45 var(--mono); color: var(--muted); }
.xp__n {
  font-family: var(--display); font-weight: 800; font-stretch: 62%;
  font-size: 2.75rem; line-height: 1; color: var(--faint); margin-bottom: 0.5rem;
}
.xp__main { display: grid; gap: 1.1rem; align-content: start; max-width: 40rem; }
.xp h3 { font: 600 clamp(1.7rem, 2.9vw, 2.6rem)/1.02 var(--display); letter-spacing: -0.035em; }
.xp__org {
  display: flex; align-items: center; gap: 0.6rem; margin-top: -0.35rem;
  font: 400 0.75rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.xp__org img { height: 22px; width: auto; border-radius: 3px; }
.xp__media { display: grid; gap: 0.7rem; align-content: start; }
.xp__media .shot--video { aspect-ratio: 16 / 9; background: var(--paper); }
.xp__media .shot--video img { object-fit: contain; }
.xp:hover .xp__n { color: var(--text); transition: color 0.4s var(--ease); }
@media (max-width: 999px) {
  .xp__when { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; align-items: baseline; }
  .xp__n { font-size: 2rem; margin: 0 0.25rem 0 0; }
}

/* ============================================================== projects == */

.proj { border-top: 1px solid var(--line); padding-block: clamp(1.75rem, 3.5vw, 3rem) clamp(2.5rem, 5vw, 4.5rem); }
.proj:last-child { border-bottom: 1px solid var(--line); }
.proj__head { display: grid; gap: 0.5rem 2.5rem; align-items: baseline; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 1000px) { .proj__head { grid-template-columns: var(--rail) minmax(0, 1fr) auto; } }
.proj h3 {
  font-family: var(--display); font-weight: 800; font-stretch: 62%;
  font-size: clamp(2.9rem, 8vw, 7.5rem); line-height: 0.86; letter-spacing: -0.003em;
  text-transform: uppercase; transition: transform 0.7s var(--ease);
}
.proj:hover h3 { transform: translateX(0.6rem); }
.proj__kind { font: 400 0.72rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); max-width: 26ch; }
@media (min-width: 1000px) { .proj__kind { text-align: right; } }
.proj__body { display: grid; gap: 1.75rem 2.5rem; align-items: start; }
@media (min-width: 1000px) {
  .proj__body { grid-template-columns: var(--rail) minmax(0, 1fr) minmax(0, 0.82fr); }
  .proj__body > .shot { grid-column: 2; }
}
.proj__body > .shot { aspect-ratio: 16 / 10; }
.proj__body > .shot--fit { aspect-ratio: auto; }
.proj__body > .shot--fit img { height: auto; }
.proj__head .xp__n { margin: 0; }
.proj__text { display: grid; gap: 1.15rem; align-content: start; }
.proj__text > p:first-child { font-size: 1.05rem; line-height: 1.55; }
.proj .figs { padding-block: 1.1rem; border-block: 1px solid var(--line); }

/* ============================================================== gallery === */

.gallery {
  display: flex; gap: clamp(1rem, 2vw, 1.75rem); overflow-x: auto; scroll-snap-type: x mandatory;
  padding-inline: max(var(--gut), calc((100vw - var(--max)) / 2 + var(--gut)));
  scroll-padding-inline: max(var(--gut), calc((100vw - var(--max)) / 2 + var(--gut)));
  padding-bottom: 1rem; cursor: grab;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.gallery[data-drag="true"] { cursor: grabbing; scroll-snap-type: none; }
.gallery::-webkit-scrollbar { height: 3px; }
.gallery::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }
.gallery img { pointer-events: none; }

.tile { flex: 0 0 clamp(16.5rem, 25vw, 22rem); scroll-snap-align: start; display: grid; gap: 0.65rem; align-content: start; }
.tile__media {
  display: block; aspect-ratio: 4 / 3; border-radius: var(--r-img); overflow: hidden;
  background: var(--raised); margin-bottom: 0.4rem;
}
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.tile__media--doc { background: var(--paper); padding: 0.6rem; }
.tile__media--doc img { object-fit: contain; }
.tile:hover .tile__media img { transform: scale(1.04); }
.tile h4 { font: 500 1.05rem/1.3 var(--body); letter-spacing: -0.01em; }
.tile p { font-size: 0.875rem; line-height: 1.55; }
.tile .shot--video .play { width: 50px; height: 50px; }
.tile .shot--video .play > span { border-left-width: 12px; border-top-width: 7px; border-bottom-width: 7px; }

/* =============================================================== ledger === */

.ledger { display: grid; }
.ledger__head, .ledger__row {
  display: grid; gap: 0.35rem 2.5rem; align-items: baseline;
  grid-template-columns: minmax(0, 1fr) auto;
}
@media (min-width: 800px) {
  .ledger__head, .ledger__row { grid-template-columns: var(--rail) minmax(0, 1fr) 7rem; }
}
.ledger__head { padding-bottom: 0.8rem; font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.ledger__head span:last-child { text-align: right; }
@media (max-width: 799px) { .ledger__head { display: none; } .ledger__by { grid-column: 1 / -1; } }
.ledger__row {
  position: relative; padding-block: 1.25rem; border-top: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.ledger__row:last-child { border-bottom: 1px solid var(--line); }
.ledger__by { font: 400 0.72rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ledger__name { font-size: clamp(1.05rem, 1.7vw, 1.4rem); line-height: 1.3; letter-spacing: -0.015em; transition: transform 0.55s var(--ease); }
.ledger__name small { display: block; margin-top: 0.35rem; font-size: 0.85rem; letter-spacing: 0; color: var(--muted); }
.ledger__state { font: 400 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); text-align: right; white-space: nowrap; }
a.ledger__row .ledger__state::after { content: " \2197"; }
.ledger__state.is-done { color: var(--faint); }
a.ledger__row::before {
  content: ""; position: absolute; inset: 0 calc(var(--gut) * -0.5); z-index: -1;
  background: var(--raised); opacity: 0; transition: opacity 0.4s var(--ease);
}
a.ledger__row:hover::before { opacity: 1; }
a.ledger__row:hover .ledger__name { transform: translateX(0.5rem); }

/* =============================================================== skills === */

.skills__row { display: grid; gap: 0.6rem 2.5rem; padding-block: 1.5rem; border-top: 1px solid var(--line); align-items: baseline; }
.skills__row:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 800px) { .skills__row { grid-template-columns: var(--rail) minmax(0, 1fr); } }
.skills__row p { font-size: clamp(1.1rem, 1.9vw, 1.55rem); line-height: 1.4; letter-spacing: -0.015em; max-width: 52rem; }

/* ============================================================== contact === */

#contact { padding-bottom: clamp(4rem, 8vw, 7rem); }
.contact__mail {
  display: inline-block; color: var(--text); text-decoration: none;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.7rem, 7.2vw, 7rem); line-height: 1.05; letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.7s var(--ease), color 0.3s var(--ease);
  padding-bottom: 0.08em;
}
.contact__mail:hover { background-size: 100% 2px; }
.contact__rest { display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; margin-top: 2.5rem; }

footer { border-top: 1px solid var(--line); padding-block: 1.75rem 2.25rem; }
.foot {
  display: flex; flex-wrap: wrap; gap: 0.9rem 2rem; align-items: center; justify-content: space-between;
  font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
.foot .arrow { font: inherit; color: var(--muted); }
button.cmdk-hint { letter-spacing: inherit; text-transform: inherit; }

/* =============================================================== motion === */

.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js [data-wipe] { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease); }
.js [data-wipe].is-in { clip-path: inset(0 0 0 0); }

/* headings rise out of a mask */
.js .sec-head h2 { overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js .sec-head h2 > span { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.js .sec-head.is-in h2 > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0ms !important; transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js [data-wipe] { clip-path: none; }
  .js .sec-head h2 > span { transform: none; }
  .grain, .cursor { display: none; }
}

/* ============================================================ command palette */

.cmdk { position: fixed; inset: 0; z-index: 120; display: grid; place-items: start center; }
.cmdk[hidden] { display: none; }
.cmdk__scrim {
  position: absolute; inset: 0;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: cmdkFade 0.25s var(--ease);
}
.cmdk__panel {
  position: relative; margin-top: min(16vh, 140px);
  width: min(560px, calc(100vw - 2rem));
  background: linear-gradient(180deg, var(--raised2), var(--raised));
  border: 1px solid var(--line-2); border-radius: var(--r-card);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  animation: cmdkRise 0.32s var(--ease);
}
@keyframes cmdkFade { from { opacity: 0; } }
@keyframes cmdkRise { from { opacity: 0; transform: translateY(-10px) scale(0.985); } }

.cmdk__input {
  width: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 400 1rem/1 var(--body);
  padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line);
}
.cmdk__input::placeholder { color: var(--faint); }

.cmdk__list { list-style: none; margin: 0; padding: 0.4rem; max-height: 46vh; overflow-y: auto; }
.cmdk__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.85rem; border-radius: var(--r-ctrl);
  font: 400 0.92rem/1.2 var(--body); color: var(--muted); cursor: pointer;
}
.cmdk__list li[aria-selected="true"] { background: rgba(169, 199, 232, 0.12); color: var(--text); }
.cmdk__hint { font: 400 0.72rem/1 var(--mono); color: var(--faint); white-space: nowrap; }
.cmdk__empty { color: var(--faint); cursor: default; }

.cmdk__foot {
  display: flex; gap: 1.25rem; padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--line);
  font: 400 0.7rem/1 var(--mono); color: var(--faint); letter-spacing: 0.08em;
}

/* the hint that the palette exists at all */
.kbd {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border: 1px solid var(--line-2); border-radius: 6px;
  padding: 0.2rem 0.45rem; margin-inline: 0.15rem;
  font: 400 0.7rem/1 var(--mono); color: var(--muted);
}
button.cmdk-hint {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; display: inline-flex; align-items: center;
}
button.cmdk-hint:hover .kbd { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------------ toast - */
.toast {
  position: fixed; left: 50%; bottom: 2.5rem; translate: -50% 0; z-index: 130;
  background: var(--raised2); border: 1px solid var(--line-2);
  border-radius: var(--r-ctrl); padding: 0.75rem 1.1rem;
  font: 400 0.85rem/1 var(--body); color: var(--text);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .cmdk__scrim, .cmdk__panel { animation: none; }
}

/* ================================================== credential verify card == */

.certstrip__mark {
  background: none; border: 0; padding: 0; cursor: pointer; display: block;
  border-radius: 6px;
}
.certstrip__mark:hover img { opacity: 1; }

.vfy {
  position: absolute; z-index: 110; width: min(300px, calc(100vw - 24px));
  display: grid; gap: 0.35rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, var(--raised2), var(--raised));
  border: 1px solid var(--line-2); border-radius: var(--r-card);
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.85);
  animation: vfyIn 0.28s var(--ease);
}
.vfy[hidden] { display: none; }
@keyframes vfyIn { from { opacity: 0; transform: translateY(-6px); } }
.vfy__by { font: 400 0.66rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.vfy__name { font: 400 0.95rem/1.3 var(--body); color: var(--text); }
.vfy__link { font: 400 0.8rem/1 var(--body); color: var(--accent); text-decoration: none; margin-top: 0.2rem; }
.vfy__link:hover { text-decoration: underline; }

/* ==================================================================== confetti */

.confetti { position: fixed; z-index: 140; pointer-events: none; }
.confetti i {
  position: absolute; display: block; border-radius: 1px;
  animation: pop 1.25s var(--delay, 0ms) cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}
@keyframes pop {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 190px)) rotate(var(--rot)); opacity: 0; }
}

/* ======================================================================= x-ray */
/* Outline every box. Nothing moves, so it stays readable while it is on. */

html.xray body * { outline: 1px solid rgba(169, 199, 232, 0.32) !important; }
html.xray .grain, html.xray .aura { display: none; }
html.xray body { background-image: linear-gradient(rgba(169,199,232,0.05) 1px, transparent 1px),
                                    linear-gradient(90deg, rgba(169,199,232,0.05) 1px, transparent 1px);
                 background-size: 48px 48px; }

/* ============================================================ small reactions */

.contact__mail.is-pinged { animation: ping 2.4s var(--ease); }
@keyframes ping {
  0%, 100% { color: var(--text); }
  12%      { color: var(--accent); }
  50%      { color: var(--accent); }
}

.hero__portrait.is-nudging .hero__hint { opacity: 1; color: var(--accent); }
.hero__portrait.is-nudging::after {
  content: ""; position: absolute; inset: -3%; border-radius: 50%;
  border: 1px solid rgba(169, 199, 232, 0.28);
  animation: nudge 2.6s var(--ease) infinite;
  pointer-events: none;
}
@keyframes nudge {
  0%   { transform: scale(0.94); opacity: 0; }
  35%  { opacity: 0.75; }
  100% { transform: scale(1.06); opacity: 0; }
}

.figs div:hover dd { color: var(--accent); transition: color 0.3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .confetti, .hero__portrait.is-nudging::after { display: none; }
  .contact__mail.is-pinged { animation: none; color: var(--accent); }
}

/* ================================================================= play === */
/* Everything on the page that exists for fun: the heart that follows the
   cursor, the like button that looks back at you, the lights and the sound. */

:root {
  --heart: #ff3b4f;
  --heart-img: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23ff3b4f' d='M12 20.6s-7.4-4.5-9.6-9.1C.9 8.1 2.9 3.9 6.7 3.9c2.2 0 3.7 1.2 5.3 3.3 1.6-2.1 3.1-3.3 5.3-3.3 3.8 0 5.8 4.2 4.3 7.6-2.2 4.6-9.6 9.1-9.6 9.1z'/></svg>");
}
::selection { background: var(--heart); color: #fff; }

/* ------------------------------------------------------------ heart cursor */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none;
  width: 0; height: 0; opacity: 0; transition: opacity 0.3s var(--ease); will-change: transform;
}
.cursor.is-on { opacity: 1; }
.cursor__heart {
  position: absolute; left: 12px; top: 14px; width: 20px; height: 20px;
  color: var(--heart); rotate: var(--tilt, 0deg);
  filter: drop-shadow(0 4px 10px rgba(255, 59, 79, 0.35));
  transition: scale 0.45s var(--ease);
}
.cursor__heart svg { width: 100%; height: 100%; display: block; transform-origin: 50% 60%; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.18); }
  24% { transform: scale(0.96); }
  36% { transform: scale(1.1); }
  50% { transform: scale(1); }
}
.cursor.is-link .cursor__heart { scale: 1.45; }
.cursor.is-link .cursor__heart svg { animation-duration: 0.8s; }
.cursor.is-hot .cursor__heart { scale: 2.8; transition: scale 0.3s ease-out; }
.cursor.is-hot .cursor__heart svg { animation-duration: 0.3s; }
.cursor.is-dizzy .cursor__heart { animation: dizzy 1.4s var(--ease); }
@keyframes dizzy { 0% { rotate: 0deg; } 75%, 100% { rotate: 1080deg; } }
.cursor__label {
  position: absolute; left: 40px; top: 13px; padding: 0.42rem 0.6rem 0.38rem;
  background: var(--text); color: var(--base); border-radius: 999px;
  font: 500 0.625rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translateX(-6px) scale(0.9); transform-origin: 0 50%;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
}
.cursor.has-label .cursor__label { opacity: 1; transform: none; }
@media (hover: none) { .cursor { display: none; } }

/* ----------------------------------------------------------- flying hearts */
.spark {
  position: fixed; z-index: 149; pointer-events: none;
  width: var(--s, 10px); height: var(--s, 10px);
  margin: calc(var(--s, 10px) / -2) 0 0 calc(var(--s, 10px) / -2);
  border-radius: 50%; background: var(--text); width: calc(var(--s, 10px) * 0.55); height: calc(var(--s, 10px) * 0.55);
  animation: spark var(--d, 0.9s) cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(0.4) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, -60px)) scale(1) rotate(var(--r, 0deg)); opacity: 0; }
}
.spark--trail { animation: trail 0.9s ease-out forwards; }
.spark--heart { border-radius: 0; width: var(--s, 10px); height: var(--s, 10px); background: var(--heart-img) center / contain no-repeat; }
@keyframes trail { 0% { transform: scale(1); opacity: 0.85; } 100% { transform: translateY(-14px) scale(0.3); opacity: 0; } }

.rain { position: fixed; inset: 0; z-index: 148; pointer-events: none; overflow: hidden; }
.rain i {
  position: absolute; top: -40px; width: var(--s); height: var(--s);
  background: var(--heart-img) center / contain no-repeat;
  animation: fall var(--d) var(--delay) linear forwards;
}
@keyframes fall { to { transform: translate(var(--sway), calc(100vh + 80px)) rotate(var(--r)); } }

.plus {
  position: fixed; z-index: 149; pointer-events: none; translate: -50% -50%;
  font: 700 1rem/1 var(--mono); color: var(--heart); animation: plus 0.9s var(--ease) forwards;
}
@keyframes plus { to { transform: translateY(-46px); opacity: 0; } }

/* ------------------------------------------------ the name reacts to you */
.hero__name .ch { pointer-events: auto; cursor: pointer; transition: translate 0.5s var(--ease), color 0.4s var(--ease); }
.hero__name .ch:hover { translate: 0 -4%; color: var(--heart); }

/* ----------------------------------------------------------------- marquee */
.marquee {
  position: relative; z-index: 2; overflow: hidden;
  border-block: 1px solid var(--line); padding-block: clamp(0.9rem, 1.6vw, 1.3rem);
}
.marquee__track { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 2.75rem); width: max-content; will-change: transform; }
.marquee__track span {
  font-family: var(--display); font-weight: 800; font-stretch: 62%; text-transform: uppercase;
  font-size: clamp(1.6rem, 3.4vw, 3rem); line-height: 1; color: var(--text); white-space: nowrap;
}
.marquee__track span:nth-child(4n+3) { color: transparent; -webkit-text-stroke: 1px var(--muted); }
.marquee__track i { flex: none; width: 6px; aspect-ratio: 1; border-radius: 50%; background: var(--faint); opacity: 0.7; }

/* -------------------------------------------------------------- nav tools */
.nav__links { align-items: center; }
.nav__tools { display: flex; gap: 0.45rem; margin-left: 0.4rem; }
.tool {
  width: 32px; height: 32px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.4s var(--ease);
}
.tool:hover { color: var(--text); border-color: var(--text); }
.tool:active { transform: scale(0.88); }
.tool svg { width: 15px; height: 15px; }
.tool[data-lights] svg { transition: rotate 0.6s var(--ease); }
:root[data-theme="light"] .tool[data-lights] svg { rotate: 180deg; }
.tool[data-on="true"] .tool__mute, .tool:not([data-on="true"]) .tool__waves { display: none; }
.tool[data-on="true"] { color: var(--heart); border-color: var(--heart); }

/* ---------------------------------------------------------------- contact */
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.copy {
  font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); background: none; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 0.65rem 0.95rem; cursor: pointer; transition: color 0.3s, border-color 0.3s;
}
.copy:hover { color: var(--text); border-color: var(--text); }

.contact__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
  margin-top: clamp(3rem, 6vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--line);
}
.tz { color: var(--muted); max-width: 32rem; font-size: 1.05rem; }
.tz strong { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.like { display: flex; align-items: center; gap: 1rem; }
.like__btn {
  width: 78px; height: 78px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--raised);
  display: grid; place-items: center;
  transition: transform 0.5s var(--ease), border-color 0.3s var(--ease);
}
.like__btn:hover { border-color: var(--heart); transform: scale(1.06); }
.like__btn:active { transform: scale(0.9); }
.like__svg { width: 46px; height: 46px; overflow: visible; }
.like__outline { fill: none; stroke: var(--heart); stroke-width: 1.5; }
.like__fill { fill: var(--heart); }
.like__level { transition: y 0.6s var(--ease); }
.like__eyes .w { fill: #fff; }
.like__eyes .p { fill: #111; }
.like__mouth { fill: none; stroke: #fff; stroke-width: 1.1; stroke-linecap: round; }
.like.is-max .like__svg { animation: likeSpin 1s var(--ease); }
@keyframes likeSpin { 50% { transform: scale(1.25) rotate(-12deg); } }
.like__text { font: 400 0.72rem/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------- shortcut sheet */
.keys__title { margin: 0; padding: 1.1rem 1.25rem 0.2rem; font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.keys__list { list-style: none; margin: 0; padding: 0.4rem 1.25rem 0.8rem; }
.keys__list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.keys__list li:last-child { border-bottom: 0; }
.keys__note { margin: 0; padding: 0.85rem 1.25rem 1.1rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.keys__note::before { content: none; }

/* ------------------------------------------------------------------ light */
:root[data-theme="light"] {
  --base: #f1efe9; --raised: #e8e5dd; --raised2: #faf9f5;
  --line: rgba(20, 20, 20, 0.1); --line-2: rgba(20, 20, 20, 0.24);
  --text: #151515; --muted: #53524d; --faint: #6b6964;
  --accent: #2d5a86; --accent-2: #2d5a86; --live: #1f9d4c; --paper: #ffffff;
  color-scheme: light;
}
:root[data-theme="light"] .nav[data-stuck="true"] { background: rgba(241, 239, 233, 0.8); }
:root[data-theme="light"] .certstrip__row img { filter: invert(1); }
:root[data-theme="light"] .plate,
:root[data-theme="light"] .shot--fit,
:root[data-theme="light"] .tile__media--doc { box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="light"] .hero__portrait::before { opacity: 0.4; }

/* the lights come on as a circle spreading from the switch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: lightsIn 0.8s cubic-bezier(0.65, 0, 0.35, 1); }
@keyframes lightsIn {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to   { clip-path: circle(160vmax at var(--vt-x, 50%) var(--vt-y, 0)); }
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .spark, .rain, .plus { display: none; }
  .marquee__track { transform: none !important; flex-wrap: wrap; width: auto; }
}

/* ============================================================ palette v5 == */
/* Warm ink instead of cool graphite, one signal red for everything that
   reacts. Red is already the colour of the hearts, so the page and the game
   finally speak the same language. */

:root {
  --void:    #070605;
  --base:    #0d0c0b;
  --raised:  #161412;
  --raised2: #1e1b18;
  --line:    rgba(255, 240, 225, 0.09);
  --line-2:  rgba(255, 240, 225, 0.2);
  --text:    #f0ebe3;
  --muted:   #aaa299;
  --faint:   #857e75;
  --accent:  #ff4d5e;
  --accent-2:#ff4d5e;
  --paper:   #f4efe7;
  --heart:   #ff3b4f;
}
:root[data-theme="light"] { --accent: #d62839; --accent-2: #d62839; --heart: #e62e45; --base: #f3eee6; --raised: #e9e3d9; }
:root[data-theme="light"] .nav[data-stuck="true"] { background: rgba(243, 238, 230, 0.82); }
.nav[data-stuck="true"] { background: rgba(13, 12, 11, 0.74); }

.progress { background: var(--heart); }
.arrow:hover::after { color: var(--heart); }
.nav__links a[data-active="true"]::after { background: var(--heart); }
.hero__portrait::before {
  background: radial-gradient(ellipse 48% 46% at 50% 42%,
              rgba(255, 214, 190, 0.1) 0%, rgba(255, 214, 190, 0.03) 50%, transparent 72%);
}
footer { padding-bottom: 5rem; }
@media (max-width: 600px) { .toast { bottom: 4.6rem; } }

/* ============================================================= heart hunt == */

.soul-spot {
  --c: #fff;
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  margin: 0 0 0 0.35rem; padding: 0; border: 0; background: none;
  color: var(--c); opacity: 0.4; cursor: pointer; vertical-align: middle;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  animation: soulIdle 2.8s ease-in-out infinite;
}
.soul-spot[hidden] { display: none; }
.soul-spot svg { width: 12px; height: 12px; filter: drop-shadow(0 0 5px var(--c)); }
.soul-spot:hover, .soul-spot:focus-visible { opacity: 1; transform: scale(1.6); }
.soul-spot.is-taken { animation: soulTake 0.5s var(--ease) forwards; pointer-events: none; }
@keyframes soulIdle { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes soulTake { to { transform: scale(3.2); opacity: 0; } }

.tile--end { flex: 0 0 7rem; display: grid; place-items: center; align-self: stretch; }

.soul-ring {
  position: fixed; z-index: 141; pointer-events: none;
  width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid var(--c); animation: soulRing 0.8s var(--ease) both;
}
@keyframes soulRing { from { transform: scale(0.4); opacity: 1; } to { transform: scale(7); opacity: 0; } }

.follower {
  position: fixed; left: 0; top: 0; z-index: 140; pointer-events: none;
  width: 0; height: 0; transition: opacity 0.4s var(--ease); will-change: transform;
}
.follower__in {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px;
  color: var(--c); filter: drop-shadow(0 0 6px var(--c));
  animation: bob 2.4s ease-in-out var(--d, 0s) infinite;
}
.follower__in svg { width: 100%; height: 100%; display: block; }
.follower.is-new .follower__in { animation: arrive 0.7s var(--ease), bob 2.4s ease-in-out var(--d, 0s) infinite; }
@keyframes bob { 0%, 100% { translate: 0 -1.5px; } 50% { translate: 0 1.5px; } }
@keyframes arrive { from { scale: 2.8; } }
html.boss-on .follower, body.souls-away .follower { opacity: 0; }

.hunt {
  position: fixed; left: var(--gut); bottom: 1.1rem; z-index: 90;
  display: flex; align-items: center; gap: 0.7rem; max-width: calc(100vw - 2 * var(--gut));
  padding: 0.5rem 0.9rem 0.5rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted);
  background: color-mix(in srgb, var(--base) 84%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 400 0.6875rem/1.25 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-align: left;
  cursor: pointer; transition: border-color 0.3s, color 0.3s, transform 0.5s var(--ease);
}
.hunt:hover { color: var(--text); border-color: var(--text); }
.hunt__slots { display: flex; gap: 3px; flex: none; }
.hunt__slots i { width: 11px; height: 11px; color: var(--line-2); transition: color 0.4s, filter 0.4s; }
.hunt__slots i svg { width: 100%; height: 100%; display: block; }
.hunt__slots i.is-found { color: var(--c); filter: drop-shadow(0 0 4px var(--c)); }
.hunt.is-pulse { animation: huntPulse 0.8s var(--ease); }
@keyframes huntPulse { 40% { transform: scale(1.08); } }
.hunt.is-ready { color: var(--text); border-color: var(--heart); animation: huntReady 1.6s ease-in-out infinite; }
@keyframes huntReady { 50% { box-shadow: 0 0 0 7px rgba(255, 59, 79, 0.18); } }
html.boss-on .hunt { display: none; }

/* ================================================================== intro == */

.intro { display: none; }
html.has-intro .intro {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 400;
  background: var(--void); color: var(--text);
  transition: transform 1s cubic-bezier(0.76, 0, 0.24, 1);
  animation: introFailsafe 0.01s 4s forwards;
}
@keyframes introFailsafe { to { transform: translateY(-100%); visibility: hidden; } }
.intro.is-done { transform: translateY(-100%); }
.intro__in { display: grid; justify-items: center; gap: 1.2rem; transition: opacity 0.4s, transform 1s cubic-bezier(0.76, 0, 0.24, 1); }
.intro.is-done .intro__in { opacity: 0; transform: translateY(-40px); }
.intro__n {
  font-family: var(--display); font-weight: 800; font-stretch: 62%;
  font-size: clamp(5rem, 16vw, 12rem); line-height: 0.8; font-variant-numeric: tabular-nums;
}
.intro__hearts { display: flex; gap: 0.5rem; }
.intro__hearts i { width: 16px; height: 16px; color: rgba(255, 255, 255, 0.14); transition: color 0.3s, transform 0.5s var(--ease), filter 0.3s; }
.intro__hearts i svg { width: 100%; height: 100%; display: block; }
.intro__hearts i.is-on { color: var(--c); transform: translateY(-4px); filter: drop-shadow(0 0 6px var(--c)); }
.intro__line { font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

html.has-intro .hero__name .ch:nth-child(1) { animation-delay: 1.3s; }
html.has-intro .hero__name .ch:nth-child(2) { animation-delay: 1.35s; }
html.has-intro .hero__name .ch:nth-child(3) { animation-delay: 1.45s; }
html.has-intro .hero__name .ch:nth-child(4) { animation-delay: 1.5s; }
html.has-intro .hero__name .ch:nth-child(5) { animation-delay: 1.55s; }
html.has-intro .hero__name .ch:nth-child(6) { animation-delay: 1.6s; }
html.has-intro .hero__name .ch:nth-child(7) { animation-delay: 1.65s; }
html.has-intro .hero__photo { animation-delay: 1.35s; }
html.has-intro .hero__meta, html.has-intro .hero__lede, html.has-intro .certstrip { animation-delay: 1.7s; }

/* ============================================================ more motion == */

/* sentences arrive a word at a time */
.js .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.js .w > span { display: inline-block; transform: translateY(108%); transition: transform 0.9s var(--ease) calc(var(--i) * 18ms); }
.js .is-in .w > span { transform: none; }
.js .sec-head h2.split > span { transform: none; }

/* the rule next to each section number draws itself */
.js .sec-head .idx::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.2s var(--ease) 0.25s; }
.js .sec-head.is-in .idx::after { transform: none; }

/* lists come in a row at a time */
.js [data-stagger] > * { opacity: 0; translate: 0 14px; transition: opacity 0.7s var(--ease) calc(var(--i, 0) * 60ms), translate 0.7s var(--ease) calc(var(--i, 0) * 60ms); }
.js [data-stagger].is-in > * { opacity: 1; translate: 0 0; }

/* nav labels roll to a second copy on hover */
.roll { display: inline-grid; overflow: hidden; vertical-align: top; line-height: 1.15; }
.roll > span { grid-area: 1 / 1; transition: transform 0.5s var(--ease); }
.roll > span + span { transform: translateY(110%); color: var(--text); }
.nav__links a:hover .roll > span:first-child { transform: translateY(-110%); }
.nav__links a:hover .roll > span + span { transform: none; }

/* photographs drift inside their frames */
img.drift { scale: 1.14; }

/* activity cards tilt toward the pointer */
.tile__media { transition: transform 0.5s var(--ease); transform-style: preserve-3d; }

@media (prefers-reduced-motion: reduce) {
  .js .w > span, .js [data-stagger] > * { transform: none; translate: none; opacity: 1; }
  .js .sec-head .idx::after { transform: none; }
  img.drift { scale: 1; }
  .follower, .soul-ring { display: none; }
}

/* =================================================================== boss == */

.boss {
  position: fixed; inset: 0; z-index: 300; background: #000; color: #fff;
  font-family: "Silkscreen", "Geist Mono", monospace;
}
.boss__cv { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.boss__top, .boss__bottom { pointer-events: none; }
.boss__top {
  position: absolute; top: 14px; left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: 0.06em; white-space: nowrap;
}
.boss__bar, .boss__mybar { position: relative; width: min(260px, 38vw); height: 12px; background: #b3102a; }
.boss__mybar { width: 110px; }
.boss__bar i, .boss__mybar i { position: absolute; inset: 0 auto 0 0; width: 100%; background: #ffe51f; transition: width 0.25s steps(4); }
.boss__bottom { position: absolute; left: 0; right: 0; bottom: 12px; display: grid; justify-items: center; gap: 8px; padding: 0 12px; }
.boss__me { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.boss__souls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.boss__souls button {
  pointer-events: auto; display: flex; align-items: center; gap: 6px;
  background: #000; border: 2px solid #444; color: var(--c); padding: 6px 9px;
  cursor: pointer; font: inherit; font-size: 11px;
}
.boss__souls button span { color: #fff; }
.boss__souls button svg { width: 16px; height: 16px; }
.boss__souls button[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 16px -2px var(--c); }
.boss__power { margin: 0; font-family: "Geist Mono", monospace; font-size: 12px; color: #bbb; text-align: center; max-width: 64ch; min-height: 1.4em; }
.boss__run {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  background: none; border: 2px solid #fff; color: #fff; font: inherit; font-size: 11px; padding: 6px 10px; cursor: pointer;
}
.boss__run:hover { color: #ffe51f; border-color: #ffe51f; }
.boss__screen {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.9);
  display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 56px 20px 24px; text-align: center; overflow: auto;
}
.boss__screen[hidden] { display: none; }
.boss__screen h2 { margin: 0; font-size: clamp(22px, 4vw, 40px); font-weight: 400; letter-spacing: 0.04em; }
.boss__say { margin: 0; font-size: 14px; }
.boss__sub { margin: 0; font-family: "Geist Mono", monospace; font-size: 13px; line-height: 1.55; color: #aaa; max-width: 58ch; }
.boss__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: min(1000px, 92vw); margin-top: 8px; }
.boss__card {
  position: relative; display: grid; justify-items: start; align-content: start; gap: 6px; text-align: left;
  background: #000; border: 2px solid #333; color: #fff; padding: 12px; cursor: pointer; font: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.boss__card:hover, .boss__card:focus-visible { border-color: var(--c); transform: translateY(-3px); }
.boss__card svg { width: 26px; height: 26px; color: var(--c); filter: drop-shadow(0 0 8px var(--c)); }
.boss__card b { font-weight: 400; font-size: 14px; color: var(--c); }
.boss__card span { font-family: "Geist Mono", monospace; font-size: 11.5px; line-height: 1.45; color: #bbb; }
.boss__card kbd { position: absolute; top: 10px; right: 10px; font: inherit; font-size: 11px; color: #666; }
.boss__flash { position: absolute; inset: 0; pointer-events: none; background: #ff0030; opacity: 0; }
.boss__flash.is-on { animation: hurtFlash 0.3s ease-out; }
@keyframes hurtFlash { from { opacity: 0.22; } to { opacity: 0; } }
.boss__big { width: 88px; height: 88px; color: var(--c); filter: drop-shadow(0 0 22px var(--c)); animation: bigBeat 1.2s ease-in-out infinite; }
@keyframes bigBeat { 50% { transform: scale(1.1); } }
.boss__trait { margin: 0; font-size: 16px; }
.boss__stats { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; width: min(460px, 88vw); font-family: "Geist Mono", monospace; font-size: 12px; }
.boss__stats li { display: grid; grid-template-columns: 7.5rem 1fr 4.5rem; align-items: center; gap: 10px; text-align: left; color: #bbb; }
.boss__stats li i { display: block; height: 8px; width: var(--w); min-width: 2px; background: var(--c); }
.boss__stats li b { font-weight: 400; color: var(--c); }
.boss__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.boss__actions button { background: #000; border: 2px solid #fff; color: #fff; font: inherit; font-size: 13px; padding: 10px 16px; cursor: pointer; }
.boss__actions button:hover, .boss__actions button:focus-visible { color: #ffe51f; border-color: #ffe51f; }
@media (max-width: 640px) {
  .boss__top { font-size: 10px; gap: 8px; }
  .boss__souls button { padding: 5px 7px; }
  .boss__power { font-size: 11px; }
}

/* ========================================================= 3D hearts, boss 3D */

/* The hearts are a CC0 Quaternius model, rendered once into a sprite sheet:
   seven rows (one per soul), sixteen frames of a full turn each. */
.heart3d {
  display: block; width: 100%; height: 100%;
  background: url("hearts-3d.webp") 0 calc(var(--row, 0) * 100% / 6) / 1600% 700% no-repeat;
  filter: drop-shadow(0 0 4px var(--c, #ff3b4f));
  animation: heartSpin 1.6s steps(16) infinite;
}
@keyframes heartSpin { from { background-position-x: 0%; } to { background-position-x: calc(100% * 16 / 15); } }

.soul-spot { width: 24px; height: 24px; }
.soul-spot .heart3d { width: 18px; height: 18px; }
.follower__in { left: -10px; top: -10px; width: 20px; height: 20px; filter: none; }
.follower__in .heart3d { animation-delay: var(--d, 0s); }

.boss__gl { position: absolute; inset: 0; pointer-events: none; }
.boss__name { color: var(--theme, #fff); }
.boss__card.is-tip { border-color: var(--c); }
.boss__card.is-tip::after {
  content: "Good start"; position: absolute; right: 10px; bottom: 9px;
  font-size: 10px; color: var(--c);
}
@media (min-width: 1100px) { .boss__cards { grid-template-columns: repeat(7, minmax(0, 1fr)); width: min(1240px, 94vw); } }
@media (max-width: 640px) {
  .boss__top { left: 12px; translate: none; max-width: calc(100vw - 120px); }
  .boss__bar { width: 34vw; }
  .boss__run { top: 8px; right: 8px; padding: 5px 8px; font-size: 10px; }
}
/* ------------------------------------------------ boss v7: stage, title, phases */
.boss__stage { position: absolute; inset: 0; will-change: transform; }
.boss__bg, .boss__gl, .boss__cv { position: absolute; inset: 0; }
.boss__bg, .boss__gl { pointer-events: none; }
.boss__bar b { position: absolute; inset: 0 auto 0 0; width: 100%; background: #fff; transition: width 0.9s ease 0.3s; }
.boss__bar i { z-index: 1; }
.boss__phase { font-size: 10px; color: #9a9a9a; letter-spacing: 0.1em; }
.boss__title {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 30%, rgba(0,0,0,0.65) 80%);
}
.boss__title[hidden] { display: none; }
.boss__title-pre { font-family: "Geist Mono", monospace; font-size: 12px; letter-spacing: 0.4em; color: #bbb; animation: titleSub 0.5s ease both; }
.boss__title-name {
  font-size: clamp(38px, 9vw, 112px); line-height: 1; letter-spacing: 0.03em; color: var(--theme);
  text-shadow: 0 0 34px var(--theme), 5px 5px 0 #000;
  animation: titleSlam 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) 0.15s both;
}
.boss__title-sub { font-family: "Geist Mono", monospace; font-size: clamp(12px, 1.6vw, 18px); letter-spacing: 0.28em; text-transform: uppercase; color: #fff; animation: titleSub 0.7s ease 0.55s both; }
@keyframes titleSlam { from { transform: scale(3.2); opacity: 0; filter: blur(8px); } }
@keyframes titleSub { from { opacity: 0; transform: translateY(12px); letter-spacing: 0.7em; } }
.boss__banner {
  position: absolute; left: 0; right: 0; top: 34%; z-index: 3; pointer-events: none; text-align: center;
  font-size: clamp(22px, 5vw, 58px); color: #fff; text-shadow: 0 0 26px var(--theme), 4px 4px 0 #000; opacity: 0;
}
.boss__banner small { display: block; margin-bottom: 6px; font-family: "Geist Mono", monospace; font-size: 13px; letter-spacing: 0.35em; color: var(--theme); text-shadow: none; }
.boss__banner.is-on { animation: bossBanner 2s ease both; }
@keyframes bossBanner { 0% { opacity: 0; transform: scaleX(2.4); } 14% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-24px); } }
.boss__soundbtn {
  pointer-events: auto; background: #000; border: 2px solid #fff; color: #fff; font: inherit; font-size: 12px;
  padding: 8px 14px; cursor: pointer;
}
.boss__soundbtn[aria-pressed="true"] { color: var(--theme); border-color: var(--theme); }
@media (prefers-reduced-motion: reduce) {
  .boss__title-name, .boss__title-sub, .boss__title-pre, .boss__banner.is-on { animation-duration: 0.01ms; }
  .boss__banner.is-on { opacity: 1; }
}
.boss__actions button.boss__next { border-color: var(--theme, #ffe51f); color: var(--theme, #ffe51f); }
.souls__next { margin-top: 0.5rem; }
/* tall screens of text must scroll from the top, not overflow above it */
.boss__screen { place-content: safe center; }
@media (max-width: 640px) { .boss__screen { padding-top: 58px; } }
.boss__credit { margin: 4px 0 0; font-family: "Geist Mono", monospace; font-size: 10.5px; line-height: 1.5; color: #6b6b6b; max-width: 72ch; }

@media (prefers-reduced-motion: reduce) {
  .heart3d { animation: none; }
}

/* ======================================================== heart hunt v80 == */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* hidden hearts warm up as the cursor gets close */
.soul-spot { position: relative; opacity: calc(0.36 + var(--near, 0) * 0.64); transform: scale(calc(1 + var(--near, 0) * 0.3)); }
.soul-spot .heart3d { filter: drop-shadow(0 0 calc(3px + var(--near, 0) * 9px) var(--c)); }
@media (pointer: coarse) { .soul-spot::before { content: ""; position: absolute; inset: -9px; } }

/* every heart in the chain has its own idle */
.follower__in { animation: var(--idle, bob) var(--idur, 2.4s) ease-in-out var(--d, 0s) infinite; }
.follower.is-new .follower__in { animation: arrive 0.7s var(--ease), var(--idle, bob) var(--idur, 2.4s) ease-in-out var(--d, 0s) infinite; }
.follower[data-soul="red"]    { --idle: idleBeat;   --idur: 1.25s; }
.follower[data-soul="orange"] { --idle: idleHop;    --idur: 0.95s; }
.follower[data-soul="yellow"] { --idle: idleSway;   --idur: 2.2s; }
.follower[data-soul="green"]  { --idle: idleFloat;  --idur: 3.4s; }
.follower[data-soul="cyan"]   { --idle: idleWait;   --idur: 4.2s; }
.follower[data-soul="blue"]   { --idle: idleDrop;   --idur: 1.7s; }
.follower[data-soul="purple"] { --idle: idleWobble; --idur: 2.6s; }
@keyframes idleBeat   { 0%, 60%, 100% { scale: 1; } 14% { scale: 1.24; } 28% { scale: 0.95; } 42% { scale: 1.12; } }
@keyframes idleHop    { 0%, 55%, 100% { translate: 0 0; } 28% { translate: 0 -5px; } }
@keyframes idleSway   { 0%, 100% { rotate: -14deg; } 50% { rotate: 14deg; } }
@keyframes idleFloat  { 0%, 100% { translate: -2px -2px; } 50% { translate: 2px 2px; } }
@keyframes idleWait   { 0%, 72%, 100% { translate: 0 0; scale: 1; } 82% { translate: 0 -3px; scale: 1.12; } }
@keyframes idleDrop   { 0%, 100% { translate: 0 -3px; scale: 1; } 46% { translate: 0 2px; scale: 1; } 56% { translate: 0 2px; scale: 1.14 0.86; } 70% { translate: 0 1px; scale: 1; } }
@keyframes idleWobble { 0%, 100% { rotate: 0deg; translate: 0 0; } 25% { rotate: 11deg; translate: 2px 0; } 75% { rotate: -11deg; translate: -2px 0; } }

.soul-trail {
  position: fixed; left: 0; top: 0; z-index: 139; pointer-events: none;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 6px var(--c); opacity: 0;
}
html.boss-on .soul-trail, body.souls-away .soul-trail,
body.souls-portal .follower, body.souls-portal .soul-trail { opacity: 0 !important; }

/* the find: a burst, a name, and the heart dropping into its slot */
.soul-burst { position: fixed; z-index: 141; pointer-events: none; width: 0; height: 0; }
.soul-burst i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 8px var(--c);
}
.soul-burst i.is-heart {
  left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 0; box-shadow: none;
  -webkit-mask: var(--heart-img) center / contain no-repeat; mask: var(--heart-img) center / contain no-repeat;
}
.soul-tag {
  position: fixed; z-index: 142; pointer-events: none;
  display: grid; justify-items: center; gap: 0.3rem; padding: 0.6rem 0.9rem 0.55rem;
  border-radius: var(--r-ctrl); white-space: nowrap;
  background: color-mix(in srgb, var(--raised2) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--c) 75%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: soulTag 2s var(--ease) both;
}
.soul-tag b { font: 800 1.55rem/0.9 var(--display); font-stretch: 62%; letter-spacing: 0.01em; text-transform: uppercase; color: var(--c); }
.soul-tag span { font: 400 0.625rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
:root[data-theme="light"] .soul-tag b { color: color-mix(in srgb, var(--c) 72%, #000); }
@keyframes soulTag {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  14% { opacity: 1; transform: none; }
  78% { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-14px); }
}
.soul-fly { position: fixed; left: 0; top: 0; z-index: 141; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; }

/* ---------------------------------------------------------------- counter */
.hunt::after {
  content: ""; position: absolute; left: 0.9rem; right: 0.9rem; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--fill, transparent); transform: scaleX(var(--p, 0)); transform-origin: 0 50%;
  transition: transform 0.9s var(--ease);
}
.hunt { gap: 0.7rem; transition: border-color 0.3s, color 0.3s, transform 0.5s var(--ease), gap 0.5s var(--ease), padding 0.5s var(--ease); }
.hunt:active { transform: scale(0.97); }
.hunt__slots i { transition: color 0.4s, filter 0.4s; }
.hunt__slots i.is-pop { animation: slotPop 0.7s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes slotPop { 0% { scale: 0.3; } 55% { scale: 1.7; } 100% { scale: 1; } }
.hunt__text {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: min(48ch, calc(100vw - 2 * var(--gut) - 8rem));
  transition: max-width 0.6s var(--ease), opacity 0.35s var(--ease);
}
.hunt.is-tucked { gap: 0; padding-right: 0.65rem; }
.hunt.is-tucked .hunt__text { max-width: 0; opacity: 0; }
.hunt[aria-expanded="true"] { color: var(--text); border-color: var(--text); }
@media (max-width: 460px) {
  .hunt { gap: 0.5rem; padding: 0.5rem 0.75rem 0.5rem 0.55rem; font-size: 0.625rem; letter-spacing: 0.03em; }
  .hunt__slots { gap: 2px; }
  .hunt__slots i { width: 10px; height: 10px; }
  .hunt__text { max-width: calc(100vw - 2 * var(--gut) - 7rem); }
}

/* ------------------------------------------------------------- collection */
.souls {
  position: fixed; left: var(--gut); bottom: 4.1rem; z-index: 95;
  width: min(392px, calc(100vw - 2 * var(--gut))); max-height: calc(100svh - 6.5rem);
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  background: linear-gradient(180deg, var(--raised2), var(--raised));
  border: 1px solid var(--line-2); border-radius: var(--r-card);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  transform-origin: 1.5rem 100%; animation: soulsIn 0.45s var(--ease);
}
.souls[hidden] { display: none; }
.souls:focus { outline: none; }
@keyframes soulsIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
.souls__head { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1rem 0.75rem 1.1rem; }
.souls__title { flex: 1; font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.souls__count { font: 800 2rem/0.8 var(--display); font-stretch: 62%; color: var(--text); font-variant-numeric: tabular-nums; }
.souls__count small { font-size: 0.55em; color: var(--faint); margin-left: 0.08em; }
.souls__x {
  width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line-2); background: none; color: var(--muted); cursor: pointer;
  transition: color 0.3s, border-color 0.3s, rotate 0.4s var(--ease);
}
.souls__x:hover { color: var(--text); border-color: var(--text); rotate: 90deg; }
.souls__x svg { width: 11px; height: 11px; }
.souls__meter { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 0 1.1rem 0.9rem; }
.souls__meter i { height: 3px; border-radius: 2px; background: var(--line-2); }
.souls__meter i.is-on { background: var(--c); box-shadow: 0 0 8px -1px var(--c); }
.souls__list { list-style: none; margin: 0; padding: 0 0.5rem; border-top: 1px solid var(--line); }
.souls__item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0.8rem; align-items: start; padding: 0.7rem 0.6rem; }
.souls__item + .souls__item { border-top: 1px solid var(--line); }
.souls__heart { width: 28px; height: 28px; display: grid; place-items: center; color: var(--line-2); }
.souls__heart svg { width: 16px; height: 16px; }
.souls__heart .heart3d { width: 28px; height: 28px; }
.souls__body { display: grid; gap: 0.2rem; min-width: 0; }
.souls__body b { font: 500 0.9rem/1.25 var(--body); color: var(--muted); }
.souls__body > span { font-size: 0.8rem; line-height: 1.45; color: var(--faint); }
.souls__item.is-found .souls__body b { color: var(--c); }
.souls__item.is-found .souls__body > span { color: var(--muted); }
:root[data-theme="light"] .souls__item.is-found .souls__body b { color: color-mix(in srgb, var(--c) 70%, #000); }
.souls__tag { margin-top: 0.3rem; font: 400 0.6rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.souls__item.is-found .souls__tag { color: var(--text); }
.souls__boss { display: grid; gap: 0.45rem; padding: 1rem 1.1rem; border-top: 1px solid var(--line); }
.souls__k { font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.souls__state { font-size: 0.92rem; line-height: 1.45; color: var(--text); }
.souls__fight {
  justify-self: start; margin-top: 0.35rem; padding: 0.8rem 1.15rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: #fff;
  background: var(--heart); box-shadow: 0 10px 30px -10px var(--heart);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.souls__fight:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px var(--heart); }
.souls__fight:active { transform: scale(0.96); }
.souls__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.75rem 1.1rem 0.85rem; border-top: 1px solid var(--line);
  font: 400 0.66rem/1.4 var(--mono); letter-spacing: 0.04em; color: var(--faint);
}
.souls__reset {
  background: none; border: 0; padding: 0.25rem 0; cursor: pointer; white-space: nowrap;
  font: inherit; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.souls__reset:hover, .souls__reset.is-armed { color: var(--heart); }
@media (max-width: 520px) {
  .souls { left: 0.6rem; right: 0.6rem; width: auto; bottom: 3.9rem; max-height: calc(100svh - 5.5rem); }
}

/* ----------------------------------------------------------------- portal */
.portal {
  position: fixed; inset: 0; z-index: 310; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.88) 72%);
  animation: portalDim 0.7s ease both; transition: opacity 0.6s ease;
}
.portal::before { content: ""; position: absolute; inset: 0; background: #050404; opacity: 0; transition: opacity 0.45s ease; }
.portal.is-dark::before { opacity: 1; }
.portal.is-out { opacity: 0; pointer-events: none; }
.portal.is-still { background: #050404; animation-duration: 0.4s; }
@keyframes portalDim { from { opacity: 0; } }
.portal__crack { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.portal__crack path {
  fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: bevel;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 10px rgba(255, 59, 79, 0.7));
  animation: crack 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.portal__crack path:nth-child(3n) { stroke-width: 2.4; }
@keyframes crack { to { stroke-dashoffset: 0; } }
.portal__vortex {
  position: absolute; width: 56vmin; height: 56vmin; margin: -28vmin 0 0 -28vmin; border-radius: 50%;
  background: conic-gradient(#ff2a3d, #ff9d1c, #ffe51f, #2ed573, #42d4ff, #3b63ff, #c54bff, #ff2a3d);
  -webkit-mask: radial-gradient(closest-side, transparent 30%, #000 34%, #000 44%, transparent 48%, transparent 58%, rgba(0, 0, 0, 0.55) 63%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 30%, #000 34%, #000 44%, transparent 48%, transparent 58%, rgba(0, 0, 0, 0.55) 63%, transparent 100%);
  filter: blur(1.5px) saturate(1.25);
  animation: vortexIn 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) 0.3s both, vortexSpin 1.1s linear infinite;
}
.portal__core {
  position: absolute; width: 18vmin; height: 18vmin; margin: -9vmin 0 0 -9vmin; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 6%, #1a0508 30%, #000 62%);
  box-shadow: 0 0 70px 14px rgba(255, 255, 255, 0.14);
  animation: vortexIn 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) 0.36s both, corePulse 0.55s ease-in-out infinite alternate;
}
.portal.is-quick .portal__vortex, .portal.is-quick .portal__core { animation-delay: 0s, 0s; }
@keyframes vortexIn { from { scale: 0; opacity: 0; } }
@keyframes vortexSpin { to { rotate: 360deg; } }
@keyframes corePulse { to { scale: 1.12; } }
.portal__heart { position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
html.souls-quake main, html.souls-quake .nav { animation: quake 0.5s linear both; }
@keyframes quake {
  0%, 100% { translate: 0 0; } 10% { translate: -7px 3px; } 20% { translate: 6px -4px; } 30% { translate: -5px -2px; }
  40% { translate: 4px 3px; } 50% { translate: -3px 2px; } 65% { translate: 2px -2px; } 80% { translate: -1px 1px; }
}

/* --------------------------------------------------------- lights switch */
.tool.is-flip { animation: toolFlip 0.6s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes toolFlip { 0% { scale: 0.7; } 55% { scale: 1.18; } 100% { scale: 1; } }
.lights-glow {
  position: fixed; z-index: 55; pointer-events: none; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.95), rgba(255, 196, 120, 0.4) 38%, transparent 70%);
  animation: lightsGlow 0.75s ease-out forwards;
}
.lights-glow.is-off { background: radial-gradient(circle, rgba(255, 77, 94, 0.5), rgba(255, 77, 94, 0.12) 40%, transparent 70%); }
@keyframes lightsGlow { from { scale: 0.3; opacity: 1; } to { scale: 8; opacity: 0; } }

/* ------------------------------------ section words fill with ink as they arrive */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .js .sec-head .h-display > span {
      width: fit-content; color: transparent;
      -webkit-text-stroke: 1px color-mix(in srgb, var(--text) 42%, transparent);
      background: linear-gradient(90deg, var(--text) 0 46%, transparent 54%) 100% 0 / 220% 100% no-repeat;
      -webkit-background-clip: text; background-clip: text;
      animation: inkFill linear both; animation-timeline: view(); animation-range: entry 15% cover 45%;
    }
  }
}
@keyframes inkFill { to { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .soul-tag { animation: none; }
  .soul-trail, .soul-burst, .soul-fly, .lights-glow { display: none; }
  .souls { animation: none; }
}
