/* Colours: light by default; dark follows the system unless the visitor picks a theme. */
:root {
  --stone: #E8EBF0;
  --slab: #F5F6F8;
  --ink: #1A2238;
  --slate: #55607A;
  --mana: #5B3FD0;
  --verdigris: #2D7A68;
  --rule: #C9CFDA;
  --on-mana: #F5F6F8;

  --display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --runes: "Noto Sans Runic", "Segoe UI Historic", sans-serif;

  --page: min(1160px, 100% - 2 * clamp(20px, 5vw, 48px));
  --measure: 60ch;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

/* Dark: deep purple night between the mana violet and Hexhold's void */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone: #171228;
    --slab: #211A38;
    --ink: #EEE9FA;
    --slate: #ADA3C6;
    --mana: #B39BFF;
    --verdigris: #5FC3A9;
    --rule: #352B52;
    --on-mana: #171228;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --stone: #171228;
  --slab: #211A38;
  --ink: #EEE9FA;
  --slate: #ADA3C6;
  --mana: #B39BFF;
  --verdigris: #5FC3A9;
  --rule: #352B52;
  --on-mana: #171228;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--mana); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--stone);
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Scrollbar */

html { scrollbar-color: var(--mana) var(--stone); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--stone); }
::-webkit-scrollbar-thumb { border: 2px solid var(--stone); border-radius: 999px; background: var(--mana); }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* Header */

.top {
  width: var(--page);
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  gap: 24px;
  view-transition-name: top;
  position: sticky;
  top: 0;
  z-index: 50;
  /* Full-width background behind a page-width bar. */
  box-shadow: 0 0 0 100vmax transparent;
  clip-path: inset(0 -100vmax);
  transition: box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}
.top.is-stuck { background: var(--stone); box-shadow: 0 0 0 100vmax var(--stone); }

/* Brand: picture, then the name, always on one line. On the home page both
   are hidden until the hero name scrolls away; then the picture pops in and the
   name is typed out by main.js, with a caret while it types. */
.top__name { white-space: nowrap; }
.top__type { min-height: 1.3em; }
.top__type.is-typing::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--mana); }
.top .avatar { transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.top--home .avatar { opacity: 0; transform: scale(0.5); }
.top--home.show-name .avatar { opacity: 1; transform: none; }

.top__name {
  margin-right: auto;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}

.top__name { display: inline-flex; align-items: center; gap: 10px; }

/* Profile picture: round, with a thin mana ring */
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar--hero {
  width: clamp(72px, 9vw, 112px);
  height: clamp(72px, 9vw, 112px);
}
.hero__id { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 28px); margin: 0 0 24px; }
.hero__id .hero__name { margin: 0; }

.top__clock {
  position: absolute;
  left: 0;
  top: 50%;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--slate);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateY(-50%);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.top__clock-place { color: var(--slate); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* Nixie tubes: separate glass capsules on a dark base. All ten cathode digits
   sit stacked inside each tube, the unlit ones faintly visible behind the lit
   one, with the anode mesh in front, like the real thing. */
.nixie { display: inline-flex; align-items: flex-end; gap: 3px; }
.nixie i {
  position: relative;
  width: 17px;
  height: 30px;
  border-radius: 8px 8px 2px 2px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1.5px, transparent 3px 75%, rgba(255, 255, 255, 0.07) 85%, transparent),
    radial-gradient(ellipse at 50% 45%, #241a3c, #0e0a18 80%);
  box-shadow: inset 0 0 0 1px rgba(200, 185, 255, 0.18), 0 3px 0 -1px #2a2633, 0 4px 0 -1px #15131a;
  overflow: hidden;
}
/* anode mesh */
.nixie i::after {
  content: "";
  position: absolute;
  inset: 4px 2px 5px;
  background:
    repeating-linear-gradient(60deg, rgba(150, 135, 190, 0.12) 0 0.4px, transparent 0.4px 1.8px),
    repeating-linear-gradient(-60deg, rgba(150, 135, 190, 0.12) 0 0.4px, transparent 0.4px 1.8px);
  pointer-events: none;
}
.nixie s {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 1px;
  font: 200 1.1875rem/1 "Segoe UI", system-ui, sans-serif;
  font-style: normal;
  text-decoration: none;
  color: transparent;
  -webkit-text-stroke: 0.4px rgba(160, 145, 200, 0.1);
  transition: color 0.35s ease, text-shadow 0.35s ease, -webkit-text-stroke-color 0.35s ease;
}
.nixie s.on {
  color: #efe9ff;
  -webkit-text-stroke-color: #c8b6ff;
  text-shadow: 0 0 1px #b39bff, 0 0 5px rgba(179, 155, 255, 0.75);
}
.nixie b { width: 5px; height: 30px; display: grid; align-content: center; justify-items: center; gap: 7px; }
.nixie b::before, .nixie b::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--mana); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top--home.show-name .top__clock { opacity: 0; transform: translateY(-80%); }
.top__nav { display: flex; gap: 22px; }
.top__nav a {
  position: relative;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
}
.top__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--mana);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.top__nav a:hover::after,
.top__nav a[aria-current="page"]::after { transform: scaleX(1); }
.top__nav a[aria-current="page"] { color: var(--mana); }

.controls { display: flex; align-items: center; gap: 8px; }

