/* ============================================================
   zcripted. — glitch / terminal / developer rebrand
   Dark · cyberpunk · RGB-split · CRT · fully responsive
   Inspired by the @zcripteddev avatar:
   black canvas · white wordmark · cyan + magenta aberration ·
   HUD corner frame · scanlines · monospace UI.
   ============================================================ */

:root {
  --bg: #08080c;
  --bg-2: #0b0c12;
  --panel: rgba(13, 15, 22, 0.66);
  --fg: #eef1f8;
  --muted: #7d8298;
  --muted-dim: #565a6e;

  --cyan: #1ff0e6;
  --cyan-2: #00e1ff;
  --magenta: #ff2da6;
  --magenta-2: #ff5cc0;

  --line: rgba(31, 240, 230, 0.16);
  --line-soft: rgba(255, 255, 255, 0.07);
  --ring: rgba(31, 240, 230, 0.55);

  /* fluid type scale */
  --step--2: clamp(0.62rem, 0.58rem + 0.18vw, 0.72rem);
  --step--1: clamp(0.74rem, 0.7rem + 0.2vw, 0.84rem);
  --step-0: clamp(0.92rem, 0.88rem + 0.22vw, 1.02rem);
  --step-1: clamp(1.02rem, 0.95rem + 0.45vw, 1.22rem);
  --step-mark: clamp(3rem, 1.3rem + 9.5vw, 9rem);

  --radius: 12px;
  --maxw: 880px;

  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--sans);
  color: var(--fg);
  background:
    radial-gradient(120% 90% at 50% -10%, #11131c 0%, var(--bg) 55%) fixed,
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Content-protection deterrents (CSS layer) ------------- */
/* Disable text/element selection, image dragging, and the iOS
   long-press "save image" callout. The email field is re-enabled
   below so visitors can still type. NOTE: deterrent only — see
   protect.js header for the honest limitations. */
html {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img, svg, canvas, a, .wordmark, .card, .term-body, .commit {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}
/* keep form fields fully usable */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* invisible watermark overlay — above content, below cursor/FX */
#watermark {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  pointer-events: none;
  user-select: none;
}

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

/* --- Background: digital rain ------------------------------ */

#matrix {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;            /* span full viewport incl. scrollbar gutter */
  height: 100%;
  z-index: 0;
  display: block;
  opacity: 0.5;
}

/* --- Cursor glow ------------------------------------------- */

.glow {
  position: fixed;
  top: 0; left: 0;
  width: 17vmax; height: 17vmax;
  z-index: 1;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(
    circle at center,
    rgba(31, 240, 230, 0.18),
    rgba(255, 45, 166, 0.07) 40%,
    transparent 66%
  );
  filter: blur(16px);
  transition: opacity 0.6s ease;
  will-change: transform;
}

/* --- Custom HUD reticle cursor (desktop / fine pointers) --- */

.cursor-dot,
.cursor-ring,
.fx { display: none; }

@media (hover: hover) and (pointer: fine) {
  /* hide the native arrow; show the reticle. Text fields keep an I-beam. */
  html, body { cursor: none; }
  a, button, [role="button"], .card, .chips li, .socials a, label, summary { cursor: none; }
  input, textarea, select { cursor: text; }

  .cursor-dot, .cursor-ring, .fx { display: block; }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
}
.cursor-ready .cursor-dot,
.cursor-ready .cursor-ring { opacity: 1; }

