/* =============================================================================
   Tadhagath Marepalli — Portfolio
   Dark Technical aesthetic (Linear / Raycast inspired)
   Single accent · surface-ladder depth · hairline borders · no drop shadows
============================================================================= */

/* ----------------------------------------------------------------- TOKENS */
:root {
  /* surface ladder */
  --canvas: #0b0b0e;
  --surface-1: #121317;
  --surface-2: #181a1f;
  --surface-3: #1f2128;

  /* hairlines */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --ink: #f7f8f8;
  --body: #c2c6cd;
  --muted: #8a8f98;
  --faint: #595e68;

  /* accent (single brand voltage) — switchable at runtime */
  --accent: #5e6ad2;
  --accent-bright: #8b95ff;
  --accent-glow: rgba(94, 106, 210, 0.30);
  --accent-soft: rgba(94, 106, 210, 0.12);
  --on-accent: #ffffff;

  /* type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* rhythm */
  --section-pad: 120px;
  --container: 1160px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "ss03", "cv11", "calt";
  background: var(--canvas);
  color: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body[data-loading="true"] { overflow: hidden; }
body[data-loading="true"] main,
body[data-loading="true"] .nav,
body[data-loading="true"] .footer { opacity: 0; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
kbd {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 5px;
  background: var(--surface-3); border: 1px solid var(--hairline);
  border-radius: 4px; color: var(--muted); line-height: 1;
}

/* custom cursor: hide native on desktop */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none !important; }
}

/* --------------------------------------------------------------- HELPERS */
.accent { color: var(--accent-bright); }
.mono { font-family: var(--font-mono); }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================== BOOT SEQ */
.boot {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--canvas);
  display: grid; place-items: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__inner { width: min(560px, 86vw); }
.boot__log {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.9;
  color: var(--body); white-space: pre-wrap; min-height: 200px;
}
.boot__log .b-accent { color: var(--accent-bright); }
.boot__log .b-ok { color: #4ade80; }
.boot__log .b-dim { color: var(--faint); }
.boot__bar {
  margin-top: 18px; height: 3px; border-radius: 99px;
  background: var(--surface-2); overflow: hidden;
}
.boot__fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transition: width 0.2s linear;
}
.boot__skip {
  margin-top: 22px; font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); letter-spacing: 0.3px; transition: color 0.2s;
}
.boot__skip:hover { color: var(--ink); }

/* =============================================================== CURSOR */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  pointer-events: none; border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.3s;
}
.cursor-dot {
  width: 7px; height: 7px; background: var(--accent-bright);
  box-shadow: 0 0 12px var(--accent-glow);
}
.cursor-ring {
  width: 34px; height: 34px; border: 1.5px solid var(--hairline-strong);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              border-color 0.25s, opacity 0.3s, background 0.25s;
}
body.cursor-active .cursor-dot, body.cursor-active .cursor-ring { opacity: 1; }
.cursor-ring.hovering {
  width: 56px; height: 56px;
  border-color: var(--accent); background: var(--accent-soft);
}
.cursor-ring.clicking { width: 26px; height: 26px; }

/* ========================================================= SCROLL PROGRESS */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  z-index: 200; transition: width 0.1s linear;
}

/* ================================================================= NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 48px);
  transition: background 0.3s, border-color 0.3s, padding 0.3s, opacity 0.6s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11, 11, 14, 0.72);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--hairline);
  padding-top: 13px; padding-bottom: 13px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.nav__dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.nav__name { font-size: 15px; letter-spacing: -0.2px; }
.nav__links { display: flex; gap: 6px; }
.nav__links a {
  font-size: 14px; color: var(--muted); padding: 7px 12px;
  border-radius: var(--radius-sm); transition: color 0.2s, background 0.2s; position: relative;
}
.nav__links a:hover, .nav__links a.active { color: var(--ink); background: var(--surface-2); }
.nav__right { display: flex; align-items: center; gap: 10px; }

.kbd-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 11px; border-radius: var(--radius-sm);
  background: var(--surface-1); border: 1px solid var(--hairline);
  color: var(--muted); font-size: 13px; transition: border-color 0.2s, color 0.2s;
}
.kbd-btn:hover { border-color: var(--hairline-strong); color: var(--ink); }
.kbd-btn__label { letter-spacing: 0.2px; }

.nav__burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav__burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav.menu-open .nav__burger span:first-child { transform: translateY(7px) rotate(45deg); }
.nav.menu-open .nav__burger span:last-child { transform: translateY(-7px) rotate(-45deg); }

/* ================================================================ HERO */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(20px, 5vw, 48px) 80px;
  max-width: var(--container); margin: 0 auto; width: 100%;
  overflow: hidden;
}
/* full-page interactive background canvas */
.bg-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
main, .nav, .footer { position: relative; z-index: 1; }
.hero__glow {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  filter: blur(40px); pointer-events: none; z-index: 0;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%); opacity: 0.45; transition: opacity 0.4s;
}
.hero__content { position: relative; z-index: 2; max-width: 820px; }

