:root {
  --bg: #0b0b0d;
  --bg2: #0f0f13;
  --surface: #141419;
  --surface2: #1a1a20;
  --border: #232329;
  --text: #eceae6;
  --muted: #a09a90;
  --faint: #6d685f;
  --accent: #ffb454;
  --accent-hi: #ffc678;
  --accent-ink: #161006;
  --accent-2: #ff7847;
  --accent-rgb: 255, 180, 84;
  --accent-dim: rgba(var(--accent-rgb), 0.12);
  --ok: #7ee2a0;
  --bg-rgb: 11, 11, 13;
  --surface-rgb: 20, 20, 25;
  --text-rgb: 236, 234, 230;
  --faint-rgb: 109, 104, 95;
  --line-rgb: 255, 255, 255;
  --blob-1: #ff9a3d;
  --blob-2: #ff6b47;
  --scroll-thumb: #2a2a30;
  --scroll-thumb-hover: #3a3a42;
  --board-bg: #0c0c10;
  --hue-1: 255, 180, 84;
  --hue-2: 106, 167, 255;
  --hue-3: 87, 217, 163;
  --snake-head: 255, 198, 120;
  --snake-tail: 255, 110, 60;
  --food: 255, 180, 84;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-snap: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---- colour themes: each one only overrides the palette variables (amber is the default above) ---- */
html[data-theme="mono"] {
  --bg: #000000;
  --bg2: #080808;
  --surface: #101010;
  --surface2: #171717;
  --border: #2c2c2c;
  --text: #ffffff;
  --muted: #b3b3b3;
  --faint: #8c8c8c;
  --accent: #cfcfcf;
  --accent-hi: #ffffff;
  --accent-ink: #000000;
  --accent-2: #8c8c8c;
  --accent-rgb: 207, 207, 207;
  --ok: #7ee2a0;
  --bg-rgb: 0, 0, 0;
  --surface-rgb: 16, 16, 16;
  --text-rgb: 255, 255, 255;
  --faint-rgb: 140, 140, 140;
  --line-rgb: 255, 255, 255;
  --blob-1: #d9d9d9;
  --blob-2: #8c8c8c;
  --scroll-thumb: #2c2c2c;
  --scroll-thumb-hover: #444444;
  --board-bg: #050505;
  --hue-1: 255, 255, 255;
  --hue-2: 190, 190, 190;
  --hue-3: 140, 140, 140;
  --snake-head: 255, 255, 255;
  --snake-tail: 130, 130, 130;
  --food: 255, 255, 255;
}

html[data-theme="forest"] {
  --bg: #0e130f;
  --bg2: #121912;
  --surface: #18201a;
  --surface2: #1e2820;
  --border: #2b382d;
  --text: #f1e8d3;
  --muted: #b9b29b;
  --faint: #8f9783;
  --accent: #9db88a;
  --accent-hi: #bfd6ab;
  --accent-ink: #0e130f;
  --accent-2: #6f8f4e;
  --accent-rgb: 157, 184, 138;
  --ok: #9ad7a0;
  --bg-rgb: 14, 19, 15;
  --surface-rgb: 24, 32, 26;
  --text-rgb: 241, 232, 211;
  --faint-rgb: 143, 151, 131;
  --line-rgb: 220, 235, 200;
  --blob-1: #5f8a4d;
  --blob-2: #3f6b3a;
  --scroll-thumb: #2b382d;
  --scroll-thumb-hover: #3b4b3d;
  --board-bg: #0a0f0b;
  --hue-1: 157, 184, 138;
  --hue-2: 214, 190, 140;
  --hue-3: 120, 160, 120;
  --snake-head: 191, 214, 171;
  --snake-tail: 95, 138, 77;
  --food: 232, 220, 170;
}

html[data-theme="frost"] {
  --bg: #0a101c;
  --bg2: #0d1524;
  --surface: #131c2e;
  --surface2: #19243a;
  --border: #25324d;
  --text: #e6f0fb;
  --muted: #9fb2ca;
  --faint: #7f93b0;
  --accent: #72c8ff;
  --accent-hi: #b3e2ff;
  --accent-ink: #06101d;
  --accent-2: #9fb6d4;
  --accent-rgb: 114, 200, 255;
  --ok: #7fe3d1;
  --bg-rgb: 10, 16, 28;
  --surface-rgb: 19, 28, 46;
  --text-rgb: 230, 240, 251;
  --faint-rgb: 127, 147, 176;
  --line-rgb: 160, 200, 255;
  --blob-1: #3b82c4;
  --blob-2: #6ec6ff;
  --scroll-thumb: #25324d;
  --scroll-thumb-hover: #364768;
  --board-bg: #070c16;
  --hue-1: 114, 200, 255;
  --hue-2: 159, 182, 212;
  --hue-3: 127, 227, 209;
  --snake-head: 179, 226, 255;
  --snake-tail: 70, 140, 220;
  --food: 114, 200, 255;
}

html[data-theme="crimson"] {
  --bg: #140609;
  --bg2: #1a090d;
  --surface: #230e14;
  --surface2: #2c121a;
  --border: #3d1b26;
  --text: #dcdfe6;
  --muted: #aeb2bd;
  --faint: #8f94a1;
  --accent: #d6ad52;
  --accent-hi: #e8c777;
  --accent-ink: #1a0a0d;
  --accent-2: #d4283a;
  --accent-rgb: 214, 173, 82;
  --ok: #d6ad52;
  --bg-rgb: 20, 6, 9;
  --surface-rgb: 35, 14, 20;
  --text-rgb: 220, 223, 230;
  --faint-rgb: 143, 148, 161;
  --line-rgb: 255, 210, 215;
  --blob-1: #8f1d2c;
  --blob-2: #b3263a;
  --scroll-thumb: #3d1b26;
  --scroll-thumb-hover: #55283a;
  --board-bg: #100508;
  --hue-1: 214, 173, 82;
  --hue-2: 212, 40, 58;
  --hue-3: 169, 174, 185;
  --snake-head: 232, 199, 119;
  --snake-tail: 193, 18, 31;
  --food: 214, 173, 82;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-padding-top: 92px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
}

html.cursor-on,
html.cursor-on * {
  cursor: none !important;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 9999;
  opacity: 0;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
  transition: opacity 0.3s, transform 0.15s;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  transition: width 0.28s var(--ease-snap), height 0.28s var(--ease-snap),
    margin 0.28s var(--ease-snap), border-color 0.28s, background 0.28s, opacity 0.3s;
}

html.cursor-hover .cursor-dot {
  transform: scale(0.5);
}

html.cursor-hover .cursor-ring {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-color: rgba(var(--accent-rgb), 0.9);
  background: rgba(var(--accent-rgb), 0.07);
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 1000;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
  transform: scaleX(0);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(rgba(var(--line-rgb), 0.033) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--line-rgb), 0.033) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 35%, transparent 78%);
  pointer-events: none;
}