.lang {
  display: flex;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.lang button {
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--slate);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--stone); }

.theme {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.theme:hover { border-color: var(--mana); transform: rotate(-20deg); }
.theme svg { width: 18px; height: 18px; }
.theme .moon { display: none; }
:root[data-mode="dark"] .theme .sun { display: none; }
:root[data-mode="dark"] .theme .moon { display: block; }

/* Buttons */

.button {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.button:hover { border-color: var(--mana); color: var(--mana); transform: translateY(-2px); }
.button--solid { background: var(--ink); color: var(--stone); }
.button--solid:hover { background: var(--mana); border-color: var(--mana); color: var(--on-mana); }

.more {
  display: inline-block;
  margin-top: 32px;
  font-weight: 700;
  text-decoration: none;
}
.more:hover { text-decoration: underline; }

/* Hero: a laptop cycling through client sites, two floating windows that trade
   places (one holds the interactive Hexhold ward), and a phone running Kyumi. */

.hero {
  padding: clamp(32px, 6vw, 80px) calc((100% - var(--page)) / 2) clamp(56px, 8vw, 104px);
  overflow: clip;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero__name {
  margin: 0 0 24px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  white-space: nowrap;
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.hero__role { margin: 0 0 12px; font-size: 1.375rem; }
.hero__pitch { margin: 0 0 32px; max-width: 46ch; color: var(--slate); }
.hero__actions { margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }

.scene { position: relative; aspect-ratio: 6 / 5; }

.lights { display: inline-flex; gap: 6px; flex: none; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.lights i:nth-child(2) { background: #FEBC2E; }
.lights i:nth-child(3) { background: #28C840; }
.win-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding: 0 12px;
  background: var(--slab);
  border-bottom: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
}
.win-bar__title { flex: 1; text-align: center; margin-right: 42px; overflow: hidden; text-overflow: ellipsis; }

.laptop { position: absolute; top: 0; right: 0; width: 88%; }
.laptop__screen {
  padding: 2.2% 2.2% 3%;
  border-radius: 16px 16px 0 0;
  background: #0E0C16;
  box-shadow: inset 0 0 0 1px #2A2540;
}
.browser { border-radius: 4px; overflow: hidden; background: var(--slab); }
.browser .win-bar { height: 24px; font-size: 0.6875rem; }
.browser .lights i { width: 8px; height: 8px; }
.browser__url {
  flex: 1;
  max-width: 50%;
  margin: 0 auto;
  padding: 1px 10px;
  border-radius: 6px;
  background: var(--stone);
  text-align: center;
  transform: translateX(-20px);
}
.browser__view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.browser__view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity 0.8s var(--ease); }
.browser__view img.is-on { opacity: 1; }
.laptop__base {
  position: relative;
  left: -6%;
  width: 112%;
  height: 14px;
  border-radius: 2px 2px 14px 14px;
  background: linear-gradient(#C9CCD6, #8E92A0);
}
.laptop__base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16%;
  height: 6px;
  border-radius: 0 0 8px 8px;
  background: #71768A;
  transform: translateX(-50%);
}

.window {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--stone);
  box-shadow: 0 18px 40px rgba(12, 10, 24, 0.22);
}
.float {
  position: absolute;
  width: 50%;
  cursor: pointer;
  transition: left 0.8s var(--ease), bottom 0.8s var(--ease), transform 0.8s var(--ease);
}
.float[data-slot="front"] { left: 0; bottom: 2%; z-index: 3; transform: rotate(-1.5deg); }
.float[data-slot="back"] { left: 14%; bottom: 20%; z-index: 2; transform: scale(0.94) rotate(2deg); }
/* While two windows trade places, the rising one slides out to the side first. */
.float.is-lifting { transform: translate(-22%, -18%) rotate(-4deg); }
.float img { display: block; width: 100%; height: auto; }
.float.ward { width: 38%; }
.ward .win-bar { cursor: default; }
.ward[data-slot="back"] .ward__svg { pointer-events: none; }

.phone {
  position: absolute;
  right: 2%;
  bottom: 0;
  z-index: 4;
  width: 21%;
  padding: 1.2%;
  border-radius: 22px;
  background: #0E0C16;
  box-shadow: 0 18px 40px rgba(12, 10, 24, 0.25), inset 0 0 0 1px #2A2540;
}
.phone img { display: block; width: 100%; height: auto; border-radius: 15px; }
.scene__caption { position: absolute; left: 0; right: 0; bottom: -40px; margin: 0; color: var(--slate); font-size: 0.875rem; text-align: center; }

.ward__svg { display: block; width: 100%; height: auto; overflow: visible; cursor: crosshair; }
.ward__runes { font-family: var(--runes); font-size: 15px; fill: var(--slate); }
.ward__rune-ring { transform-origin: 240px 240px; }
.ward__stone { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.ward__ring { fill: none; stroke: var(--rule); stroke-width: 1; }
.ward__hex { fill: var(--mana); fill-opacity: 0.16; stroke: var(--mana); stroke-width: 2; stroke-linejoin: round; transition: fill-opacity 0.3s var(--ease); }
.ward__aim { stroke: var(--mana); stroke-width: 1.5; stroke-dasharray: 3 7; stroke-linecap: round; opacity: 0.7; }
.ward__caster { fill: var(--ink); }
.ward__pulse { fill: none; stroke: var(--mana); stroke-width: 1.5; opacity: 0; }

/* Hero orb: the Hexhold ward sits on a plate over a large mana disc that runs
   off the right edge, with three cards pinned around it. */

.hero { position: relative; }
.hero__name { color: var(--mana); }
.hero__role { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.125rem); line-height: 1.2; color: var(--ink); }

.orb { position: relative; isolation: isolate; aspect-ratio: 1; width: min(100%, 560px); justify-self: center; }
.orb::before {
  content: "";
  position: absolute;
  --grow: max(0px, (100vw - 1440px) / 2);
  top: calc(-20% - var(--grow));
  left: 30%;
  width: calc(130% + var(--grow));
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--mana);
  z-index: -1;
}
.orb__plate {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: var(--slab);
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--slab) 55%, transparent), 0 30px 60px rgba(12, 10, 24, 0.28);
}
.orb .ward__svg { background: none; padding: 6%; border-radius: 50%; }

/* Work header: same violet ball, with a dial whose chips filter the projects. */
/* Page header on Work and Contact: full-bleed like the home hero so the ball can
   run off the right edge. */
.page-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin: 0 calc(50% - 50vw) clamp(32px, 5vw, 64px); padding: 0 calc(50vw - 50%) clamp(48px, 6vw, 80px); overflow: clip; }
.page-head .page-lead { margin-bottom: 0; }
.orb--small { width: min(100%, 440px); }
.orb--globe .globe { position: absolute; inset: 9%; width: 82%; margin: 0; }
.dial { display: block; width: 100%; height: auto; padding: 6%; overflow: visible; }
.dial__pointer { transform-origin: 240px 240px; transform: rotate(var(--aim, -90deg)); transition: transform 0.8s var(--ease); }
.dial__count { position: absolute; inset: 0; margin: 0; display: grid; place-content: center; justify-items: center; pointer-events: none; }
.dial__count b { font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; color: var(--mana); font-variant-numeric: tabular-nums; }
.dial__count span { color: var(--slate); font-size: 0.875rem; letter-spacing: 0.08em; text-transform: uppercase; }
button.chip { font: inherit; cursor: pointer; padding-right: 20px; }
.chip .filters__count { margin-left: 2px; color: var(--slate); font-size: 0.8125rem; }
.chip[aria-pressed="true"] { border-color: var(--mana); }
.chip[aria-pressed="true"] .chip__icon { background: var(--mana); color: var(--stone); }

