@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #080710;
  --bg-soft: #0e0c18;
  --panel: rgba(18, 16, 31, 0.72);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f6ff;
  --muted: #a29caf;
  --purple: #9b6cff;
  --cyan: #4de7ff;
  --lime: #c8ff62;
  --orange: #ffad5c;
  --danger: #ff5876;
  --font-main: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 15%, rgba(99, 65, 180, .12), transparent 27rem),
    radial-gradient(circle at 10% 45%, rgba(18, 183, 204, .07), transparent 30rem),
    var(--bg);
  font-family: var(--font-main);
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
::selection { background: var(--lime); color: #17131e; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
canvas#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .55;
  z-index: 0;
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
.cursor-dot, .cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1000;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.cursor-dot { width: 7px; height: 7px; background: var(--lime); }
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(200, 255, 98, .6);
  transition: width .2s, height .2s, background .2s, border-color .2s;
}
.cursor-ring.hovered {
  width: 54px; height: 54px;
  border-color: rgba(77, 231, 255, .7);
  background: rgba(77, 231, 255, .08);
}
.boot-screen {
  position: fixed;
  inset: 0;
  background: #05040b;
  z-index: 999;
  display: grid;
  place-items: center;
  transition: opacity .6s ease, visibility .6s ease;
}
.boot-screen.hidden { opacity: 0; visibility: hidden; }
.boot-card { width: min(430px, calc(100vw - 48px)); }
.boot-logo {
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -.08em;
  margin-bottom: 1.5rem;
}
.boot-logo span { color: var(--lime); }
.boot-track { height: 3px; background: #22202d; overflow: hidden; }
.boot-track span {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--lime));
  transition: width .15s linear;
}
.boot-card p { font: .75rem var(--font-mono); color: var(--muted); }

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 36px));
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 22px;
  border: 1px solid var(--line);
  background: rgba(9, 8, 17, .72);
  backdrop-filter: blur(18px);
  border-radius: 20px;
  z-index: 90;
  box-shadow: 0 15px 50px rgba(0,0,0,.2);
}
.brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.05em;
}
.brand-bracket { color: var(--purple); }
.brand-slash { color: var(--lime); }
.desktop-nav { display: flex; gap: 32px; }
.desktop-nav a {
  color: var(--muted);
  font-size: .88rem;
  position: relative;
  transition: color .2s ease;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -7px;
  height: 1px; width: 0;
  background: var(--lime);
  transition: width .2s ease;
}
.desktop-nav a:hover { color: var(--text); }
.desktop-nav a:hover::after { width: 100%; }
.header-actions { display: flex; gap: 8px; }
.icon-button, .menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 13px;
  cursor: pointer;
}
.sound-off { display: none; }
.sound-muted .sound-on { display: none; }
.sound-muted .sound-off { display: inline; }
.menu-button { display: none; position: relative; }
.menu-button span {
  width: 17px; height: 1px;
  position: absolute; left: 12px;
  background: white;
  transition: transform .25s, top .25s;
}
.menu-button span:first-child { top: 16px; }
.menu-button span:last-child { top: 24px; }
.menu-button.active span:first-child { top: 20px; transform: rotate(45deg); }
.menu-button.active span:last-child { top: 20px; transform: rotate(-45deg); }
.mobile-menu {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(8,7,16,.97);
  backdrop-filter: blur(20px);
  display: grid;
  place-content: center;
  gap: 26px;
  text-align: center;
  font-size: clamp(2rem, 10vw, 4rem);
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }

main, footer { position: relative; z-index: 2; }
.section { width: min(1180px, calc(100% - 42px)); margin: auto; }
.hero {
  min-height: 100svh;
  padding: 150px 0 90px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 55px;
  position: relative;
}
.hero-copy { position: relative; z-index: 3; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font: 500 .72rem var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  margin-right: 9px;
  box-shadow: 0 0 16px var(--lime);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; transform: scale(.8); } }