.blob {
  position: fixed;
  width: 52vw;
  height: 52vw;
  border-radius: 50%;
  filter: blur(96px);
  z-index: -3;
  pointer-events: none;
}

.b1 {
  top: -20vw;
  right: -14vw;
  background: radial-gradient(circle, var(--blob-1) 0%, transparent 62%);
  opacity: 0.12;
  animation: drift 26s ease-in-out infinite alternate;
}

.b2 {
  bottom: -26vw;
  left: -16vw;
  background: radial-gradient(circle, var(--blob-2) 0%, transparent 60%);
  opacity: 0.07;
  animation: drift 32s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  to {
    transform: translate(7vw, 5vh) scale(1.12);
  }
}

.grain {
  position: fixed;
  inset: -80px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 1.1s steps(5) infinite;
}

@keyframes grainShift {
  to {
    transform: translate(-42px, -32px);
  }
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding-block: 18px;
  transition: transform 0.4s var(--ease-snap), background 0.3s, padding 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  padding-block: 12px;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav.hidden {
  transform: translateY(-110%);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 36px;
}

.theme-switch {
  position: relative;
  flex: none;
}

.theme-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.theme-btn[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

@media (hover: hover) {
  .theme-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
  }
}

.theme-pop {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 950;
  min-width: 214px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.75);
}

.theme-pop[hidden] {
  display: none;
}

.theme-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .theme-opt:hover {
    background: rgba(var(--text-rgb), 0.06);
  }
}

