/* ============================================================
   Different OS - styles
   Slide-deck presentation + simple content pages.
   No framework. Hand-written. Mobile-first.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;

  /* Brand / OS accent colors. Carefully tuned for both themes. */
  --windows: #0078d4;
  --macos: #6e6e73;
  --linux: #f29111;

  /* Light theme (default) */
  --bg: #f7f8fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef0f5;
  --text: #14181f;
  --text-soft: #4a5260;
  --muted: #6c7480;
  --border: #d9dde5;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1100px;
}

:root[data-theme="dark"],
:root.theme-dark {
  --bg: #0b0f17;
  --bg-elev: #131826;
  --bg-soft: #1a2030;
  --text: #e7eaf0;
  --text-soft: #b3b9c4;
  --muted: #8b93a1;
  --border: #232a3a;
  --accent: #60a5fa;
  --accent-contrast: #0b0f17;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Honor system preference when the user hasn't picked manually. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --bg-elev: #131826;
    --bg-soft: #1a2030;
    --text: #e7eaf0;
    --text-soft: #b3b9c4;
    --muted: #8b93a1;
    --border: #232a3a;
    --accent: #60a5fa;
    --accent-contrast: #0b0f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
}

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

kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  font: inherit;
  font-size: 0.85em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-soft);
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.93em;
  padding: 0.1em 0.35em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.5rem 0.75rem;
  border-radius: 0 0 8px 8px;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: color-mix(in oklab, var(--bg-elev) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--windows), var(--linux));
  color: white;
  font-size: 16px;
  line-height: 1;
}

.topbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar-nav a {
  color: var(--text-soft);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}
.topbar-nav a:hover,
.topbar-nav a[aria-current="page"] {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-button:hover {
  background: var(--bg-soft);
  color: var(--text);
}

/* ---------- Deck layout ---------- */
.deck {
  /* The deck fills the viewport between top bar and controls. */
  --topbar-h: 56px;
  --controls-h: 84px;
  height: calc(100vh - var(--topbar-h) - var(--controls-h));
  min-height: 480px;
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity 280ms ease, transform 320ms ease;
  overflow: auto;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.slide.is-prev {
  transform: translateX(-24px);
}

.slide-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.slide h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  margin: 0 0 1rem 0;
  letter-spacing: -0.01em;
}

.slide p {
  color: var(--text-soft);
  margin: 0 0 0.9rem 0;
}

.slide .lede {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Title slide */
.slide--title .slide-inner {
  text-align: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.75rem 0 !important;
}
.title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--windows), var(--accent) 45%, var(--linux));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--text-soft);
  margin: 1rem 0 2rem 0;
}
.hint {
  color: var(--muted);
  font-size: 0.95rem;
}

/* End slide */
.slide--end .slide-inner {
  text-align: center;
}
.cta {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius);
  font-weight: 600;
  border: 1px solid transparent;
}
.cta:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

/* ---------- OS pills ---------- */
.os-pill {
  display: inline-block;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: white;
  vertical-align: middle;
  white-space: nowrap;
}
.os-pill--windows { background: var(--windows); }
.os-pill--macos   { background: var(--macos); }
.os-pill--linux   { background: var(--linux); }

.muted { color: var(--muted); font-size: 0.9em; }

/* ---------- Cards (Meet the contenders) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--border);
}
.card h3 { margin: 0 0 0.25rem 0; font-size: 1.25rem; }
.card-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.75rem 0; }
.card p { color: var(--text-soft); margin: 0; }

.card--windows { border-top-color: var(--windows); }
.card--macos   { border-top-color: var(--macos); }
.card--linux   { border-top-color: var(--linux); }

/* ---------- Key/value list (per-OS overview) ---------- */
.kv {
  list-style: none;
  margin: 1rem 0 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.kv li {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
}
.kv li:first-child { border-top: none; }
.kv li > span:first-child {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kv li > span:last-child {
  color: var(--text);
}

/* ---------- Three-column comparison ---------- */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.compare-col {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.25rem;
  border-top: 4px solid var(--border);
  box-shadow: var(--shadow);
}
.compare-col h3 { margin: 0 0 0.5rem 0; font-size: 1.05rem; }
.compare-col p { margin: 0; color: var(--text-soft); }

.compare-col--windows { border-top-color: var(--windows); }
.compare-col--macos   { border-top-color: var(--macos); }
.compare-col--linux   { border-top-color: var(--linux); }

/* ---------- Pros & cons ---------- */
.proscons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.proscons-col {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
}
.proscons-col h3 { margin: 0 0 0.5rem 0; font-size: 1.05rem; }
.proscons-col ul { margin: 0; padding-left: 1.2rem; color: var(--text-soft); }
.proscons-col li { margin-bottom: 0.4rem; }

.proscons-col--pros { border-top: 4px solid #10b981; }
.proscons-col--cons { border-top: 4px solid #ef4444; }

/* ---------- Picker table ---------- */
.picker {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.picker th,
.picker td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
}
.picker thead th {
  border-top: none;
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.picker tbody td { color: var(--text-soft); }
.picker tbody tr:nth-child(odd) td { background: color-mix(in oklab, var(--bg-elev) 92%, var(--accent) 0%); }

/* ---------- Big points (summary) ---------- */
.big-points {
  list-style: none;
  margin: 1rem 0 0 0;
  padding: 0;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}
.big-points li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.big-points li:first-child { border-top: none; }
.big-points em { font-style: italic; color: var(--text); }

/* ---------- Controls (footer nav) ---------- */
.controls {
  position: sticky;
  bottom: 0;
  background: color-mix(in oklab, var(--bg-elev) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem 0.75rem;
}
.progress {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 0.5rem 0;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--windows), var(--accent), var(--linux));
  transition: width 240ms ease;
}
.controls-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--maxw);
  margin: 0 auto;
}
.nav-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-button:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}
.nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border);
}
.dots {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.dot:hover { transform: scale(1.15); }
.dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
}
.counter {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 56px;
  text-align: right;
}

/* ---------- Static content page (About) ---------- */
body.page { background: var(--bg); }
.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.page-content h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem 0;
}
.page-content h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
}
.page-content p,
.page-content li { color: var(--text-soft); }
.page-content a { color: var(--accent); }
.page-content code {
  background: var(--bg-soft);
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .deck { --controls-h: 110px; }
  .topbar { padding: 0.6rem 0.9rem; }
  .topbar-nav a { padding: 0.3rem 0.45rem; }
  .slide { padding: 1.25rem 1rem; }
  .kv li { grid-template-columns: 1fr; gap: 0.1rem; }
  .picker th, .picker td { padding: 0.55rem 0.7rem; font-size: 0.95rem; }
  .counter { min-width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; transform: none !important; }
  .progress-bar { transition: none; }
}