/* precise crosshair reticle — tracks the pointer exactly */
.cursor-dot {
  width: 18px; height: 18px;
  background: radial-gradient(circle, var(--cyan) 0 1.6px, transparent 2.3px);
  filter: drop-shadow(0 0 4px rgba(31, 240, 230, 0.7));
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.cursor-dot::before,
.cursor-dot::after {
  content: "";
  position: absolute;
  background: var(--cyan);
  box-shadow: 0 0 4px rgba(31, 240, 230, 0.55);
}
.cursor-dot::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.cursor-dot::after  { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }

/* trailing reticle ring — eases behind the dot */
.cursor-ring {
  width: 30px; height: 30px;
  border: 1px solid rgba(31, 240, 230, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(31, 240, 230, 0.15), inset 0 0 8px rgba(31, 240, 230, 0.08);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease,
              background 0.2s ease, opacity 0.2s ease;
}

/* over interactive targets: ring grows + shifts to magenta */
.cursor--hover .cursor-ring {
  width: 48px; height: 48px;
  border-color: var(--magenta);
  background: rgba(255, 45, 166, 0.08);
  box-shadow: 0 0 16px rgba(255, 45, 166, 0.25);
}
.cursor--hover .cursor-dot { filter: drop-shadow(0 0 6px rgba(255, 45, 166, 0.85)); }

/* over text fields / off-window: hide the reticle */
.cursor--text .cursor-dot,
.cursor--text .cursor-ring,
.cursor--hidden .cursor-dot,
.cursor--hidden .cursor-ring { opacity: 0; }

/* left-click pulse — ring snaps inward, briefly white-hot */
.cursor--down .cursor-ring { width: 22px; height: 22px; border-color: #fff; }

/* --- Left-click ripple FX ---------------------------------- */

.fx {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}
.click-ripple {
  position: absolute;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 1px solid rgba(31, 240, 230, 0.85);
  box-shadow: 0 0 8px rgba(31, 240, 230, 0.2);
  animation: ripple 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes ripple {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(3); opacity: 0; }
}

/* --- CRT overlays ------------------------------------------ */

.scanlines {
  position: fixed;
  top: 0; left: 0; right: auto; bottom: 0;
  width: 100vw;            /* cover the scrollbar gutter too */
  z-index: 8;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  animation: scan-roll 8s linear infinite;
}
@keyframes scan-roll { to { background-position: 0 120px; } }

.vignette {
  position: fixed;
  top: 0; left: 0; right: auto; bottom: 0;
  width: 100vw;            /* cover the scrollbar gutter too */
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(125% 125% at 50% 0%, transparent 52%, rgba(0, 0, 0, 0.6) 100%),
    radial-gradient(90% 70% at 50% 110%, rgba(31, 240, 230, 0.06), transparent 60%);
}

/* --- Fixed HUD frame --------------------------------------- */

.frame {
  position: fixed;
  inset: clamp(0.7rem, 1.6vw, 1.4rem);
  z-index: 7;
  pointer-events: none;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 2px solid var(--cyan);
  filter: drop-shadow(0 0 6px rgba(31, 240, 230, 0.45));
}
.corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.frame-row {
  position: absolute;
  left: clamp(0.8rem, 2vw, 1.6rem);
  right: clamp(0.8rem, 2vw, 1.6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.frame-top { top: clamp(0.45rem, 1.2vw, 0.8rem); }
.frame-bottom { bottom: clamp(0.45rem, 1.2vw, 0.8rem); }

.online { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--cyan); }
.blk {
  width: 8px; height: 11px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }

/* --- Layout shell ------------------------------------------ */

.shell {
  position: relative;
  z-index: 3;
  width: min(100% - 2.5rem, var(--maxw));
  margin: 0 auto;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: clamp(3.4rem, 8vh, 5.5rem) 0 clamp(2rem, 5vh, 3rem);
}

/* --- Page sections ----------------------------------------- */

.section {
  padding: clamp(2.8rem, 7vh, 5rem) 0;
  border-top: 1px solid var(--line-soft);
}

.section-head { margin-bottom: clamp(1.4rem, 3vw, 2rem); }
.section-kicker {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  color: var(--cyan);
}
.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.2rem);
  letter-spacing: -0.02em;
}

/* --- Project cards ----------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: clamp(0.9rem, 2vw, 1.25rem);
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--ring);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(31, 240, 230, 0.08);
}

.card-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}
.card-path { font-size: var(--step--2); color: var(--muted); margin-left: 0.3rem; }
.card-status { margin-left: auto; font-size: var(--step--2); letter-spacing: 0.06em; }
.card-status.ok { color: var(--cyan); }
.card-status.dev { color: #f7c948; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
  padding: 1rem 1rem 1.1rem;
}
.card-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
}
.card-desc { margin: 0; font-size: var(--step--1); line-height: 1.6; color: var(--muted); }
.card-link {
  margin-top: auto;
  align-self: flex-start;
  color: var(--cyan);
  font-size: var(--step--1);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.card-link:hover:not(.dim) { color: var(--magenta); transform: translateX(2px); }
.card-link.dim { color: var(--muted-dim); cursor: default; }

/* small tag chips reuse .chips but without the › prefix */
.chips.small { gap: 0.4rem; }
.chips.small li { font-size: var(--step--2); padding: 0.25rem 0.55rem; }
.chips.small li::before { display: none; }
.chips.small li:hover { transform: none; }

/* --- Changelog (git log) ----------------------------------- */

.commits { list-style: none; margin: 0; padding: 0; }
.commit {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: var(--step--1);
}
.commit:last-child { border-bottom: 0; }
.commit .hash { flex: 0 0 auto; color: var(--cyan); }
.commit .cmsg { flex: 1; color: var(--fg); word-break: break-word; }
.commit .ctime { flex: 0 0 auto; }

.building {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: clamp(1.1rem, 3vw, 1.5rem) 0 0;
  font-size: var(--step--1);
  color: var(--muted);
}
.building .blk {
  width: 8px; height: 11px;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
  animation: blink 1.1s steps(1) infinite;
}
.building .hl { color: var(--fg); border-bottom: 1px dashed var(--cyan); padding-bottom: 1px; }

/* --- Footer ------------------------------------------------ */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: clamp(2rem, 5vh, 3rem) 0 clamp(2.6rem, 6vh, 3.6rem);
  border-top: 1px solid var(--line-soft);
}
.site-footer .socials { margin: 0; }
.copyright { font-size: var(--step--1); color: var(--muted-dim); }

/* --- Desktop scroll-hint fade ------------------------------ */
/* Hidden by default; only the desktop tier shows it. Visible when
   idle, fades out smoothly while scrolling or when at page bottom. */
.scroll-fade {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: clamp(96px, 14vh, 150px);
  z-index: 6;
  pointer-events: none;
  display: none;
  opacity: 1;
  background: linear-gradient(
    to top,
    var(--bg) 6%,
    rgba(8, 8, 12, 0.82) 36%,
    rgba(8, 8, 12, 0) 100%
  );
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Eyebrow ----------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  margin: 0 0 clamp(1rem, 2.5vw, 1.6rem);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow .prompt { color: var(--magenta); }
.caret { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }

/* --- Glitch wordmark --------------------------------------- */

.wordmark {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-mark);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #fff;
  text-transform: lowercase;
  width: max-content;
  max-width: 100%;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.12);
}
.wordmark .dot { color: var(--cyan); }