.theme-opt[aria-pressed="true"] {
  background: var(--accent-dim);
  color: var(--accent);
}

.theme-dot {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-bg) 48%, var(--sw-ac) 52%);
  border: 1px solid rgba(var(--text-rgb), 0.3);
}

.theme-check {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0;
}

.theme-opt[aria-pressed="true"] .theme-check {
  opacity: 1;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding-block: 4px;
  transition: color 0.25s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-snap);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  padding: 10px;
  z-index: 960;
}

.menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.35s var(--ease-snap), background 0.3s;
}

body.menu-open .menu-btn span:first-child {
  transform: translateY(4px) rotate(45deg);
}

body.menu-open .menu-btn span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(var(--bg-rgb), 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10vh;
  padding: 0 10vw;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s, visibility 0.35s;
}

body.menu-open .mobile-menu {
  visibility: visible;
  opacity: 1;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-link {
  font-family: var(--font-head);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding-block: 6px;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.45s var(--ease-out) calc(var(--i) * 60ms + 0.1s),
    transform 0.45s var(--ease-out) calc(var(--i) * 60ms + 0.1s), color 0.25s;
}

.m-link:hover {
  color: var(--accent);
}

body.menu-open .m-link {
  opacity: 1;
  transform: none;
}

.mm-socials {
  display: flex;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s var(--ease-out) 0.4s, transform 0.45s var(--ease-out) 0.4s;
}

.mm-socials a {
  color: var(--muted);
  text-decoration: none;
}

.mm-socials a:hover {
  color: var(--accent);
}

body.menu-open .mm-socials {
  opacity: 1;
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 27px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
  will-change: transform;
}

.btn svg {
  transition: transform 0.3s var(--ease-snap);
}

@media (hover: hover) {
  .btn:hover svg {
    transform: translate(2px, -2px);
  }
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--accent-hi);
    box-shadow: 0 10px 34px -10px rgba(var(--accent-rgb), 0.5);
  }
}

button.btn {
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

@media (hover: hover) {
  .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
  }
}

.btn-small {
  padding: 9px 19px;
  font-size: 13.5px;
}

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 130px;
  padding-bottom: 70px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
  width: 100%;
}

.load-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ld, 0s) var(--ease-out),
    transform 0.9s var(--ld, 0s) var(--ease-out);
}

body.loaded .load-reveal {
  opacity: 1;
  transform: none;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.status-wrap {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  70%,
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(4rem, 11.5vw, 8.75rem);
  line-height: 0.94;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.line-inner {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease-out);
}

.line:nth-child(2) .line-inner {
  transition-delay: 0.12s;
}

body.loaded .line-inner {
  transform: translateY(0);
}

.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}

@supports not (-webkit-text-stroke: 1px black) {
  .outline {
    color: var(--accent);
  }
}

.hero-role {
  margin-top: 34px;
  font-size: clamp(1.1rem, 2.1vw, 1.4rem);
  color: var(--muted);
  max-width: 640px;
}

.rotator {
  display: inline-flex;
  vertical-align: bottom;
  color: var(--accent);
  font-weight: 500;
}

.rot-track {
  position: relative;
  display: inline-block;
  height: 1.45em;
  line-height: 1.45;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.5s var(--ease-snap);
}

.rot-word {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  opacity: 0;
  transform: translateY(105%);
  transition: transform 0.55s var(--ease-snap), opacity 0.4s;
}

.rot-word.is-active {
  opacity: 1;
  transform: translateY(0);
}

.rot-word.is-exit {
  opacity: 0;
  transform: translateY(-105%);
}

.hero-desc {
  margin-top: 22px;
  max-width: 540px;
  color: var(--muted);
  font-size: 16.5px;
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  list-style: none;
}

.hero-roles + .hero-actions {
  margin-top: 26px;
}

@media (max-height: 860px) and (min-width: 1021px) {
  .hero {
    padding-top: 92px;
    padding-bottom: 32px;
  }
  .hero-roles {
    margin-top: 14px;
  }
  .hero-roles + .hero-actions {
    margin-top: 20px;
  }
}

.hero-roles li {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: var(--accent-dim);
  color: var(--text);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 38px;
}

