/* ============================================================
   VerdeX — Shared Base Stylesheet
   Used by: index.html, about.html, works.html, verdex.html
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg:      oklch(100% 0 0);
  --surface: oklch(100% 0 0);
  --fg:      oklch(20% 0.02 50);
  --muted:   oklch(48% 0.018 50);
  --border:  oklch(89% 0.014 70);
  --accent:  oklch(62% 0.17 170);
  --accent-hover: oklch(54% 0.17 170);
  --accent-soft:  oklch(90% 0.08 170);

  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --space-1: 4px;  --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px; --space-6: 24px;  --space-8: 32px;  --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;

  --text-xs: .75rem;   --text-sm: .875rem;  --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.25rem;  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem; --text-4xl: 2.25rem; --text-5xl: 3rem;
  --text-6xl: 3.75rem;  --text-7xl: 4.5rem;

  --radius-sm: 6px;   --radius-md: 10px;  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px oklch(0% 0 0 / .05);
  --shadow-md: 0 4px 16px oklch(0% 0 0 / .08);
  --shadow-lg: 0 12px 40px oklch(0% 0 0 / .12);

  --nav-h: 72px;
}

[data-theme="dark"] {
  --bg:      oklch(14% 0.012 60);
  --surface: oklch(18% 0.014 60);
  --fg:      oklch(94% 0.008 70);
  --muted:   oklch(60% 0.015 60);
  --border:  oklch(28% 0.015 60);
  --accent:  oklch(68% 0.18 170);
  --accent-hover: oklch(60% 0.18 170);
  --accent-soft:  oklch(22% 0.06 170);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  transition: background .4s, color .4s;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* ============================================================
   NAV (top bar — shared by index / about / works)
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-8);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: all .4s;
}
.nav.scrolled {
  background: oklch(100% 0 0 / .55);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .nav { background: transparent; }
[data-theme="dark"] .nav.scrolled { background: oklch(14% 0.012 60 / .72); }

.nav-logo svg { width: 110px; height: auto; }
.nav-logo svg .cls-1,
svg .cls-1 { fill: var(--fg); transition: fill .4s; }

/* Logo entrance animation */
.nav-logo .logo-icon,
.nav-logo polygon {
  transform-box: fill-box; transform-origin: center;
  animation: logoIconPop 0.7s 0.1s cubic-bezier(.22,.61,.36,1) both;
}
.nav-logo .logo-word,
.nav-logo path.cls-1 { animation: logoWordSlide 0.5s ease both; }
.nav-logo .logo-word:nth-of-type(1),
.nav-logo path.cls-1:nth-of-type(1),
.sidebar-brand path.cls-1:nth-of-type(1) { animation-delay: 0.35s; }
.nav-logo .logo-word:nth-of-type(2),
.nav-logo path.cls-1:nth-of-type(2),
.sidebar-brand path.cls-1:nth-of-type(2) { animation-delay: 0.42s; }
.nav-logo .logo-word:nth-of-type(3),
.nav-logo path.cls-1:nth-of-type(3),
.sidebar-brand path.cls-1:nth-of-type(3) { animation-delay: 0.49s; }
.nav-logo .logo-word:nth-of-type(4),
.nav-logo path.cls-1:nth-of-type(4),
.sidebar-brand path.cls-1:nth-of-type(4) { animation-delay: 0.56s; }
.nav-logo .logo-word:nth-of-type(5),
.nav-logo path.cls-1:nth-of-type(5),
.sidebar-brand path.cls-1:nth-of-type(5) { animation-delay: 0.63s; }

@keyframes logoIconPop {
  0%   { transform: scale(0); opacity: 0; }
  55%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes logoWordSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nav-links {
  display: flex; gap: var(--space-8); list-style: none; align-items: center;
}
.nav-links a {
  font-size: var(--text-sm); font-weight: 500;
  color: var(--muted); transition: color .2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--accent); border-radius: 1px; transition: width .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* Theme dot toggle */
.theme-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .25s; flex-shrink: 0;
}
.theme-dot:hover { border-color: var(--accent); }
.theme-dot svg { width: 14px; height: 14px; opacity: .5; }

/* Mobile toggle */
.nav-mobile-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: var(--space-2);
}
.nav-mobile-toggle span {
  display: block; width: 22px; height: 2px; background: var(--fg);
  border-radius: 1px; transition: all .25s;
}
.nav-mobile-toggle span + span { margin-top: 5px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: .7em 1.6em; border-radius: var(--radius-full);
  font-family: var(--font-body); font-size: var(--text-sm);
  font-weight: 600; line-height: 1; cursor: pointer;
  border: 1px solid transparent; transition: all .25s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: oklch(100% 0 0); }
.btn-primary:hover {
  background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 4px 20px oklch(62% 0.17 170 / .3);
}
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--accent-soft); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: var(--space-16) var(--space-8);
  border-top: 1px solid var(--border); text-align: center;
}
.footer-links {
  display: flex; justify-content: center; gap: var(--space-8);
  list-style: none; margin-bottom: var(--space-8); flex-wrap: wrap;
}
.footer-links a { font-size: var(--text-sm); color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: var(--text-xs); color: var(--muted); }

/* ============================================================
   LANG TOGGLE (shared button style)
   ============================================================ */
.lang-toggle-btn {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  color: var(--muted); background: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px 8px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.lang-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   RESPONSIVE — Nav
   ============================================================ */
@media (max-width: 860px) {
  .nav { padding: 0 var(--space-5); }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: var(--nav-h); left: 0; right: 0; background: var(--surface);
    padding: var(--space-6); gap: var(--space-4);
    border-bottom: 1px solid var(--border);
  }
  .nav-mobile-toggle { display: block; }
  .footer { padding: var(--space-10) var(--space-4); }
  .footer-links { gap: var(--space-4); }
}
