.site-header,
.nav-toggle,
.back-to-top,
.share-fallback,
.nav-links {
  transition: background .2s, border-color .2s, color .2s;
}

:root {
  color-scheme: dark;
  --bg: #080c0a;
  --bg-soft: #101511;
  --panel: rgba(255,255,255,.045);
  --panel-strong: rgba(255,255,255,.075);
  --text: #f5f1e8;
  --muted: rgba(245,241,232,.72);
  --subtle: rgba(245,241,232,.52);
  --line: rgba(255,255,255,.12);
  --surface: var(--bg-soft);
  --surface2: rgba(255,255,255,.065);
  --surface3: rgba(255,255,255,.09);
  --border: var(--line);
  --border2: rgba(255,255,255,.18);
  --ink: var(--text);
  --ink2: var(--muted);
  --ink3: var(--subtle);
  --accent: #f2b66d;
  --accent2: #ffd09a;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-disp: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-bg: rgba(13,15,14,.88);
  --nav-panel: rgba(15,18,16,.98);
  --nav-control-bg: rgba(255,255,255,.035);
  --floating-bg: rgba(20,23,21,.94);
  --floating-bg-hover: rgba(24,27,24,.98);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(242,182,109,.10), transparent 34rem), var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

main {
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.1));
  background: var(--nav-bg, rgba(13,15,14,.88));
  backdrop-filter: blur(18px) saturate(1.25);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent, #f2b66d);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: none;
}

.site-top-anchor {
  position: absolute;
  top: 0;
}

.nav {
  width: min(var(--max, 1120px), calc(100% - 32px));
  min-height: 64px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}

.brand {
  display: grid;
  gap: 2px;
  color: var(--accent, #d4935a);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.05;
}

.brand strong {
  color: var(--accent2, #e8b07a);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
}

.brand span {
  color: var(--ink3, #9b958c);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .14em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink2, #c9c2b8);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active,
.nav-links a[aria-current="page"] {
  border-color: var(--border2, rgba(255,255,255,.13));
  color: var(--ink, #f0ede6);
  background: var(--surface3, rgba(255,255,255,.08));
  outline: none;
}

.nav-toggle {
  display: none;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface2, #1c1f1d);
  color: var(--ink, #f0ede6);
  font: 700 13px var(--font-body, system-ui, -apple-system, Segoe UI, sans-serif);
}

.breadcrumb {
  width: min(var(--max, 1120px), calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 0;
  color: var(--ink3, #9b958c);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 12px;
  line-height: 1.4;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.breadcrumb li + li::before {
  content: "›";
  color: var(--accent, #d4935a);
}

.breadcrumb a {
  color: var(--ink2, #c9c2b8);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--ink, #f0ede6);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink, #f0ede6);
  overflow-wrap: anywhere;
}

.back-to-top {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 850;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,147,90,.46);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--floating-bg, rgba(20,23,21,.94));
  color: var(--ink, #f0ede6);
  text-decoration: none;
  font: 800 13px var(--font-body, system-ui, -apple-system, Segoe UI, sans-serif);
  box-shadow: 0 16px 42px rgba(0,0,0,.36);
  backdrop-filter: blur(12px);
  transition: transform .18s, border-color .18s, background .18s;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(232,176,122,.72);
  background: var(--floating-bg-hover, rgba(24,27,24,.98));
  outline: none;
}

.share-wrapper {
  position: relative;
  display: inline-flex;
}

.share-fallback {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 900;
  min-width: 210px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(212,147,90,.34);
  border-radius: 12px;
  padding: 8px;
  background: var(--nav-panel, rgba(15,18,16,.98));
  box-shadow: 0 22px 58px rgba(0,0,0,.42);
}

.share-fallback[hidden] {
  display: none;
}

.share-fallback a,
.share-fallback button {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 8px;
  padding: 0 10px;
  background: var(--nav-control-bg, rgba(255,255,255,.035));
  color: var(--ink, #f0ede6);
  font: 800 13px var(--font-body, system-ui, -apple-system, Segoe UI, sans-serif);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.share-fallback a:hover,
.share-fallback a:focus-visible,
.share-fallback button:hover,
.share-fallback button:focus-visible {
  border-color: rgba(232,176,122,.55);
  background: rgba(212,147,90,.10);
  outline: none;
}

.share-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 950;
  max-width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(212,147,90,.34);
  border-radius: 999px;
  padding: 11px 14px;
  background: var(--floating-bg, rgba(20,23,21,.94));
  color: var(--ink, #f0ede6);
  font: 800 13px var(--font-body, system-ui, -apple-system, Segoe UI, sans-serif);
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
  backdrop-filter: blur(12px);
}

.share-toast[hidden] {
  display: none;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 30px 0;
}

.stage-actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(255,255,255,.12);
  background: rgba(28,31,29,.92);
  color: var(--ink, #f0ede6);
  text-align: center;
}

.stage-actions .btn:hover,
.stage-actions .btn:focus-visible {
  border-color: rgba(232,176,122,.58);
  background: rgba(212,147,90,.12);
  outline: none;
}

.stage-actions .btn.primary {
  border-color: rgba(232,176,122,.62);
  background: linear-gradient(135deg, rgba(212,147,90,.96), rgba(157,94,47,.96));
  color: #160f0a;
}

.stage-actions .btn.primary:hover,
.stage-actions .btn.primary:focus-visible {
  border-color: rgba(255,221,180,.82);
  background: linear-gradient(135deg, rgba(232,176,122,.98), rgba(181,111,57,.98));
}

@media (max-width: 860px) {
  .nav {
    position: relative;
    min-height: 62px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: min(320px, calc(100vw - 32px));
    justify-content: stretch;
    padding: 10px;
    border: 1px solid rgba(212,147,90,.32);
    border-radius: 14px;
    background: var(--nav-panel, rgba(15,18,16,.98));
    box-shadow: 0 24px 70px rgba(0,0,0,.42);
  }

  .nav-links.is-open {
    display: grid;
    gap: 7px;
  }

  .nav-links a {
    width: 100%;
    min-height: 48px;
    justify-content: space-between;
    border-color: var(--border, rgba(255,255,255,.1));
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--nav-control-bg, rgba(255,255,255,.035));
    font-size: 15px;
  }

  .breadcrumb {
    width: min(100% - 24px, var(--max, 1120px));
    padding-top: 12px;
    font-size: 11px;
  }

  .share-fallback {
    right: auto;
    left: 0;
  }

  .stage-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 24px 0;
  }

  .stage-actions .btn {
    width: 100%;
    white-space: normal;
  }

}