.term-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 34px 70px -30px rgba(0, 0, 0, 0.65);
  transform: rotate(1.6deg);
  transition: transform 0.5s var(--ease-out);
}

.term-card:hover {
  transform: rotate(0deg);
}

.term-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.d-r { background: #ff5f57; }
.d-y { background: #febc2e; }
.d-g { background: #28c840; }

.term-title {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  color: var(--faint);
}

.term-body {
  padding: 18px 20px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2.05;
  min-height: 218px;
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.term-line a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(var(--accent-rgb), 0.5);
  word-break: break-all;
}

.term-line a:hover {
  border-bottom-style: solid;
}

.t-echo {
  color: var(--text);
}

.t-err {
  color: #ff8a7a;
}

.t-ok {
  color: var(--ok);
}

.t-dim {
  color: var(--faint);
}

.term-live {
  display: flex;
  align-items: baseline;
  margin: 0 -20px;
  padding: 0 20px 0 18px;
  border-left: 2px solid transparent;
}

.term-live[hidden] {
  display: none;
}

.term-live .t-prompt {
  white-space: pre;
}

@media (forced-colors: active) {
  .term-live:focus-within {
    outline: 2px solid Highlight;
  }
}

.term-live:focus-within {
  border-left-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.term-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: inherit;
  caret-color: var(--accent);
}

.term-input::placeholder {
  color: var(--faint);
}

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}

.term-chips[hidden] {
  display: none;
}

.term-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

@media (hover: hover) {
  .term-chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
  }
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.t-prompt {
  color: var(--accent);
  font-weight: 700;
}

.t-muted {
  color: var(--muted);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-scroll {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.scroll-line {
  width: 58px;
  height: 1px;
  background: rgba(var(--faint-rgb), 0.4);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
  animation: slideLine 2.4s var(--ease-snap) infinite;
}

@keyframes slideLine {
  45%,
  55% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(101%);
  }
}

.marquee {
  border-block: 1px solid var(--border);
  background: var(--bg2);
  padding: 17px 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.m-group {
  display: flex;
  align-items: center;
  gap: 46px;
  padding-right: 46px;
}

.m-group span {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--faint);
  white-space: nowrap;
}

.m-group i {
  color: var(--accent);
  font-style: normal;
  font-size: 9px;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.section {
  padding-block: 108px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 54px;
}

.sec-num {
  font-size: 13px;
  color: var(--accent);
}

.sec-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sec-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  align-self: center;
}

.sec-more {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s;
}

.sec-more:hover {
  color: var(--accent);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
}

.about-copy p {
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 62ch;
  font-size: 16.5px;
}

.about-copy strong {
  color: var(--text);
  font-weight: 600;
}

.edu-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 24px 20px;
  background: linear-gradient(180deg, var(--surface), rgba(var(--surface-rgb), 0.35));
  margin-bottom: 20px;
}

.edu-card h3 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  margin-bottom: 12px;
}

.edu-degree {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 10px;
}

.edu-list {
  list-style: none;
  font-size: 12.5px;
  color: var(--muted);
}

.edu-list li {
  padding: 5px 0 5px 18px;
  position: relative;
}

.edu-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.stat:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-3px);
}

.stat-num {
  font-family: var(--font-head);
  font-size: 2.05rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-top: 8px;
}

.timeline {
  list-style: none;
  position: relative;
  max-width: 780px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--border));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.4s var(--ease-snap) 0.2s;
}

.timeline.in::before {
  transform: scaleY(1);
}

.tl-item {
  position: relative;
  padding-left: 44px;
  padding-bottom: 48px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-marker {
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
}

.tl-marker::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.45s var(--ease-snap) 0.45s;
}

.tl-item.in .tl-marker::after {
  transform: scale(1);
}

.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.tl-role {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
}

.tl-period {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.tl-org {
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 500;
  margin-top: 3px;
}

.tl-points {
  list-style: none;
  margin-top: 13px;
}

.tl-points li {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 8px;
  padding-left: 19px;
  position: relative;
  max-width: 66ch;
}

.tl-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  opacity: 0.65;
  transform: rotate(45deg);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.proj-wide {
  grid-column: 1 / -1;
}

.proj-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.35s, box-shadow 0.35s;
  will-change: transform;
}

