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

:root {
  --bg:        #050a14;
  --bg2:       #0a0f1e;
  --bg3:       #0f1628;
  --border:    #1e2a42;
  --text:      #e2e8f0;
  --muted:     #8ba3c0;
  --cyan:      #06b6d4;
  --purple:    #8b5cf6;
  --green:     #4ade80;
  --amber:     #f59e0b;
  --radius:    12px;
  --font-mono: 'Courier New', Courier, monospace;
}

[data-theme="light"] {
  --bg:      #ffffff;
  --bg2:     #f8fafc;
  --bg3:     #f1f5f9;
  --border:  #e2e8f0;
  --text:    #0f172a;
  --muted:   #64748b;
  --cyan:    #0891b2;
  --purple:  #7c3aed;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
  backdrop-filter: blur(12px);
}
[data-theme="light"] nav { background: rgba(255,255,255,0.95); box-shadow: 0 1px 0 var(--border); }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.nav-logo span { font-family: var(--font-mono); font-weight: bold; font-size: 1.1rem; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-link-icon { display: inline-flex; align-items: center; gap: 0.3rem; }
.btn-nav {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff !important; padding: 0.4rem 1rem;
  border-radius: 6px; font-size: 0.85rem; font-weight: 600; transition: opacity 0.2s;
}
.btn-nav:hover { opacity: 0.85; text-decoration: none; }
.nav-user-chip { display: inline-flex; align-items: center; text-decoration: none; }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cyan); }
.nav-avatar-fallback { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--purple)); color: #fff; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lang-switch {
  display: flex; align-items: center; gap: 0;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.lang-switch .lang-cur { padding: 0.2rem 0.5rem; background: var(--cyan); color: #fff; letter-spacing: 0.5px; }
.lang-switch .lang-sep { width: 1px; background: var(--border); align-self: stretch; }
.lang-switch .lang-other { padding: 0.2rem 0.5rem; color: var(--muted); letter-spacing: 0.5px; transition: color 0.2s, background 0.2s; }
.lang-switch .lang-other:hover { color: var(--cyan); background: rgba(6,182,212,0.08); text-decoration: none; }
.theme-btn {
  background: none; border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; transition: border-color 0.2s, color 0.2s;
}
.theme-btn:hover { border-color: var(--cyan); color: var(--cyan); }
/* show sun in dark mode, moon in light mode */
.theme-btn .icon-moon { display: none; }
[data-theme="light"] .theme-btn .icon-sun  { display: none; }
[data-theme="light"] .theme-btn .icon-moon { display: inline-flex; }

/* ── Footer ── */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 2.5rem 2rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.footer-logo { display: flex; align-items: center; gap: 0.5rem; }
.footer-logo span { font-family: var(--font-mono); font-weight: 700; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-link-icon { display: inline-flex; align-items: center; gap: 0.3rem; }
.footer-copy { color: var(--muted); font-size: 0.8rem; width: 100%; text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ── Cookie banner ── */
#cookie-banner {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg2); border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--purple)) 1;
  padding: 1.1rem 2rem; gap: 1.5rem; align-items: center; flex-wrap: wrap;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
}
.cookie-text { flex: 1; min-width: 260px; }
.cookie-text strong { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--text); }
.cookie-text p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.cookie-text a { color: var(--cyan); font-size: 0.82rem; }
.cookie-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.btn-cookie-decline { padding: 0.5rem 1.2rem; border-radius: 7px; border: 1.5px solid var(--border); color: var(--muted); background: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: border-color 0.2s, color 0.2s; }
.btn-cookie-decline:hover { border-color: var(--muted); color: var(--text); }
.btn-cookie-accept { padding: 0.5rem 1.2rem; border-radius: 7px; background: linear-gradient(135deg, var(--cyan), var(--purple)); color: #fff; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 700; transition: opacity 0.2s; }
.btn-cookie-accept:hover { opacity: 0.88; }

/* ── mlc-symbol custom element ── */
mlc-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1.1em;
  height: 1.1em;
  position: relative;
  top: -0.05em;
  flex-shrink: 0;
  color: inherit; /* ensures currentColor propagates into the SVG */
}
mlc-symbol:not(:defined) { opacity: 0; } /* prevent flash before JS defines the element */
mlc-symbol svg {
  /* No fill override — SVG presentation attrs (fill/stroke) on the <symbol> handle it.
     We only set dimensions so the SVG fills the custom element. */
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* ── Responsive nav/footer ── */
@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .nav-links > a:not(.btn-nav) { display: none; }
  .lang-switch { display: flex; }
  footer { text-align: center; }
  .footer-inner { justify-content: center; }
}