/* kyakz site styles. no framework, no build step. */

/* tokens */
:root {
  /* ink */
  --ink:        #0a060f;
  --ink-2:      #120b1f;
  --plum:       #1a0b2e;
  --plum-2:     #2a1247;
  --plum-3:     #3b1a63;

  /* neon */
  --violet:     #7b2ff7;
  --violet-lt:  #a855f7;
  --magenta:    #e040fb;

  /* paper */
  --bone:       #ede6db;
  --bone-2:     #c9c1b6;
  --bone-dim:   #8b8379;

  /* signal */
  --mint:       #34d399;
  --rose:       #fb7185;
  --amber:      #fbbf24;

  /* type */
  --display: 'Anton', 'Arial Narrow', sans-serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* rhythm */
  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --sec: clamp(5rem, 12vh, 9rem);
  --maxw: 1240px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone-2);
  font-family: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--violet); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--plum-3));
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--violet-lt); }
::-webkit-scrollbar-corner { background: var(--ink); }

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

/* type */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--bone);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.01em;
}

.display {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.005em;
}

.h-mega  { font-size: clamp(3.5rem, 15vw, 12rem); }
.h-xl    { font-size: clamp(2.5rem, 7vw, 5.5rem); }
.h-lg    { font-size: clamp(1.9rem, 4.2vw, 3.25rem); }
.h-md    { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--violet-lt);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: linear-gradient(90deg, var(--violet), transparent);
  flex: none;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--bone-2);
  max-width: 56ch;
}

.mono { font-family: var(--mono); }
.dim  { color: var(--bone-dim); }
strong { color: var(--bone); font-weight: 600; }

/* glow on the display headings */
.glow {
  text-shadow:
    0 0 28px rgba(123, 47, 247, 0.35),
    0 0 70px rgba(123, 47, 247, 0.16);
}

/* layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

section { position: relative; }
.section { padding-block: var(--sec); }

/* keep anchor jumps clear of the fixed nav */
section[id], .specimen[id] { scroll-margin-top: 6.5rem; }

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--plum-2) 15%, var(--plum-3) 50%, var(--plum-2) 85%, transparent);
}

.sec-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.sec-head .eyebrow { margin-bottom: 1.25rem; }
.sec-head p { margin: 1.25rem 0 0; }

/* atmosphere */
#fog {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* fallback if webgl is missing */
  background:
    radial-gradient(60% 50% at 20% 15%, rgba(123, 47, 247, 0.22), transparent 70%),
    radial-gradient(55% 45% at 82% 30%, rgba(224, 64, 251, 0.13), transparent 70%),
    radial-gradient(70% 60% at 50% 100%, rgba(42, 18, 71, 0.75), transparent 75%),
    var(--ink);
}

/* ash and the cursor ink trail */
#fx {
  position: fixed;
  inset: 0;
  z-index: 88;
  pointer-events: none;
}

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

/* film scratch texture */
.scratches {
  position: fixed;
  inset: -20%;
  z-index: 91;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75 0.008' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
  animation: scratch-drift 7s steps(9) infinite;
}
@keyframes scratch-drift {
  0%   { transform: translateX(0) scaleY(1); }
  50%  { transform: translateX(-2%) scaleY(1.04); }
  100% { transform: translateX(1%) scaleY(1); }
}
@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-1.5%, 1%); }
  66%  { transform: translate(1%, -1.5%); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(10, 6, 15, 0.75) 100%);
}

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

/* cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 95;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s;
}
.cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--magenta);
  box-shadow: 0 0 12px var(--magenta);
}
.cursor-ring {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(168, 85, 247, 0.6);
  transition: opacity 0.3s, width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), border-color 0.25s;
}
body.has-cursor .cursor-dot,
body.has-cursor .cursor-ring { opacity: 1; }
body.cursor-lg .cursor-ring {
  width: 62px; height: 62px;
  margin: -31px 0 0 -31px;
  border-color: var(--magenta);
}

/* preloader */
#preload {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: grid;
  place-items: center;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