/* RGB-split layers */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  width: 100%;
  pointer-events: none;
  text-shadow: none;
}
.glitch::before {
  color: var(--magenta);
  z-index: -1;
  transform: translate(3px, 0);
  mix-blend-mode: screen;
  animation: split-x 5s ease-in-out infinite, glitch-a 3.4s steps(2) infinite;
}
.glitch::after {
  color: var(--cyan);
  z-index: -2;
  transform: translate(-3px, 0);
  mix-blend-mode: screen;
  animation: split-y 5s ease-in-out infinite, glitch-b 2.7s steps(2) infinite;
}

@keyframes split-x {
  0%, 100% { transform: translate(3px, 0); }
  50% { transform: translate(5px, -1px); }
}
@keyframes split-y {
  0%, 100% { transform: translate(-3px, 0); }
  50% { transform: translate(-5px, 1px); }
}
/* occasional slice glitches via clip-path */
@keyframes glitch-a {
  0%, 92%, 100% { clip-path: inset(0 0 0 0); transform: translate(3px, 0); }
  93% { clip-path: inset(14% 0 52% 0); transform: translate(8px, -2px); }
  96% { clip-path: inset(64% 0 8% 0); transform: translate(-6px, 1px); }
}
@keyframes glitch-b {
  0%, 90%, 100% { clip-path: inset(0 0 0 0); transform: translate(-3px, 0); }
  91% { clip-path: inset(40% 0 30% 0); transform: translate(-9px, 2px); }
  95% { clip-path: inset(8% 0 70% 0); transform: translate(7px, -1px); }
}

