:root {
  color-scheme: dark;
  --ink: #f7fafc;
  --muted: #b8c2cc;
  --quiet: #8492a3;
  --night: #080d14;
  --night-soft: #0b1118;
  --panel: #121a25;
  --panel-2: #182331;
  --panel-3: #202d3d;
  --line: rgba(184, 194, 204, 0.18);
  --line-strong: rgba(255, 255, 255, 0.27);
  --amber: #f59e0b;
  --amber-bright: #ffc56b;
  --teal: #16c7a3;
  --blue: #78b7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 88% 5%, rgba(22, 199, 163, 0.11), transparent 27rem),
    radial-gradient(circle at 10% 18%, rgba(245, 158, 11, 0.1), transparent 30rem),
    var(--night);
  color: var(--ink);
  font-family: Inter, Aptos, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
  margin: 0;
  min-height: 100vh;
  position: relative;
}

/* Six strings crossed by fret markers: guitar character without a novelty backdrop. */
body::before {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 76px, rgba(120, 183, 255, 0.06) 76px 77px),
    repeating-linear-gradient(180deg, transparent 0 19px, rgba(255, 255, 255, 0.027) 19px 20px);
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, #000 0, transparent 42rem);
  opacity: 0.7;
  pointer-events: none;
  position: fixed;
}

a {
  color: var(--blue);
  font-weight: 760;
  text-decoration-color: rgba(120, 183, 255, 0.45);
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: #b8d8ff;
  text-decoration-color: currentColor;
}

a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

.shell {
  margin: 0 auto;
  max-width: 1240px;
  padding: 22px 24px 64px;
  position: relative;
  z-index: 1;
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 26px;
  min-height: 58px;
}

.brand,
.nav-links,
.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  color: #fff;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  background: #05080d;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  height: 42px;
  width: 42px;
}

.nav-links {
  gap: 4px;
  justify-content: flex-end;
}

.nav-links a {
  border-radius: 7px;
  color: #dbe5ef;
  font-size: 0.84rem;
  padding: 8px 9px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.hero,
.panel,
.callout,
.manual-section {
  background: linear-gradient(145deg, rgba(25, 34, 49, 0.98), rgba(15, 23, 34, 0.98));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: clamp(30px, 6vw, 66px);
  position: relative;
}

.hero::before {
  background:
    radial-gradient(circle at center, rgba(245, 158, 11, 0.16) 0 4px, transparent 5px),
    linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.13));
  background-size: 64px 64px, 100% 100%;
  content: "";
  inset: 0 0 0 58%;
  mask-image: linear-gradient(90deg, transparent, #000);
  pointer-events: none;
  position: absolute;
}

.hero::after {
  background: linear-gradient(90deg, var(--amber), var(--teal));
  content: "";
  height: 3px;
  inset: auto 0 0;
  position: absolute;
}

.hero > * {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: #fff;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.7rem, 7.6vw, 6.2rem);
  line-height: 0.92;
  max-width: 900px;
}

h2 {
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}

.lede,
.muted {
  color: var(--muted);
}

.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  max-width: 860px;
}

.button {
  align-items: center;
  background: var(--amber);
  border: 1px solid var(--amber-bright);
  border-radius: 8px;
  color: #111827;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 850;
  justify-content: center;
  min-height: 46px;
  padding: 10px 17px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover,
.button:focus-visible {
  background: #ffb52e;
  color: #0b1118;
  transform: translateY(-1px);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: #fff;
}

.button.secondary:hover,
.button.secondary:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.grid,
.toc-grid {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toc-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.callout {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.panel {
  transition: border-color 160ms ease, transform 160ms ease;
}

.panel:hover {
  border-color: rgba(22, 199, 163, 0.42);
  transform: translateY(-2px);
}

.section {
  margin-top: 30px;
}

.resource-list,
.check-list,
.steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 21px;
}

.resource-list li::marker,
.check-list li::marker,
.steps li::marker {
  color: var(--amber);
  font-weight: 900;
}

.callout,
.mini-index {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(22, 199, 163, 0.06));
  border-color: rgba(245, 158, 11, 0.27);
}

.doc-meta {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.manual-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(220px, 272px) minmax(0, 1fr);
  margin-top: 30px;
}

.chapter-nav {
  align-self: start;
  background: rgba(12, 19, 29, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  display: grid;
  gap: 3px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px;
  position: sticky;
  top: 16px;
}

.chapter-nav strong {
  color: var(--amber);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  margin: 3px 8px 9px;
  text-transform: uppercase;
}

.chapter-nav a {
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 7px 9px;
  text-decoration: none;
}

.chapter-nav a:hover,
.chapter-nav a:focus-visible {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--amber);
  color: #fff;
}

.manual-content {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.manual-section {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 4vw, 40px);
  scroll-margin-top: 18px;
}

.manual-section:nth-child(3n + 2) {
  border-top-color: rgba(22, 199, 163, 0.5);
}

.manual-section:nth-child(3n + 3) {
  border-top-color: rgba(120, 183, 255, 0.5);
}

.manual-section h2 {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
}

.manual-section h2::before {
  background: linear-gradient(180deg, var(--amber), #d97706);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
  content: "";
  flex: 0 0 auto;
  height: 28px;
  width: 5px;
}

.split,
.figure-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

.split > div {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.figure-card {
  background: #e8edf2;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.27);
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
}

.figure-card:hover {
  border-color: rgba(22, 199, 163, 0.62);
  transform: translateY(-2px);
}

.figure-card img {
  background: #fff;
  display: block;
  height: auto;
  width: 100%;
}

.screenshot-link {
  cursor: zoom-in;
  display: block;
  overflow: hidden;
  position: relative;
}

.screenshot-link::after {
  background: rgba(8, 13, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  bottom: 12px;
  color: #fff;
  content: "Open full size ↗";
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  opacity: 0.9;
  padding: 7px 10px;
  pointer-events: none;
  position: absolute;
  right: 12px;
  transition: background 160ms ease, transform 160ms ease;
}

.screenshot-link:hover::after,
.screenshot-link:focus-visible::after {
  background: #111827;
  border-color: var(--amber-bright);
  transform: translateY(-2px);
}

.screenshot-link:focus-visible {
  border-radius: 8px 8px 0 0;
  outline: 3px solid var(--amber);
  outline-offset: -3px;
}

.figure-card figcaption {
  background: #111a26;
  border-top: 1px solid var(--line);
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 13px 15px 15px;
}

.full-width {
  grid-column: 1 / -1;
}

.workflow-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.workflow-table th,
.workflow-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.workflow-table tr:last-child td {
  border-bottom: 0;
}

.workflow-table th:last-child,
.workflow-table td:last-child {
  border-right: 0;
}

.workflow-table th {
  background: rgba(245, 158, 11, 0.12);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workflow-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.022);
}

.mini-index {
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.mini-index strong {
  color: var(--amber-bright);
}

footer {
  border-top: 1px solid var(--line);
  color: var(--quiet);
  margin-top: 42px;
  padding-top: 22px;
}

@media (max-width: 900px) {
  .toc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manual-layout {
    grid-template-columns: 1fr;
  }

  .chapter-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    position: static;
  }

  .chapter-nav strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 16px 14px 44px;
  }

  .nav,
  .brand,
  .nav-links,
  .actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .hero {
    border-radius: 12px;
    padding: 28px 22px 34px;
  }

  .grid,
  .toc-grid,
  .split,
  .figure-grid,
  .chapter-nav {
    grid-template-columns: 1fr;
  }

  .chapter-nav strong {
    grid-column: auto;
  }

  .workflow-table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .figure-card,
  .panel {
    transition: none;
  }
}