.proj-card:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 26px 64px -26px rgba(0, 0, 0, 0.6);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.proj-wide .thumb {
  aspect-ratio: 21 / 8;
}

.thumb-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(var(--hue, var(--hue-1)), 0.15), rgba(var(--hue, var(--hue-1)), 0.02) 75%), var(--bg2);
  transition: transform 0.8s var(--ease-out);
}

.thumb-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(var(--line-rgb), 0.032) 0 1px,
    transparent 1px 13px
  );
}

.thumb-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 90% at 18% 0%, rgba(var(--hue, var(--hue-1)), 0.16), transparent 65%);
}

.proj-card:hover .thumb-bg {
  transform: scale(1.05);
}

.thumb-tag {
  position: absolute;
  left: 22px;
  top: 17px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(var(--text-rgb), 0.78);
}

.thumb-glyph {
  position: absolute;
  right: 24px;
  bottom: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(3rem, 6.5vw, 4.6rem);
  letter-spacing: -0.06em;
  color: rgba(var(--line-rgb), 0.07);
  user-select: none;
}

.proj-body {
  padding: 26px 26px 28px;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ptag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
}

.proj-card h3 {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.proj-card:hover h3 {
  color: var(--accent);
}

.proj-body p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 20px;
  max-width: 68ch;
}

.proj-links {
  display: flex;
  gap: 24px;
}

.proj-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding-bottom: 3px;
}

.proj-links a svg {
  color: var(--accent);
  transition: transform 0.3s var(--ease-snap);
}

.proj-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-snap);
}

.proj-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.proj-links a:hover svg {
  transform: translate(2px, -2px);
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.skill-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  background: var(--surface);
  transition: border-color 0.3s, transform 0.35s var(--ease-out);
}

.skill-group:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-4px);
}

.skill-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  font-weight: 500;
  margin-bottom: 20px;
}

.skill-group h3 span {
  color: var(--accent);
  margin-right: 8px;
}

.pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 17px;
  position: relative;
  overflow: hidden;
  transition: color 0.3s, border-color 0.3s;
  isolation: isolate;
}

.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: inherit;
  transform: translateY(102%);
  transition: transform 0.32s var(--ease-snap);
  z-index: -1;
}

.pill:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
}

.pill:hover::before {
  transform: translateY(0);
}

.pills-dashed .pill {
  border-style: dashed;
}

.skill-note {
  margin-top: 18px;
  font-size: 13px;
  font-style: italic;
  color: var(--faint);
}

.contact {
  padding-block: 140px 120px;
  text-align: center;
  position: relative;
}

.contact-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6.4vw, 4.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-top: 22px;
}

.serif-it {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0;
}

.contact-sub {
  color: var(--muted);
  max-width: 520px;
  margin: 26px auto 0;
  font-size: 16.5px;
}

.email-row {
  margin-top: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.email-link {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 4.6vw, 1.9rem);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  transition: color 0.3s, border-color 0.3s;
}

.email-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-btn {
  width: 47px;
  height: 47px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: border-color 0.3s, color 0.3s, transform 0.2s;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.copy-btn:active {
  transform: translateY(0) scale(0.94);
}

.copy-btn .ic-check {
  display: none;
}

.copy-btn.done {
  color: var(--ok);
  border-color: var(--ok);
}

.copy-btn.done .ic-copy {
  display: none;
}

.copy-btn.done .ic-check {
  display: block;
}

.socials {
  margin-top: 56px;
  display: flex;
  justify-content: center;
  gap: 36px;
}

.socials a {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s;
}

.socials a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-snap);
}

.socials a:hover {
  color: var(--text);
}

.socials a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer {
  border-top: 1px solid var(--border);
  padding-block: 26px;
}

.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.foot-time {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

#clock {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  transform: translate(-50%, calc(100% + 48px));
  opacity: 0;
  pointer-events: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  z-index: 1200;
  transition: transform 0.45s var(--ease-snap), opacity 0.3s;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.6);
}

.toast::before {
  content: "✓";
  color: var(--ok);
  margin-right: 9px;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.85s var(--d, 0s) var(--ease-out),
    transform 0.85s var(--d, 0s) var(--ease-out);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 1020px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-side {
    max-width: 480px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 118px;
  }
}