.chip {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 10px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: color-mix(in srgb, var(--slab) 88%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(12, 10, 24, 0.16);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.chip:hover { border-color: var(--mana); transform: translateY(-3px); }
.chip[data-chip="web"] { top: 2%; right: 4%; }
.chip[data-chip="app"] { top: 50%; right: -10%; }
.chip[data-chip="game"] { bottom: 6%; left: -6%; }
.chip__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--mana) 14%, var(--slab));
  color: var(--mana);
}
.chip__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip__text { display: grid; gap: 2px; }
.chip__title { font-weight: 700; font-size: 0.9375rem; }
.chip__note { color: var(--slate); font-size: 0.8125rem; }
.chip__note b { color: var(--verdigris); font-weight: 700; }
.hero__hint { margin: 20px 0 0; color: var(--slate); font-size: 0.875rem; }

/* Home "What I do": services on the left, the laptop scene on the right. */
.showcase { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: center; }


/* Sections */

.section {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) 0;
  border-top: 1px solid var(--rule);
}
.section--first { border-top: 0; padding-top: clamp(24px, 4vw, 48px); }

.page-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
}
.page-lead { margin: 0 0 clamp(40px, 6vw, 72px); max-width: 52ch; color: var(--slate); font-size: 1.3125rem; }

.section__title {
  margin: 0 0 clamp(32px, 5vw, 56px);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
}

/* Projects */

.project {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.project + .project { margin-top: clamp(64px, 9vw, 112px); }
.project--flip .project__media { order: 2; }
.project--text, .project--wide { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.project--wide .shots { grid-column: 1 / -1; }

.project__title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.15;
}
.project__kind { margin: 0 0 16px; color: var(--slate); }
.project__live { margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.project__live::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verdigris);
  box-shadow: 0 0 0 0 var(--verdigris);
}
.project__body { margin: 0 0 16px; max-width: var(--measure); }
.project__stack { margin: 0; color: var(--slate); font-size: 0.9375rem; }

.shot {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--slab);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
.shot img { transition: transform 0.6s var(--ease); }
.shot[data-title] { border-radius: 10px; }
.shot video { display: block; width: 100%; height: auto; }
.shots--media img, .shots--media video { aspect-ratio: 1280 / 672; object-fit: cover; }
.shot .win-bar { position: relative; z-index: 1; }
.shot:hover { border-color: var(--mana); box-shadow: 0 12px 28px rgba(12, 10, 24, 0.14); transform: translateY(-4px); }
.shot:hover img { transform: scale(1.03); }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shots--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* App card: text on the left, three phones fanned out on the right. The middle
   one sits in front; hovering or focusing a side phone brings it forward. */
