/* ============================================
   MAIN.CSS — Shared styles across all pages
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Syne', sans-serif;
  background: #080c10;
  color: #e8edf3;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
code { font-family: 'Space Mono', monospace; }

/* --- CSS VARIABLES --- */
:root {
  --bg:        #080c10;
  --bg-2:      #0d1117;
  --bg-3:      #111820;
  --surface:   #141c26;
  --surface-2: #1a2433;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);

  --text:      #e8edf3;
  --muted:     #8895a7;
  --soft:      #b4c1d0;

  --accent:    #4af0c4;   /* teal-green — sharp */
  --accent-2:  #3b82f6;   /* blue */
  --accent-3:  #f59e0b;   /* amber — WIP */

  --radius:    16px;
  --radius-sm: 10px;
  --max:       1160px;

  --shadow: 0 24px 64px rgba(0,0,0,0.5);
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.3);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; line-height: 1.1; }
h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p  { color: var(--soft); }

.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}
.section-title { margin-bottom: 12px; }

/* --- LAYOUT --- */
.container {
  width: min(92%, var(--max));
  margin: 0 auto;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: #6bf8d2; box-shadow: 0 0 24px rgba(74,240,196,0.25); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover { background: rgba(74,240,196,0.08); }

.btn-full { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 0.88rem; }

/* --- NAV --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(8, 12, 16, 0.80);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav.scrolled {
  background: rgba(8, 12, 16, 0.96);
  border-bottom-color: var(--border-2);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}
.logo {
  font-family: 'Space Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  flex-shrink: 0;
}
.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.18s;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); }
.nav-gh {
  color: var(--accent) !important;
  border: 1px solid rgba(74,240,196,0.25);
  margin-left: 8px;
}
.nav-gh:hover { background: rgba(74,240,196,0.08) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* --- SHARED HERO BG ELEMENTS --- */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.grid-texture {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
}
.glow-1 {
  width: 600px; height: 400px;
  top: -80px; left: -60px;
  background: var(--accent);
}
.glow-2 {
  width: 500px; height: 400px;
  top: -40px; right: -80px;
  background: var(--accent-2);
}

/* --- PAGE HERO (inner pages) --- */
.page-hero {
  position: relative;
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.page-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.page-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
}

/* --- SHARED PROJECT TAGS --- */
.project-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--soft);
  letter-spacing: 0.04em;
}
.wip-tag {
  color: var(--accent-3);
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.08);
}
.tag-done {
  color: var(--accent);
  border-color: rgba(74,240,196,0.3);
  background: rgba(74,240,196,0.08);
}

/* --- CODE HIGHLIGHT --- */
.code-highlight {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  overflow: hidden;
  background: #06090d;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.code-filename {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
}
.code-lang {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.code-highlight pre {
  padding: 18px 16px;
  overflow-x: auto;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #b4c1d0;
}
.c-comment { color: #4a5f70; }
.c-kw { color: #56b6c2; }
.c-type { color: #c678dd; }
.c-fn  { color: #61afef; }
.c-str { color: #98c379; }

/* --- FOOTER --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-2);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.18s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

/* --- REVEAL ANIMATIONS --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- RESPONSIVE NAV --- */
@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: rgba(8,12,16,0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 999;
  }
  .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: all;
  }
  .nav-link { width: 100%; padding: 12px 16px; }
  .nav-gh { margin-left: 0; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
