/* ═══════════════════════════════════════════════════════
   AI-Native Theme — Dark-first, terminal-inspired
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:          #09090b;
  --bg-surface:  #111113;
  --bg-card:     #18181b;
  --bg-elevated: #1f1f23;
  --text:        #fafafa;
  --text-muted:  #71717a;
  --text-dim:    #52525b;
  --accent:      #22d3ee;
  --accent-2:    #a78bfa;
  --accent-glow: rgba(34, 211, 238, 0.15);
  --accent-glow2:rgba(167, 139, 250, 0.12);
  --border:      #27272a;
  --border-hover:#3f3f46;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --radius:      8px;
}

[data-theme="light"] {
  --bg:          #fafafa;
  --bg-surface:  #f4f4f5;
  --bg-card:     #ffffff;
  --bg-elevated: #ffffff;
  --text:        #09090b;
  --text-muted:  #71717a;
  --text-dim:    #a1a1aa;
  --accent:      #0891b2;
  --accent-2:    #7c3aed;
  --accent-glow: rgba(8, 145, 178, 0.08);
  --accent-glow2:rgba(124, 58, 237, 0.06);
  --border:      #e4e4e7;
  --border-hover:#d4d4d8;
}

/* ── Base ─────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ── Typography ───────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}
h1 { font-size: 1.875rem; line-height: 1.2; margin-bottom: 0.5em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { color: var(--text-muted); line-height: 1.8; }
strong { color: var(--text); }

/* ── Links ────────────────────────────────────────── */
a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover { color: var(--accent-2); }
a:visited { color: var(--accent); }

/* ── Navigation ───────────────────────────────────── */
.navigation-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: relative;
  backdrop-filter: blur(16px);
}

.site-name {
  font-family: var(--font-mono) !important;
  font-weight: 700;
  font-size: 0.95rem !important;
  color: var(--accent) !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.site-name a { color: var(--accent) !important; }
.site-name a:hover { color: var(--accent-2) !important; }

.top-navigation li {
  border-bottom-color: var(--border) !important;
}
.top-navigation li a {
  color: var(--text-dim) !important;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
.top-navigation li a:hover {
  color: var(--accent) !important;
}

/* ── Theme toggle ─────────────────────────────────── */
.navigation-wrapper { position: relative; }

#theme-toggle {
  position: absolute;
  right: 8.333%;
  top: 0;
  bottom: 0;
  margin: auto 0;
  height: 32px;
  width: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 0;
}
#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
#icon-sun  { display: block; }
#icon-moon { display: none; }
[data-theme="light"] #icon-sun  { display: none; }
[data-theme="light"] #icon-moon { display: block; }

/* ── Author sidebar ───────────────────────────────── */
.article-author-side { text-align: center; }

.article-author-side .bio-photo {
  border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px var(--accent-glow2);
  transition: box-shadow 0.4s ease;
}
.article-author-side .bio-photo:hover {
  box-shadow: 0 0 32px var(--accent-glow), 0 0 64px var(--accent-glow2);
}

.article-author-side h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-top: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.article-author-side p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ── Social links ─────────────────────────────────── */
.author-social {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  margin: 0.2rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}
.author-social:visited { color: var(--text-dim); }
.author-social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}
.author-social .fa { font-size: 0.85rem; }

/* ── Main content ─────────────────────────────────── */
#main article, #index {
  background: var(--bg-card);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.article-wrap { color: var(--text-muted); }
.article-wrap strong { color: var(--text); }

.article-wrap p > a, .article-wrap li > a {
  color: var(--accent);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
  transition: all 0.2s ease;
}
.article-wrap p > a:hover, .article-wrap li > a:hover {
  border-bottom-color: var(--accent);
  border-bottom-style: solid;
  text-shadow: 0 0 12px var(--accent-glow);
}

/* About Me heading — monospace accent */
#main article h1,
#index h1 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ── Feature image ────────────────────────────────── */
.image-wrap {
  border-radius: var(--radius);
  overflow: hidden;
}
.image-wrap img {
  filter: brightness(0.7) saturate(0.9);
  transition: filter 0.4s ease;
}
.image-wrap:hover img {
  filter: brightness(0.8) saturate(1);
}
.image-wrap:after { border-bottom-color: var(--bg); }

/* ── Code ─────────────────────────────────────────── */
code, pre, .highlight {
  font-family: var(--font-mono);
  border-radius: var(--radius);
}
p code, li code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  font-size: 0.85em;
  color: var(--accent);
}
.highlight {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

/* ── Footer ───────────────────────────────────────── */
.footer-wrap {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 2rem;
}
.footer-wrap footer {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.footer-wrap a, .footer-wrap a:visited { color: var(--text-dim); }
.footer-wrap a:hover { color: var(--accent); }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  background: transparent;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}
.btn:visited { color: var(--accent) !important; }
.btn:hover {
  background: var(--accent) !important;
  color: var(--bg) !important;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ── Forms ─────────────────────────────────────────── */
input, textarea, select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
label { color: var(--text-muted); }

/* ── Subtle grid background ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}
[data-theme="light"] body::before { opacity: 0.12; }

/* ── Responsive ───────────────────────────────────── */
@media only screen and (max-width: 37.5em) {
  body { font-size: 15px; }
  #main article, #index {
    padding: 1.5rem 1.25rem;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  #theme-toggle { right: 4%; }
}

/* ── Print ────────────────────────────────────────── */
@media print {
  body::before { display: none; }
  :root {
    --bg: white; --text: black; --bg-card: white;
    --text-muted: #333; --border: #ccc;
  }
}