.project--app { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; }
.phones { position: relative; display: flex; justify-content: center; align-items: center; padding: 24px 0; }
.phone-shot {
  position: relative;
  width: 34%;
  flex: none;
  padding: 6px;
  border: 0;
  border-radius: 26px;
  background: #0E0C16;
  box-shadow: inset 0 0 0 1px #2A2540, 0 18px 36px rgba(12, 10, 24, 0.22);
}
.phone-shot img { border-radius: 20px; }
.phone-shot--left { z-index: 1; margin-right: -9%; transform: translateY(18px) rotate(-6deg) scale(0.9); }
.phone-shot--mid { z-index: 2; }
.phone-shot--right { z-index: 1; margin-left: -9%; transform: translateY(18px) rotate(6deg) scale(0.9); }
.phone-shot:hover,
.phone-shot:focus-visible { z-index: 3; border-color: transparent; transform: translateY(-6px) rotate(0) scale(1.02); }
.phone-shot:hover img { transform: none; }

/* Same idea for desktop screenshots, mirrored: the windows fan out on the left
   and the text sits on the right. */
.project--app-flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.fan { position: relative; aspect-ratio: 16 / 11; }
.fan .fan-shot.shot { position: absolute; top: 50%; width: 76%; }
.fan-shot--left { left: 0; z-index: 1; transform: translateY(-58%) rotate(-5deg) scale(0.86); }
.fan-shot--right { right: 0; z-index: 1; transform: translateY(-42%) rotate(5deg) scale(0.86); }
.fan-shot--mid { left: 12%; z-index: 2; transform: translateY(-50%); box-shadow: 0 18px 40px rgba(12, 10, 24, 0.28); }
.fan-shot--left:hover, .fan-shot--left:focus-visible { z-index: 3; transform: translateY(-60%) rotate(0) scale(0.98); }
.fan-shot--right:hover, .fan-shot--right:focus-visible { z-index: 3; transform: translateY(-44%) rotate(0) scale(0.98); }
.fan-shot--mid:hover, .fan-shot--mid:focus-visible { transform: translateY(-53%); }
.fan-shot:hover img { transform: none; }
.project__stack + .project__stack { margin-top: 6px; }

/* Click-to-zoom */

.shot[role="button"] { cursor: zoom-in; }
.shot[role="button"] { position: relative; }
.shot[role="button"]:focus-visible { border-color: var(--mana); outline-offset: 4px; }
/* A small magnifier badge slides in on hover, so it's clear the image opens. */
.shot[role="button"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8.5v5M8.5 11h5'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.shot[role="button"]:hover::after,
.shot[role="button"]:focus-visible::after { opacity: 0.9; transform: none; }
.zoom {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 4vw, 48px);
  border: 0;
  background: transparent;
  cursor: zoom-out;
}
.zoom[open] { display: grid; place-items: center; }
.zoom::backdrop { background: rgba(10, 8, 20, 0.86); backdrop-filter: blur(4px); }
.zoom img {
  max-width: 100%;
  max-height: calc(100dvh - 2 * clamp(16px, 4vw, 48px));
  width: auto;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.zoom__close {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(23, 18, 40, 0.7);
  color: #F5F6F8;
  cursor: pointer;
}
.zoom__close svg { width: 20px; height: 20px; }
.zoom__close:hover { border-color: #B39BFF; color: #B39BFF; }

/* Hexhold, laid out like a game's store page: a big frame with the
   chosen clip or still, thumbnails beside it, numbers as tiles, then the text. */
.store { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

/* Client sites: the desktop window with the phone version leaning on its corner. */
.devices { position: relative; padding: 0 9% 9% 0; }
.devices--flip { padding: 0 0 9% 9%; }
.devices .devices__phone.shot { position: absolute; right: 0; bottom: 0; width: 24%; z-index: 2; transform: rotate(4deg); }
.devices--flip .devices__phone.shot { right: auto; left: 0; transform: rotate(-4deg); }
.devices .devices__phone.shot:hover, .devices .devices__phone.shot:focus-visible { transform: translateY(-6px) rotate(0); }
.store__media { display: grid; gap: 12px; }
.store__stage video, .store__stage img { aspect-ratio: 1280 / 672; object-fit: cover; }
.store__thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.store__thumb {
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--slab);
  color: var(--slate);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.store__thumb img { display: block; width: 100%; aspect-ratio: 1280 / 672; object-fit: cover; opacity: 0.65; transition: opacity 0.2s var(--ease); }
.store__thumb span { display: block; padding: 6px 10px; font-size: 0.875rem; }
.store__thumb:hover { transform: translateY(-2px); color: var(--ink); }
.store__thumb:hover img, .store__thumb[aria-pressed="true"] img { opacity: 1; }
.store__thumb[aria-pressed="true"] { border-color: var(--mana); color: var(--ink); }

/* Eden: the clip window on the left with Ana's Minecraft character leaning on
   its bottom-left corner; text on the right. */
.eden { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.drag-stage { position: relative; padding: 0 0 0 12%; overflow-x: clip; }
/* skinview3d writes a fixed inline size on the canvas; the stage decides instead. */
.drag-hero { position: absolute; left: 0; bottom: -2%; width: 24% !important; height: auto !important; aspect-ratio: 2 / 3; z-index: 1; pointer-events: none; }
.drag-window { flex: 1; min-width: 0; }
.drag-window .shot video { aspect-ratio: 1280 / 672; object-fit: cover; }
.drag-stage.is-waiting .drag-window, .drag-stage.is-waiting .drag-hero { visibility: hidden; }

/* Work filters */

.experience { padding-bottom: clamp(40px, 5vw, 56px); border-bottom: 1px solid var(--rule); margin-bottom: clamp(32px, 4vw, 48px); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(40px, 6vw, 64px); }
.filters button {
  padding: 8px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--slate);
  font: inherit;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.filters button:hover { border-color: var(--mana); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--stone); }
.filters__count { margin-left: 6px; font-size: 0.8125rem; opacity: 0.7; }
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(64px, 9vw, 112px); }
.projects .project + .project { margin-top: 0; }
.projects + .project { margin-top: clamp(64px, 9vw, 112px); }
.projects .project[hidden] { display: none; }

.features { margin: 0 0 16px; padding-left: 1.2em; max-width: var(--measure); }
.features li { margin: 4px 0; }
.features li::marker { color: var(--mana); }

.minor { padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--rule); }
.minor__list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.minor__list li { padding: 20px 22px; border: 1px solid var(--rule); border-radius: 14px; background: var(--slab); }
.minor__list strong { display: block; margin-bottom: 6px; font-family: var(--display); font-weight: 400; font-size: 1.25rem; }
/* Text-only projects sit in a card so they read as a block, not loose text. */
.project--text { align-items: start; }
.project--card { padding: clamp(24px, 3.5vw, 40px); border: 1px solid var(--rule); border-radius: 16px; background: var(--slab); }

/* Home teasers */

.teasers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.teaser { color: inherit; text-decoration: none; }
.teaser .shot { margin-bottom: 16px; }
.teaser .shot img, .teaser .shot video { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.teaser h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 1.75rem; transition: color 0.25s var(--ease); }
.teaser p { margin: 0; color: var(--slate); }
.teaser:hover h3 { color: var(--mana); }

/* Services */

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.service {
  position: relative;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--slab);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.service:hover { border-color: var(--mana); transform: translateY(-3px); }
.services--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.services--four .service p { font-size: 0.9375rem; }
.service__num { display: block; margin-bottom: 18px; color: var(--mana); font-family: var(--display); font-size: 1rem; letter-spacing: 0.08em; }
.service h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
}
.service p { margin: 0; max-width: 44ch; color: var(--slate); }