#preload canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#preload .pl-mark {
  position: relative;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(2rem, 8vw, 5rem);
  color: var(--bone);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: pl-in 1.1s var(--ease) 0.25s forwards;
}
#preload .pl-sub {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--violet-lt);
  opacity: 0;
  animation: pl-in 1s var(--ease) 0.7s forwards;
}
@keyframes pl-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
body.loaded #preload { opacity: 0; visibility: hidden; }
body.loading { overflow: hidden; }

/* nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: rgba(10, 6, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(59, 26, 99, 0.6);
}
.nav-in {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.1rem var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--bone);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-pfp {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--plum-3);
  box-shadow: 0 0 12px rgba(123, 47, 247, 0.55);
  filter: sepia(1) hue-rotate(225deg) saturate(1.8) brightness(1.05);
}

.brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 14px var(--magenta);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}

.nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-links a {
  position: relative;
  padding: 0.5rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--bone); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 0.25rem;
  height: 1px;
  background: var(--violet-lt);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.cta {
  color: var(--bone);
  border: 1px solid var(--plum-3);
  border-radius: 2px;
  margin-left: 0.5rem;
  background: rgba(123, 47, 247, 0.1);
}
.nav-links a.cta:hover {
  background: var(--violet);
  border-color: var(--violet);
}
.nav-links a.cta::after { display: none; }

.burger {
  display: none;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--plum-3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 12px;
  width: 20px; height: 1.5px;
  background: var(--bone);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 26px; }
body.menu-open .burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(10, 6, 15, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 var(--gut);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease);
  visibility: hidden;
}
body.menu-open .mobile-menu {
  clip-path: inset(0 0 0 0);
  visibility: visible;
}
.mobile-menu a {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(2rem, 11vw, 3.5rem);
  color: var(--bone);
  line-height: 1.1;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.2s;
}
.mobile-menu a:hover { color: var(--violet-lt); }
body.menu-open .mobile-menu a {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.14s + var(--i) * 0.06s);
}

/* hero */
.hero {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding-block: 7rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-mark {
  position: absolute;
  top: 44%;
  left: 64%;
  transform: translate(-50%, -50%);
  width: min(82vw, 640px);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: mark-wake 2.2s var(--ease) 0.4s forwards;
}
@keyframes mark-wake { to { opacity: 1; } }

.hero-mark img {
  width: 100%;
  mix-blend-mode: screen;
  opacity: 0.56;
  filter: brightness(0.82) sepia(1) hue-rotate(222deg) saturate(3.2) contrast(1.06);
  -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent 92%);
  mask-image: radial-gradient(closest-side, #000 58%, transparent 92%);
  will-change: transform;
}

.hero-content { position: relative; z-index: 2; }
.hero-word {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(4rem, 19vw, 15rem);
  line-height: 0.82;
  color: var(--bone);
  letter-spacing: -0.005em;
  margin: 0.5rem 0 0;
  filter: url(#rough-lg);
  text-shadow:
    0 0 40px rgba(123, 47, 247, 0.4),
    0 0 110px rgba(123, 47, 247, 0.18);
}
.hero-word .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em) rotate(2deg);
  animation: ch-in 0.9s var(--ease) forwards;
  animation-delay: calc(0.15s + var(--i) * 0.055s);
}
@keyframes ch-in {
  to { opacity: 1; transform: none; }
}