/* a hard glitch burst toggled by JS */
.wordmark.burst { animation: skew 0.32s steps(2) 1; }
@keyframes skew {
  0% { transform: skewX(0deg); }
  20% { transform: skewX(7deg) translateX(2px); }
  40% { transform: skewX(-6deg) translateX(-3px); }
  60% { transform: skewX(4deg); }
  100% { transform: skewX(0deg); }
}

/* cyan scanline cutting through the wordmark (avatar detail) */
.wordmark::after { } /* reserved */
.wordmark { padding-block: 0.06em; }

/* --- Lede -------------------------------------------------- */

.lede {
  margin: clamp(1.3rem, 3vw, 1.9rem) 0 0;
  max-width: 56ch;
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--muted);
}
.lede .hl {
  color: var(--fg);
  border-bottom: 1px dashed var(--magenta);
  padding-bottom: 1px;
}

/* --- Terminal ---------------------------------------------- */

.terminal {
  margin: clamp(1.8rem, 4vw, 2.6rem) 0 0;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(31, 240, 230, 0.06);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}
.tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted-dim); }
.tdot:nth-child(1) { background: var(--magenta); }
.tdot:nth-child(2) { background: #f7c948; }
.tdot:nth-child(3) { background: var(--cyan); }
.term-title { font-size: var(--step--1); color: var(--muted); margin-left: 0.4rem; }
.term-meta { font-size: var(--step--1); margin-left: auto; }

.term-body {
  padding: 0.9rem 1rem 1rem;
  font-size: var(--step--1);
  line-height: 1.85;
  min-height: 9.5em;
  color: var(--fg);
}
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line .pfx { color: var(--magenta); margin-right: 0.6ch; }
.term-line.out .pfx { color: var(--cyan); }
.term-line.out { color: var(--muted); }
.term-line.ok { color: var(--cyan); }
.term-line .count { color: var(--fg); font-weight: 700; letter-spacing: 0.04em; }
.tcaret {
  display: inline-block;
  width: 0.6ch; height: 1.05em;
  vertical-align: -0.16em;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}

/* --- Notify form ------------------------------------------- */

.notify { margin: clamp(1.6rem, 4vw, 2.2rem) 0 0; max-width: 560px; }

.field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.4rem 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 4px rgba(31, 240, 230, 0.12), 0 0 30px rgba(31, 240, 230, 0.1);
}
.field-prompt {
  font-size: var(--step--1);
  color: var(--cyan);
  white-space: nowrap;
  user-select: none;
}
.field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0; outline: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--step-0);
  padding: 0.6rem 0.4rem;
}
.field input::placeholder { color: var(--muted-dim); }

.field button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  color: #03110f;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--cyan), var(--cyan-2));
  background-size: 160% auto;
  box-shadow: 0 8px 22px rgba(31, 240, 230, 0.28);
  transition: transform 0.18s ease, background-position 0.4s ease, box-shadow 0.25s ease;
}
.field button:hover {
  background-position: right center;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(31, 240, 230, 0.4);
}
.field button:active { transform: translateY(0); }
.btn-icon { transition: transform 0.25s ease; }
.field button:hover .btn-icon { transform: translateX(3px); }

