:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --bg-raised: #11151a;
  --surface: #171c22;
  --surface-2: #20262d;
  --line: #303842;
  --line-bright: #46515e;
  --text: #f2f5f7;
  --muted: #aab4be;
  --faint: #77828d;
  --accent: #f3b33d;
  --accent-strong: #ffc85e;
  --accent-soft: rgba(243, 179, 61, 0.12);
  --blue: #62b9e8;
  --green: #67cf95;
  --danger: #ff806e;
  --code: #0c1014;
  --max: 1180px;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% -10%, rgba(243, 179, 61, 0.09), transparent 34rem),
    linear-gradient(180deg, #0d1014 0%, var(--bg) 48rem);
  color: var(--text);
  font: 400 1rem/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; }
button, input { font: inherit; }

:focus-visible {
  outline: 3px solid rgba(243, 179, 61, 0.8);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 100;
  transform: translateY(-160%);
  padding: .65rem .9rem;
  border-radius: 8px;
  background: var(--accent);
  color: #16120a;
  font-weight: 800;
  transition: transform .15s ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(70, 81, 94, 0.7);
  background: rgba(11, 13, 16, 0.86);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(calc(100% - 2rem), var(--max));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -.025em;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid #5b6672;
  border-radius: 9px;
  background:
    linear-gradient(135deg, transparent 47%, rgba(255,255,255,.16) 48% 52%, transparent 53%),
    linear-gradient(145deg, #414b55, #1c2228 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 5px 16px rgba(0,0,0,.35);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 4px;
  top: 15px;
  left: 9px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(-45deg);
  box-shadow: 0 0 8px rgba(243, 179, 61, .5);
}

.brand span:last-child { color: var(--muted); font-weight: 600; }

.top-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.top-nav a,
.mobile-toggle {
  padding: .48rem .72rem;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 650;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
}

.top-nav .github-link {
  margin-left: .35rem;
  border: 1px solid var(--line);
  color: var(--text);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
}

.container {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--accent-strong);
  font: 750 .78rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -.035em;
}

