/* ===============================================================
   Developer Mac Setup Guide — Field Guide Aesthetic
   =============================================================== */

:root {
  /* Field guide palette */
  --ink: #1A1A1A;              /* Carbon black for text */
  --ink-muted: #4A4A4A;        /* Muted for secondary text */
  --bg: #F8F4E8;               /* Cream field-page ground */
  --surface: #FFFFFF;          /* White for elevated surfaces */
  --surface-tint: #F0EBD8;     /* Tinted cream for code boxes */
  --rule: #D4CAB0;             /* Border color */
  --accent: #2D5016;           /* Forest green */
  --accent-light: #4A7829;     /* Lighter green for hover */
  --accent-ink: #FFFFFF;       /* White text on green */

  /* Typography scale */
  --font-display: "Arial Narrow", "Helvetica Condensed", "Liberation Sans Narrow", sans-serif-condensed, sans-serif;
  --font-body: Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;

  --measure: 68ch;

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

p {
  text-wrap: pretty;
}

h1, h2, h3 {
  text-wrap: balance;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.625rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem 0;
  color: var(--accent);
}

h2 {
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  margin: 2rem 0 1rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--ink);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-tint);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.2em 0.5em;
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--rule);
}

::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;
  border-bottom: 1px solid var(--accent);
  text-underline-offset: 0.18em;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

/* ===============================================================
   Sidebar Navigation — Field Guide Tabs
   =============================================================== */

.sidebar {
  width: 240px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 0 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

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

.nav-tab {
  border-left: 4px solid transparent;
  transition: all 0.15s ease-out;
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: var(--accent-ink);
}

.nav-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  text-decoration: none;
}

.nav-tab a:hover {
  color: var(--accent-ink);
}

/* ===============================================================
   Main Content
   =============================================================== */

.content {
  flex: 1;
  padding: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--accent);
}

.subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--ink-muted);
  margin: 0;
  font-style: italic;
}

/* ===============================================================
   Guide Sections
   =============================================================== */

.guide-section {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

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

.tool-description {
  font-size: 1.0625rem;
  line-height: 1.7;
  margin: 1rem 0 1.5rem 0;
  padding: 0.75rem 1rem;
  background: rgba(45, 80, 22, 0.06);
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  color: var(--ink);
}

/* ===============================================================
   Code Specimens — Like Field Guide Specimen Boxes
   =============================================================== */

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

.code-specimen.verify {
  border-color: var(--accent);
  border-width: 2px;
}

.specimen-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-tint);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.code-specimen pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  background: var(--surface-tint);
}

.code-specimen code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  background: none;
  padding: 0;
  border: none;
  color: var(--ink);
  display: block;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.copy-btn:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

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

.expected-output {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  font-style: italic;
  margin: 0.5rem 0 0 0;
}

/* ===============================================================
   Note Boxes — Like Field Guide Annotations
   =============================================================== */

.note-box {
  background: var(--surface);
  border: 2px solid var(--accent);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  position: relative;
}

.note-box.success {
  border-left-color: var(--accent);
  background: rgba(45, 80, 22, 0.05);
}

.note-box strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ===============================================================
   Checklists — Progress Tracking Like Field Marks
   =============================================================== */

.checklist {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.checklist-item:hover {
  background: var(--surface-tint);
  margin: 0 -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-radius: 4px;
}

.step-check {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.checklist-item span {
  font-size: 0.9375rem;
  line-height: 1.5;
  flex: 1;
}

/* ===============================================================
   Lists and Instructions
   =============================================================== */

.instruction-list {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.instruction-list li {
  margin: 0.5rem 0;
  padding-left: 0.5rem;
  line-height: 1.65;
}

.extension-list {
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

.extension-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.extension-item strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
}

.extension-item span {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.completion-list {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.completion-list li {
  margin: 0.5rem 0;
  padding-left: 0.5rem;
  line-height: 1.65;
}

.completion-list li::marker {
  color: var(--accent);
}

/* ===============================================================
   Completion Section
   =============================================================== */

.guide-section.completion {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 2rem;
  margin-top: 4rem;
}

.guide-section.completion h2 {
  color: var(--accent);
  margin-top: 0;
}

/* ===============================================================
   Responsive Design
   =============================================================== */

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 1.5rem 0;
  }

  .sidebar-header {
    padding: 0 1rem 0.75rem 1rem;
  }

  .nav-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .nav-tab {
    border-left: none;
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
  }

  .nav-tab.active {
    background: rgba(255, 255, 255, 0.15);
    border-bottom-color: var(--accent-ink);
  }

  .nav-tab a {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }

  .content {
    padding: 2rem 1.25rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .section-number {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .code-specimen pre {
    font-size: 0.85rem;
  }

  .copy-btn {
    position: static;
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    border-top: 1px solid var(--rule);
    border-radius: 0 0 4px 4px;
  }
}

/* ===============================================================
   Motion — Smooth Transitions
   =============================================================== */

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

  .copy-btn,
  .nav-tab,
  .checklist-item {
    transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* ===============================================================
   Print Styles
   =============================================================== */

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

  .sidebar {
    display: none;
  }

  .content {
    max-width: 100%;
    padding: 0;
  }

  .copy-btn {
    display: none;
  }

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

  .code-specimen {
    page-break-inside: avoid;
  }

  a {
    color: #000;
    border-bottom: none;
  }

  .note-box {
    border: 1px solid #000;
  }
}