.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps { position: relative; }
.steps li { position: relative; counter-increment: step; }
/* A line runs behind the hexagons and fills in, step by step, when the list scrolls into view. */
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 22px;
  right: calc(25% - 10px);
  height: 1.5px;
  background: var(--rule);
}
.steps::after { background: var(--mana); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease) 0.2s; }
.steps.is-on::after { transform: scaleX(1); }
.steps li::before { position: relative; z-index: 1; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.steps.is-on li::before { background: var(--mana); color: var(--on-mana); }
.steps.is-on li:nth-child(2)::before { transition-delay: 0.6s; }
.steps.is-on li:nth-child(3)::before { transition-delay: 1s; }
.steps.is-on li:nth-child(4)::before { transition-delay: 1.4s; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 1.5px solid var(--mana);
  color: var(--mana);
  font-family: var(--display);
  font-size: 1.25rem;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: var(--stone);
}
.steps h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 1.375rem; }
.steps p { margin: 0; color: var(--slate); }

/* About */

/* About: intro beside a pixel cat, skills as cards of tags, experience as a timeline. */
.about-intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.about-intro p { margin: 0 0 16px; max-width: var(--measure); color: var(--slate); }
.pixel-cat { margin: 0; justify-self: center; width: min(100%, 320px); }
.pixel-cat svg { display: block; width: 100%; height: auto; overflow: visible; }
.pixel-cat__body { fill: #0B0914; }
/* A thin outline so the black cat still reads on the dark background. */
.pixel-cat svg { filter: drop-shadow(0.6px 0 0 var(--cat-edge)) drop-shadow(-0.6px 0 0 var(--cat-edge)) drop-shadow(0 0.6px 0 var(--cat-edge)) drop-shadow(0 -0.6px 0 var(--cat-edge)); --cat-edge: color-mix(in srgb, var(--slate) 55%, transparent); }
.pixel-cat__eyes { fill: #F2EEF8; }
.pixel-cat__lids { fill: #0B0914; opacity: 0; }
.pixel-cat__sparks { fill: var(--mana); stroke: var(--mana); stroke-width: 0.45; stroke-linecap: round; opacity: 0.7; }
.pixel-cat__sparks circle:nth-of-type(2) { fill: none; }

.section--about { padding: clamp(36px, 5vw, 64px) 0; }
.section--about .section__title { margin-bottom: 28px; font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.skill { padding: 22px; border: 1px solid var(--rule); border-radius: 12px; background: var(--slab); transition: border-color 0.25s var(--ease), transform 0.25s var(--ease); }
.skill:hover { border-color: var(--mana); transform: translateY(-3px); }
.skill h3 { margin: 0 0 14px; font-weight: 700; font-size: 1.125rem; }
.chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 3px 12px; border: 1px solid var(--mana); border-radius: 999px; color: var(--ink); font-size: 0.875rem; }

.timeline { position: relative; margin: 0; padding: 0; list-style: none; display: grid; gap: 24px; }
.timeline::before { content: ""; position: absolute; top: 28px; bottom: 28px; left: 27px; width: 2px; background: var(--rule); }
.timeline__item { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; }
.timeline__year { position: relative; z-index: 1; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--mana); color: var(--on-mana); font-weight: 700; font-size: 0.9375rem; font-variant-numeric: lining-nums tabular-nums; }
.timeline__card { padding: 22px 26px; border: 1px solid var(--rule); border-radius: 12px; background: var(--slab); transition: border-color 0.25s var(--ease); }
.timeline__item:hover .timeline__card { border-color: var(--mana); }
.timeline__card h3 { margin: 0; font-weight: 700; font-size: 1.1875rem; }
.now-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 10px; border: 1px solid var(--verdigris); border-radius: 999px; color: var(--verdigris); font-size: 0.75rem; font-weight: 700; vertical-align: middle; }
.now-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verdigris); }
.timeline__where { margin: 4px 0 10px; color: var(--mana); font-weight: 700; font-size: 0.9375rem; }
.timeline__card p:last-child { margin: 0; max-width: var(--measure); color: var(--slate); }

