/* ============================================================
   indigocam — shared styles
   Tokens: warm paper, indigo-black ink, single indigo accent
   Type: Archivo (display + body) · IBM Plex Mono (labels/meta)
   ============================================================ */

:root {
  --paper: #faf7f2;
  --paper-2: #f1ede5;
  --ink: #17161c;
  --ink-60: rgba(23, 22, 28, 0.6);
  --ink-30: rgba(23, 22, 28, 0.28);
  --ink-12: rgba(23, 22, 28, 0.12);
  --accent: oklch(0.48 0.19 278);
  --accent-soft: oklch(0.48 0.19 278 / 0.08);
  --display: "Archivo", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ============================================================
   DARK MODE TOKENS (default)
   ============================================================ */
[data-theme="dark"] {
  --paper: #0f0e14;
  --paper-2: #18171f;
  --ink: #ede9e1;
  --ink-60: rgba(237, 233, 225, 0.58);
  --ink-30: rgba(237, 233, 225, 0.26);
  --ink-12: rgba(237, 233, 225, 0.09);
  --accent: oklch(0.62 0.2 278);
  --accent-soft: oklch(0.62 0.2 278 / 0.12);
}

[data-theme="dark"] ::selection { background: var(--accent); color: #fff; }

/* dark mode: play overlay adapts */
[data-theme="dark"] .tile .play {
  background: rgba(237, 233, 225, 0.1);
}

/* dark mode: form placeholder */
[data-theme="dark"] .field input::placeholder,
[data-theme="dark"] .field textarea::placeholder {
  color: var(--ink-30);
}

/* smooth theme transitions */
html {
  transition: background-color 0.25s ease, color 0.25s ease;
  background: var(--paper);
}

* { box-sizing: border-box; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: opacity 0.28s ease, background-color 0.25s ease, color 0.25s ease;
}

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

a { color: inherit; }

/* ---------- mono label utility ---------- */
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- theme toggle button ---------- */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-30);
  background: none;
  color: var(--ink-60);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: var(--mono);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- shared top bar (inner pages) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--ink-12);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 50;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.topbar .wordmark {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  flex-shrink: 0;
}

.topbar .wordmark .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.topbar nav {
  display: flex;
  gap: 22px;
  flex: 1;
  justify-content: flex-end;
}

.topbar nav a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-60);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.topbar nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- topbar controls group (theme toggle + hamburger) ---------- */
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- hamburger button ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .bar:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* ---------- page shell ---------- */
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

.page-head { margin-bottom: 36px; }

.page-head .kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.page-head h1 {
  font-family: var(--display);
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.page-head .lede {
  font-size: 15.5px;
  color: var(--ink-60);
  max-width: 560px;
  margin: 0;
  text-wrap: pretty;
  line-height: 1.7;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--ink-12);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-60);
}

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

/* ---------- next-route ribbon at page bottom ---------- */
.next-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 80px;
  padding: 36px 40px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.next-route:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.next-route:hover .mono { color: inherit; }

.next-route .label { color: var(--ink-60); }

.next-route .title {
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.next-route .arrow { font-size: 32px; line-height: 1; flex-shrink: 0; }

/* =============================================================
   RESPONSIVE — tablet 860px
   ============================================================= */
@media (max-width: 860px) {
  .page { padding: 40px 24px 72px; }
  .page-head h1 { font-size: clamp(44px, 8vw, 84px); }
  .page-head .lede { font-size: 17px; }
  .next-route { padding: 28px 28px; margin-top: 56px; }
  .topbar { padding: 18px 24px; }
  .topbar nav { gap: 16px; }
}

/* =============================================================
   RESPONSIVE — mobile 600px: hamburger nav
   ============================================================= */
@media (max-width: 600px) {
  /* show hamburger */
  .nav-toggle { display: flex; }

  .topbar {
    flex-wrap: wrap;
    padding: 14px 20px;
    gap: 0;
    justify-content: space-between;
  }

  .topbar .wordmark { flex: 1; }

  /* controls group: theme toggle + hamburger */
  .topbar .topbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* hidden by default; opens below topbar */
  .topbar nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid var(--ink-12);
    justify-content: flex-start;
    flex: none;
  }

  .topbar nav.open { display: flex; }

  .topbar nav a {
    padding: 16px 0;
    font-size: 13px;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--ink-12);
    color: var(--ink-60);
  }

  .topbar nav a:last-child { border-bottom: none; }

  .topbar nav a[aria-current="page"] {
    color: var(--accent);
    border-bottom-color: var(--ink-12);
  }

  /* page */
  .page { padding: 32px 18px 64px; }
  .page-head { margin-bottom: 32px; }
  .page-head h1 { font-size: clamp(42px, 12vw, 84px); }
  .page-head .lede { font-size: 16px; }

  /* next route: stack on mobile */
  .next-route {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 22px;
    margin-top: 48px;
    border-radius: 16px;
  }

  .next-route .arrow { align-self: flex-end; }

  /* footer */
  .site-footer {
    flex-direction: column;
    gap: 6px;
    padding: 20px 18px;
  }

  /* button: full width */
  .btn { width: 100%; }
}

/* ─── Page transitions ──────────────────────────────────────────────────────── */
body {
  opacity: 0;
}

body.page-visible {
  opacity: 1;
}

body.page-exiting {
  opacity: 0 !important;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body { opacity: 1 !important; }
}

/* =============================================================
   TOUCH — active states for hover-less devices
   ============================================================= */
@media (hover: none) {
  .topbar nav a:active { color: var(--accent); }
  .btn:active { background: var(--ink); color: var(--paper); }
  .btn.primary:active { background: var(--ink); border-color: var(--ink); }
  .next-route:active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .next-route:active .label { color: inherit; }
}