.hero-title {
  font-size: clamp(3.8rem, 7.7vw, 7.4rem);
  line-height: .88;
  letter-spacing: -.085em;
  margin: 0;
  font-weight: 700;
}
.title-line { display: block; }
.gradient-text {
  color: transparent;
  background: linear-gradient(110deg, var(--purple), var(--cyan) 45%, var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  max-width: 640px;
  color: var(--muted);
  margin: 32px 0;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 15px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.button:hover { transform: translateY(-3px); }
.button-primary {
  background: var(--lime);
  color: #121018;
  border-color: var(--lime);
  box-shadow: 0 10px 40px rgba(200,255,98,.12);
}
.button-primary:hover { box-shadow: 0 14px 50px rgba(200,255,98,.22); }
.button-ghost { background: rgba(255,255,255,.035); }
.button-ghost:hover { border-color: rgba(255,255,255,.3); }
.button-arrow { font-size: 1.25rem; }
.prompt-icon { font-family: var(--font-mono); color: var(--cyan); }
.hero-stats {
  margin-top: 42px;
  display: flex;
  gap: 38px;
}
.hero-stats div { display: grid; grid-template-columns: auto auto; align-items: end; }
.hero-stats strong, .hero-stats > div > span {
  font: 500 1.5rem var(--font-mono);
}
.hero-stats > div > span { color: var(--lime); }
.hero-stats small {
  grid-column: 1 / 3;
  color: var(--muted);
  font-size: .65rem;
  letter-spacing: .08em;
  margin-top: 5px;
  text-transform: uppercase;
}
.hero-visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.code-card {
  width: min(100%, 520px);
  background: linear-gradient(145deg, rgba(26,23,42,.96), rgba(11,10,20,.96));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 23px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-style: preserve-3d;
}
.code-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(155,108,255,.4), transparent 35%, rgba(77,231,255,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
}
.code-topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.code-topbar span { width: 9px; height: 9px; border-radius: 50%; background: #ff637d; }
.code-topbar span:nth-child(2) { background: #ffcb5c; }
.code-topbar span:nth-child(3) { background: #6fe68d; }
.code-topbar p { margin: 0 0 0 8px; color: var(--muted); font: .72rem var(--font-mono); }
.code-card pre {
  margin: 0;
  padding: 34px 28px 40px;
  overflow: auto;
  font: 400 clamp(.74rem, 1.3vw, .95rem)/1.85 var(--font-mono);
  color: #d7d3e0;
}
.code-purple { color: #c795ff; }
.code-green { color: #c8ff91; }
.code-orange { color: #ffbd73; }
.code-blue { color: #6be4ff; }
.code-footer {
  min-height: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 17px;
  color: var(--muted);
  font: .62rem var(--font-mono);
}
.code-footer span:first-child { margin-right: auto; }
.code-footer i { display: inline-block; width: 6px; height: 6px; background: var(--lime); border-radius: 50%; }
.floating-chip {
  position: absolute;
  width: 72px; height: 72px;
  border-radius: 22px;
  background: rgba(17,15,28,.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.15);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  font: 600 1.1rem var(--font-mono);
  animation: float 4s ease-in-out infinite;
  transition: opacity .3s, transform .3s, filter .3s;
}
.floating-chip:hover { filter: brightness(1.35); }
.floating-chip.collected { opacity: 0; transform: scale(0) rotate(180deg); pointer-events: none; }
.chip-one { top: 35px; right: 0; color: #ffd45a; }
.chip-two { bottom: 45px; right: 14px; color: var(--lime); animation-delay: -1.3s; }
.chip-three { bottom: 75px; left: -12px; color: var(--cyan); animation-delay: -.6s; }
@keyframes float { 50% { transform: translateY(-15px) rotate(3deg); } }
.hero-orbit {
  position: absolute;
  border: 1px solid rgba(155,108,255,.12);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-one { width: 620px; height: 620px; right: -340px; top: 110px; }
.orbit-two { width: 360px; height: 360px; left: -280px; top: 270px; border-color: rgba(77,231,255,.1); }
.scroll-hint {
  position: absolute;
  left: 0; bottom: 28px;
  color: #777181;
  font: .6rem var(--font-mono);
  letter-spacing: .16em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.scroll-hint i { width: 45px; height: 1px; background: #777181; position: relative; overflow: hidden; }
.scroll-hint i::after {
  content: ""; position: absolute; inset: 0;
  background: var(--lime);
  animation: scan 2s linear infinite;
}
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 22px 0;
  background: rgba(255,255,255,.018);
}
.marquee-track {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 25px;
  animation: marquee 30s linear infinite;
  font: 500 .72rem var(--font-mono);
  letter-spacing: .13em;
  color: #9b95a5;
}
.marquee-track i { color: var(--lime); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

.about, .stack, .projects, .playground { padding: 135px 0; }
.section-heading {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 68px;
}
.section-heading h2, .contact h2 {
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.07em;
  margin: 0;
}
.section-index {
  font: .7rem var(--font-mono);
  color: var(--lime);
  border: 1px solid rgba(200,255,98,.25);
  border-radius: 999px;
  padding: 7px 10px;
  width: max-content;
}
.about-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 55px;
}
.about-copy { padding-right: 20px; }
.large-copy {
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  letter-spacing: -.04em;
  line-height: 1.18;
  margin: 0 0 30px;
}
.about-copy > p:not(.large-copy) { color: var(--muted); line-height: 1.75; max-width: 560px; }
.signature {
  margin-top: 42px;
  color: var(--purple);
  font: 500 1.25rem var(--font-mono);
  transform: rotate(-4deg);
  width: max-content;
}
.trait-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trait-card {
  min-height: 250px;
  padding: 25px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}
.trait-card::before {
  content: "";
  position: absolute;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(155,108,255,.18), transparent 70%);
  right: -45px; top: -45px;
}
.trait-icon { font: .65rem var(--font-mono); color: var(--lime); }
.trait-card h3 { margin: 50px 0 10px; font-size: 1.35rem; }
.trait-card p { color: var(--muted); line-height: 1.55; margin: 0; font-size: .92rem; }
.special-card { background: linear-gradient(145deg, rgba(89,63,153,.25), rgba(14,12,24,.9)); }
.quest-progress { margin-top: 17px; color: var(--text); font: .7rem var(--font-mono); }
.quest-progress > div { height: 3px; margin-top: 8px; background: rgba(255,255,255,.1); }
.quest-progress i { display: block; height: 100%; width: 0; background: var(--lime); transition: width .4s ease; }

.stack { position: relative; }
.stack-board {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 410px;
  border-radius: 25px;
  border: 1px solid var(--line);
  background: rgba(14,12,24,.76);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stack-tabs {
  border-right: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stack-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 15px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: .2s;
}
.stack-tab:hover, .stack-tab.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
}
.stack-tab.active::before { content: "›"; color: var(--lime); margin-right: 10px; }
.stack-content {
  padding: 55px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}
.stack-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 25px;
}
.stack-item span { font-size: 1.05rem; }
.stack-item i {
  display: block;
  position: relative;
  height: 7px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
}
.stack-item i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--level);
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--lime));
  border-radius: inherit;
  transform: translateX(-100%);
  animation: loadSkill 1s .2s forwards;
}
@keyframes loadSkill { to { transform: translateX(0); } }

.project-list { display: grid; gap: 16px; }
.project-card {
  min-height: 320px;
  display: grid;
  grid-template-columns: 70px 1fr .8fr;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(15,13,25,.72);
  overflow: hidden;
  transform-style: preserve-3d;
}
.project-number {
  border-right: 1px solid var(--line);
  padding: 26px 0;
  text-align: center;
  color: var(--lime);
  font: .7rem var(--font-mono);
}
.project-content { padding: 36px 35px; display: flex; flex-direction: column; justify-content: center; }
.project-meta { display: flex; gap: 14px; color: var(--muted); font: .62rem var(--font-mono); letter-spacing: .1em; }
.project-content h3 { font-size: clamp(1.8rem, 4vw, 3.5rem); margin: 18px 0; letter-spacing: -.05em; }
.project-content p { color: var(--muted); line-height: 1.65; max-width: 600px; margin: 0; }
.project-tags { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.project-tags span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font: .62rem var(--font-mono); color: #c9c4d0; }
.project-art {
  min-height: 100%;
  border-left: 1px solid var(--line);
  background: radial-gradient(circle at center, rgba(155,108,255,.18), transparent 65%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.art-grid {
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(155,108,255,.2), transparent 60%);
  background-size: 28px 28px, 28px 28px, auto;
}
.mini-window {
  width: 70%;
  height: 57%;
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 12px;
  background: rgba(10,9,17,.78);
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
  transform: rotate(-6deg);
}
.mini-window span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--purple); }
.mini-window i { display: block; height: 7px; margin-top: 18px; border-radius: 4px; background: rgba(255,255,255,.1); }
.mini-window i:nth-of-type(2) { width: 73%; }
.mini-window i:nth-of-type(3) { width: 48%; background: rgba(200,255,98,.35); }
.art-orbit::before {
  content: ""; width: 230px; height: 230px; border: 1px dashed rgba(255,255,255,.18); border-radius: 50%; animation: rotate 15s linear infinite;
}
.planet { position: absolute; width: 86px; height: 86px; border-radius: 50%; background: linear-gradient(145deg, var(--purple), #4b2f84); box-shadow: 0 0 50px rgba(155,108,255,.25); }
.satellite { position: absolute; width: 18px; height: 18px; background: var(--lime); border-radius: 5px; animation: satellite 8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes satellite {
  from { transform: rotate(0deg) translateX(115px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(115px) rotate(-360deg); }
}
.art-terminal { display: block; padding: 85px 35px; font: .8rem/1.7 var(--font-mono); }
.art-terminal p { margin: 0; }
.art-terminal b { color: var(--purple); }
.term-success { color: var(--lime); margin-top: 10px !important; }
.term-cursor { color: var(--cyan); animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.playground-shell {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(34,25,54,.7), rgba(11,10,18,.9));
  min-height: 520px;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  overflow: hidden;
}
.playground-copy { padding: 55px; }
.playground-copy h2 { font-size: clamp(2.5rem, 5vw, 4.7rem); margin: 0 0 22px; letter-spacing: -.07em; }
.playground-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; max-width: 450px; margin-bottom: 30px; }
.game-stats { margin-top: 48px; display: flex; gap: 35px; }
.game-stats div { display: flex; flex-direction: column; }
.game-stats span { font: 500 1.6rem var(--font-mono); color: var(--lime); }
.game-stats small { font: .55rem var(--font-mono); color: var(--muted); margin-top: 5px; }
.game-area {
  position: relative;
  min-height: 520px;
  border-left: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.game-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle, black, transparent 75%);
}
#game-message { color: var(--muted); font: .8rem var(--font-mono); z-index: 1; }
.bug {
  position: absolute;
  width: 43px; height: 43px;
  border: 0;
  border-radius: 14px;
  background: var(--danger);
  display: grid;
  place-items: center;
  cursor: crosshair;
  box-shadow: 0 0 25px rgba(255,88,118,.35);
  animation: bugPop .18s ease-out;
}
.bug::before { content: "×"; color: white; font: 600 1.3rem var(--font-mono); }
@keyframes bugPop { from { transform: scale(0) rotate(-45deg); } }

.contact {
  min-height: 730px;
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.contact-glow {
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155,108,255,.18), rgba(77,231,255,.08) 35%, transparent 70%);
  filter: blur(10px);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .65; } }
.contact-inner { position: relative; z-index: 2; max-width: 900px; }
.contact-inner > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; margin: 28px auto 35px; max-width: 650px; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 19px 25px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  font: 500 clamp(1rem, 3vw, 1.35rem) var(--font-mono);
  transition: .25s;
}
.contact-link:hover { border-color: var(--lime); background: rgba(200,255,98,.06); }
.contact-link span { color: var(--lime); }
footer {
  width: min(1180px, calc(100% - 42px));
  margin: auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: .76rem;
}
footer .brand { color: var(--text); }

.terminal-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3,3,7,.75);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}
.terminal-modal.open { opacity: 1; visibility: visible; }
.terminal-window {
  width: min(760px, 100%);
  height: min(520px, 80vh);
  border-radius: 20px;
  background: #0b0a12;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 35px 100px rgba(0,0,0,.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.terminal-header {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.terminal-header > div { display: flex; gap: 7px; }
.terminal-header > div span { width: 9px; height: 9px; border-radius: 50%; background: #ff637d; }
.terminal-header > div span:nth-child(2) { background: #ffcb5c; }
.terminal-header > div span:nth-child(3) { background: #6fe68d; }
.terminal-header p { margin: auto; color: var(--muted); font: .7rem var(--font-mono); }
.terminal-header button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 1.4rem; }
.terminal-output { padding: 24px; flex: 1; overflow-y: auto; color: #c7c2cf; font: .78rem/1.7 var(--font-mono); }
.terminal-output p { margin: 0 0 7px; }
.terminal-output b, .terminal-command { color: var(--lime); }
.terminal-error { color: var(--danger); }
.terminal-info { color: var(--cyan); }
.terminal-input-line {
  display: flex;
  gap: 10px;
  padding: 15px 24px 22px;
  font: .78rem var(--font-mono);
}
.terminal-input-line span { color: var(--purple); white-space: nowrap; }
.terminal-input-line input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }

.achievement {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 400;
  width: min(330px, calc(100vw - 50px));
  padding: 18px 20px;
  border: 1px solid rgba(200,255,98,.28);
  background: rgba(10,9,17,.93);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transform: translateY(150%);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.achievement.show { transform: translateY(0); }
.achievement span { display: block; color: var(--lime); font: .58rem var(--font-mono); letter-spacing: .12em; margin-bottom: 7px; }
.achievement strong { font-size: .92rem; }

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 950px) {
  .desktop-nav { display: none; }
  .menu-button { display: block; }
  .hero { grid-template-columns: 1fr; padding-top: 145px; }
  .hero-visual { min-height: 470px; }
  .hero-title { max-width: 800px; }
  .hero-subtitle { max-width: 720px; }
  .about-grid { grid-template-columns: 1fr; }
  .project-card { grid-template-columns: 55px 1fr; }
  .project-art { grid-column: 2; min-height: 260px; border-left: 0; border-top: 1px solid var(--line); }
  .playground-shell { grid-template-columns: 1fr; }
  .game-area { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .cursor-dot, .cursor-ring { display: none; }
  .site-header { top: 10px; width: calc(100% - 20px); }
  .hero { width: min(100% - 28px, 1180px); padding-bottom: 70px; }
  .hero-title { font-size: clamp(3.5rem, 17vw, 5.7rem); }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .hero-visual { min-height: 390px; }
  .code-card pre { padding: 27px 18px 30px; font-size: .7rem; }
  .floating-chip { width: 58px; height: 58px; border-radius: 17px; }
  .chip-one { right: -2px; }
  .chip-three { left: -2px; bottom: 45px; }
  .scroll-hint { display: none; }
  .section { width: calc(100% - 28px); }
  .about, .stack, .projects, .playground { padding: 95px 0; }
  .section-heading { grid-template-columns: 1fr; gap: 14px; margin-bottom: 45px; }
  .trait-grid { grid-template-columns: 1fr; }
  .trait-card { min-height: 210px; }
  .stack-board { grid-template-columns: 1fr; }
  .stack-tabs {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
  }
  .stack-tab { white-space: nowrap; }
  .stack-content { padding: 38px 24px; }
  .stack-item { grid-template-columns: 1fr; gap: 12px; }
  .project-card { grid-template-columns: 44px 1fr; }
  .project-content { padding: 28px 22px; }
  .playground-copy { padding: 38px 24px; }
  .game-area { min-height: 420px; }
  .contact { min-height: 620px; }
  footer { width: calc(100% - 28px); flex-direction: column; gap: 16px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Refinements: clearer navigation and scroll feedback */
.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--lime));
  box-shadow: 0 0 16px rgba(77, 231, 255, .45);
}
.desktop-nav a.active { color: var(--text); }
.desktop-nav a.active::after { width: 100%; }
.mobile-menu a.active { color: var(--lime); }

@media (max-width: 700px) {
  .hero-subtitle { font-size: 1.02rem; }
  .project-content h3 { line-height: 1.02; }
  .project-tags { gap: 6px; }
  .contact-inner > p:not(.eyebrow) { padding: 0 8px; }
}
