/* ── Design tokens ── */
:root {
  --bg:        oklch(14% 0.01 60);
  --surface:   oklch(18% 0.012 60);
  --border:    oklch(24% 0.012 60);
  --text:      oklch(88% 0.01 80);
  --dim:       oklch(55% 0.01 80);
  --amber:     oklch(75% 0.18 60);
  --amber-dim: oklch(75% 0.18 60 / 0.15);
  --code-bg:   oklch(16% 0.012 60);
  --green:     oklch(72% 0.14 160);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Georgia, serif;
  line-height: 1.65;
  padding: 0 1.5rem;
}

/* ── Nav ── */
nav.site-nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
}

.site-name {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.9rem;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: 0.04em;
}

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

.nav-links a {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 120ms;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

/* ── Page layouts ── */
.page-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 4rem;
  align-items: start;
}

.page-wrap-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

/* ── Index intro ── */
.intro {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.intro-name {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.intro-desc {
  color: var(--dim);
  font-size: 0.95rem;
  max-width: 560px;
  line-height: 1.6;
}

/* ── Post list ── */
.post-list { list-style: none; }

.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-meta {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  color: var(--dim);
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  color: var(--amber);
  background: var(--amber-dim);
  padding: 0.1em 0.5em;
  border-radius: 3px;
}

.tag.tech   { color: oklch(75% 0.18 60); background: oklch(75% 0.18 60 / 0.12); }
.tag.travel { color: oklch(72% 0.14 220); background: oklch(72% 0.14 220 / 0.12); }
.tag.dad    { color: oklch(72% 0.14 160); background: oklch(72% 0.14 160 / 0.12); }

.post-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 120ms;
}

.post-title a:hover { color: var(--amber); }

.post-desc {
  color: var(--dim);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ── Sidebar (shared) ── */
.sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-block {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.sidebar-label {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.68rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.sidebar-about p {
  font-size: 0.88rem;
  color: var(--dim);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.sidebar-about a {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.75rem;
  color: var(--amber);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.5rem;
}

.sidebar-about a:hover { text-decoration: underline; }

/* Series list */
.series-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }

.series-list li {
  font-size: 0.82rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.series-list .part-num {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.68rem;
  color: var(--dim);
  flex-shrink: 0;
}

.series-list a { color: var(--amber); text-decoration: none; line-height: 1.35; }
.series-list a:hover { text-decoration: underline; }
.series-list .current { color: var(--text); font-weight: 500; }

/* Recent list */
.recent-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }

.recent-item-date {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.68rem;
  color: var(--dim);
  display: block;
  margin-bottom: 0.15rem;
}

.recent-item-title {
  font-size: 0.82rem;
  color: var(--dim);
  text-decoration: none;
  line-height: 1.35;
  transition: color 120ms;
}

.recent-item-title:hover { color: var(--amber); }

/* Listening list */
.listening-list { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }

.listening-item { display: flex; flex-direction: column; gap: 0.2rem; }

.listening-title { font-size: 0.82rem; color: var(--text); line-height: 1.35; text-decoration: none; }
a.listening-title:hover { color: var(--amber); }

.listening-type {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.68rem;
  color: var(--amber);
  letter-spacing: 0.06em;
}

.listening-desc { font-size: 0.78rem; color: var(--dim); line-height: 1.4; }

/* ── Article ── */
article { min-width: 0; }

.article-series {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  color: var(--amber);
  background: var(--amber-dim);
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.article-meta {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.75rem;
  color: var(--dim);
  display: flex;
  gap: 1.25rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

/* ── Prose ── */
.prose p { margin-bottom: 1.4rem; }

.prose h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.prose h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.75rem 0 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

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

.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { text-decoration: none; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }

.prose blockquote {
  border-left: 3px solid var(--amber);
  padding: 0.6rem 0 0.6rem 1.25rem;
  margin: 1.75rem 0;
  color: var(--dim);
  font-style: italic;
}
.prose blockquote p { margin-bottom: 0; }

.prose code {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.85em;
  background: var(--surface);
  color: var(--amber);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: inherit;
}

/* ── Series nav (article footer) ── */
.series-nav {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
  margin-top: 3.5rem;
  gap: 2rem;
}

.series-nav-item { max-width: 46%; }
.series-nav-item.next { text-align: right; margin-left: auto; }

.series-nav-label {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

.series-nav-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--amber);
  text-decoration: none;
  line-height: 1.35;
}

.series-nav-title:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── About page ── */
.page-label {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.about-prose p { margin-bottom: 1.4rem; }

.about-prose a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-prose a:hover { text-decoration: none; }

.links-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.links-row a {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 120ms;
}

.links-row a:hover { color: var(--amber); }

/* ── Projects page ── */
.projects-list { list-style: none; }

.project-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 2rem;
  align-items: start;
}

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

.project-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.project-desc { color: var(--dim); font-size: 0.92rem; line-height: 1.5; }

.project-stack {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
}

.project-status {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.68rem;
  color: var(--amber);
  letter-spacing: 0.06em;
  text-align: right;
}

/* ── Privacy page ── */
.prose-page { max-width: 680px; margin: 0 auto; padding: 3.5rem 0 5rem; }
.prose-page h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.prose-page .page-meta {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  color: var(--dim);
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.prose-page h2 { font-size: 1.05rem; font-weight: 600; margin: 2rem 0 0.75rem; letter-spacing: -0.01em; }
.prose-page p { margin-bottom: 1.2rem; color: var(--dim); font-size: 0.95rem; line-height: 1.65; }
.prose-page a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

/* ── Footer ── */
footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  color: var(--dim);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--amber); }

/* ── Photos stub ── */
.coming-soon {
  text-align: center;
  padding: 6rem 0;
  color: var(--dim);
}
.coming-soon-label {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.coming-soon p { font-size: 0.95rem; line-height: 1.6; max-width: 420px; margin: 0 auto; }

/* ── Mobile ── */
@media (max-width: 720px) {
  .page-wrap { grid-template-columns: 1fr; gap: 3rem; }
  .sidebar { position: static; }
  .prose h1 { font-size: 1.5rem; }
  .series-nav { flex-direction: column; gap: 1.5rem; }
  .series-nav-item.next { text-align: left; margin-left: 0; }
  .project-item { grid-template-columns: 1fr; }
  .project-stack, .project-status { text-align: left; }
}

/* --- Matrix header --- */
.site-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.site-header canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.65;
  z-index: 0;
}
.site-header::after {
  /* fade rain into page background so the band ends soft, not clipped */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgb(0 0 0 / 0.1), transparent 40%, var(--bg) 97%);
  z-index: 1;
  pointer-events: none;
}
.site-header .site-nav {
  position: relative;
  z-index: 2;
  border-bottom: none;
}
.rain-band { height: 88px; }

/* --- Red pill / blue pill (footer easter egg) --- */
.pill-row {
  display: inline-flex;
  gap: 8px;
}
.pill {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.pill:hover { opacity: 1; }
.pill-red { color: oklch(65% 0.16 25); }
.pill-blue { color: oklch(68% 0.11 250); }

/* --- Photo social links --- */
.photo-links {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 14px;
}
.photo-links a {
  color: var(--amber);
  text-decoration: none;
}
.photo-links a:hover { text-decoration: underline; }
