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

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

:root {
  --ink:      #0f0e0d;
  --paper:    #f5f3ef;
  --sand:     #e8e4dc;
  --mist:     #c8c3b8;
  --dim:      #7a7570;
  --teal:     #1a6b6b;
  --teal-lt:  #e8f2f2;
  --rose:     #c0404a;
  --amber:    #b87333;
  --white:    #ffffff;
  --font: 'DM Mono', monospace;
  --max: 740px;
}

[data-theme="dark"] {
  --ink:    #f0ede8;
  --paper:  #111110;
  --sand:   #1e1d1b;
  --mist:   #4a4844;
  --dim:    #8a8580;
  --white:  #1a1918;
  --teal-lt: #0d2929;
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
  background: rgba(245,243,239,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
  transition: background 0.3s;
}
[data-theme="dark"] nav {
  background: rgba(17,17,16,0.9);
}

.nav-name {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-icons {
  display: flex; align-items: center; gap: 20px;
}

.nav-icon {
  background: none; border: none; cursor: pointer;
  color: var(--dim); font-size: 16px;
  padding: 4px; display: flex; align-items: center;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-icon:hover { color: var(--ink); }
.nav-icon.active { color: var(--teal); }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ── MAIN ── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 140px 48px 80px;
}

/* ── HOME ── */
.intro {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
}

.intro a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.intro a:hover { color: var(--teal); }

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 32px;
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb a {
  color: var(--dim); text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--ink); }

/* ── PAGE TITLE ── */
.page-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--ink);
}
.page-subtitle {
  font-size: 13px;
  font-style: italic;
  color: var(--dim);
  margin-bottom: 40px;
}

/* ── WORK LIST ── */
.work-list { display: flex; flex-direction: column; }

.work-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--sand);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
  cursor: pointer;
}
.work-item:hover { opacity: 0.65; }
.work-item:first-child { border-top: 1px solid var(--sand); }

.work-num {
  font-size: 11px;
  color: var(--mist);
  letter-spacing: 0.04em;
}
.work-name {
  font-size: 15px;
  color: var(--ink);
}
.work-tag {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
}

/* ── CATEGORY CARDS (writing landing page) ── */
.category-list { display: flex; flex-direction: column; }

.category-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 0;
  border-bottom: 1px solid var(--sand);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}
.category-item:first-child { border-top: 1px solid var(--sand); }
.category-item:hover { opacity: 0.65; }
.category-item:hover .category-title { color: var(--teal); }

.category-head {
  display: flex; align-items: center; justify-content: space-between;
}
.category-cat {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.05em;
}
.category-count {
  font-size: 11px;
  color: var(--mist);
  letter-spacing: 0.02em;
}
.category-title {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.2s;
}
.category-desc {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.8;
  max-width: 560px;
}
.category-arrow {
  font-size: 12px;
  color: var(--teal);
  letter-spacing: 0.02em;
}

/* ── WRITING ── */
.writing-list { display: flex; flex-direction: column; gap: 0; }
.writing-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 24px 0;
  border-bottom: 1px solid var(--sand);
  text-decoration: none; color: inherit;
  cursor: default;
}
.writing-item:first-child { border-top: 1px solid var(--sand); }
.writing-cat {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.05em;
}
.writing-title { font-size: 15px; color: var(--ink); line-height: 1.4; }
a.writing-title { text-decoration: underline; text-decoration-color: var(--teal); }
.writing-excerpt { font-size: 13px; color: var(--dim); line-height: 1.7; }
.writing-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}
.writing-date { font-size: 11px; color: var(--mist); }
.writing-status {
  font-size: 11px;
  color: var(--teal);
  display: flex; align-items: center; gap: 5px;
}
.status-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── FOOTER ── */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 48px 40px;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 20px;
}
.social-links {
  display: flex; gap: 16px; align-items: center;
}
.social-link {
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.03em;
  display: flex; align-items: center;
  transition: color 0.2s;
}
.social-link:hover { color: var(--ink); }
.social-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ── DIVIDER ── */
hr {
  border: none;
  border-top: 1px solid var(--sand);
  margin: 32px 0;
}

@media (max-width: 600px) {
  nav { padding: 18px 24px; }
  main { padding: 110px 24px 60px; }
  footer { padding: 20px 24px 36px; }
  .work-item { grid-template-columns: 32px 1fr; }
  .work-tag { display: none; }
  .category-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}
