/* ══════════════════════════════════════════════
   Custom theme — matches presentation style
   Fonts: Inter + IBM Plex Mono
   Palette: warm neutrals with ink/mid/light
   ══════════════════════════════════════════════ */

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

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

:root {
  --bg:     #fafaf8;
  --ink:    #111;
  --mid:    #888;
  --light:  #aaa;
  --xlight: #f0ede8;
  --mono:   'IBM Plex Mono', monospace;
  --sans:   'Inter', sans-serif;
  --body:   'Inter', sans-serif;
  --fs-body: 15px;
  --pad-x:  28px;
  --max-w:  720px;
}

@media (min-width: 600px) {
  :root { --pad-x: 56px; --fs-body: 16px; }
}
@media (min-width: 900px) {
  :root { --pad-x: 96px; }
}

/* ── BASE ── */
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── DARK MODE ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #141414;
    --ink:    #ede8e0;
    --mid:    #999;
    --light:  #555;
    --xlight: #1a1a1a;
  }
}

/* ── LAYOUT ── */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ── TOP RULE ── */
.site-wrapper::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--ink);
}

/* ── HEADER ── */
header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--pad-x) 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
}

header .title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0;
}

header .title a {
  color: inherit;
  text-decoration: none;
}

header nav p {
  display: flex;
  gap: 20px;
}

header nav a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--mid);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

header nav a:hover {
  color: var(--ink);
}

/* ── HEADINGS ── */
h1 {
  font-family: var(--sans);
  font-size: clamp(32px, 7vw, 56px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 32px 0 16px;
}

h2 {
  font-family: var(--sans);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 40px 0 12px;
}

h3 {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 28px 0 8px;
}

h4 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 24px 0 8px;
}

/* ── RULE (decorative) ── */
hr {
  border: none;
  width: 24px;
  height: 1px;
  background: var(--ink);
  margin: 24px 0;
}

/* ── BODY TEXT ── */
p {
  color: var(--mid);
  margin: 12px 0;
  font-weight: 400;
}

strong {
  color: var(--ink);
  font-weight: 600;
}

em {
  font-style: italic;
}

/* ── LINKS ── */
a {
  color: var(--ink);
  text-decoration-color: var(--light);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: var(--ink);
}

/* ── LISTS ── */
ul, ol {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

li {
  color: var(--mid);
  padding: 6px 0;
  line-height: 1.6;
}

li strong {
  color: var(--ink);
}

ul > li::before {
  content: none;
}

/* ── CODE ── */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--xlight);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--ink);
}

pre {
  background: var(--xlight);
  border: 1px solid var(--light);
  padding: 18px 22px;
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--mid);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ── BLOCKQUOTE ── */
blockquote {
  border-left: 2px solid var(--ink);
  padding: 10px 0 10px 16px;
  margin: 20px 0;
  font-family: var(--body);
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--mid);
  line-height: 1.6;
}

blockquote strong {
  color: var(--ink);
  font-weight: 600;
}

blockquote p {
  margin: 4px 0;
}

/* ── TABLES ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

th {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mid);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--light);
}

td {
  padding: 10px 12px;
  color: var(--mid);
  border-bottom: 1px solid var(--xlight);
  line-height: 1.5;
}

td strong {
  color: var(--ink);
}

/* ── TAGS / CHIPS ── */
.tag, .chip {
  display: inline-block;
  border: 1px solid var(--light);
  border-radius: 3px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mid);
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-decoration: none;
}

.tag:hover {
  border-color: var(--mid);
  color: var(--ink);
  text-decoration: none;
}

/* ── POST LIST ── */
.post-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.post-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--xlight);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list a {
  text-decoration: none;
}

.post-title {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 4px;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--light);
}

.post-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--light);
  letter-spacing: 0.08em;
}

.post-excerpt {
  color: var(--mid);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.6;
}

/* ── POST (single) ── */
.post-header {
  margin: 32px 0 24px;
}

.post-header .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 12px;
}

.post-header h1 {
  margin-top: 0;
}

.post-header .post-meta {
  margin-top: 12px;
}

.post-content {
  padding-bottom: 48px;
}

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── PAGE TITLE ── */
.page-title {
  font-family: var(--sans);
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 32px 0 8px;
}

/* ── IMAGES ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
}

/* ── FOOTER ── */
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px var(--pad-x) 32px;
  border-top: 1px solid var(--xlight);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

footer p, footer i, footer a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--light);
  letter-spacing: 0.06em;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  color: var(--mid);
}

/* ── ANIMATIONS ── */
@keyframes up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-content > * {
  animation: up 0.35s ease forwards;
  opacity: 0;
}

.site-content > *:nth-child(1) { animation-delay: 0.00s; }
.site-content > *:nth-child(2) { animation-delay: 0.04s; }
.site-content > *:nth-child(3) { animation-delay: 0.08s; }
.site-content > *:nth-child(4) { animation-delay: 0.12s; }
.site-content > *:nth-child(5) { animation-delay: 0.16s; }
.site-content > *:nth-child(n+6) { animation-delay: 0.20s; }