.about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 56px);
}
.about p { margin: 0 0 16px; max-width: var(--measure); }
.facts { margin: 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 4px 0 20px; color: var(--slate); }

/* Call to action band */

.cta {
  width: var(--page);
  margin: 0 auto clamp(56px, 8vw, 104px);
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--slab);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cta h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.cta p { margin: 0; color: var(--slate); }

/* Contact */

.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 64px); }
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 1rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--slab);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--mana); box-shadow: 0 0 0 1px var(--mana); }
.form .button { justify-self: start; }
.form__note { margin: 0; color: var(--slate); font-size: 0.9375rem; }
.sent {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--verdigris);
  border-radius: 8px;
  color: var(--ink);
}
.globe { display: block; width: clamp(200px, 22vw, 280px); aspect-ratio: 1; margin: -24px 0 0; --globe-dot: var(--slate); --globe-home: var(--mana); --globe-ring: var(--rule); }
.reach { padding: 28px; border: 1px solid var(--rule); border-radius: 16px; background: var(--slab); }
.reach__row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.reach__row:first-of-type { margin-top: 4px; }
.reach__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--rule); border-radius: 12px; color: var(--mana); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.reach__icon svg { width: 20px; height: 20px; }
.reach__text { display: grid; min-width: 0; }
.reach__text small { color: var(--slate); font-size: 0.8125rem; }
.reach__text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.reach__row:hover { color: var(--mana); }
a.reach__row:hover .reach__icon { border-color: var(--mana); transform: translateY(-2px); }
.contact__aside h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.contact__aside p { margin: 0 0 16px; color: var(--slate); }
.contact__email {
  font-family: var(--display);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  color: var(--ink);
  text-decoration-color: var(--mana);
  overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--mana); }

/* Footer: a card like the others on the site, with the picture and name on the
   left and the links on the right. A black cat naps on its top edge. */
.footer {
  position: relative;
  width: var(--page);
  margin: clamp(120px, 12vw, 160px) auto 32px;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--slab);
  color: var(--slate);
  font-size: 0.9375rem;
}
.footer a { color: var(--slate); }
.footer__brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--display); font-size: 1.25rem; text-decoration: none; }
.footer .footer__brand { color: var(--ink); }
.footer__brand small { margin-left: 6px; color: var(--slate); font-family: var(--body); font-size: 0.8125rem; }

.nap-cat {
  position: absolute;
  right: clamp(24px, 6vw, 72px);
  bottom: calc(100% - 3px);
  width: 136px;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.nap-cat svg { display: block; width: 100%; height: auto; overflow: visible; }
.nap-cat__sleep { transition: opacity 0.15s; }
.nap-cat.is-awake .nap-cat__sleep, .nap-cat.is-petted .nap-cat__sleep { opacity: 0; }
.nap-cat:focus-visible { outline: 2px solid var(--mana); outline-offset: 6px; border-radius: 12px; }
.nap-cat__body { transform-origin: 221px 349px; }

.nap-cat__zz { position: absolute; left: 30%; bottom: 78%; pointer-events: none; }
.nap-cat__zz i { position: absolute; left: 0; bottom: 0; font-family: var(--display); font-style: normal; color: var(--slate); opacity: 0; }
.nap-cat__zz i:nth-child(1) { font-size: 0.875rem; }
.nap-cat__zz i:nth-child(2) { font-size: 1.125rem; }
.nap-cat__zz i:nth-child(3) { font-size: 1.375rem; }
.nap-cat.is-awake .nap-cat__zz, .nap-cat.is-petted .nap-cat__zz { visibility: hidden; }
.nap-cat__hearts { position: absolute; inset: 0 0 40% 0; pointer-events: none; }
.nap-cat__hearts i { position: absolute; bottom: 40%; font-style: normal; color: var(--mana); font-size: 1rem; animation: heart-up 1.2s var(--ease) forwards; }

/* Background hexagons: fixed behind everything, faint, never in the way */

.hexfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.hexfield span { position: absolute; top: 0; opacity: 0.08; }
.hexfield { opacity: calc(0.65 + var(--depth, 0) * 0.6); }
.hexfield svg { display: block; width: 100%; height: 100%; }
.hexfield polygon { fill: none; stroke: var(--mana); stroke-width: 1.5; }

/* Footer links */

.social { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.social__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--slate);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.social__icon:hover { color: var(--mana); border-color: var(--mana); transform: translateY(-2px); }
.social__icon svg { width: 18px; height: 18px; }
button.social__icon, button.reach__row { font: inherit; background: none; cursor: pointer; }
button.reach__row { width: 100%; border-width: 1px 0 0; text-align: left; }
.reach__hint { margin-left: auto; color: var(--slate); font-size: 0.8125rem; }
[data-copy] { position: relative; }
[data-copy][data-copied]::after {
  content: attr(data-copied);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--stone);
  font-size: 0.8125rem;
  white-space: nowrap;
  pointer-events: none;
}
.reach__row[data-copied]::after { left: auto; right: 0; translate: none; bottom: 50%; transform: translateY(50%); }
.reach__row[data-copied] .reach__hint { visibility: hidden; }

