/* Shared with the main site (index.html): theme tokens, body, skip link, site header, theme toggle */
:root {
  --radius: 14px;
  --radius-lg: 22px;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --max: 1120px;
  --nav-h: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0a0908;
    --bg-elevated: #12100e;
    --bg-card: #181512;
    --border: rgba(232, 220, 200, 0.12);
    --text: #ebe4d8;
    --muted: #9c9488;
    --accent: #c9a66b;
    --accent-soft: rgba(201, 166, 107, 0.14);
    --accent-glow: rgba(201, 166, 107, 0.35);
    --sage: #7a9e8e;
    --danger: #c45c4a;
    --grad-spot-1: rgba(201, 166, 107, 0.09);
    --grad-spot-2: rgba(122, 158, 142, 0.06);
    --footer-bg: #070605;
    --modal-scrim: rgba(5, 4, 3, 0.72);
    --modal-shadow: rgba(0, 0, 0, 0.55);
    --work-fade: rgba(18, 16, 14, 0.5);
    --tag-bg: rgba(255, 255, 255, 0.04);
    --pill-bg: rgba(255, 255, 255, 0.05);
    --code-bg: rgba(255, 255, 255, 0.06);
    --hero-panel-shine: rgba(201, 166, 107, 0.08);
    --bento-border-hover: rgba(201, 166, 107, 0.35);
    --bento-glow-line: rgba(201, 166, 107, 0.12);
    --bento-shadow: rgba(0, 0, 0, 0.45);
    --bento-glow-outer: rgba(201, 166, 107, 0.12);
    --product-glow: rgba(122, 158, 142, 0.08);
    --product-border-hover: rgba(122, 158, 142, 0.35);
  }
}

