/* ============================================================
   PERSONAL SITE — Steel Blue / Sans-Serif Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --steel:       #5b9bd5;
  --steel-light: #7db8e8;
  --steel-dim:   #3a78b5;
  --steel-pale:  #b8d8f0;
  --ink:         #111318;
  --ink-2:       #1a1f28;
  --ink-3:       #242b36;
  --border:      #2e3a4a;
  --text:        #d4dde8;
  --text-muted:  #8fa5bc;
  --text-bright: #eef3f9;
  --accent:      #74c0fc;
  --tag-bg:      rgba(91, 155, 213, 0.18);
  --nav-bg-color: rgba(13, 17, 23, 0.92);
  --body-glow:   rgba(91, 155, 213, 0.12);

  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --radius: 4px;
  --max-w:  720px;
  --nav-h:  64px;
  color-scheme: dark;
}

[data-theme="light"] {
  --steel:       #2d6da8;
  --steel-light: #1a5a9a;
  --steel-dim:   #4a85bb;
  --steel-pale:  #0d3f6e;
  --ink:         #f0f4f8;
  --ink-2:       #e3ecf5;
  --ink-3:       #d6e4f0;
  --border:      #b0cae0;
  --text:        #243040;
  --text-muted:  #5a7890;
  --text-bright: #0d1a26;
  --accent:      #1a5a9a;
  --tag-bg:      rgba(45, 109, 168, 0.1);
  --nav-bg-color: rgba(240, 244, 248, 0.95);
  --body-glow:   rgba(45, 109, 168, 0.06);
  color-scheme: light;
}

[data-theme="sepia"] {
  --steel:       #9c6e2e;
  --steel-light: #b07d35;
  --steel-dim:   #7a5420;
  --steel-pale:  #4a3010;
  --ink:         #f5f0e6;
  --ink-2:       #ede6d6;
  --ink-3:       #e3d9c6;
  --border:      #c4a87a;
  --text:        #3a2415;
  --text-muted:  #7a5a38;
  --text-bright: #1e0e04;
  --accent:      #9c6e2e;
  --tag-bg:      rgba(156, 110, 46, 0.1);
  --nav-bg-color: rgba(245, 240, 230, 0.95);
  --body-glow:   rgba(156, 110, 46, 0.08);
  color-scheme: light;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  min-height: 100vh;
  /* Subtle noise texture */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--body-glow) 0%, transparent 70%);
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-bright);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.5em; }
h3 { font-size: 1.25rem; color: var(--steel-light); }

p { margin-bottom: 1.2em; color: var(--text); }
a { color: var(--steel-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--steel-pale); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

pre {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--steel);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  border-radius: var(--radius);
  margin: 1.5em 0;
}

code {
  background: var(--ink-3);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--steel-pale);
}

pre code { background: none; padding: 0; }

blockquote {
  border-left: 3px solid var(--steel);
  padding-left: 1.2rem;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Nav ───────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg-color);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--steel);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo::before {
  content: '>';
  color: var(--steel-dim);
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--steel-light);
  background: var(--tag-bg);
}

/* ── Layout ────────────────────────────────────────────── */
.page-wrap {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ── Page Header ───────────────────────────────────────── */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin-bottom: 0.75rem;
  display: block;
}

/* ── Hero (Home) ───────────────────────────────────────── */
.hero {
  padding: 4rem 0 3rem;
  position: relative;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-bright) 0%, var(--steel-pale) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--steel);
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.hero-bio {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.8;
}

/* ── Blog Post List ────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--steel-dim);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.post-item:first-child { border-top: 1px solid var(--border); }

.post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding-top: 0.1em;
}

.post-link {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-bright);
  transition: color 0.2s;
}

.post-link:hover { color: var(--steel-light); }

.post-excerpt {
  grid-column: 2;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
  line-height: 1.6;
}

/* ── Tags ──────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--tag-bg);
  color: var(--steel-light);
  border: 1px solid var(--steel-dim);
  padding: 0.2em 0.6em;
  border-radius: 2px;
}

/* ── Article (Single Post) ─────────────────────────────── */
.article-header {
  margin-bottom: 3rem;
}

.article-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.article-meta .meta-date { color: var(--steel); }

.article-body {
  max-width: 68ch;
}

.article-body h2 { margin-top: 2.5em; }
.article-body h3 { margin-top: 2em; }
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2em;
}
.article-body li { margin-bottom: 0.4em; }
.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5em 0;
}

/* ── Projects Grid ─────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--steel), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.project-card:hover {
  border-color: var(--steel-dim);
  transform: translateY(-2px);
}

.project-card:hover::before { opacity: 1; }

.project-card.pinned::before { opacity: 0.6; }

.project-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--steel-light);
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin: 0;
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.project-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color 0.2s;
}

.project-links a:hover { color: var(--steel-light); }

.project-lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.project-lang::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steel);
  display: inline-block;
}

/* ── Music Page ────────────────────────────────────────── */
.music-releases {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.music-card {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  transition: border-color 0.2s;
}

.music-card:hover { border-color: var(--steel-dim); }

.music-cover {
  width: 80px;
  height: 80px;
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--steel-dim);
  font-size: 1.8rem;
  flex-shrink: 0;
}

.music-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.music-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--steel);
  margin-bottom: 0.5rem;
}

.music-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.music-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.music-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.music-links a:hover { color: var(--steel-light); }

/* ── Contact ───────────────────────────────────────────── */
.contact-wrap {
  max-width: 52ch;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.contact-item:first-of-type { border-top: 1px solid var(--border); }

.contact-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  width: 6rem;
  flex-shrink: 0;
}

.contact-value { color: var(--steel-light); }

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Back Link ─────────────────────────────────────────── */
.back-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--steel-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.back-link:hover { color: var(--steel-light); }

/* ── Theme Toggle ──────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.theme-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.theme-btn:hover { color: var(--steel-light); }

.theme-btn.active {
  background: var(--tag-bg);
  color: var(--steel-light);
}

.theme-btn + .theme-btn {
  border-left: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .post-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .post-date { font-size: 0.68rem; }
  .post-excerpt { grid-column: 1; }
  .projects-grid { grid-template-columns: 1fr; }
  .music-card { grid-template-columns: 1fr; }
  .music-cover { display: none; }
  .nav-links a { padding: 0.4rem 0.5rem; }
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero, .post-list, .projects-grid, .music-releases, .contact-wrap {
  animation: fadeUp 0.5s ease both;
}