.hero-sub {
  margin: 1.75rem 0 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.55;
  color: var(--bone-2);
  opacity: 0;
  animation: fade-up 1s var(--ease) 0.85s forwards;
}
.hero-tag {
  opacity: 0;
  animation: fade-up 1s var(--ease) 0.7s forwards;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fade-up 1s var(--ease) 1.05s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.scroll-hint {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  opacity: 0;
  animation: fade-up 1s var(--ease) 1.5s forwards;
  z-index: 2;
}
.scroll-hint i {
  display: block;
  width: 1px; height: 42px;
  background: linear-gradient(var(--violet-lt), transparent);
  animation: hint-slide 2.2s ease-in-out infinite;
}
@keyframes hint-slide {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50%      { transform: scaleY(1);   transform-origin: top; opacity: 1; }
}

/* buttons */
.btn {
  --btn-bg: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--btn-bg);
  border: 1px solid var(--plum-3);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
  will-change: transform;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--violet), var(--magenta));
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
  z-index: -1;
}
.btn > * { position: relative; z-index: 1; }
.btn:hover {
  color: #fff;
  border-color: var(--magenta);
}
.btn:hover::before { transform: translateY(0); }
.btn .arw { transition: transform 0.35s var(--ease); }
.btn:hover .arw { transform: translateX(5px); }

.btn-solid {
  --btn-bg: linear-gradient(120deg, var(--violet), #9333ea);
  border-color: transparent;
  box-shadow: 0 8px 34px -12px rgba(123, 47, 247, 0.85);
}
.btn-solid::before { background: linear-gradient(120deg, var(--magenta), var(--violet)); }

.btn-ghost { --btn-bg: rgba(26, 11, 46, 0.4); }

/* reveals */
.rv {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.rv.in { opacity: 1; transform: none; }

.rv-mask { overflow: hidden; display: block; }
.rv-mask > * {
  display: block;
  transform: translateY(105%);
  transition: transform 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.rv-mask.in > * { transform: none; }

/* proof strip */
.proof {
  border-block: 1px solid rgba(59, 26, 99, 0.5);
  background: rgba(18, 11, 31, 0.5);
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.proof-item {
  padding: 2.25rem 1.5rem;
  text-align: center;
  border-left: 1px solid rgba(59, 26, 99, 0.4);
}
.proof-item:first-child { border-left: 0; }
.proof-item b {
  display: block;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  color: var(--bone);
  line-height: 1;
  margin-bottom: 0.55rem;
}
.proof-item span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* work cards */
.work-list { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }

.torn {
  position: relative;
  background: linear-gradient(155deg, rgba(26, 11, 46, 0.92), rgba(10, 6, 15, 0.96));
  border: 0;
  padding: clamp(1.6rem, 3.6vw, 2.75rem);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.55s var(--ease), background 0.45s;
  will-change: transform;
}

/* inked frame, turbulence keeps the edges uneven */
.inked-edge {
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(139, 76, 214, 0.45);
  filter: url(#rough-edge);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.45s, border-color 0.45s;
}
.torn:hover .inked-edge,
.torn.open .inked-edge { opacity: 1; border-color: rgba(200, 120, 255, 0.85); }
.specimen { border: 0; }
.specimen .inked-edge { inset: 8px; opacity: 0.4; border-width: 1.5px; }
.torn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 120% at 100% 0%, rgba(123, 47, 247, 0.2), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.torn:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 70px -28px rgba(123, 47, 247, 0.55);
}
.torn:hover::before { opacity: 1; }

/* ink seam on hover */
.torn::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--magenta), var(--violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease);
}
.torn:hover::after, .torn.open::after { transform: scaleX(1); }

.work-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}
.work-idx {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  color: var(--violet-lt);
  margin-bottom: 0.9rem;
  display: block;
}
.work-title {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.75rem, 4.4vw, 3.1rem);
  line-height: 0.95;
  color: var(--bone);
  transition: color 0.35s;
}
.torn:hover .work-title { color: #fff; }
.work-role {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-top: 0.75rem;
}
.work-role em {
  font-style: normal;
  color: var(--mint);
}
.work-toggle {
  flex: none;
  width: 46px; height: 46px;
  border: 1px solid var(--plum-3);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--violet-lt);
  transition: background 0.35s, transform 0.5s var(--ease), border-color 0.35s;
}
.torn:hover .work-toggle { background: rgba(123, 47, 247, 0.18); border-color: var(--violet-lt); }
.torn.open .work-toggle { transform: rotate(135deg); background: var(--violet); color: #fff; }

.work-blurb {
  margin: 1.5rem 0 0;
  max-width: 60ch;
  color: var(--bone-2);
}

/* big ghost number on the right */
.work-ghost {
  position: absolute;
  right: 2rem;
  top: 5.5rem;
  font-family: var(--display);
  font-size: clamp(5rem, 10vw, 9rem);
  line-height: 0.75;
  color: rgba(123, 47, 247, 0.11);
  pointer-events: none;
  user-select: none;
  transition: color 0.5s, transform 0.7s var(--ease);
}
.torn:hover .work-ghost {
  color: rgba(168, 85, 247, 0.2);
  transform: translateX(-10px);
}
@media (max-width: 1040px) { .work-ghost { display: none; } }

.work-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.65s var(--ease);
}
.torn.open .work-body { grid-template-rows: 1fr; }
.work-body > div { overflow: hidden; }
.work-inner {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(59, 26, 99, 0.55);
}