@media (prefers-color-scheme: no-preference) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0a0908;
    --bg-elevated: #12100e;
    --bg-card: #181512;
    --border: rgba(232, 220, 200, 0.12);
    --text: #ebe4d8;
    --muted: #9c9488;
    --accent: #c9a66b;
    --accent-soft: rgba(201, 166, 107, 0.14);
    --accent-glow: rgba(201, 166, 107, 0.35);
    --sage: #7a9e8e;
    --danger: #c45c4a;
    --grad-spot-1: rgba(201, 166, 107, 0.09);
    --grad-spot-2: rgba(122, 158, 142, 0.06);
    --footer-bg: #070605;
    --modal-scrim: rgba(5, 4, 3, 0.72);
    --modal-shadow: rgba(0, 0, 0, 0.55);
    --work-fade: rgba(18, 16, 14, 0.5);
    --tag-bg: rgba(255, 255, 255, 0.04);
    --pill-bg: rgba(255, 255, 255, 0.05);
    --code-bg: rgba(255, 255, 255, 0.06);
    --hero-panel-shine: rgba(201, 166, 107, 0.08);
    --bento-border-hover: rgba(201, 166, 107, 0.35);
    --bento-glow-line: rgba(201, 166, 107, 0.12);
    --bento-shadow: rgba(0, 0, 0, 0.45);
    --bento-glow-outer: rgba(201, 166, 107, 0.12);
    --product-glow: rgba(122, 158, 142, 0.08);
    --product-border-hover: rgba(122, 158, 142, 0.35);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f5f2eb;
    --bg-elevated: #ebe7de;
    --bg-card: #fffcf7;
    --border: rgba(26, 21, 16, 0.1);
    --text: #1a1510;
    --muted: #5e5950;
    --accent: #9a6f2d;
    --accent-soft: rgba(154, 111, 45, 0.12);
    --accent-glow: rgba(154, 111, 45, 0.28);
    --sage: #3d5c50;
    --danger: #b54a3c;
    --grad-spot-1: rgba(154, 111, 45, 0.1);
    --grad-spot-2: rgba(61, 92, 80, 0.08);
    --footer-bg: #e8e3d9;
    --modal-scrim: rgba(26, 21, 16, 0.45);
    --modal-shadow: rgba(26, 21, 16, 0.18);
    --work-fade: rgba(235, 231, 222, 0.92);
    --tag-bg: rgba(26, 21, 16, 0.05);
    --pill-bg: rgba(26, 21, 16, 0.06);
    --code-bg: rgba(26, 21, 16, 0.07);
    --hero-panel-shine: rgba(154, 111, 45, 0.07);
    --bento-border-hover: rgba(154, 111, 45, 0.45);
    --bento-glow-line: rgba(154, 111, 45, 0.15);
    --bento-shadow: rgba(26, 21, 16, 0.1);
    --bento-glow-outer: rgba(154, 111, 45, 0.12);
    --product-glow: rgba(61, 92, 80, 0.12);
    --product-border-hover: rgba(61, 92, 80, 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0908;
  --bg-elevated: #12100e;
  --bg-card: #181512;
  --border: rgba(232, 220, 200, 0.12);
  --text: #ebe4d8;
  --muted: #9c9488;
  --accent: #c9a66b;
  --accent-soft: rgba(201, 166, 107, 0.14);
  --accent-glow: rgba(201, 166, 107, 0.35);
  --sage: #7a9e8e;
  --danger: #c45c4a;
  --grad-spot-1: rgba(201, 166, 107, 0.09);
  --grad-spot-2: rgba(122, 158, 142, 0.06);
  --footer-bg: #070605;
  --modal-scrim: rgba(5, 4, 3, 0.72);
  --modal-shadow: rgba(0, 0, 0, 0.55);
  --work-fade: rgba(18, 16, 14, 0.5);
  --tag-bg: rgba(255, 255, 255, 0.04);
  --pill-bg: rgba(255, 255, 255, 0.05);
  --code-bg: rgba(255, 255, 255, 0.06);
  --hero-panel-shine: rgba(201, 166, 107, 0.08);
  --bento-border-hover: rgba(201, 166, 107, 0.35);
  --bento-glow-line: rgba(201, 166, 107, 0.12);
  --bento-shadow: rgba(0, 0, 0, 0.45);
  --bento-glow-outer: rgba(201, 166, 107, 0.12);
  --product-glow: rgba(122, 158, 142, 0.08);
  --product-border-hover: rgba(122, 158, 142, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f2eb;
  --bg-elevated: #ebe7de;
  --bg-card: #fffcf7;
  --border: rgba(26, 21, 16, 0.1);
  --text: #1a1510;
  --muted: #5e5950;
  --accent: #9a6f2d;
  --accent-soft: rgba(154, 111, 45, 0.12);
  --accent-glow: rgba(154, 111, 45, 0.28);
  --sage: #3d5c50;
  --danger: #b54a3c;
  --grad-spot-1: rgba(154, 111, 45, 0.1);
  --grad-spot-2: rgba(61, 92, 80, 0.08);
  --footer-bg: #e8e3d9;
  --modal-scrim: rgba(26, 21, 16, 0.45);
  --modal-shadow: rgba(26, 21, 16, 0.18);
  --work-fade: rgba(235, 231, 222, 0.92);
  --tag-bg: rgba(26, 21, 16, 0.05);
  --pill-bg: rgba(26, 21, 16, 0.06);
  --code-bg: rgba(26, 21, 16, 0.07);
  --hero-panel-shine: rgba(154, 111, 45, 0.07);
  --bento-border-hover: rgba(154, 111, 45, 0.45);
  --bento-glow-line: rgba(154, 111, 45, 0.15);
  --bento-shadow: rgba(26, 21, 16, 0.1);
  --bento-glow-outer: rgba(154, 111, 45, 0.12);
  --product-glow: rgba(61, 92, 80, 0.12);
  --product-border-hover: rgba(61, 92, 80, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--grad-spot-1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 50%, var(--grad-spot-2), transparent 45%);
  min-height: 100vh;
  transition: background-color 0.28s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  z-index: 9999;
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--bento-border-hover);
  background: var(--bg-card);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

.theme-toggle.is-dark-mode .icon-sun {
  display: block;
}

.theme-toggle.is-dark-mode .icon-moon {
  display: none;
}

main#main {
  overflow-x: clip;
}