h1 { font-size: clamp(2.7rem, 8vw, 5.8rem); max-width: 12ch; }
h2 { font-size: clamp(2rem, 4vw, 3.15rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.hero {
  min-height: 650px;
  padding: 7rem 0 6rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}

.hero h1 em { color: var(--accent); font-style: normal; }

.hero-copy {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 2vw, 1.27rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: #6c7885;
  background: var(--surface-2);
  color: var(--text);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #171209;
}

.button.primary:hover { background: var(--accent-strong); }

.hero-art {
  position: relative;
  min-height: 440px;
  perspective: 900px;
}

.texture-card {
  position: absolute;
  width: clamp(150px, 17vw, 216px);
  aspect-ratio: 1;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(31, 37, 44, .86);
  box-shadow: var(--shadow);
  transform: rotateX(7deg) rotateY(-12deg) rotateZ(var(--r));
}

.texture-card img {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  image-rendering: pixelated;
}

.texture-card.one { --r: -8deg; top: 2%; right: 7%; z-index: 2; }
.texture-card.two { --r: 8deg; top: 32%; left: 0; z-index: 3; }
.texture-card.three { --r: -2deg; right: 1%; bottom: 1%; z-index: 4; }

.chisel-sprite {
  position: absolute;
  z-index: 6;
  width: 170px;
  left: 40%;
  top: 26%;
  image-rendering: pixelated;
  filter: drop-shadow(0 20px 18px rgba(0,0,0,.52));
  transform: rotate(17deg);
}

.section {
  padding: 5.5rem 0;
  border-top: 1px solid rgba(70, 81, 94, .45);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(280px, .8fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: 2.4rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.audience-grid,
.project-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.project-grid.two { grid-template-columns: repeat(2, 1fr); }

.audience-card,
.project-card,
.feature-card {
  position: relative;
  min-height: 260px;
  padding: 1.45rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(32,38,45,.94), rgba(19,23,28,.94));
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}

.audience-card:hover,
.project-card:hover {
  transform: translateY(-4px);
  border-color: #65717e;
  color: var(--text);
}

.audience-card .number {
  display: block;
  margin-bottom: 3rem;
  color: var(--faint);
  font: 700 .8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.audience-card p,
.project-card p,
.feature-card p {
  margin: .75rem 0 0;
  color: var(--muted);
}

.card-arrow {
  position: absolute;
  right: 1.3rem;
  bottom: 1.1rem;
  color: var(--accent);
  font-size: 1.5rem;
}

.project-card { min-height: 310px; }
.project-card .project-top { display: flex; justify-content: space-between; gap: 1rem; }
.project-card .project-name { font: 800 1.45rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .2rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(12, 16, 20, .45);
  font: 650 .76rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.badge.accent { border-color: rgba(243,179,61,.4); color: var(--accent-strong); background: var(--accent-soft); }

.manifesto {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.manifesto-copy { padding: clamp(2rem, 5vw, 4rem); }
.manifesto-copy p { color: var(--muted); max-width: 38rem; }
.texture-wall { display: grid; grid-template-columns: repeat(2, 1fr); min-height: 360px; }
.texture-wall img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

.site-footer {
  padding: 2.4rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { text-decoration: none; }

/* Documentation */
.docs-shell {
  width: min(calc(100% - 2rem), 1320px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 780px) 190px;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  padding: 3rem 0 6rem;
}

.docs-sidebar,
.on-this-page {
  position: sticky;
  top: 96px;
  height: max-content;
}

.sidebar-label {
  margin: 0 0 .7rem;
  color: var(--faint);
  font: 750 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.sidebar-nav { display: grid; gap: .2rem; margin-bottom: 1.6rem; }
.sidebar-nav a {
  padding: .42rem .6rem;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
}
.sidebar-nav a:hover { color: var(--text); background: var(--surface); }
.sidebar-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }

.doc-content { min-width: 0; }
.doc-content > header {
  padding-bottom: 2.3rem;
  margin-bottom: 2.8rem;
  border-bottom: 1px solid var(--line);
}
.doc-content h1 { max-width: none; font-size: clamp(2.5rem, 6vw, 4.5rem); }
.doc-lede { margin: 1rem 0 0; color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
.doc-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }

.doc-section { padding: 1rem 0 2.5rem; }
.doc-section + .doc-section { border-top: 1px solid rgba(70,81,94,.34); padding-top: 2.6rem; }
.doc-section h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.doc-section h3 { margin: 2rem 0 .7rem; }
.doc-section p, .doc-section li { color: #c7cfd6; }
.doc-section ul, .doc-section ol { padding-left: 1.3rem; }
.doc-section li + li { margin-top: .45rem; }
.doc-section strong { color: var(--text); }

.steps { list-style: none; padding: 0 !important; counter-reset: steps; }
.steps li {
  position: relative;
  min-height: 52px;
  padding-left: 3.5rem;
  counter-increment: steps;
}
.steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: -.1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243,179,61,.45);
  border-radius: 9px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font: 800 .85rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.callout {
  margin: 1.4rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(98,185,232,.35);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
  background: rgba(98,185,232,.08);
  color: #d9e8f0;
}
.callout.warning { border-color: rgba(243,179,61,.35); border-left-color: var(--accent); background: var(--accent-soft); }
.callout strong { display: block; margin-bottom: .2rem; }

.code-wrap {
  position: relative;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--code);
}
.code-label {
  display: block;
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  background: #11161b;
  font: 700 .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre { margin: 0; padding: 1rem; overflow: auto; color: #d8e2ea; font: 500 .88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
p code, li code, td code {
  padding: .1rem .3rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--code);
  color: #f6ca77;
  font-size: .88em;
}
.copy-button {
  position: absolute;
  right: .55rem;
  top: .36rem;
  border: 0;
  border-radius: 5px;
  padding: .2rem .45rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
}
.copy-button:hover { color: var(--text); }

.table-wrap { overflow-x: auto; margin: 1.3rem 0; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: .72rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--text); background: #14191f; font-size: .82rem; }
td { color: var(--muted); font-size: .9rem; }
tr:last-child td { border-bottom: 0; }

.on-this-page a {
  display: block;
  padding: .28rem 0;
  color: var(--faint);
  text-decoration: none;
  font-size: .82rem;
}
.on-this-page a:hover { color: var(--text); }

.doc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1.3rem 0; }
.doc-card { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-card p { margin: .45rem 0 0; font-size: .9rem; }

.crumbs { display: flex; gap: .5rem; margin-bottom: 1.2rem; color: var(--faint); font-size: .86rem; }
.crumbs a { color: var(--muted); text-decoration: none; }

.next-doc {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.next-doc a { color: var(--text); text-decoration: none; font-weight: 750; }

@media (max-width: 1040px) {
  .docs-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .on-this-page { display: none; }
}

@media (max-width: 780px) {
  .top-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    padding: .8rem 1rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #0d1014;
    box-shadow: 0 18px 30px rgba(0,0,0,.28);
  }
  .top-nav.open { display: grid; }
  .top-nav .github-link { margin-left: 0; }
  .mobile-toggle { display: block; }
  .hero { padding: 4.5rem 0 4rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 340px; max-width: 470px; width: 100%; margin-inline: auto; }
  .audience-grid, .project-grid, .project-grid.two, .feature-grid { grid-template-columns: 1fr; }
  .audience-card { min-height: 220px; }
  .section-heading { grid-template-columns: 1fr; gap: 1rem; }
  .manifesto { grid-template-columns: 1fr; }
  .texture-wall { min-height: 260px; }
  .docs-shell { display: block; padding-top: 1.5rem; }
  .docs-sidebar { position: static; margin-bottom: 2rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .docs-sidebar .sidebar-label:not(:first-child), .docs-sidebar .sidebar-nav:not(:nth-child(2)) { display: none; }
  .docs-sidebar .sidebar-nav { grid-template-columns: repeat(2, 1fr); margin: 0; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 500px) {
  h1 { font-size: 2.65rem; }
  .hero-art { min-height: 285px; }
  .texture-card { width: 142px; }
  .chisel-sprite { width: 120px; }
  .doc-cards { grid-template-columns: 1fr; }
  .docs-sidebar .sidebar-nav { grid-template-columns: 1fr; }
  .texture-wall { min-height: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