.manifest {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.manifest li {
  padding: 0.9rem 1.1rem;
  background: rgba(10, 6, 15, 0.6);
  border: 1px solid rgba(59, 26, 99, 0.45);
  border-left: 2px solid var(--violet);
  transition: border-color 0.3s, background 0.3s;
}
.manifest li:hover { background: rgba(42, 18, 71, 0.5); border-left-color: var(--magenta); }
.manifest b {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-lt);
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.manifest span { font-size: 0.86rem; color: var(--bone-2); }

.ctx-note {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.35rem;
  background: rgba(10, 6, 15, 0.55);
  border: 1px dashed rgba(59, 26, 99, 0.8);
  font-size: 0.88rem;
  color: var(--bone-dim);
}
.ctx-note b {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  display: block;
  margin-bottom: 0.4rem;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.75rem;
}

/* lab teaser */
.lab-teaser {
  position: relative;
  border: 1px solid rgba(59, 26, 99, 0.6);
  background: linear-gradient(150deg, rgba(26, 11, 46, 0.85), rgba(10, 6, 15, 0.95));
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.75rem, 4.5vw, 3.5rem);
}
.lab-teaser .lt-canvas {
  position: relative;
  aspect-ratio: 16 / 11;
  border: 1px solid rgba(59, 26, 99, 0.6);
  background: #0d0818;
  overflow: hidden;
}
.lab-teaser canvas { width: 100%; height: 100%; }
.lt-badge {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
  background: rgba(10, 6, 15, 0.8);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 0.25rem 0.55rem;
}

/* skills */
.skill-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 1.1rem;
}
.skill-cat {
  border: 1px solid rgba(59, 26, 99, 0.5);
  background: rgba(18, 11, 31, 0.55);
  padding: 1.5rem;
}
.skill-cat > h3 {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet-lt);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.skill-cat > h3::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.skill { border-bottom: 1px solid rgba(59, 26, 99, 0.3); }
.skill:last-child { border-bottom: 0; }
.skill-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.8rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  color: var(--bone-2);
  transition: color 0.25s;
}
.skill-btn:hover, .skill.open .skill-btn { color: var(--bone); }
.skill-btn i {
  flex: none;
  width: 16px; height: 16px;
  position: relative;
  opacity: 0.5;
  transition: opacity 0.25s, transform 0.4s var(--ease);
}
.skill-btn i::before, .skill-btn i::after {
  content: '';
  position: absolute;
  background: var(--violet-lt);
  transition: transform 0.4s var(--ease);
}
.skill-btn i::before { top: 7.5px; left: 0; width: 16px; height: 1px; }
.skill-btn i::after  { left: 7.5px; top: 0; width: 1px; height: 16px; }
.skill.open .skill-btn i { opacity: 1; }
.skill.open .skill-btn i::after { transform: scaleY(0); }
.skill-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.skill.open .skill-panel { grid-template-rows: 1fr; }
.skill-panel > div { overflow: hidden; }
.skill-panel p {
  margin: 0 0 1rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--violet);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--bone-dim);
}

