/* ============================================================
   Vare — Design Tokens
   Monochrome (black / white / gray) palette, light + dark mode.
   Typography and spacing follow the Apple Human Interface
   Guidelines: SF font stack, hairline separators, generous
   whitespace, 12–14px corner radii, 44px minimum tap targets.
   ============================================================ */

:root {
  /* Light theme (default) */
  --color-bg: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-surface: #f5f5f7;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: #e5e5e7;
  --color-accent: #1d1d1f;
  --color-accent-contrast: #ffffff;
  --shadow-elevated: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);

  /* Apple's own web font stack (apple.com): SF Pro on Apple devices,
     Helvetica Neue/Helvetica/Arial elsewhere — deliberately skips
     Segoe UI so non-Apple devices don't fall back to a Windows-native look. */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;

  /* Fixed spacing tokens — used for small, self-contained UI elements
     (button/control padding) that shouldn't scale with the viewport. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;

  /* Fluid tokens — used for page-level layout (gutters, section padding,
     headline size). Each scales continuously between a mobile floor and a
     desktop ceiling via vw, so spacing grows on tablets/ultra-wide displays
     instead of leaving a fixed-width column stranded in a sea of margin. */
  --gutter: clamp(20px, 4vw, 96px);
  --section-padding-y: clamp(2.5rem, 6vw, 6rem);
  --content-max-width: 1440px;

  --font-size-h1: clamp(2rem, 1.3rem + 3vw, 4rem);
  --font-size-body-lg: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-bg-elevated: #1c1c1e;
    --color-surface: #1c1c1e;
    --color-text: #f5f5f7;
    --color-text-secondary: #98989d;
    --color-border: #2c2c2e;
    --color-accent: #f5f5f7;
    --color-accent-contrast: #1d1d1f;
    --shadow-elevated: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

html[data-theme="light"] {
  --color-bg: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-surface: #f5f5f7;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: #e5e5e7;
  --color-accent: #1d1d1f;
  --color-accent-contrast: #ffffff;
  --shadow-elevated: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] {
  --color-bg: #000000;
  --color-bg-elevated: #1c1c1e;
  --color-surface: #1c1c1e;
  --color-text: #f5f5f7;
  --color-text-secondary: #98989d;
  --color-border: #2c2c2e;
  --color-accent: #f5f5f7;
  --color-accent-contrast: #1d1d1f;
  --shadow-elevated: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset & Basics ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  font-family: var(--font-system);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header / Navigation ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 10;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: clamp(14px, 2vw, 24px) var(--gutter);
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-wordmark {
  height: 20px;
  width: auto;
}

.logo-wordmark--light {
  display: block;
}

.logo-wordmark--dark {
  display: none;
}

html[data-theme="dark"] .logo-wordmark--light {
  display: none;
}

html[data-theme="dark"] .logo-wordmark--dark {
  display: block;
}

.nav-links {
  display: flex;
  gap: var(--space-4);
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-text);
}

/* ---------- Theme switch (Light / Dark segmented control) ---------- */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background-color: var(--color-surface);
  flex-shrink: 0;
}

.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: calc(var(--radius-l) - 3px);
  background-color: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.theme-option .icon {
  width: 18px;
  height: 18px;
}

.theme-option:hover {
  color: var(--color-text);
}

.theme-option:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.theme-option[aria-checked="true"] {
  background-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--section-padding-y) var(--gutter);
}

.hero h1 {
  font-size: var(--font-size-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.hero p {
  font-size: var(--font-size-body-lg);
  color: var(--color-text-secondary);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: var(--space-4) var(--gutter);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* ============================================================
   Responsive breakpoints
   - Mobile:  up to 640px  — stacked nav, links wrap below the logo/switch.
   - Tablet:  641px–1024px — single-row nav restored, tighter link spacing.
   - Desktop: 1025px+      — full spacing; --gutter/--font-size-h1 continue
                             to scale fluidly via vw all the way to
                             ultra-wide monitors, so nothing is hardcoded
                             to a single fixed desktop width.
   ============================================================ */

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .nav-links {
    gap: var(--space-3);
  }

  .nav-links a {
    font-size: 0.9rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .navbar {
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
  }
}