.form-msg {
  margin: 0.8rem 0 0;
  min-height: 1.2em;
  font-size: var(--step--1);
  color: var(--muted);
}
.form-msg::before { content: "// "; color: var(--muted-dim); }
.form-msg.error { color: var(--magenta); }
.form-msg.success { color: var(--cyan); }

/* --- Socials ----------------------------------------------- */

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: clamp(2rem, 5vw, 2.75rem) 0 0;
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  color: var(--muted);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.socials a:hover {
  color: var(--fg);
  border-color: var(--ring);
  background: rgba(31, 240, 230, 0.08);
  transform: translateY(-2px);
}
.socials a:hover svg { color: var(--cyan); }

/* --- Tech stack -------------------------------------------- */

.stack {
  margin: clamp(1.6rem, 4vw, 2.3rem) 0 0;
  display: grid;
  gap: clamp(0.9rem, 2.5vw, 1.35rem);
  max-width: 620px;
}

.stack-label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.chips li {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--fg);
  padding: 0.4rem 0.75rem 0.4rem 0.6rem;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.chips li::before {
  content: "›";
  color: var(--cyan);
  margin-right: 0.55ch;
}
.chips li:hover {
  transform: translateY(-2px);
  border-color: var(--ring);
  background: rgba(31, 240, 230, 0.07);
}
.stack-group.focus .chips li::before { content: "#"; color: var(--magenta); }
.stack-group.focus .chips li:hover {
  border-color: rgba(255, 45, 166, 0.5);
  background: rgba(255, 45, 166, 0.08);
}

/* --- Custom scrollbar: transparent track · cyan thumb + arrows --- */
/* Matches the HUD reticle's primary colour (--cyan). Track is fully
   transparent, so only the thumb and the arrow buttons are visible. */
html {
  scrollbar-width: auto;                       /* thicker than "thin" (Firefox) */
  scrollbar-color: var(--cyan) transparent;    /* thumb · track */
}
/* Every scrollbar part is transparent — including the track-piece (the strip
   of track above/below the thumb, i.e. the "back" behind the thumb) and the
   scrollbar's own base. The page's fixed background FX span the full viewport
   width (see #matrix / .scanlines / .vignette below), so the live site shows
   through. */
::-webkit-scrollbar { width: 16px; height: 16px; background: transparent; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece,
::-webkit-scrollbar-corner {
  background: transparent;
  background-color: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--cyan);
  border: 3px solid transparent;               /* slim inset; track shows through */
  background-clip: padding-box;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(31, 240, 230, 0.55);
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan-2); background-clip: padding-box; }

/* Arrow buttons — one per end, drawn in cyan */
::-webkit-scrollbar-button {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
}
::-webkit-scrollbar-button:vertical { height: 16px; }
::-webkit-scrollbar-button:horizontal { width: 16px; }
::-webkit-scrollbar-button:vertical:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231ff0e6' d='M8 5l4 6H4z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:vertical:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231ff0e6' d='M8 11L4 5h8z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:horizontal:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231ff0e6' d='M5 8L11 4v8z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:horizontal:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231ff0e6' d='M11 8L5 4v8z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:hover { background-color: rgba(31, 240, 230, 0.12); }
/* hide the duplicate (double-arrow) buttons so each end shows one arrow */
::-webkit-scrollbar-button:vertical:start:increment,
::-webkit-scrollbar-button:vertical:end:decrement,
::-webkit-scrollbar-button:horizontal:start:increment,
::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }

/* --- Custom OVERLAY scrollbar (desktop / fine pointers) ---
   The native gutter scrollbar can't be made truly see-through on Windows —
   its track always reveals a backing. So on fine pointers we hide the native
   scrollbar entirely (the page still scrolls) and float a custom thumb +
   arrows over the content. The track is genuinely empty: no gutter, no
   background, fully click-through, so the live site shows behind the thumb. */