@media (max-width: 800px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .theme-switch {
    margin-left: auto;
  }
  .menu-btn {
    display: flex;
    margin-left: 6px;
  }
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .proj-wide .thumb {
    aspect-ratio: 16 / 9;
  }
  .foot-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .section {
    padding-block: 84px;
  }
  .contact {
    padding-block: 110px 90px;
  }
}

@media (max-width: 520px) {
  .hero-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat-num {
    font-size: 1.7rem;
  }
  .socials {
    gap: 24px;
  }
  .email-row {
    gap: 10px;
  }
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(var(--accent-rgb), 0.45);
  transition: border-color 0.25s;
  white-space: nowrap;
}

.inline-link:hover {
  border-bottom-style: solid;
}

.arcade-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(28px, 4vw, 44px);
  align-items: start;
}

.cabinet {
  container: cab / inline-size;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 34px 70px -30px rgba(0, 0, 0, 0.65);
}

.crt-wrap {
  position: relative;
  line-height: 0;
  /* keep the whole board on screen in short (landscape) viewports */
  max-width: max(280px, calc((100vh - 150px) * 660 / 374));
  max-width: max(280px, calc((100svh - 150px) * 660 / 374));
  margin-inline: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* while playing, swipes steer instead of scrolling (overlays included, while they fade out) */
.crt-wrap.playing {
  touch-action: none;
}

.crt-wrap:has(#gameCanvas:focus-visible)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

@media (forced-colors: active) {
  #gameCanvas:focus-visible,
  .crt-wrap:has(#gameCanvas:focus-visible)::after {
    outline-color: Highlight;
  }
}

/* long game-over text must still fit on a very small board */
.crt-wrap {
  container: board / inline-size;
}

@container board (max-width: 360px) {
  .crt-wrap .scr {
    padding: 8px 12px;
    gap: 4px;
    line-height: 1.3;
  }
  .crt-wrap .scr-big {
    font-size: 1.15rem;
  }
  .crt-wrap .scr-sub {
    font-size: 10.5px;
    letter-spacing: 0.03em;
  }
  .crt-wrap .nb-long {
    display: none;
  }
}

#gameCanvas {
  width: 100%;
  height: auto;
  display: block;
  background: var(--board-bg);
  outline: none;
  touch-action: none;
}

#gameCanvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(var(--line-rgb), 0.035) 0 1px,
    transparent 1px 3px
  );
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.38));
}

.scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  line-height: 1.4;
  background: rgba(var(--bg-rgb), 0.9);
  transition: opacity 0.3s, visibility 0.3s;
  overflow-y: auto;
}

.scr > :first-child {
  margin-top: auto;
}

.scr > :last-child {
  margin-bottom: auto;
}

.scr.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hint-touch,
.ctl-touch {
  display: none;
}

.scr-big {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  word-break: break-word;
}

.scr-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  max-width: 46ch;
}

.cab-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.cab-bar .btn {
  min-height: 42px;
  justify-content: center;
}

#btnStart {
  min-width: 92px;
}

.icon-btn {
  width: 42px;
  padding: 0;
  display: inline-flex;
}

.icon-btn:hover svg {
  transform: none;
}

#btnSound .ic-mute {
  display: none;
}

#btnSound.muted .ic-vol {
  display: none;
}

#btnSound.muted .ic-mute {
  display: block;
}

.cab-score {
  margin-left: auto;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.cab-score b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cab-score i {
  font-style: normal;
  margin: 0 10px;
  color: var(--border);
}

.arcade-copy h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.arcade-copy p {
  color: var(--muted);
  font-size: 15.5px;
  margin-bottom: 14px;
  max-width: 52ch;
}

.controls {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  margin-block: 20px;
  color: var(--muted);
  font-size: 13px;
}

.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 3px 8px;
}