.hero__eyebrow {
  font-family: var(--font-mono); font-size: 13px; color: var(--accent-bright);
  letter-spacing: 0.5px; margin-bottom: 24px;
}
.blink { animation: blink 1.2s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__title {
  font-size: clamp(48px, 9vw, 104px);
  font-weight: 600; line-height: 0.98; letter-spacing: -0.04em;
  color: var(--ink); margin-bottom: 26px;
}
.hero__role {
  font-size: clamp(20px, 3.2vw, 30px); color: var(--body);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  letter-spacing: -0.02em; margin-bottom: 28px; min-height: 1.4em;
}
.hero__role-prefix { color: var(--muted); }
.hero__typewriter { color: var(--accent-bright); font-weight: 500; }
.hero__caret { color: var(--accent-bright); animation: blink 1s step-end infinite; font-weight: 300; }

.hero__blurb { font-size: clamp(16px, 1.6vw, 18px); max-width: 580px; color: var(--body); margin-bottom: 38px; }

.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }

.hero__meta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__meta-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--surface-1); border: 1px solid var(--hairline);
}
.hero__meta-item .k { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: lowercase; }
.hero__meta-item .v { font-size: 14px; color: var(--ink); font-weight: 500; }

.hero__scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 2; color: var(--muted);
}
.hero__scroll-line { width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 40%; background: var(--accent-bright); animation: scrolldot 1.8s var(--ease) infinite; }
@keyframes scrolldot { 0% { transform: translateY(-100%); } 100% { transform: translateY(250%); } }
.hero__scroll-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; }

/* ============================================================== BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--radius-md);
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  will-change: transform;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-bright); }
.btn--ghost { background: var(--surface-1); color: var(--ink); border: 1px solid var(--hairline); }
.btn--ghost:hover { border-color: var(--hairline-strong); background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; }

/* =============================================================== SECTIONS */
.section { max-width: var(--container); margin: 0 auto; padding: var(--section-pad) clamp(20px, 5vw, 48px); }
.section__head { display: flex; align-items: center; gap: 18px; margin-bottom: 56px; }
.section__index { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }
.section__title { font-size: clamp(28px, 4.5vw, 44px); font-weight: 600; letter-spacing: -0.03em; color: var(--ink); white-space: nowrap; }
.section__rule { flex: 1; height: 1px; background: var(--hairline); }

/* ================================================================ ABOUT */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.about__text p { font-size: clamp(16px, 1.7vw, 18px); color: var(--body); margin-bottom: 20px; }
.about__text p:last-child { margin-bottom: 0; }
.about__text strong { color: var(--ink); font-weight: 600; }