/* snippets */
.snip {
  border: 1px solid rgba(59, 26, 99, 0.6);
  background: rgba(10, 6, 15, 0.85);
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 420px;
}
.snip-tabs {
  border-right: 1px solid rgba(59, 26, 99, 0.5);
  padding: 1rem 0;
  background: rgba(18, 11, 31, 0.6);
}
.snip-tab {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  padding: 0.7rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--bone-dim);
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.snip-tab:hover { color: var(--bone); background: rgba(42, 18, 71, 0.4); }
.snip-tab.on {
  color: var(--bone);
  border-left-color: var(--violet-lt);
  background: rgba(42, 18, 71, 0.6);
}
.snip-view { padding: 1.5rem; overflow: auto; }
.snip-view pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.75;
  color: var(--bone-2);
  white-space: pre;
}
.snip-view .cm { color: #6b5b8a; font-style: italic; }
.snip-view .kw { color: var(--magenta); }
.snip-view .fn { color: #67e8f9; }
.snip-view .st { color: var(--mint); }
.snip-view .nm { color: var(--amber); }

/* rates */
.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}
.tier {
  position: relative;
  border: 1px solid rgba(59, 26, 99, 0.55);
  background: linear-gradient(165deg, rgba(26, 11, 46, 0.8), rgba(10, 6, 15, 0.9));
  padding: 1.9rem 1.6rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.4s, transform 0.45s var(--ease);
}
.tier:hover {
  border-color: rgba(168, 85, 247, 0.7);
  transform: translateY(-4px);
  box-shadow: 0 18px 55px -26px rgba(123, 47, 247, 0.45);
}
.tier-tag {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 1rem;
}
.tier h3 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1.05;
  margin-bottom: 0.9rem;
}
.tier-cost {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--violet-lt);
}
.tier-devex {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-top: 0.2rem;
}
.tier p { font-size: 0.88rem; color: var(--bone-2); margin: 1.15rem 0 1.5rem; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--violet-lt);
  border: 1px solid rgba(123, 47, 247, 0.4);
  background: rgba(123, 47, 247, 0.09);
  padding: 0.3rem 0.55rem;
}

.terms {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  margin-top: 3.5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(59, 26, 99, 0.5);
}
.terms ol { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.terms li {
  counter-increment: t;
  padding: 0.9rem 0 0.9rem 3rem;
  position: relative;
  font-size: 0.88rem;
  color: var(--bone-dim);
  border-bottom: 1px solid rgba(59, 26, 99, 0.28);
}
.terms li:last-child { border-bottom: 0; }
.terms li::before {
  content: counter(t, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0.95rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--violet);
}
.terms li b { display: block; color: var(--bone); margin-bottom: 0.2rem; font-weight: 600; }

.warranty {
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-left: 2px solid var(--mint);
  background: rgba(52, 211, 153, 0.05);
  padding: 1.75rem;
  align-self: start;
}
.warranty blockquote {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--bone-2);
}
.warranty .seal {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mint);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.warranty .seal::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
}
.warranty p { font-size: 0.85rem; color: var(--bone-dim); margin: 0; }
.warranty .caveat {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(59, 26, 99, 0.8);
  color: var(--bone-dim);
  font-size: 0.8rem;
}