/* Motion: one hero sequence, scroll reveals, page transitions. All of it off for reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: page-out 0.25s var(--ease) both; }
  ::view-transition-new(root) { animation: page-in 0.45s var(--ease) both; }

  .hero__name, .hero__role, .hero__pitch, .hero__actions, .hero__hint { animation: rise 0.8s var(--ease) both; }
  .hero__hint { animation-delay: 0.42s; }
  .hero__role { animation-delay: 0.12s; }
  .hero__pitch { animation-delay: 0.22s; }
  .hero__actions { animation-delay: 0.32s; }
  .orb__plate { animation: scene-in 0.9s var(--ease) 0.1s backwards; }
  .orb::before { animation: fade-in 1.2s var(--ease) backwards; }
  .chip { animation: scene-in 0.7s var(--ease) backwards; }
  .chip[data-chip="web"] { animation-delay: 1s; }
  .chip[data-chip="app"] { animation-delay: 1.15s; }
  .chip[data-chip="game"] { animation-delay: 1.3s; }
  .scene > * { animation: scene-in 0.9s var(--ease) backwards; }
  .scene .laptop { animation-delay: 0.15s; }
  .scene .float[data-slot="back"] { animation-delay: 0.45s; }
  .scene .float[data-slot="front"] { animation-delay: 0.6s; }
  .scene .phone { animation-delay: 0.75s; }

  .ward__stone { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ward-draw 1.4s var(--ease) 0.2s forwards; }
  .ward__ring { opacity: 0; animation: fade 0.8s var(--ease) 0.9s forwards; }
  .ward__rune-ring { opacity: 0; animation: fade 1.2s var(--ease) 1s forwards, spin 120s linear 1s infinite; }
  .ward__hex { opacity: 0; animation: hex-in 0.5s var(--ease) forwards; }
  .ward__hex:nth-of-type(1) { animation-delay: 1.3s; }
  .ward__hex:nth-of-type(2) { animation-delay: 1.38s; }
  .ward__hex:nth-of-type(3) { animation-delay: 1.46s; }
  .ward__hex:nth-of-type(4) { animation-delay: 1.54s; }
  .ward__hex:nth-of-type(5) { animation-delay: 1.62s; }
  .ward__aim { opacity: 0; animation: fade 0.6s var(--ease) 1.7s forwards, flow 1.2s linear 1.7s infinite; }
  .ward__pulse.is-on { animation: pulse 0.7s var(--ease); }
  .pixel-cat svg { animation: cat-float 6s ease-in-out infinite; }
  .pixel-cat__lids { animation: cat-blink 5s infinite; }
  .pixel-cat__sparks { animation: cat-sparks 3.5s ease-in-out infinite; }
  .nap-cat__body { animation: cat-breathe 3.2s ease-in-out infinite; }
  .nap-cat__zz i { animation: zz-float 3.6s ease-in infinite; }
  .nap-cat__zz i:nth-child(2) { animation-delay: 1.2s; }
  .nap-cat__zz i:nth-child(3) { animation-delay: 2.4s; }
  .nap-cat.is-petted .nap-cat__body { animation: cat-purr 0.5s ease-in-out 2; }
  .now-badge::before { animation: live 2s ease-out infinite; }
  .zoom[open] img { animation: zoom-pop 0.3s var(--ease); }
  .zoom[open]::backdrop { animation: zoom-fade 0.3s var(--ease); }
  .ward__svg:hover .ward__hex { fill-opacity: 0.3; }

  .project__live::before { animation: live 2.4s ease-out infinite; }

  .hexfield span { opacity: 0; animation: hex-rise 22s linear infinite; }

  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@keyframes cat-float { 50% { transform: translateY(-8px); } }
@keyframes cat-blink { 0%, 92%, 98%, 100% { opacity: 0; } 94%, 96% { opacity: 1; } }
@keyframes cat-sparks { 50% { opacity: 0.25; } }
@keyframes cat-breathe { 50% { transform: scale(1.025, 0.98); } }
@keyframes cat-purr { 0%, 100% { transform: none; } 50% { transform: scale(1.03, 0.97); } }
@keyframes zz-float { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 0.8; } 100% { opacity: 0; transform: translate(26px, -46px); } }
@keyframes heart-up { from { opacity: 1; transform: translate(0, 0) scale(0.6); } to { opacity: 0; transform: translate(var(--sway), -56px) scale(1.15); } }
@keyframes scene-in { from { opacity: 0; translate: 0 28px; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
@keyframes fade { to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes zoom-pop { from { opacity: 0; transform: scale(0.94); } }
@keyframes zoom-fade { from { opacity: 0; } }
@keyframes ward-draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hex-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes flow { to { stroke-dashoffset: -20; } }
@keyframes pulse { from { opacity: 0.8; r: 10; } to { opacity: 0; r: 180; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 var(--verdigris); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes hex-rise {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  15% { opacity: 0.32; }
  80% { opacity: 0.22; }
  100% { opacity: 0; transform: translate(var(--drift), var(--rise)) rotate(var(--turn)); }
}
@keyframes hex-float {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  50% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(var(--drift)) rotate(var(--turn)); }
}
@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

/* Narrow screens */

