/* ── TOKENS ── */
:root {
  --ink-black:        #001219;
  --dark-teal:        #005f73;
  --dark-cyan:        #0a9396;
  --pearl-aqua:       #94d2bd;
  --vanilla-custard:  #e9d8a6;
  --golden-orange:    #ee9b00;
  --burnt-caramel:    #ca6702;
  --rusty-spice:      #bb3e03;
  --oxidized-iron:    #ae2012;
  --brown-red:        #9b2226;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --radius: 4px;
  --transition: 200ms ease;
}

/* ── DARK MODE (default) ── */
[data-theme="dark"] {
  --bg:           #001219;
  --bg-card:      #02202e;
  --bg-hover:     #04303f;
  --border:       #0a9396;
  --border-muted: #005f73;
  --text:         #e9d8a6;
  --text-muted:   #94d2bd;
  --text-dim:     #4a8a80;
  --accent:       #ee9b00;
  --accent-soft:  rgba(238,155,0,0.12);
  --accent2:      #0a9396;
  --accent2-soft: rgba(10,147,150,0.15);
  --badge-open:   rgba(10,147,150,0.2);
  --badge-cloud:  rgba(238,155,0,0.18);
  --badge-wip:    rgba(187,62,3,0.2);
  --glow:         rgba(10,147,150,0.25);
  --hero-line:    rgba(148,210,189,0.08);
}

/* ── LIGHT MODE ── */
[data-theme="light"] {
  --bg:           #f5edd8;
  --bg-card:      #fffbf0;
  --bg-hover:     #fff8e3;
  --border:       #94d2bd;
  --border-muted: #c4e8e0;
  --text:         #001219;
  --text-muted:   #005f73;
  --text-dim:     #7ab3a8;
  --accent:       #ca6702;
  --accent-soft:  rgba(202,103,2,0.1);
  --accent2:      #005f73;
  --accent2-soft: rgba(0,95,115,0.08);
  --badge-open:   rgba(0,95,115,0.12);
  --badge-cloud:  rgba(202,103,2,0.12);
  --badge-wip:    rgba(187,62,3,0.12);
  --glow:         rgba(0,95,115,0.15);
  --hero-line:    rgba(0,95,115,0.06);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-muted); border-radius: 2px; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: 60px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg);
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-bracket {
  color: var(--accent2);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--accent); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border-muted);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  transition: border-color var(--transition), color var(--transition);
}
.theme-toggle:hover { border-color: var(--border); color: var(--text); }
.btn-github {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 7px 16px;
  border: 1px solid var(--border);
  color: var(--accent2);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.btn-github:hover { background: var(--accent2-soft); }

/* ── HERO ── */
.hero {
  padding-top: 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-left: clamp(1.5rem, 8vw, 8rem);
  padding-right: clamp(1.5rem, 8vw, 8rem);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--accent2);
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.03em;
  max-width: 900px;
  margin-bottom: 1.5rem;
}
.hero-headline .accent  { color: var(--accent); }
.hero-headline .accent2 { color: var(--accent2); }
.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4rem;
}
.btn-primary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--ink-black);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 12px 24px;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover { border-color: var(--border); color: var(--text); }

/* ── TERMINAL ── */
.terminal {
  display: inline-flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  width: min(520px, 100%);
  overflow: hidden;
  box-shadow: 0 0 40px var(--glow);
  justify-self: end;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: var(--oxidized-iron); }
.dot-y { background: var(--golden-orange); }
.dot-g { background: var(--dark-cyan); }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 6px;
}
.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.t-prompt { color: var(--accent2); }
.t-cmd    { color: var(--text); }
.t-out    { color: var(--text-dim); }
.t-accent { color: var(--accent); }
.t-green  { color: var(--pearl-aqua); }
.t-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent2);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── STATS ── */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-muted);
}
.stat-item  { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* ── SECTIONS ── */
section { padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 8vw, 8rem); }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent2);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 3rem;
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-muted), transparent);
  margin: 0 clamp(1.5rem, 8vw, 8rem);
}