/* contact */
.outro {
  position: relative;
  min-height: 92svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding-block: var(--sec);
  overflow: hidden;
}
.outro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  pointer-events: none;
}
.outro.dark::before { opacity: 1; }
.outro > * { position: relative; z-index: 1; }
.outro-mark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 720px);
  z-index: 0;
  opacity: 0;
  transition: opacity 1.4s var(--ease) 0.3s;
}
.outro.dark .outro-mark { opacity: 0.9; }
.outro-mark img {
  width: 100%;
  mix-blend-mode: screen;
  opacity: 0.34;
  filter: brightness(0.8) sepia(1) hue-rotate(222deg) saturate(3.4) contrast(1.05);
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 88%);
  mask-image: radial-gradient(closest-side, #000 50%, transparent 88%);
  animation: mark-breathe 8s ease-in-out infinite;
}
@keyframes mark-breathe {
  0%, 100% { opacity: 0.34; transform: scale(1); }
  50%      { opacity: 0.46; transform: scale(1.03); }
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
}
.link-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
  min-width: 190px;
  text-align: left;
  border: 1px solid rgba(59, 26, 99, 0.6);
  background: rgba(18, 11, 31, 0.6);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
}
.link-card:hover {
  border-color: var(--violet-lt);
  background: rgba(42, 18, 71, 0.7);
  transform: translateY(-3px);
}
.link-card b {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-dim);
  font-weight: 700;
}
.link-card span { font-size: 1rem; color: var(--bone); }

footer {
  border-top: 1px solid rgba(59, 26, 99, 0.4);
  padding: 2rem 0;
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* console */
.console {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 140%);
  width: min(92vw, 620px);
  z-index: 96;
  background: rgba(10, 6, 15, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--plum-3);
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.9), 0 0 40px -18px var(--violet);
  transition: transform 0.5s var(--ease);
  font-family: var(--mono);
  font-size: 0.8rem;
}
body.console-open .console { transform: translate(-50%, 0); }
.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid rgba(59, 26, 99, 0.6);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.console-out {
  max-height: 190px;
  overflow-y: auto;
  padding: 0.85rem;
  line-height: 1.7;
}
.console-out div { word-break: break-word; }
.console-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid rgba(59, 26, 99, 0.6);
}
.console-in span { color: var(--magenta); }
.console-in input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: var(--bone);
}
.c-vi { color: var(--violet-lt); }
.c-mi { color: var(--mint); }
.c-ro { color: var(--rose); }
.c-dm { color: var(--bone-dim); }

/* lights out mode. konami code, or type lights in the console */
body.lights-out {
  --bone:     #3a2f4a;
  --bone-2:   #2e2540;
  --bone-dim: #241d33;
}
body.lights-out #fog { opacity: 0.28; transition: opacity 1s var(--ease); }
body.lights-out .grain { opacity: 0.3; }
body.lights-out .hero-eyes,
body.lights-out .outro-mark { opacity: 1; }

/* lab page */
.lab-hero { padding-block: 9rem 3.5rem; }

/* index rail + specimens */
.lab-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.lab-index {
  position: sticky;
  top: 7rem;
  border-left: 1px solid rgba(59, 26, 99, 0.5);
  padding-left: 1rem;
}
.lab-index .eyebrow { margin-bottom: 1rem; font-size: 0.6rem; }
.lab-index a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.42rem 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--bone-dim);
  transition: color 0.25s, transform 0.35s var(--ease);
}
.lab-index a i {
  font-style: normal;
  font-size: 0.58rem;
  color: var(--plum-3);
  transition: color 0.25s;
}
.lab-index a:hover { color: var(--bone); transform: translateX(3px); }
.lab-index a.on { color: var(--violet-lt); }
.lab-index a.on i { color: var(--magenta); }

.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
  padding: 0.22rem 0.5rem;
  margin-left: 0.6rem;
  vertical-align: middle;
}
.spec-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* claim line under each demo */
.spec-claim {
  margin: 0.9rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--violet);
  font-size: 0.88rem;
  color: var(--bone-2);
  max-width: 62ch;
}