.about__terminal { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--hairline); }
.term__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.term__dot:nth-child(1) { background: #ff5f57; } .term__dot:nth-child(2) { background: #febc2e; } .term__dot:nth-child(3) { background: #28c840; }
.term__title { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.term__body { padding: 18px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.95; white-space: pre-wrap; min-height: 230px; }
.term__body .t-cmd { color: var(--ink); }
.term__body .t-cmd::before { content: "$ "; color: var(--accent-bright); }
.term__body .t-out { color: var(--muted); }
.term__body .t-ok { color: #4ade80; }
.term__cursor { color: var(--accent-bright); animation: blink 1s step-end infinite; }

.about__facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 48px; }
.fact { padding: 24px; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-md); transition: border-color 0.3s, transform 0.3s var(--ease); }
.fact:hover { border-color: var(--hairline-strong); transform: translateY(-3px); }
.fact__k { font-size: clamp(28px, 4vw, 38px); font-weight: 600; color: var(--accent-bright); letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; }
.fact__v { font-size: 13.5px; color: var(--muted); }

/* ============================================================= TIMELINE */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--hairline); }
.tl-item { position: relative; padding-bottom: 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -27px; top: 6px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--canvas); border: 2px solid var(--accent);
  transition: box-shadow 0.3s, background 0.3s;
}
.tl-item:hover::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 26px 28px; transition: border-color 0.3s, transform 0.3s var(--ease); }
.tl-card:hover { border-color: var(--hairline-strong); transform: translateX(4px); }
.tl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.tl-role { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.tl-org { color: var(--accent-bright); font-weight: 500; }
.tl-when { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 4px; }
.tl-type { display: inline-block; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 99px; margin-bottom: 12px; }
.tl-type.work { background: var(--surface-3); color: var(--muted); }
.tl-type.leadership { background: var(--accent-soft); color: var(--accent-bright); }
.tl-points { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.tl-points li { position: relative; padding-left: 20px; font-size: 14.5px; color: var(--body); }
.tl-points li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 2px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag-mini { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding: 3px 9px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 99px; }

/* ============================================================== PROJECTS */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 36px; }
.filter-chip {
  font-family: var(--font-mono); font-size: 12.5px; padding: 7px 14px;
  border-radius: 99px; background: var(--surface-1); border: 1px solid var(--hairline);
  color: var(--muted); transition: all 0.2s;
}
.filter-chip:hover { color: var(--ink); border-color: var(--hairline-strong); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.proj {
  position: relative; padding: 30px; border-radius: var(--radius-lg);
  background: var(--surface-1); border: 1px solid var(--hairline);
  transition: border-color 0.3s, transform 0.18s var(--ease), background 0.3s, opacity 0.4s;
  transform-style: preserve-3d; will-change: transform; overflow: hidden;
}
.proj::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
}
.proj:hover { border-color: var(--hairline-strong); background: var(--surface-2); }
.proj:hover::after { opacity: 1; }
.proj.hide { display: none; }
.proj.featured-flag::before {
  content: "★ featured"; position: absolute; top: 18px; right: 18px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px;
  color: var(--accent-bright); background: var(--accent-soft); padding: 4px 9px; border-radius: 99px;
}
.proj__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; transform: translateZ(30px); }
.proj__num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.proj__year { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin-left: auto; }
.proj__name { font-size: 21px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 12px; transform: translateZ(24px); }
.proj__blurb { font-size: 14.5px; color: var(--body); margin-bottom: 18px; transform: translateZ(16px); }
.proj__highlights { list-style: none; display: none; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.proj.open .proj__highlights { display: flex; }
.proj__highlights li { position: relative; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.proj__highlights li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.proj__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; transform: translateZ(12px); }
.proj__footer { display: flex; align-items: center; gap: 16px; transform: translateZ(20px); }
.proj__toggle { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent-bright); display: flex; align-items: center; gap: 6px; transition: gap 0.2s; }
.proj__toggle:hover { gap: 10px; }
.proj__toggle .chev { transition: transform 0.3s; display: inline-block; }
.proj.open .proj__toggle .chev { transform: rotate(90deg); }
.proj__links { display: flex; gap: 12px; margin-left: auto; }
.proj__link { color: var(--muted); transition: color 0.2s, transform 0.2s; display: flex; }
.proj__link:hover { color: var(--accent-bright); transform: translateY(-2px); }
.proj__link svg { width: 18px; height: 18px; }

/* ================================================================ SKILLS */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.skill-group { padding: 28px; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); transition: border-color 0.3s; }
.skill-group:hover { border-color: var(--hairline-strong); }
.skill-group__title { display: flex; align-items: center; gap: 10px; font-size: 13px; font-family: var(--font-mono); color: var(--muted); text-transform: lowercase; letter-spacing: 0.5px; margin-bottom: 20px; }
.skill-group__title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.skill-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 13.5px; padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--body);
  transition: all 0.2s var(--ease); cursor: default;
}
.chip:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-3px); background: var(--surface-3); }