/* ── PROJECTS ── */
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border: 1px solid var(--border-muted);
  background: none;
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent2);
  color: var(--accent2);
  background: var(--accent2-soft);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1px;
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  overflow: hidden;
}
.project-card {
  background: var(--bg-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background var(--transition);
  position: relative;
  cursor: pointer;
  border-right: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}
.project-card:hover { background: var(--bg-hover); }
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--accent);
  transition: height 250ms ease;
}
.project-card:hover::before { height: 100%; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--accent2-soft);
  border: 1px solid var(--border-muted);
}
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: var(--radius);
  font-weight: 500;
}
.badge-open  { background: var(--badge-open);  color: var(--dark-cyan);     border: 1px solid rgba(10,147,150,0.3); }
.badge-cloud { background: var(--badge-cloud); color: var(--golden-orange); border: 1px solid rgba(238,155,0,0.3); }
.badge-wip   { background: var(--badge-wip);   color: var(--rusty-spice);   border: 1px solid rgba(187,62,3,0.3); }
.card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.card-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.card-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border-muted);
  padding: 2px 8px;
  border-radius: var(--radius);
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-muted);
  margin-top: auto;
}
.card-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 5px;
  transition: gap var(--transition);
}
.card-link:hover { gap: 10px; }
.card-link::after { content: '→'; }

/* ── PHILOSOPHY ── */
.philosophy {
  background: var(--bg-card);
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}
.philosophy-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.phil-list { display: flex; flex-direction: column; gap: 0; list-style: none; margin-top: 2rem; }
.phil-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-muted);
}
.phil-item:first-child { border-top: 1px solid var(--border-muted); }
.phil-num { font-family: var(--font-mono); font-size: 0.65rem; color: var(--accent2); min-width: 24px; padding-top: 3px; }
.phil-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; letter-spacing: -0.01em; }
.phil-desc  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.phil-visual { display: flex; flex-direction: column; gap: 12px; }
.code-snippet {
  background: var(--bg);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-dim);
  overflow-x: auto;
}
.code-snippet .kw   { color: var(--dark-cyan); }
.code-snippet .fn   { color: var(--golden-orange); }
.code-snippet .str  { color: var(--pearl-aqua); }
.code-snippet .cm   { color: var(--text-dim); opacity: 0.6; font-style: italic; }
.code-snippet .punc { color: var(--text-muted); }

/* ── OSS BAND ── */
.oss-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem clamp(1.5rem, 8vw, 8rem);
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
  background: var(--accent-soft);
}
.oss-left { display: flex; align-items: center; gap: 1rem; }
.oss-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent2-soft);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.oss-text strong { font-family: var(--font-display); font-weight: 700; font-size: 1rem; display: block; margin-bottom: 2px; }
.oss-text span   { font-size: 0.82rem; color: var(--text-muted); }

/* ── CTA ── */
.cta-section { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.cta-section .section-title { max-width: 700px; }
.cta-section .section-desc  { text-align: center; }
.cta-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── FOOTER ── */
footer {
  padding: 3rem clamp(1.5rem, 8vw, 8rem);
  border-top: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-logo { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }
.footer-links { display: flex; gap: 2rem; list-style: none; }
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-credit { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); }
.footer-credit span { color: var(--accent2); }

/* ── HERO LAYOUT ── */
#heroCanvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 380px auto;
  gap: 2rem;
  align-items: center;
}
#nanobot-stage {
  width: 380px;
  height: 420px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

/* ── ANIME.JS INITIAL STATES ── */
nav               { opacity: 0; transform: translateY(-20px); }
.hero-eyebrow     { opacity: 0; transform: translateX(-16px); }
.hero-headline    { opacity: 0; }
.hero-headline .line { display: block; overflow: hidden; }
.hero-sub         { opacity: 0; transform: translateY(12px); }
.hero-cta         { opacity: 0; transform: translateY(12px); }
.hero-stats       { opacity: 0; }
.stat-item        { opacity: 0; transform: translateY(10px); }
.terminal         { opacity: 0; transform: translateX(24px); }

/* ── MOBILE ── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .terminal   { display: none; }
  #nanobot-stage { display: none; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .philosophy-inner { grid-template-columns: 1fr; }
  .phil-visual { display: none; }
  footer { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .hero { padding-top: 80px; }
}