@media (max-width: 900px) {
  .hero,
  .project,
  .project--text,
  .project--wide,
  .about,
  .contact { grid-template-columns: minmax(0, 1fr); }
  .project--flip .project__media { order: 0; }
  .store, .eden, .page-head { grid-template-columns: minmax(0, 1fr); }
  .scene { width: min(100%, 560px); margin: 16px auto 40px; }
  .showcase { grid-template-columns: minmax(0, 1fr); }
  .orb { width: min(86%, 460px); margin: 24px auto 72px; }
  .steps, .services--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-intro { grid-template-columns: minmax(0, 1fr); }
  .pixel-cat { width: min(70%, 260px); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps::before, .steps::after { display: none; }
}

@media (max-width: 760px) {
  .top { flex-wrap: wrap; row-gap: 12px; position: relative; }
  .top__clock { top: 38px; }
  .top__nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; }
  .services, .shots, .teasers, .steps { grid-template-columns: minmax(0, 1fr); }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .minor__list { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .footer { padding: 22px; }
  .nap-cat { width: 88px; }
  .social { gap: 10px; }
  .social__mail { flex-basis: 100%; }
  .timeline__item { grid-template-columns: 48px minmax(0, 1fr); }
  .timeline__year { width: 48px; height: 48px; font-size: 0.8125rem; }
  .timeline::before { left: 23px; }
  .float .win-bar__title { display: none; }
  .store__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .store__thumb span { padding: 4px 6px; font-size: 0.75rem; }
    .chip { padding: 6px 12px 6px 6px; gap: 8px; }
  .chip__icon { width: 30px; height: 30px; }
  .chip[data-chip="app"] { right: -6%; }
  .chip[data-chip="game"] { left: -4%; }
  .float .lights i { width: 8px; height: 8px; }
  .phones { padding: 8px 0 0; }
}

/* Contact form as a "new message" window. */
.compose { border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--slab); box-shadow: 0 18px 40px rgba(12, 10, 24, 0.1); }
.compose .form { gap: 0; }
.compose__to { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 24px; border-bottom: 1px solid var(--rule); color: var(--slate); font-size: 0.9375rem; }
.compose__to .avatar { width: 24px; height: 24px; margin-left: 4px; }
.compose__to b { color: var(--ink); font-weight: 500; }
.compose__body { display: grid; gap: 20px; padding: 24px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pills legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 8px 16px; border: 1px solid var(--rule); border-radius: 999px; color: var(--slate); cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease); }
.pill span:hover { border-color: var(--mana); color: var(--ink); }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--stone); }
.pill input:focus-visible + span { outline: 2px solid var(--mana); outline-offset: 2px; }
.compose__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.compose__foot .form__note { max-width: 32ch; }
.send { display: inline-flex; align-items: center; gap: 10px; }
.send__plane { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.send:hover .send__plane { transform: translate(2px, -2px); }
.send__spin { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.send.is-sending .send__plane { display: none; }
.send.is-sending .send__spin { display: block; }
.send:disabled { cursor: progress; opacity: 0.85; }
.form__error { margin: 0; color: #C2410C; font-size: 0.9375rem; }
.compose [hidden] { display: none; }
.compose__done { display: grid; justify-items: center; gap: 4px; padding: 56px 24px; text-align: center; }
.compose__done h2 { margin: 12px 0 0; font-family: var(--display); font-weight: 400; font-size: 1.75rem; }
.compose__done p { margin: 0 0 16px; max-width: 40ch; color: var(--slate); }
.compose__check { width: 64px; height: 64px; fill: none; stroke: var(--verdigris); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.compose__check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 0.6s var(--ease) forwards; }
.compose__check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.4s var(--ease) 0.45s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* First visit in a tab: a violet hexagon draws itself, the name types out, then
   the screen lifts away. Only shown when the head script adds .has-intro. */
.intro { display: none; }
.has-intro .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--stone);
  animation: intro-out 0.55s var(--ease) 1.25s forwards;
}
.intro__hex { width: 64px; height: 64px; fill: none; stroke: var(--mana); stroke-width: 3; stroke-linejoin: round; }
.intro__hex polygon { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hex-draw 0.7s var(--ease) 0.1s forwards; }
.intro__name { font-family: var(--display); font-size: 1.5rem; color: var(--ink); white-space: nowrap; clip-path: inset(0 100% 0 0); animation: type-in 0.6s steps(11) 0.55s forwards; }
@keyframes hex-draw { to { stroke-dashoffset: 0; } }
@keyframes type-in { to { clip-path: inset(0 0 0 0); } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; transform: translateY(-24px); } }

/* Pages fade into each other where the browser supports it. */
@view-transition { navigation: auto; }
