/* midnightblue: calm night, paper grain, one soft accent */

:root {
  --bg: #0c1124;
  --raised: #111733;
  --line: #1d2447;
  --text: #f3eee6;
  --dim: #8b91b3;
  --lavender: #a99bf0;
  --pink: #ff86d4;
  --max: 660px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

html { background: var(--bg); }

/* faint dot grid: the "graph paper" under the night sky */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(169, 155, 240, 0.16) 1px, transparent 1.3px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 70% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 60% at 70% 0%, #000 0%, transparent 75%);
}

.mono { font-family: var(--mono); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  position: relative;
  background: transparent;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* paper grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(169, 155, 240, 0.5); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--pink); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* header */
.site-header { padding: 32px 0 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1.02rem; letter-spacing: -0.01em; text-decoration: none; }
.logo img { width: 28px; height: 28px; }
.nav { display: flex; gap: 22px; font-size: 0.82rem; font-family: var(--mono); }
.nav a { color: var(--dim); text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--text); }

/* hero */
.hero { padding: 56px 0 40px; }
.hero-art { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 0 20px -12px; }
.hero h1 {
  font-weight: 500;
  font-size: clamp(1.9rem, 5.6vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--lavender); letter-spacing: 0; }
.hero p { color: var(--dim); margin: 0; }
.tagline { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; margin-bottom: 12px !important; }

/* live status line, like a process that's running */
.status {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 26px !important;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 51, 0.6);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim) !important;
}
.status b { color: var(--text); font-weight: 400; }
.status .live { width: 7px; height: 7px; border-radius: 50%; background: #7ee2a8; box-shadow: 0 0 0 0 rgba(126, 226, 168, .6); animation: ping 2.4s infinite; }
.cursor { display: inline-block; width: 7px; height: 1em; background: var(--lavender); margin-left: 2px; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(126, 226, 168, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(126, 226, 168, 0); } }
@media (prefers-reduced-motion: reduce) { .cursor, .status .live { animation: none; } }
.tagline::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); margin: 0 10px 2px 0; vertical-align: middle; }

/* sections */
.section { padding: 28px 0; }
.section h2 { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; text-transform: lowercase; letter-spacing: 0.04em; color: var(--dim); margin: 0 0 14px; }
.section h2::before { content: "~/"; color: var(--lavender); }

.card {
  display: block;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.card:last-child { border-bottom: 1px solid var(--line); }
a.card:hover h3 { color: var(--lavender); }
.card h3 { font-weight: 500; margin: 0 0 6px; font-size: 1.2rem; line-height: 1.4; letter-spacing: -0.01em; transition: color .2s; }
.card p { margin: 0; color: var(--dim); font-size: 0.97rem; }
.meta { font-family: var(--mono); font-size: 0.75rem; color: var(--dim); margin-bottom: 6px; }
.meta .idx { color: var(--lavender); }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.72rem; color: var(--lavender); margin-top: 10px; }

/* post */
.post-header { padding: 64px 0 24px; }
.post-header h1 { font-weight: 500; font-size: clamp(1.9rem, 5.4vw, 2.5rem); line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 10px; }
.post-header .subtitle { font-family: "Instrument Serif", Georgia, serif; font-style: italic; color: var(--lavender); font-size: 1.3rem; margin: 0 0 10px; }
.post { padding-bottom: 48px; counter-reset: sec; }
.post h2 { font-weight: 500; font-size: 1.3rem; letter-spacing: -0.01em; margin: 2.4em 0 0.6em; }
.post h2::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); font-family: var(--mono); font-size: 0.72rem; font-weight: 400; color: var(--lavender); margin-right: 12px; vertical-align: 3px; }
.post p { margin: 0 0 1.3em; }
.post ul { padding-left: 1.2em; margin: 0 0 1.3em; }
.post li { margin-bottom: 0.6em; }
.post li::marker { color: var(--lavender); }
.post blockquote {
  margin: 2em 0;
  padding: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 1.55rem;
  line-height: 1.4;
  color: var(--text);
}
.post blockquote::before { content: ""; display: block; width: 28px; height: 1px; background: var(--pink); margin-bottom: 14px; }
.post strong { font-weight: 600; }
.signoff { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 1.3rem; color: var(--lavender); }

hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* footer */
.site-footer { padding: 40px 0 56px; color: var(--dim); font-family: var(--mono); font-size: 0.75rem; }
.site-footer .wrap { border-top: 1px solid var(--line); padding-top: 20px; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .hero { padding: 56px 0 28px; }
  .hero-art { margin-left: -8px; }
  .nav { gap: 16px; }
}
