/* ---------------------------------------------------------------
   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 {
  /* System bootstrap sequence palette */
  --ink: #18181B;
  --ink-muted: #52525B;
  --ink-tertiary: #A1A1AA;
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-dark: #1C1C1E;
  --rule: #E4E4E7;
  --accent: #10B981;
  --accent-hover: #059669;
  --accent-ink: #FFFFFF;
  --warning: #F59E0B;
  --text-inverse: #F4F4F5;

  /* 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);
}

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

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: 2px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color 150ms ease-out;
}

a:hover {
  color: var(--accent-hover);
}

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

/* 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,
  .checkbox-wrapper {
    display: none;
  }

  .step-card {
    page-break-inside: avoid;
  }
}

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 16px;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  font-weight: 500;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.page-header {
  text-align: center;
  padding: 64px 32px 48px;
  max-width: 800px;
  margin: 0 auto;
}

.page-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
}

.page-subtitle {
  font-size: 18px;
  color: var(--ink-muted);
  margin: 0;
}

.main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

.intro-section {
  margin-bottom: 48px;
}

.intro-section p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 16px;
}

.intro-section p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Step Cards
   --------------------------------------------------------------- */

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
}

.step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.step-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex: 1;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content {
  color: var(--ink);
}

.step-description {
  font-size: 16px;
  color: var(--ink-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

.step-subheading {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--ink);
}

.step-subheading:first-of-type {
  margin-top: 0;
}

.step-content p {
  font-size: 16px;
  margin: 0 0 12px;
}

.step-content p:last-child {
  margin-bottom: 0;
}

.step-note {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 15px;
  border-radius: 0 4px 4px 0;
}

.step-note strong {
  font-weight: 600;
}

/* ---------------------------------------------------------------
   Command Blocks
   --------------------------------------------------------------- */

.command-block {
  position: relative;
  background: var(--surface-dark);
  border-radius: 4px;
  padding: 12px;
  margin: 12px 0;
  overflow-x: auto;
}

.command-block pre {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
}

.command-block code {
  color: var(--text-inverse);
  font-family: inherit;
}

.prompt {
  color: var(--ink-tertiary);
  user-select: none;
  margin-right: 8px;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  color: var(--ink-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 150ms ease-out;
}

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

.copy-button.copied {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------
   Checkboxes
   --------------------------------------------------------------- */

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.step-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 150ms ease-out;
  margin: 0;
  flex-shrink: 0;
}

.step-checkbox:hover {
  border-color: var(--accent);
}

.step-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.step-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 500;
}

/* ---------------------------------------------------------------
   Completion Section
   --------------------------------------------------------------- */

.completion-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--rule);
}

.section-heading {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.section-subheading {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.next-steps-list,
.resources-list {
  margin: 0;
  padding-left: 24px;
}

.next-steps-list li,
.resources-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.next-steps-list li:last-child,
.resources-list li:last-child {
  margin-bottom: 0;
}

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

.page-footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 32px 48px;
  text-align: center;
  border-top: 1px solid var(--rule);
}

.page-footer p {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0;
}

/* ---------------------------------------------------------------
   Inline Code
   --------------------------------------------------------------- */

code {
  font-family: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
}

.command-block code {
  background: transparent;
  padding: 0;
}

kbd {
  font-family: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

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

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

  .page-header {
    padding: 48px 16px 32px;
  }

  .main-content {
    padding: 0 16px 48px;
  }

  .section-heading {
    font-size: 24px;
  }

  .step-card {
    padding: 20px;
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .checkbox-wrapper {
    align-self: flex-start;
  }

  .command-block {
    padding: 12px 12px 12px 8px;
  }

  .copy-button {
    position: static;
    display: block;
    margin-bottom: 8px;
    width: fit-content;
  }

  .page-footer {
    padding: 32px 16px;
  }
}

@media print {
  .page-header {
    padding: 32px 0 24px;
  }

  .main-content {
    padding: 0 0 32px;
  }

  .step-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin-bottom: 16px;
  }

  .command-block {
    background: #f5f5f5;
    border: 1px solid #ddd;
  }

  .command-block code {
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
