/* Overpass — open-source Interstate/Highway-Gothic lineage, self-hosted (variable). */
@font-face {
  font-family: "Overpass";
  src: url("/css/fonts/overpass.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Design tokens — Anthropic-ish ivory ground, mandarin-orange accent. */
:root {
  --clr-ivory-100: #f6f4ec;
  --clr-ivory-200: #f0eee6;
  --clr-ivory-300: #e7e2d5;
  --clr-ivory-400: #ddd8ca;
  --clr-ink-500:   #8f8a7e;
  --clr-ink-900:   #191714;

  --clr-accent: #ef7215;   /* mandarin */

  --clr-bg:      var(--clr-ivory-200);
  --clr-fg:      var(--clr-ink-900);
  --clr-muted:   var(--clr-ink-500);
  --clr-rule:    var(--clr-ivory-400);
  --clr-code-bg: var(--clr-ivory-300);

  --fs-300: clamp(0.78rem, 0.75rem + 0.15vw, 0.88rem);
  --fs-400: clamp(1rem, 0.97rem + 0.2vw, 1.1rem);
  --fs-600: clamp(1.25rem, 1.15rem + 0.5vw, 1.55rem);
  --fs-800: clamp(1.55rem, 1.3rem + 1.1vw, 2.1rem);

  --measure: 66ch;         /* Bringhurst: ~66 char measure */
  --gutter: clamp(1.2rem, 4vw, 2.5rem);

  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: "Overpass", Arial, system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --clr-bg: #1a1714;
    --clr-fg: #ece7dd;
    --clr-muted: #979184;
    --clr-rule: #332e26;
    --clr-code-bg: #241f18;
    --clr-accent: #ff9040;
  }
}
:root[data-theme="light"] { --clr-bg:#f0eee6; --clr-fg:#191714; --clr-muted:#8f8a7e; --clr-rule:#ddd8ca; --clr-code-bg:#e7e2d5; --clr-accent:#ef7215; }
:root[data-theme="dark"]  { --clr-bg:#1a1714; --clr-fg:#ece7dd; --clr-muted:#979184; --clr-rule:#332e26; --clr-code-bg:#241f18; --clr-accent:#ff9040; }

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

/* Serif reading column (Anthropic uses a serif text face). */
body {
  margin: 0;
  background: var(--clr-bg);
  color: var(--clr-fg);
  font-family: var(--font-serif);
  font-size: var(--fs-400);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first allow-end last; /* Bringhurst: optical margin (Safari) */
}

.site-header,
.site-main,
.site-footer {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
}

.site-footer {
  border-top: 1px solid var(--clr-rule);
  margin-top: 3rem;
  padding-block: 1.4rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: var(--fs-300);
}
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer a { color: var(--clr-muted); text-decoration: none; }
.site-footer a:hover { color: var(--clr-accent); }
.site-footer__meta { margin: 0; color: var(--clr-muted); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--clr-bg);
  padding-block: clamp(1.5rem, 5vw, 2.6rem) 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--clr-rule);
  transition: padding-block 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  padding-block: 0.7rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.site-header__brand { display: flex; align-items: baseline; gap: 0.9rem; }

/* JANBRAUER → J\B animated wordmark (sans). */
.site-header__logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--fs-600);
  letter-spacing: 0.02em;
  color: var(--clr-fg);
  text-decoration: none;
  display: inline-flex;
  line-height: 1;
  white-space: nowrap;
}
.site-header__logo .l,
.site-header__logo .l-slash { display: inline-block; overflow: hidden; }
/* Morph is driven by scroll: JANBRAUER at top, collapses to J\B once scrolled. */
.l-drop { max-width: 1.2em; opacity: 1; transition: max-width 0.4s ease, opacity 0.3s ease; }
.l-slash { max-width: 0; opacity: 0; color: var(--clr-accent); transition: max-width 0.4s ease, opacity 0.3s ease; }
.site-header.scrolled .l-drop { max-width: 0; opacity: 0; }
.site-header.scrolled .l-slash { max-width: 0.62em; opacity: 1; }

.site-header__claim {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-300);
  font-weight: 600;
  color: var(--clr-accent);
  letter-spacing: -0.01em;
}
.accent { color: var(--clr-accent); }

.site-nav { display: flex; gap: 1.2rem; font-family: var(--font-sans); font-size: var(--fs-300); }
.site-nav a { color: var(--clr-muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--clr-accent); }
.site-nav a.link { color: var(--clr-accent); text-decoration: underline; }
.site-nav a.link:hover { color: #fff; }

/* CSS-only hamburger for narrow viewports. */
.nav-toggle { display: none; }
.burger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--clr-fg);
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 34rem) {
  .burger { display: block; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; gap: 0.5rem; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}

.site-main { padding-block: 1.6rem 4rem; }

/* Links — mandarin coloured underline. */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--clr-accent);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.15em;
  transition: text-decoration-thickness 0.15s ease, background-color 0.15s ease;
}
a:hover { text-decoration-thickness: 0.2em; }
.link { font-weight: 700; text-decoration-thickness: 0.14em; transition: color 0.15s ease, background-color 0.15s ease, text-decoration-color 0.15s ease; }
.link:hover { background-color: var(--clr-accent); color: #fff; text-decoration-color: transparent; box-shadow: 0 0 0 0.15em var(--clr-accent); }

/* Headings — sans (Anthropic sets display in the grotesque). */
h1, h2, h3 { font-family: var(--font-sans); line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-600); margin-top: 2.5rem; }
h3 { font-size: var(--fs-600); }

/* Latest post block. */
#post h3 { margin-bottom: 0.2rem; }
#post h3 a { color: var(--clr-fg); text-decoration: none; }
#post h3 a:hover { color: var(--clr-accent); }
#date {
  font-family: var(--font-sans);
  color: var(--clr-muted);
  font-size: var(--fs-300);
  font-variant-caps: all-small-caps;   /* Bringhurst: small caps over faux uppercase */
  font-variant-numeric: oldstyle-nums; /* text figures, not lining */
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

hr { border: 0; border-top: 1px solid var(--clr-rule); margin-block: 2.5rem; }

/* Archive list — serif titles, sans oldstyle-figure dates (Bringhurst). */
#archive { list-style: none; padding: 0; margin: 0; }
#archive li { display: flex; gap: 1rem; padding-block: 0.4rem; border-bottom: 1px solid var(--clr-rule); }
#archive li span {
  color: var(--clr-muted);
  font-family: var(--font-sans);
  font-variant-numeric: oldstyle-nums;
  font-size: var(--fs-300);
  white-space: nowrap;
}
#archive li a { color: var(--clr-fg); text-decoration: none; }
#archive li a:hover { color: var(--clr-accent); }

/* Prose extras. */
blockquote { margin-inline: 0; padding-left: 1rem; border-left: 2px solid var(--clr-accent); color: var(--clr-muted); font-style: italic; }
img { max-width: 100%; height: auto; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--clr-code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--clr-code-bg); padding: 1rem; border-radius: 6px; overflow-x: auto; }
pre code { background: none; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  .site-header, .l-drop, .l-slash { transition: none; }
}