/* =============================================================== CONTACT */
.section--contact { text-align: center; padding-top: 140px; padding-bottom: 140px; }
.contact { max-width: 680px; margin: 0 auto; }
.contact__eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--accent-bright); margin-bottom: 20px; }
.contact__title { font-size: clamp(40px, 8vw, 84px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; color: var(--ink); margin-bottom: 26px; }
.contact__blurb { font-size: 17px; color: var(--body); margin-bottom: 38px; }
.contact__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ================================================================ FOOTER */
.footer {
  max-width: var(--container); margin: 0 auto;
  padding: 36px clamp(20px, 5vw, 48px); border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  transition: opacity 0.6s;
}
.footer__left { display: flex; flex-direction: column; gap: 3px; }
.footer__brand { font-size: 14px; color: var(--ink); font-weight: 500; }
.footer__note { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.footer__hint { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.link-btn { color: var(--accent-bright); font-family: var(--font-mono); font-size: 12px; transition: color 0.2s; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline-strong); }
.link-btn:hover { color: var(--ink); }

/* ======================================================== COMMAND PALETTE */
.palette { position: fixed; inset: 0; z-index: 500; display: none; }
.palette.open { display: block; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 7, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.palette__panel {
  position: absolute; top: 14vh; left: 50%; transform: translateX(-50%);
  width: min(600px, 92vw); background: var(--surface-1);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: pop 0.22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(0.97) translateY(-6px); } }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--hairline); }
.palette__prompt { font-family: var(--font-mono); color: var(--accent-bright); font-size: 15px; }
.palette__search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: 16px; font-family: var(--font-sans); }
.palette__search input::placeholder { color: var(--faint); }
.palette__esc { flex-shrink: 0; }
.palette__list { list-style: none; max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette__item { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.12s; }
.palette__item.active { background: var(--accent-soft); }
.palette__item-ico { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--hairline); border-radius: var(--radius-sm); font-size: 15px; }
.palette__item.active .palette__item-ico { border-color: var(--accent); }
.palette__item-body { flex: 1; min-width: 0; }
.palette__item-title { font-size: 14.5px; color: var(--ink); }
.palette__item-sub { font-size: 12px; color: var(--muted); }
.palette__item-cat { font-family: var(--font-mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; }
.palette__empty { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }
.palette__foot { display: flex; gap: 18px; padding: 11px 16px; border-top: 1px solid var(--hairline); font-size: 11.5px; color: var(--muted); }
.palette__foot span { display: flex; align-items: center; gap: 5px; }

/* ================================================================= GAME */
.game { position: fixed; inset: 0; z-index: 600; display: none; }
.game.open { display: grid; place-items: center; }
.game__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 7, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.game__panel { position: relative; background: var(--surface-1); border: 1px solid var(--hairline-strong); border-radius: var(--radius-lg); padding: 22px; width: min(480px, 94vw); animation: pop2 0.25s var(--ease); }
@keyframes pop2 { from { opacity: 0; transform: scale(0.95); } }
.game__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.game__title { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.game__score { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.game__score b { color: var(--accent-bright); }
.game__close { color: var(--muted); font-size: 16px; width: 30px; height: 30px; border-radius: var(--radius-sm); transition: background 0.2s, color 0.2s; }
.game__close:hover { background: var(--surface-3); color: var(--ink); }
.game__canvas { width: 100%; aspect-ratio: 1; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--radius-md); display: block; }
.game__hint { margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: center; }
.game__hint b { color: var(--accent-bright); }

/* ============================================================== MATRIX */
.matrix { position: fixed; inset: 0; z-index: 700; pointer-events: none; opacity: 0; transition: opacity 0.5s; }
.matrix.on { opacity: 1; }

/* =============================================================== TOAST */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); border: 1px solid var(--hairline-strong);
  color: var(--ink); font-size: 13.5px; padding: 12px 20px; border-radius: var(--radius-md);
  z-index: 800; opacity: 0; transition: opacity 0.3s, transform 0.3s var(--ease); pointer-events: none;
  font-family: var(--font-mono);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================== RESPONSIVE */
@media (max-width: 880px) {
  :root { --section-pad: 84px; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about__facts { grid-template-columns: repeat(2, 1fr); }
  .projects, .skills { grid-template-columns: 1fr; }

  .nav__links {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(280px, 80vw);
    flex-direction: column; justify-content: center; gap: 8px; padding: 40px;
    background: var(--surface-1); border-left: 1px solid var(--hairline);
    transform: translateX(100%); transition: transform 0.35s var(--ease); z-index: 99;
  }
  .nav.menu-open .nav__links { transform: translateX(0); }
  .nav__links a { font-size: 18px; padding: 12px 16px; }
  .nav__burger { display: flex; }
  .kbd-btn__label { display: none; }

  .footer { justify-content: center; text-align: center; }
  .footer__left { align-items: center; }
}

@media (max-width: 480px) {
  .about__facts { grid-template-columns: 1fr; }
  .hero__meta { width: 100%; }
  .hero__meta-item { flex: 1; }
  .palette__foot { display: none; }
}
