/* ---------------------------------------------------------------
   Mac Dev Setup
   Professional technical documentation with deep teal accent
   --------------------------------------------------------------- */

:root {
  /* Light Mode Palette */
  --ink: #0f1419;
  --ink-muted: #4a5568;
  --bg: #ffffff;
  --surface: #f7f9fb;
  --surface-raised: #ffffff;
  --rule: #cbd5e0;
  --accent: #1e40af;
  --accent-hover: #1d4ed8;
  --accent-ink: #ffffff;
  --code-bg: #f1f5f9;
  --code-border: #e2e8f0;
  --success: #059669;

  /* Typography */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-code: "SF Mono", Monaco, "Cascadia Code", Consolas, monospace;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;
  --space-4xl: 4rem;

  /* Measure */
  --measure: 68ch;

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

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f5f9;
    --ink-muted: #94a3b8;
    --bg: #0f1419;
    --surface: #1a202c;
    --surface-raised: #2d3748;
    --rule: #374151;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-ink: #0f1419;
    --code-bg: #1e293b;
    --code-border: #334155;
    --success: #10b981;
  }
}

/* ---------------------------------------------------------------
   Reset and Base
   --------------------------------------------------------------- */

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

html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p {
  text-wrap: pretty;
  margin: 0 0 var(--space-md);
  max-width: var(--measure);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  margin: 0;
  line-height: 1.2;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: all 0.15s ease-out;
}

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

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0.25rem;
}

pre code {
  background: none;
  padding: 0;
}

kbd {
  font-family: var(--font-body);
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

button {
  min-width: 44px;
  min-height: 44px;
}

input[type="checkbox"] {
  min-height: 1.25rem;
  min-width: 1.25rem;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3xl);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */

.site-header {
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--space-3xl) 0;
  margin-bottom: var(--space-4xl);
}

.site-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.site-tagline {
  font-size: 1.125rem;
  opacity: 0.95;
  margin: 0;
  max-width: var(--measure);
}

@media (max-width: 480px) {
  .site-header {
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
  }

  .site-title {
    font-size: 2rem;
  }

  .site-tagline {
    font-size: 1rem;
  }
}

/* ---------------------------------------------------------------
   Guide
   --------------------------------------------------------------- */

.guide {
  padding-bottom: var(--space-4xl);
}

.guide-intro {
  margin-bottom: var(--space-4xl);
  max-width: var(--measure);
}

.guide-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

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

@media (max-width: 480px) {
  .guide-intro {
    margin-bottom: var(--space-xl);
  }

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

  .intro-text {
    font-size: 1rem;
  }
}

/* ---------------------------------------------------------------
   Table of Contents
   --------------------------------------------------------------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: var(--space-lg);
  margin-bottom: var(--space-4xl);
  max-width: var(--measure);
}

.toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  color: var(--ink-muted);
}

.toc-list {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0;
}

.toc-list li {
  counter-increment: toc-counter;
  margin-bottom: var(--space-sm);
}

.toc-list li:last-child {
  margin-bottom: 0;
}

.toc-list li::before {
  content: counter(toc-counter);
  font-weight: 700;
  color: var(--accent);
  margin-right: var(--space-sm);
  font-variant-numeric: tabular-nums;
}

.toc-list a {
  color: var(--ink);
}

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

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */

.guide-section {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-4xl);
  position: relative;
}

.section-marker {
  width: 3rem;
  height: 3rem;
  background: var(--accent);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: var(--space-xl);
  flex-shrink: 0;
}

.section-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-ink);
}

.section-content {
  min-width: 0;
  max-width: var(--measure);
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

.section-description {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: var(--space-2xl);
  max-width: var(--measure);
}

@media (max-width: 768px) {
  .guide-section {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .section-marker {
    position: static;
    width: 2.5rem;
    height: 2.5rem;
  }

  .section-number {
    font-size: 1.125rem;
  }

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

  .section-description {
    font-size: 1rem;
  }
}

/* ---------------------------------------------------------------
   Checklist
   --------------------------------------------------------------- */

.checklist {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: var(--space-lg);
  margin-bottom: var(--space-2xl);
  max-width: var(--measure);
}

.checklist-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--ink);
}

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

.checklist-items li {
  margin-bottom: var(--space-sm);
}

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

.checklist-items label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: color 0.15s ease-out;
  user-select: none;
}

.checklist-items label:hover {
  color: var(--accent);
}

.checklist-items input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checklist-items span {
  font-size: 0.9375rem;
}

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

.step {
  margin-bottom: var(--space-2xl);
  max-width: var(--measure);
}

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

.step-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.step p {
  max-width: var(--measure);
  margin-bottom: var(--space-md);
}

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

.note {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin-top: var(--space-md);
  max-width: var(--measure);
}

/* ---------------------------------------------------------------
   Code Blocks
   --------------------------------------------------------------- */

.code-block {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 0.5rem;
  margin: var(--space-md) 0;
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.875rem;
  line-height: 1.6;
}

.code-block pre code {
  font-size: inherit;
}

.copy-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 0.375rem;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-out;
  font-family: var(--font-body);
}

.copy-btn:hover {
  background: var(--accent-hover);
}

.copy-btn.copied {
  background: var(--success);
}

@media (max-width: 480px) {
  .copy-btn {
    position: static;
    width: 100%;
    margin-bottom: var(--space-sm);
  }

  .code-block pre {
    padding: var(--space-md) var(--space-sm);
  }
}

/* ---------------------------------------------------------------
   Verification
   --------------------------------------------------------------- */

.verification {
  margin-top: var(--space-lg);
  max-width: var(--measure);
}

.verification-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--ink-muted);
}

.verification-output {
  background: var(--surface-raised);
  border-color: var(--rule);
}

/* ---------------------------------------------------------------
   Lists
   --------------------------------------------------------------- */

.ordered-list {
  padding-left: var(--space-lg);
  margin: var(--space-md) 0;
  max-width: var(--measure);
}

.ordered-list li {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
}

.ordered-list li:last-child {
  margin-bottom: 0;
}

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

.completion {
  margin-top: var(--space-4xl);
}

.completion-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-ink);
  border-radius: 0.5rem;
  padding: var(--space-xl);
  text-align: center;
}

.completion-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.completion-text {
  font-size: 1.125rem;
  margin: 0;
  opacity: 0.95;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 480px) {
  .completion-title {
    font-size: 1.5rem;
  }

  .completion-text {
    font-size: 1rem;
  }
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--space-4xl);
  padding: var(--space-3xl) 0;
}

.footer-text {
  text-align: center;
  color: var(--ink-muted);
  margin: 0;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

/* ---------------------------------------------------------------
   Motion
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .copy-btn,
  a,
  .checklist-items label {
    transition: all 0.15s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------
   Print
   --------------------------------------------------------------- */

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

  .site-header {
    background: transparent;
    color: #000;
    border-bottom: 2px solid #000;
  }

  .copy-btn {
    display: none;
  }

  .checklist {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

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

  .section-marker {
    position: static;
    background: transparent;
    border: 2px solid #000;
  }

  .section-number {
    color: #000;
  }

  .completion-banner {
    background: transparent;
    color: #000;
    border: 2px solid #000;
  }

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

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.875rem;
    color: #666;
  }

  input[type="checkbox"] {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
@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);
  }
}
