/* =========================================================================
   zonduu — terminal-flavored blog
   Hand-built. No framework. Edit the tokens below to reskin the whole site.
   ========================================================================= */

:root {
  /* Palette */
  --bg:            #0d0e10;
  --bg-grid:       rgba(255, 255, 255, 0.015);
  --surface:       #15171a;
  --surface-2:     #1b1e22;
  --border:        #24282d;
  --border-soft:   #1e2226;

  --text:          #c7ccd1;
  --text-dim:      #7b828b;
  --text-faint:    #565c64;
  --text-bright:   #f2f4f6;

  --accent:        #57d13a;   /* green — the original zonduu accent, refined */
  --accent-bright: #74e85a;
  --accent-dim:    #3a8f27;
  --accent-glow:   rgba(87, 209, 58, 0.16);

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Metrics */
  --measure: 68rem;         /* reading column (posts, header, footer) */
  --wide:    68rem;         /* keep everything aligned to one column */
  --radius:  10px;
  --gutter:  clamp(1.15rem, 5vw, 2rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    radial-gradient(1200px 600px at 50% -10%, var(--accent-glow), transparent 70%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

::selection { background: var(--accent); color: #05130a; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--reading { max-width: var(--measure); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55ch;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-bright);
  white-space: nowrap;
}
.logo__prompt { color: var(--accent); }
.logo__cursor {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  translate: 0 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .logo__cursor { animation: none; } }

.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  transition: color 0.15s ease;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav__icons { display: flex; gap: 0.9rem; }
.nav__icons a { color: var(--text-dim); display: grid; place-items: center; }
.nav__icons a:hover { color: var(--accent); }
.nav__icons svg { width: 18px; height: 18px; }

/* ---------- Hero (home) ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(3rem, 9vw, 5.5rem) 0 2.5rem;
}
.hero__avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 6px rgba(87, 209, 58, 0.05), 0 18px 50px -20px rgba(0,0,0,0.8);
}
.hero__name {
  margin: 1.4rem 0 0;
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  line-height: 1.05;
}
.hero__role {
  margin: 0.7rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.4px;
  color: var(--text-dim);
}
.hero__role b { color: var(--accent); font-weight: 500; }
.hero__socials {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.6rem;
}
.hero__socials a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: var(--surface);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.hero__socials a:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.hero__socials svg { width: 19px; height: 19px; }
.hero__cta {
  margin-top: 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.hero__cta:hover { color: var(--accent); border-color: var(--accent-dim); }
.hero__cta-prompt { color: var(--accent); }

/* ---------- Section kicker ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 0.5rem;
}
.section-head h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0;
}
.section-head a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.section-head a:hover { color: var(--accent); }

/* ---------- Post list ---------- */
.post-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  margin: 2.2rem 0 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border);
}
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-bottom: 1px solid var(--border-soft); }
.post-item__link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1.05rem 0.6rem;
  border-radius: var(--radius);
  transition: background 0.15s ease, padding-left 0.15s ease;
}
.post-item__link:hover {
  background: var(--surface);
  padding-left: 1rem;
}
.post-item__title {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-bright);
  transition: color 0.15s ease;
}
.post-item__link:hover .post-item__title { color: var(--accent); }
.post-item__ext { color: var(--text-faint); font-weight: 400; font-size: 0.85em; }
.post-item__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.post-item__tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.08rem 0.6rem;
}

/* ---------- Page title block ---------- */
.page-title {
  padding: clamp(2.2rem, 6vw, 3.4rem) 0 0.5rem;
}
.page-title h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-bright);
  margin: 0.4rem 0 0;
}

/* ---------- Article ---------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 1rem;
}
.post-meta .dot { color: var(--accent); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.back-link:hover { color: var(--accent); }

.prose { margin-top: 2rem; padding-bottom: 2rem; }
.prose > * + * { margin-top: 1.25rem; }
.prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  margin-top: 2.6rem;
  scroll-margin-top: 80px;
}
.prose h2::before {
  content: "# ";
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
}
.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-top: 2rem;
}
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--text-bright); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.5rem; }
.prose li::marker { color: var(--accent-dim); }

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.8rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}
.prose blockquote p { margin: 0; }

.prose figure { margin: 1.7rem 0; }
.prose figure img,
.prose > img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.prose figure figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-align: center;
}
.prose ol { padding-left: 1.4rem; }
.rating {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-bright);
}

/* Tables (timelines, secret lists) */
.prose .table-scroll { overflow-x: auto; margin: 1.7rem 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose thead th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.prose tbody td:first-child {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.prose td code { white-space: nowrap; }

/* inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: var(--accent-bright);
}

/* code blocks */
.code {
  margin: 1.7rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b0c0e;
}
.code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.code__dots { display: inline-flex; gap: 6px; }
.code__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.code__copy {
  font: inherit;
  background: none;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.08em;
}
.code__copy:hover { color: var(--accent); }
.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.6;
  color: #d6dae0;
  tab-size: 2;
}
.code pre code { font-family: inherit; background: none; border: 0; padding: 0; }

.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border-soft);
  padding: 2rem 0 3rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 1rem; }
  .nav a span.nav__label { display: none; }
  .post-item__link { grid-template-columns: 1fr; }
  .post-item__date { order: -1; }
}
