:root {
  --bg: hsl(0, 0%, 0%);
  --fg: hsl(30, 10%, 90%);
  --muted: hsl(30, 8%, 70%);
  --strong: #ff7881;
  --em: #fbbb83;
  --link: #ffbe00;
  --link-visited: hsl(45, 100%, 40%);
  --panel: hsl(240, 12%, 10%);
  --border: hsl(240, 12%, 18%);
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Libre Baskerville", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  line-height: 1.6;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  container-type: inline-size;
}

nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.post-list {
  text-align: center;
}

header h1 {
  font-size: clamp(1.3rem, 6.49cqw, 3.29rem);
  line-height: 1.3;
  margin: 0 0 8px;
  text-wrap: balance;
}

hgroup {
  margin-bottom: 30px;
}

hgroup p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

h2, h3 {
  margin-top: 40px;
  margin-bottom: 12px;
  line-height: 1.2;
}

h2 {
  font-size: 1.7rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

h3 { font-size: 1.3rem; }

h1 small {
  font-size: 1rem;
  font-weight: normal;
}

p { margin: 0 0 16px; }

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

em {
  color: var(--em);
  font-style: italic;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link) 45%, transparent);
}

a:visited {
  color: var(--link-visited);
  border-bottom-color: color-mix(in srgb, var(--link-visited) 45%, transparent);
}

a:hover { border-bottom-color: currentColor; }

.table-wrap {
  margin: 32px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: hsl(240, 12%, 18%);
  font-weight: 600;
}

tr:last-child td { border-bottom: none; }

/* Mobile labels - hidden on desktop, shown on mobile */
.mobile-label {
  display: none;
}

@media (max-width: 700px) {
  .table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  table {
    border: none;
    font-size: 0.9rem;
  }

  thead {
    display: none;
  }

  tr {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
  }

  tr:last-child {
    border-bottom: none;
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: none;
  }

  .mobile-label {
    display: inline;
    color: var(--muted);
    font-weight: 600;
  }
}

code, pre {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1rem;
  background: var(--panel);
  color: hsl(30, 12%, 88%);
}

/* syntax highlighting - matching existing accent vibrancy */
.sh { color: hsl(35, 50%, 72%); }
.cw { color: hsl(140, 70%, 60%); }   /* cache write: 1.25× input price */
.in { color: hsl(175, 80%, 60%); }   /* regular input: 1× */
.cr { color: hsl(210, 70%, 70%); }   /* cache read: 0.1× input price */
.out { color: hsl(280, 70%, 72%); }  /* output */

code {
  padding: 2px 6px;
  border-radius: 6px;
}

pre {
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 12px 0 20px;
}

pre code {
  display: block;
  padding: 0;
  border: none;
  white-space: pre;
}

hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 28px 0;
}

details summary {
  cursor: pointer;
}

.note {
  color: var(--muted);
  font-size: 0.85rem;
}

.note a {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--muted) 45%, transparent);
}

.note a:visited {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--muted) 45%, transparent);
}

.note a:hover {
  border-bottom-color: currentColor;
}

.bio {
  line-height: 1.8;
  margin-top: 16px;
}

.mobile-only { display: none; }

@media (max-width: 700px) {
  h2 { font-size: 1.25rem; }

  .mobile-only { display: block; }
  .desktop-only { display: none; }

  .wrap {
    padding: 24px 10px;
  }

  .post-list {
    text-align: left;
  }

  pre, code {
    font-size: 0.85rem;
  }

  pre {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 16px;
    padding-right: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  pre code {
    display: inline-block;
    min-width: 100%;
    padding-right: 10px;
  }
}