.meter {
  height: 4px;
  background: rgba(59, 26, 99, 0.7);
  border-radius: 99px;
  overflow: hidden;
  min-width: 90px;
  flex: 1;
}
.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  transition: width 0.12s linear;
}
.meter.good span { background: linear-gradient(90deg, var(--mint), #6ee7b7); }

.sk-verdict {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1rem, 2vw, 1.4rem);
  line-height: 1;
}

.stage-hud b { color: var(--bone); font-weight: 700; }
.stage-hud.play {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--bone-dim);
  cursor: pointer;
  pointer-events: auto;
}

.specimen {
  border: 1px solid rgba(59, 26, 99, 0.55);
  background: linear-gradient(160deg, rgba(26, 11, 46, 0.65), rgba(10, 6, 15, 0.9));
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
.spec-head {
  padding: clamp(1.4rem, 3vw, 2.1rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  border-bottom: 1px solid rgba(59, 26, 99, 0.5);
}
.spec-head h2 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  line-height: 1;
}
.spec-head p { margin: 0.65rem 0 0; font-size: 0.9rem; color: var(--bone-dim); max-width: 58ch; }

.toggle {
  display: inline-flex;
  border: 1px solid var(--plum-3);
  border-radius: 2px;
  overflow: hidden;
  flex: none;
}
.toggle button {
  background: none;
  border: 0;
  padding: 0.6rem 1.05rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.toggle button:hover { color: var(--bone); }
.toggle button.on { background: var(--violet); color: #fff; }
.toggle button.on.good { background: var(--mint); color: #04160f; }

.stage {
  position: relative;
  background: #0d0818;
  aspect-ratio: 16 / 7.5;
  max-height: 540px;
  min-height: 300px;
}
.stage canvas { width: 100%; height: 100%; }

.stage-hud {
  position: absolute;
  top: 0.9rem; left: 0.9rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  background: rgba(10, 6, 15, 0.7);
  border: 1px solid rgba(59, 26, 99, 0.5);
  padding: 0.4rem 0.7rem;
  pointer-events: none;
}
.stage-hud.right { left: auto; right: 0.9rem; text-align: right; }

.stage-ctl {
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(10, 6, 15, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(59, 26, 99, 0.5);
  padding: 0.7rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-lt);
}
.stage-ctl output { color: var(--bone); min-width: 4.5rem; text-align: right; }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 2px;
  background: var(--plum-3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--violet-lt);
  box-shadow: 0 0 12px var(--violet);
  cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px;
  border: 0;
  border-radius: 50%;
  background: var(--violet-lt);
  box-shadow: 0 0 12px var(--violet);
  cursor: pointer;
}

.spec-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(59, 26, 99, 0.5);
  border-top: 1px solid rgba(59, 26, 99, 0.5);
}
.spec-code {
  background: rgba(10, 6, 15, 0.92);
  padding: 1.25rem;
  transition: opacity 0.4s, filter 0.4s;
  position: relative;
}
.spec-code.off { opacity: 0.28; filter: grayscale(1); }
.spec-code .tag {
  position: absolute;
  top: 0; right: 0;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  background: rgba(59, 26, 99, 0.7);
  color: var(--bone-dim);
}
.spec-code.good .tag { background: rgba(52, 211, 153, 0.2); color: var(--mint); }
.spec-code pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--bone-2);
  overflow-x: auto;
}

.sec-panel {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  text-align: right;
  max-width: min(360px, 58%);
  background: rgba(10, 6, 15, 0.78);
  border: 1px solid rgba(59, 26, 99, 0.5);
  padding: 0.8rem 1rem;
  pointer-events: none;
}
.sec-verdict {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.05rem, 2.3vw, 1.6rem);
  line-height: 1;
  letter-spacing: 0.02em;
}
.sec-panel p {
  margin: 0.55rem 0 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.55;
  color: var(--bone-dim);
}