.vscroll { display: none; }

/* While dragging the thumb, scrolling must be INSTANT — otherwise the page's
   global `scroll-behavior: smooth` animates the content behind the thumb, so
   it lags. This forces the content to track the thumb 1:1. */
html.vscroll-dragging { scroll-behavior: auto; }

@media (hover: hover) and (pointer: fine) {
  html { scrollbar-width: none; }            /* Firefox: hide native */
  ::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* WebKit: hide native */

  .vscroll {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 22px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;        /* container; only thumb/track/arrows take input */
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .vscroll.is-active { opacity: 1; }
}

.vscroll__btn {
  flex: 0 0 auto;
  width: 22px; height: 24px;
  display: grid; place-items: center;
  padding: 0; border: 0;
  background: none;
  color: var(--cyan);
  pointer-events: auto;
  transition: color 0.18s ease, background 0.18s ease;
}
.vscroll__btn:hover { color: var(--cyan-2); background: rgba(31, 240, 230, 0.12); }
.vscroll__btn:active { background: rgba(31, 240, 230, 0.22); }
.vscroll__btn svg {
  width: 15px; height: 15px; display: block;
  filter: drop-shadow(0 0 3px rgba(31, 240, 230, 0.6));
}

.vscroll__track {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  pointer-events: auto;          /* visually empty (no bg) but clickable to jump */
}
/* Glitch/tech thumb: cyan slices split by slanted notches, chamfered corners,
   and a magenta RGB-split echo. The notch gaps are transparent, so the live
   site shows through them too. */
.vscroll__thumb {
  position: absolute;
  top: 0; left: 4px;             /* (22 − 14) / 2 */
  width: 14px;
  min-height: 40px;
  pointer-events: auto;
  will-change: transform;
  /* sliced segments: tall cyan bands cut by large transparent diagonal notches
     (you see the live site through the gaps, like the track) */
  background: repeating-linear-gradient(
    155deg,
    var(--cyan) 0 15px,
    transparent 15px 24px
  );
  /* notched/slanted ends: chamfer the top-right + bottom-left corners */
  clip-path: polygon(
    0 0,
    calc(100% - 5px) 0,
    100% 5px,
    100% 100%,
    5px 100%,
    0 calc(100% - 5px)
  );
  filter: drop-shadow(0 0 5px rgba(31, 240, 230, 0.6));
  transition: filter 0.2s ease;
}
/* magenta chromatic-aberration echo, offset like the glitch wordmark */
.vscroll__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: repeating-linear-gradient(
    155deg,
    var(--magenta) 0 15px,
    transparent 15px 24px
  );
  transform: translateX(2px);
  mix-blend-mode: screen;
  opacity: 0.5;
  pointer-events: none;
}
.vscroll__thumb:hover,
.vscroll-dragging .vscroll__thumb {
  background: repeating-linear-gradient(
    155deg,
    var(--cyan-2) 0 15px,
    transparent 15px 24px
  );
  filter: drop-shadow(0 0 8px rgba(31, 240, 230, 0.85));
}
/* glitch the chroma split while dragging */
.vscroll-dragging .vscroll__thumb::before {
  animation: thumb-glitch 0.28s steps(2) infinite;
}
@keyframes thumb-glitch {
  0%   { transform: translateX(2px); }
  50%  { transform: translateX(-2px); }
  100% { transform: translateX(2px); }
}

/* --- Back-to-top button (HUD, bottom-right) --- */
/* Fades in after a slight scroll, fades out near the top; smooth via CSS.
   Inherits cursor: none so the reticle shows over it (see cursor rules). */