.arcade-hint {
  font-size: 12px !important;
  color: var(--muted) !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[tabindex="-1"]:focus {
  outline: none;
}

@media (any-pointer: coarse) {
  .hint-touch {
    display: inline;
  }
  .ctl-touch {
    display: block;
  }
}

/* touch-only devices: no keyboard wording */
@media (any-pointer: coarse) and (not (any-pointer: fine)) {
  .hint-key,
  .ctl-key {
    display: none;
  }
}

/* touch + mouse/keyboard (tablets, touch laptops): show both, separated */
@media (any-pointer: coarse) and (any-pointer: fine) {
  .hint-key + .hint-touch::before {
    content: " · ";
  }
}

@media (pointer: coarse) {
  .term-body {
    overscroll-behavior: auto;
  }
  .term-input {
    font-size: 16px;
  }
  .term-chip {
    padding: 9px 14px;
    font-size: 12.5px;
  }
  .theme-btn {
    width: 44px;
    height: 44px;
  }
  .theme-opt {
    padding: 13px 12px;
  }
  .cab-bar .btn {
    min-height: 44px;
  }
  .icon-btn {
    min-width: 44px;
  }
}

/* when the cabinet is too narrow for one row, the score always gets its own row, so the
   bar height never changes with the button label or the number of score digits */
@container cab (max-width: 500px) {
  .cab-score {
    flex: 1 0 100%;
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 420px) {
  #arcade .sec-more {
    display: none;
  }
}

/* ---- snake skin picker ---- */
.skins {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.skins-title {
  margin-bottom: 12px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.skin {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "sw name" "sw sub";
  align-items: center;
  column-gap: 10px;
  padding: 9px 12px;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

@media (hover: hover) {
  .skin:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
  }
}

.skin[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.skin.locked {
  border-style: dashed;
  color: var(--muted);
}

.skin.locked .skin-sw {
  opacity: 0.4;
  filter: grayscale(0.7);
}

.skin-sw {
  grid-area: sw;
  width: 30px;
  height: 14px;
  border-radius: 4px;
  background: var(--sw, var(--faint));
}

.skin-name {
  grid-area: name;
  font-size: 13px;
  line-height: 1.2;
}

.skin-sub {
  grid-area: sub;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.skin[aria-pressed="true"] .skin-sub {
  color: var(--accent);
}

.sk-classic {
  --sw: linear-gradient(90deg, rgb(var(--snake-head)), rgb(var(--snake-tail)));
}
.sk-neon {
  --sw: linear-gradient(90deg, #ff2d95, #ffd400, #2dffb2, #2d9bff, #b02dff);
}
.sk-ghost {
  --sw: linear-gradient(90deg, rgba(var(--snake-head), 0.95), rgba(var(--snake-head), 0.08));
}
.sk-gold {
  --sw: linear-gradient(90deg, #ffe08a, #d4a017, #8c5a00);
}
.sk-phosphor {
  --sw: linear-gradient(90deg, #b6ffcb, #39ff7a, #0f8a3a);
}
.sk-eightbit {
  --sw: repeating-linear-gradient(90deg, #ffffff 0 6px, #5b6cff 6px 12px);
}

.arcade-copy .skins-hint {
  min-height: 2.8em;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--accent);
}

.arcade-copy .skins-tease,
.arcade-copy .skins-record {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.skins-tease a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(var(--accent-rgb), 0.5);
}

.skins-record[hidden] {
  display: none;
}

.skins-record b {
  color: var(--text);
}

@media (max-width: 900px) {
  .arcade-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .load-reveal,
  .line-inner {
    opacity: 1 !important;
    transform: none !important;
  }
  .cursor-dot,
  .cursor-ring,
  .grain {
    display: none;
  }
}

/* ---- konami easter egg ---- */
.konami {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(var(--bg-rgb), 0.84);
  opacity: 0;
  transition: opacity 0.45s;
  cursor: pointer;
  touch-action: none;
  overscroll-behavior: contain;
}

.konami-card:focus {
  outline: none;
}

.konami.in {
  opacity: 1;
}

.konami.out {
  opacity: 0;
}

.konami canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.konami-card {
  position: relative;
  max-width: 460px;
  padding: 28px 30px;
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--bg-rgb), 0.9);
  box-shadow: 0 0 60px -10px rgba(var(--accent-rgb), 0.45);
  text-align: center;
}

.konami-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 700;
  color: var(--accent);
}

.konami-seq {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--text);
}

.konami-sub {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.konami-esc {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  .konami {
    transition: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   I see what you're doing. Nice try.
   (the very bottom of a stylesheet? now THAT is commitment.)
   unlock code:  view-source-wins
   ───────────────────────────────────────────────────────────── */
