/* ---------------------------------------------------------------
   Craft floor.

   Everything below is byte-identical in every page that gets it
   right, so it ships here rather than being re-typed from the
   rules each time. Replace the :root values with the page's own
   palette; do not delete the rules that consume them.
   --------------------------------------------------------------- */

:root {
  /* Technical documentation palette */
  --ink: #0D1117;
  --ink-muted: #57606A;
  --bg: #FFFFFF;
  --surface: #F6F8FA;
  --rule: #D0D7DE;
  --accent: #0969DA;
  --accent-ink: #FFFFFF;
  --success: #1A7F37;

  /* Under 80 rendered characters. ch is the width of a 0 and most
     letters are narrower, so 75ch measures nearer 95. */
  --measure: 60ch;

  scrollbar-color: var(--rule) transparent;
  caret-color: var(--accent);
  color-scheme: light dark;
}

/* The same seven properties, for readers whose OS is set to dark.
   Replace these alongside the light ones — a page that restyles
   :root and leaves this block holding the placeholder greys has a
   dark mode that belongs to a different design.

   Darken by desaturating and lifting, not by inverting: --bg wants a
   near-black carrying a little of the accent's hue, --ink a soft
   off-white rather than #fff, and --accent usually needs lightening
   to stay legible, since a colour tuned against white rarely clears
   4.5:1 against black. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E6EDF3;
    --ink-muted: #8B949E;
    --bg: #0D1117;
    --surface: #161B22;
    --rule: #30363D;
    --accent: #539BF5;
    --accent-ink: #0D1117;
    --success: #3FB950;
  }
}

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

/* Prevent any overflowing element from widening the document past the
   viewport. Without this a single oversized heading or image at a
   narrow viewport stretches the scroll width, which makes every
   paragraph on the page measure as flush to the viewport edge. */
html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* The surfaces you did not draw, which otherwise ship with browser
   defaults belonging to no design system. */
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

/* Put on any cell holding a figure, so columns of numbers line up. */
.num {
  font-variant-numeric: tabular-nums;
}

/* 44px is the smallest reliably tappable target. Anything the reader
   presses needs it; a link inside a paragraph does not, which is why
   this is not on `a`. */
button,
[role="button"],
summary,
input[type="checkbox"],
input[type="radio"] {
  min-height: 44px;
}

button {
  min-width: 44px;
}

/* A document is one column, so the only thing that reliably breaks it
   is content that cannot shrink: a wide table, a long URL, a code
   block. These make the narrow viewport survivable without needing a
   layout per breakpoint. */
img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

pre {
  overflow-x: auto;
}

table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 480px) {
  body {
    /* Thumbs cover the edges; text should not start underneath them. */
    padding-inline: 1rem;
  }
}

/* Motion only for readers who have not asked the OS to stop it. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .copy-button {
    display: none;
  }

  .progress-tracker {
    break-inside: avoid;
  }

  .setup-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ---------------------------------------------------------------
   Page structure
   --------------------------------------------------------------- */

.container {
  max-width: 1024px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding-block: 3rem 2rem;
}

.page-title {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.page-subtitle {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 1.125rem;
  color: var(--ink-muted);
}

main {
  padding-block: 3rem;
}

/* ---------------------------------------------------------------
   Intro section
   --------------------------------------------------------------- */

.intro-section {
  margin-bottom: 4rem;
}

.intro-text {
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: var(--measure);
  margin-bottom: 2.5rem;
}

.progress-tracker {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.75rem;
  max-width: 40rem;
}

.progress-title {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  border-top: 1px solid var(--rule);
  padding-block: 0.75rem;
}

.checklist li:first-child {
  border-top: none;
  padding-top: 0;
}

.checklist li:last-child {
  padding-bottom: 0;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem;
  border-radius: 4px;
  transition: background-color 150ms ease-out;
}

.checklist-item:hover {
  background: rgba(9, 105, 218, 0.05);
}

.checklist-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.checklist-label {
  font-size: 1rem;
  color: var(--ink);
  user-select: none;
}

/* ---------------------------------------------------------------
   Setup sections
   --------------------------------------------------------------- */

.setup-section {
  margin-bottom: 5rem;
  max-width: 50rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--rule);
}

.section-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(9, 105, 218, 0.1);
  border-radius: 12px;
  margin-left: auto;
}

.section-description {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  margin-block: 1.25rem 2rem;
}

/* ---------------------------------------------------------------
   Steps
   --------------------------------------------------------------- */

.step {
  margin-bottom: 2.5rem;
}

.step-title {
  margin-top: 0;
  margin-bottom: 0.625rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.step-description {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.step-instruction {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.step-note {
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

/* ---------------------------------------------------------------
   Code blocks
   --------------------------------------------------------------- */

.code-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-block: 1rem;
  overflow: hidden;
}

.copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 150ms ease-out;
  z-index: 1;
  min-width: unset;
  min-height: unset;
}

.copy-button:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink-muted);
}

.copy-button:active {
  transform: translateY(1px);
}

.copy-button.copied {
  color: var(--success);
  border-color: var(--success);
}

.code-block pre {
  margin: 0;
  padding: 1rem 1.25rem;
  padding-right: 3.5rem;
}

.code-block code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--ink);
}

kbd {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.15em 0.5em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

/* ---------------------------------------------------------------
   Extension list
   --------------------------------------------------------------- */

.extension-list {
  list-style: none;
  margin-top: 1.25rem;
  padding: 0;
}

.extension-list li {
  padding-block: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.extension-list li:last-child {
  border-bottom: none;
}

.extension-list strong {
  font-weight: 600;
  color: var(--ink);
}

/* ---------------------------------------------------------------
   Completion section
   --------------------------------------------------------------- */

.completion-section {
  margin-block: 4rem 3rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(9, 105, 218, 0.05) 0%, rgba(9, 105, 218, 0.02) 100%);
  border: 1px solid rgba(9, 105, 218, 0.15);
  border-radius: 8px;
  max-width: 50rem;
}

.completion-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

.completion-text {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 2rem;
}

.next-steps {
  margin-top: 2rem;
}

.next-steps-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.next-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.next-steps-list li {
  position: relative;
  padding-left: 1.75rem;
  padding-block: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.next-steps-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.page-footer {
  margin-top: 6rem;
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.footer-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------------------------------------------------------------
   Responsive adjustments
   --------------------------------------------------------------- */

@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-badge {
    margin-left: 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .completion-section {
    padding: 1.75rem;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding-block: 2rem 1.5rem;
  }

  .page-title {
    font-size: 1.75rem;
  }

  main {
    padding-block: 2rem;
  }

  .progress-tracker {
    padding: 1.25rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .code-block pre {
    padding: 0.875rem;
    padding-right: 3rem;
    font-size: 0.875rem;
  }

  .copy-button {
    top: 0.5rem;
    right: 0.5rem;
  }
}
@media (max-width: 480px) {
  /* --impeccable-mobile-pad */
  body { padding-inline: max(1rem, 16px); }
  .container, [class*="container"], section, header, footer, nav, main, article {
    padding-inline: max(1rem, 16px);
  }
}
/* --impeccable-measure */
p, li, dt, dd, blockquote, figcaption, td, th { max-width: var(--measure); }