.to-top {
  position: fixed;
  right: clamp(1.4rem, 3vw, 2.4rem);
  bottom: clamp(3.4rem, 8vh, 5rem);   /* clears the bottom HUD row (@zcripteddev) */
  z-index: 20;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  color: var(--cyan);
  background: rgba(8, 8, 12, 0.66);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45),
              0 10px 30px rgba(0, 0, 0, 0.5),
              0 0 22px rgba(31, 240, 230, 0.12);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover {
  color: var(--cyan-2);
  border-color: var(--ring);
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45),
              0 16px 36px rgba(0, 0, 0, 0.55),
              0 0 30px rgba(31, 240, 230, 0.3);
}
.to-top:active { transform: translateY(-1px); }
.to-top svg { width: 20px; height: 20px; display: block;
  filter: drop-shadow(0 0 4px rgba(31, 240, 230, 0.5)); }

/* HUD corner ticks (mirrors the frame corners) */
.to-top::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 7px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 1px 7px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 7px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 1px 7px no-repeat;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.to-top:hover::before { opacity: 0.9; }

/* Custom hover tooltip — terminal chip to the left of the button */
.to-top::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--cyan);
  background: rgba(8, 8, 12, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(31, 240, 230, 0.1);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.to-top:hover::after,
.to-top:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
@media (hover: none) { .to-top::after { display: none; } }

/* ============================================================
   RESPONSIVE TIERS — tailored layouts per device class
     Phone .................. <= 600px
     Tablet ................. 601px – 1024px
     Computer (default) ..... 1025px – 1439px
     Large monitor .......... >= 1440px
   ============================================================ */

/* ---- COMPUTER (>= 1025px): desktop-only scroll-hint fade ---- */
@media (min-width: 1025px) {
  .scroll-fade { display: block; }
}
/* fade out smoothly while actively scrolling or when at the page bottom */
body.scrolling .scroll-fade,
body.at-bottom .scroll-fade { opacity: 0; }

/* ---- COMPUTER · large monitors (>= 1440px) ---- */
@media (min-width: 1440px) {
  :root { --maxw: 1000px; }
  .lede { max-width: 60ch; }
}

/* ---- TABLET (601px – 1024px) ---- */
@media (min-width: 601px) and (max-width: 1024px) {
  :root { --maxw: 720px; --step-mark: clamp(3.4rem, 1rem + 9vw, 6.4rem); }
  .shell { width: min(100% - 3rem, var(--maxw)); }
  .lede { max-width: 54ch; }
}

/* ---- MOBILE PHONE (<= 600px) ---- */
@media (max-width: 600px) {
  :root {
    --maxw: 100%;
    --step-mark: clamp(2.7rem, 13vw + 0.5rem, 4.4rem);
  }
  .shell { width: min(100% - 1.75rem, var(--maxw)); }
  .hero { padding: 3.4rem 0 2.4rem; }
  .lede { max-width: 100%; }
  .terminal, .notify { max-width: 100%; }

  /* commit time drops to its own line on narrow screens */
  .commit { flex-wrap: wrap; gap: 0.35rem 0.9rem; }
  .commit .ctime { width: 100%; }

  /* stack the subscribe field */
  .field { flex-direction: column; align-items: stretch; padding: 0.7rem; }
  .field-prompt { padding: 0 0.25rem; }
  .field input { padding: 0.65rem 0.3rem; }
  .field button { justify-content: center; padding: 0.85rem 1rem; }

  .term-body { min-height: 11em; }
}

/* ---- Landscape phone (short viewport) ---- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 3rem 0; }
}

/* ---- Very small phones (<= 360px) ---- */
@media (max-width: 360px) {
  .socials a span { display: none; }   /* icon-only chips to save room */
  .socials a { padding: 0.55rem; }
}

/* ---- Touch devices: cursor glow is pointer-only ---- */
@media (hover: none) and (pointer: coarse) {
  .glow { display: none; }
}

/* --- Accessibility ----------------------------------------- */

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

::selection { background: rgba(255, 45, 166, 0.35); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .glitch::before { transform: translate(2px, 0); }
  .glitch::after { transform: translate(-2px, 0); }
}
