/* ========== TOKENS ========== */
:root {
  --bg: #07080c;
  --bg-2: #0c0e14;
  --ink: #ece4d0;
  --ink-dim: #ece4d099;
  --ink-faint: #ece4d055;
  --line: #ece4d014;
  --line-strong: #ece4d028;
  --green: #3eff9a;
  --green-dim: #3eff9a55;
  --warn: #ffb86b;
  --red: #ff6a6a;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-vcr: "VT323", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  cursor: none;
  overflow-x: hidden;
}

/* faint grid overlay on the page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 80%);
  z-index: 0;
}

/* a soft warm wash glow drifting in the background */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 500px at 80% 10%, #3eff9a10, transparent 60%),
    radial-gradient(700px 600px at 10% 80%, #ece4d008, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* hide native cursor everywhere, including on links/buttons */
a, button, input, textarea, [role="button"] { cursor: none; }

/* ========== Liquid Glass ========== */
.glass {
  position: relative;
  background: linear-gradient(180deg, #ffffff08, #ffffff03);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 1px 0 0 #ffffff10 inset,
    0 -1px 0 0 #00000040 inset,
    0 30px 60px -20px #00000080;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #ffffff10, transparent 35%, transparent 65%, #ffffff05);
  pointer-events: none;
}

/* ========== Layout ========== */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 96px 200px;
}

/* Each section gets layout containment so DOM mutations inside one section
   (the orbit rotating, the terminal typing, the project carousel swap)
   don't force layout/paint invalidation across the whole page. We use
   `layout` only — `paint` would clip drop-shadows that intentionally extend
   beyond section bounds (terminal glow, project tilt shadows). */
section {
  position: relative;
  contain: layout;
}

@media (max-width: 900px) {
  .shell { padding: 0 24px 160px; }
}
@media (max-width: 480px) {
  .shell { padding: 0 16px 120px; }
}

section { position: relative; }

/* ========== Type ========== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  margin-right: 10px;
  vertical-align: middle;
}
h2.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 18px 0 0;
  color: var(--ink);
  text-wrap: balance;
}
h2.section-title em {
  font-style: normal;
  font-family: var(--font-vcr);
  color: var(--green);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-shadow: 0 0 2px var(--green), 0 0 16px var(--green-dim), 0 0 32px #3eff9a22;
}

/* ========== Navbar (3-pill layout) ========== */
.navbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: transparent !important;
  border: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.navbar--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.navbar::before { display: none !important; }

/* shared pill style */
.nav-pill {
  display: flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #ffffff0c, #ffffff05);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 1px 0 0 #ffffff10 inset,
    0 -1px 0 0 #00000040 inset,
    0 20px 40px -20px #00000080;
}

/* Brand block — tagline above wordmark */
.nav-brand {
  gap: 12px;
  padding: 8px 18px 8px 14px;
}
.nav-brand .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.04em;
}
.nav-brand .stack {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.nav-brand .tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.nav-brand .word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-brand .word .green-text { color: var(--green); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* Center links pill */
.nav-links {
  gap: 2px;
  padding: 6px;
}
.nav-links a {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  transition: color .2s, background .2s;
  letter-spacing: -0.005em;
}
.nav-links a:hover { color: var(--ink); background: #ffffff08; }
.nav-links a.active { color: var(--ink); background: #ffffff10; }

/* Right icons pill */
.nav-icons {
  gap: 4px;
  padding: 6px;
}
.nav-icons a {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  text-decoration: none;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-icons a:hover { color: var(--ink); background: #ffffff10; }
.nav-icons a.cta {
  background: var(--ink);
  color: var(--bg);
  width: auto;
  padding: 0 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  height: 36px;
}
.nav-icons a.cta:hover { background: var(--green); color: var(--bg); }

@media (max-width: 900px) {
  .navbar { top: 12px; width: calc(100% - 32px); }
  .nav-pill.nav-links {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
  }
  .nav-pill.nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { font-size: 12px; padding: 6px 12px; white-space: nowrap; }
}

/* ========== Side rail (socials) ========== */
.rail {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 10px;
  border-radius: 28px;
}
.rail a {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  text-decoration: none;
  border-radius: 12px;
  transition: color .2s, background .2s, transform .2s;
}
.rail a:hover { color: var(--green); background: #ffffff08; transform: translateY(-2px); }
.rail .line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--line-strong), transparent);
  margin-top: 6px;
}
@media (max-width: 900px) { .rail { display: none; } }

/* ========== Footer (minimizes) ========== */
.footer-mini {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(120%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: transform .55s cubic-bezier(.2,.9,.25,1), opacity .35s;
  opacity: 0;
}
.footer-mini.shown {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.footer-mini .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-mini .meta::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.footer-mini .icons {
  display: flex;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
}
.footer-mini .icons a {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--ink-dim);
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.footer-mini .icons a:hover { color: var(--green); background: #ffffff08; }

/* ========== Back-to-top floating button ========== */
.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0e1219dd, #08090ddd);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  /* hidden until shown */
  opacity: 0;
  transform: translateY(20px) scale(.92);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34,1.56,.64,1),
              color .2s ease, border-color .2s ease, background .2s ease;
}
.to-top.shown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.to-top:hover {
  color: var(--green);
  border-color: var(--green);
  background: linear-gradient(180deg, #3eff9a14, #0e1219dd);
}
.to-top .tt-arrow {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1;
  color: var(--green);
  text-shadow: 0 0 8px var(--green-dim);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.to-top:hover .tt-arrow { transform: translateY(-2px); }
@media (max-width: 760px) {
  .to-top { right: 16px; bottom: 16px; padding: 9px 12px; }
  .to-top .tt-label { display: none; }
}

/* ========== Cursor — Web Animations API powered ========== */
body.cursor-shown,
body.cursor-shown a,
body.cursor-shown button,
body.cursor-shown [role="button"] { cursor: none; }

.cursor-inner, .cursor-outer {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
body.cursor-shown .cursor-inner,
body.cursor-shown .cursor-outer { opacity: 1; }

/* Inner dot — site-green phosphor with VHS glow. */
.cursor-inner {
  width: 8px;
  height: 8px;
  background-color: var(--green);
  box-shadow:
    0 0 6px var(--green),
    0 0 14px var(--green-dim);
  transition: width .2s ease, height .2s ease, background-color .2s ease, mix-blend-mode .2s;
}
.cursor-inner.hover {
  width: 18px;
  height: 18px;
  mix-blend-mode: difference;
  background-color: #ece4d0;
  box-shadow:
    0 0 8px #ece4d066,
    0 0 16px #ece4d033;
}

/* Outer ring — cream outline. Width/height animate on hover via CSS;
   position is animated via Web Animations API (Element.animate) in JS. */
.cursor-outer {
  width: 36px;
  height: 36px;
  border: 1.5px solid #ece4d0;
  box-shadow:
    0 0 8px #ece4d044,
    inset 0 0 4px #ece4d018;
  transition: width .25s ease, height .25s ease, border-color .25s ease;
}
.cursor-outer.hover {
  width: 50px;
  height: 50px;
  border-color: var(--green);
  box-shadow:
    0 0 10px var(--green-dim),
    inset 0 0 6px #3eff9a22;
}

/* ========== Buttons / chips ========== */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #ffffff05;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .2s, transform .15s, border-color .2s, color .2s;
}
.btn:hover { background: #ffffff10; border-color: #ece4d040; transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--green); border-color: var(--green); color: var(--bg); }
.btn-gh:hover { background: #8250df18; border-color: #8250df70; color: #8250df; }

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  background: #ffffff04;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ece4d018; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #ece4d030; }