.mini-btn {
  background: rgba(123, 47, 247, 0.12);
  border: 1px solid var(--plum-3);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.mini-btn:hover { background: var(--violet); border-color: var(--violet); color: #fff; }
.mini-btn.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.mini-btn.danger { border-color: rgba(251, 113, 133, 0.5); color: var(--rose); background: rgba(251, 113, 133, 0.08); }
.mini-btn.danger:hover,
.mini-btn.danger.on { background: var(--rose); border-color: var(--rose); color: #1a0208; }

.spec-hint {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(59, 26, 99, 0.5);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  background: rgba(10, 6, 15, 0.5);
}
.spec-hint b { color: var(--violet-lt); font-weight: 700; }

/* atomic transaction demo */
.tx-stage {
  display: grid;
  place-content: center;
  gap: 2.25rem;
  padding: 2.5rem 1.5rem;
  aspect-ratio: auto;
  min-height: 340px;
}
.tx-rail {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(700px, 82vw);
}
.tx-node { text-align: center; flex: none; }
.tx-box {
  width: 68px; height: 68px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border: 1px solid var(--plum-3);
  background: rgba(26, 11, 46, 0.8);
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.tx-box .lbl {
  position: absolute;
  top: -0.7rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  white-space: nowrap;
  background: var(--violet);
  color: #fff;
}
.tx-node.recv .tx-box .lbl { background: var(--mint); color: #04160f; }
.tx-val {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bone);
  margin-top: 0.6rem;
}
.tx-wire {
  flex: 1;
  height: 1px;
  background: var(--plum-3);
  position: relative;
}
.tx-packet {
  position: absolute;
  top: -11px; left: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #04160f;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.6);
  opacity: 0;
}
.tx-packet.lost { background: var(--rose); color: #fff; box-shadow: 0 0 18px rgba(251, 113, 133, 0.6); }
.tx-actions { display: flex; justify-content: center; gap: 0.7rem; flex-wrap: wrap; }
.tx-status {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  min-height: 1.5rem;
  color: var(--bone-dim);
}
.btn[disabled] { opacity: 0.35; pointer-events: none; }

.tone-mint { color: var(--mint); }
.tone-rose { color: var(--rose); }
.tone-amber { color: var(--amber); }
.tone-violet { color: var(--violet-lt); }

/* responsive */
@media (max-width: 1080px) {
  .lab-layout { grid-template-columns: 1fr; }
  .lab-index {
    position: static;
    border-left: 0;
    border-bottom: 1px solid rgba(59, 26, 99, 0.5);
    padding: 0 0 1rem;
    margin-bottom: 2rem;
  }
  .lab-index nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
}

@media (max-width: 940px) {
  .lab-teaser { grid-template-columns: 1fr; }
  .terms { grid-template-columns: 1fr; }
  .snip { grid-template-columns: 1fr; min-height: 0; }
  .snip-tabs {
    border-right: 0;
    border-bottom: 1px solid rgba(59, 26, 99, 0.5);
    display: flex;
    overflow-x: auto;
    padding: 0;
  }
  .snip-tab {
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .snip-tab.on { border-left-color: transparent; border-bottom-color: var(--violet-lt); }
  .spec-foot { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof-item:nth-child(3) { border-left: 0; }
  .proof-item:nth-child(n+3) { border-top: 1px solid rgba(59, 26, 99, 0.4); }
}

@media (max-width: 780px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .stage { aspect-ratio: 4 / 3; }
  .stage-ctl { flex-wrap: wrap; }
  .hero-mark { top: 30%; left: 50%; width: min(118vw, 520px); }
  .cursor-dot, .cursor-ring { display: none; }
}

@media (max-width: 520px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-item { border-left: 0; border-top: 1px solid rgba(59, 26, 99, 0.4); }
  .proof-item:first-child { border-top: 0; }
  .work-head { flex-direction: column; }
  .link-card { width: 100%; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rv { opacity: 1; transform: none; }
  .rv-mask > * { transform: none; }
  .hero-word .ch { opacity: 1; transform: none; }
  .hero-sub, .hero-tag, .hero-actions, .scroll-hint, .hero-mark { opacity: 1; }
  .grain { animation: none; }
  .cursor-dot, .cursor-ring { display: none; }
}
