/* martymonero — base styles.
   Tokens + reset + page chrome. Same token architecture as the
   hexenwerkzeug lab theme (blog.css / admin.css consume these names);
   the palette is this site's own: warm copper on near-black. */

:root {
  color-scheme: dark;

  /* Background layers — every panel/card picks one. */
  --bg:           #0a0a0b;
  --surface:      #131316;
  --surface-2:    #18181d;
  --elevated:     #1f1f25;
  --border:       #26262d;
  --border-strong:#2f2f37;

  /* Text hierarchy — color alone signals weight. */
  --text:         #e8e8ec;
  --dim:          #8a8a93;
  --faint:        #5a5a63;

  /* Accent + semantic */
  --accent:       #fb923c;
  --accent-d:     #f97316;
  --accent-dim:   rgba(251, 146, 60, 0.10);
  --blue:         #60a5fa;
  --purple:       #c084fc;
  --amber:        #f59e0b;
  --cyan:         #22d3ee;
  --rose:         #fb7185;

  --sans:         'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:         'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --radius:       8px;
  --radius-sm:    4px;
  --gap:          0.75rem;
}

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

:where(html) {
  font: 14px/1.5 var(--sans);
  color: var(--text);
  background: var(--bg);
  tab-size: 2;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

:where(body) {
  margin: 0;
  min-block-size: 100dvh;
}

:where(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
:where(p, ul, ol, dl, pre, figure) { margin: 0; }
:where(ul, ol) { padding: 0; list-style: none; }

:where(a) {
  color: var(--accent);
  text-decoration: none;
}
:where(a:hover) { text-decoration: underline; text-underline-offset: 3px; }

:where(button) {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:where(code, kbd, samp, pre) { font-family: var(--mono); font-size: 0.92em; }
:where(:not(pre) > code) {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.05em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent);
}
:where(pre) {
  background: #08080a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow: auto;
  color: var(--dim);
  line-height: 1.7;
}

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

:where(::selection) { background: var(--accent); color: var(--bg); }

/* Scrollbar that doesn't fight the theme. */
*::-webkit-scrollbar           { width: 8px; height: 8px; }
*::-webkit-scrollbar-track     { background: transparent; }
*::-webkit-scrollbar-thumb     { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

:where(.icon) {
  --icon-size: 16px;
  inline-size: var(--icon-size);
  block-size: var(--icon-size);
  flex-shrink: 0;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Skip link — first focusable element on every page. */
.skip-link {
  position: absolute;
  inset-inline-start: 0.5rem;
  inset-block-start: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  z-index: 100;
}
.skip-link:focus { transform: none; }

/* ─── Page scaffold (about, 404) ─── */
.page {
  display: grid;
  grid-template-areas: "hero" "tools" "foot";
  max-inline-size: 980px;
  margin-inline: auto;
  padding: 6rem 2rem 5rem;
  gap: 4.5rem;
  position: relative;
}
body.page-host {
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%,   rgba(251, 146, 60, 0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(251, 146, 60, 0.04), transparent 60%);
  background-attachment: fixed;
}

.hero { grid-area: hero; }
.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  margin-block-start: 1.5rem;
  color: var(--dim);
  font-size: 1.15rem;
  line-height: 1.55;
  max-inline-size: 56ch;
}
.hero .meta {
  margin-block-start: 1.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The homepage hero reuses blog.css's .blog-list-head; only the accent
   em needs defining here because the copy uses it. */
.blog-list-head h1 em { font-style: normal; color: var(--accent); }
.blog-list-page .foot { margin-block-start: 3rem; }

.tools { grid-area: tools; display: grid; gap: 1rem; }
.tools h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}
.tool-list { display: grid; gap: 0.5rem; }
.tool-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 120ms, transform 120ms;
}
.tool-list a:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.tool-list a .icon { color: var(--accent); --icon-size: 18px; }
.tool-list a .slug { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }

.foot {
  grid-area: foot;
  text-align: center;
  font-size: 0.88rem;
  color: var(--faint);
  padding-block-start: 2rem;
  border-block-start: 1px solid var(--border);
}
.foot strong { color: var(--accent); font-weight: 500; }

/* ─── Buttons — opt-in via .btn; semantic <button> stays neutral. ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 120ms, color 120ms, background 120ms;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn[data-primary] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}
.btn[data-primary]:hover { background: var(--accent-d); border-color: var(--accent-d); color: var(--bg); }

/* ─── Syntax tokens ───
   Class names come from articles ported out of binarybacktrace, whose
   code blocks ship pre-highlighted markup (see code_html in ui.js).
   Palette matches that source so ported code reads as it always did. */
.post-content pre .keyword     { color: #fc5fa3; }
.post-content pre .string      { color: #fc6a5d; }
.post-content pre .comment     { color: #6c7986; font-style: italic; }
.post-content pre .function    { color: #67b7a4; }
.post-content pre .constant    { color: #5dd8ff; }
.post-content pre .number      { color: #d0bf69; }
.post-content pre .property    { color: #dfdfe0; }
.post-content pre .operator,
.post-content pre .punctuation { color: #a0a0a8; }

/* ─── Site nav (40 px bar, 11 px UPPERCASE, 2px tracking) ─── */
.hw-nav {
  block-size: 40px;
  display: flex;
  align-items: center;
  padding-inline: 1rem;
  gap: 0.75rem;
  background: var(--bg);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}
.hw-nav-home,
.hw-nav-link,
.hw-nav-sep,
.hw-nav-title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.hw-nav-home  {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hw-nav-home:hover { color: var(--accent); text-decoration: none; }
.hw-nav-home:hover .hw-nav-mark { color: var(--accent); transform: rotate(-8deg); }
.hw-nav-mark {
  inline-size: 16px;
  block-size: 16px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color 160ms ease, transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hw-nav-wordmark { letter-spacing: 2px; }
.hw-nav-link  {
  color: var(--dim);
  text-decoration: none;
  transition: color 120ms;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.hw-nav-link:hover         { color: var(--text); text-decoration: none; }
.hw-nav-link--active       { color: var(--accent); }
.hw-nav-sep   { color: var(--faint); user-select: none; }
.hw-nav-title { color: var(--accent); }
.hw-nav-spacer { flex: 1; }
.hw-nav-controls {
  display: flex; align-items: center; gap: 0.85rem;
}
.hw-nav-user {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim);
}
.hw-nav-user img { border-radius: 50%; }
