/* ============ Tokens ============ */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Light mode — Dropbox brand */
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --ink: #1A1918;
  --ink-secondary: #736C64;
  --border: #DFDCD8;
  --primary: #0061FE;
  --primary-button-fill: #0061FE;
  --primary-raw: #0061FE;
  --accent: #007891;
  --accent-decorative: #14C8EB;
  --success: #0F503C;
  --success-ink: #FFFFFF;
  --focus-ring: #0061FE;
  --glow-blue: rgba(0, 97, 254, .07);
  --glow-cyan: rgba(20, 200, 235, .06);
}

:root[data-theme="dark"] {
  --bg: #1E1919;
  --surface: #242321;
  --ink: #F7F5F2;
  --ink-secondary: #978F86;
  --border: #393633;
  --primary: #0061FE;
  --primary-button-fill: #0061FE;
  --primary-raw: #0061FE;
  --accent: #14C8EB;
  --accent-decorative: #14C8EB;
  --success: #B4DC19;
  --success-ink: #1A1918;
  --focus-ring: #14C8EB;
  --glow-blue: rgba(0, 97, 254, .15);
  --glow-cyan: rgba(20, 200, 235, .10);
}

/* ============ Base ============ */
* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: 'DM Sans', 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 100% 0%, var(--glow-blue), transparent 60%),
    radial-gradient(55% 45% at 0% 100%, var(--glow-cyan), transparent 55%);
}

@media (prefers-reduced-motion: no-preference) {
  body,
  .site-header,
  .site-footer,
  .page-body table,
  .page-body th,
  .page-body td,
  .page-body pre,
  .page-body code,
  .page-body blockquote,
  .page-body hr,
  .toggle-track {
    transition: background-color .8s ease, color .8s ease, border-color .8s ease;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============ Layout ============ */
.site-header,
.page-content,
.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

/* ============ Header / brand ============ */
.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(20px, 3vw, 28px);
  /* text-transform: uppercase; */
  letter-spacing: -.01em;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
}

.site-tagline {
  font-size: 14px;
  color: var(--ink-secondary);
  margin: .5rem 0 0;
}

/* ============ Theme toggle ============ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-pill);
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-secondary);
  transition: color .4s ease;
  user-select: none;
}

/* Light mode: "Light" is active, "Dark" is inactive */
.toggle-label-light { color: var(--ink); }
.toggle-label-dark  { color: var(--ink-secondary); }

/* Dark mode: "Dark" is active, "Light" is inactive */
:root[data-theme="dark"] .toggle-label-light { color: var(--ink-secondary); }
:root[data-theme="dark"] .toggle-label-dark  { color: var(--ink); }

.toggle-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  transition: left .5s cubic-bezier(.4, 0, .2, 1), background-color .5s ease;
}

/* 52 - 3 - 20 = 29px */
:root[data-theme="dark"] .toggle-thumb {
  left: 29px;
}

.toggle-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: opacity .8s ease;
}

.toggle-icon-sun {
  opacity: 1;
  color: #FFFFFF;
}

:root[data-theme="dark"] .toggle-icon-sun {
  opacity: 0;
}

:root[data-theme="dark"] .toggle-icon-moon {
  opacity: 1;
  color: #FFFFFF;
}

@media (max-width: 480px) {
  .toggle-label { display: none; }
}

/* ============ Nav ============ */
.site-topnav {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 calc(1rem - .75rem);
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-topnav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  padding: .5rem .75rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s ease, border-color .2s ease;
}

.site-topnav a:hover {
  color: var(--ink);
}

.site-topnav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}


/* ============ Page content ============ */
.page-body h1,h2,h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  /* text-transform: uppercase; */
  letter-spacing: -.01em;
}
.page-body h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: .95;
  letter-spacing: .005em;
  margin: 2rem 0 1rem;
}
.page-body h2 {
  font-size: clamp(22px, 3.5vw, 34px);
  line-height: 1;
  letter-spacing: .005em;
  margin: 2rem 0 .5rem;
}
.page-body h3 {
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 1.1;
  letter-spacing: .005em;
  margin: 1.5rem 0 .5rem;
}

.page-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 14px;
}

.page-body th {
  border: 1px solid var(--border);
  padding: .5rem .75rem;
  text-align: left;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

.page-body td {
  border: 1px solid var(--border);
  padding: .5rem .75rem;
  text-align: left;
}

.page-body code {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: .9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .1em .35em;
}

.page-body pre {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
}

.page-body pre code {
  border: none;
  padding: 0;
  background: none;
}

.page-body blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--primary);
  color: var(--ink-secondary);
}

.page-body li {
  margin-bottom: 4px;
}

.page-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  max-width: 720px;
  margin: 0 auto;
  padding: .5rem 1rem 0;
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-secondary);
}

.breadcrumb li + li::before {
  content: '›\00a0';
  color: var(--ink-secondary);
}

.breadcrumb a {
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color .15s ease;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb [aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* ============ Copy button ============ */
.copy-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.copy-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ============ Pills ============ */
.pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  position: relative;
  top: -1px;
  white-space: nowrap;
}

.pill-starter {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--ink);
}

.pill-intermediate {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--ink);
}

.pill-advanced {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--ink);
}

/* ============ Section landing ============ */
.section-description {
  font-size: 18px;
  color: var(--ink-secondary);
  margin: 0 0 2rem;
  max-width: 56ch;
  line-height: 1.5;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-card {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.guide-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.guide-card-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 1.8rem;
}

.guide-card-label {
  font-size: 15px;
  font-weight: 500;
}

/* ============ Footer ============ */
.site-footer {
  font-size: 13px;
  color: var(--ink-secondary);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer a {
  color: var(--ink-secondary);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: none;
}
