/* ============================================================
   zachasnes.com: shared styles for Home, Trainings, Stories.
   Calm and light: warm off-white, one blue accent, Inter.
   A soft dark theme follows the visitor's system setting.
   ============================================================ */

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

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --hover: #f4f3f0;
  --text: #1d1f23;
  --body: #3b3f45;
  --muted: #6a6f76;
  --line: #e6e4df;
  --accent: #2b59c3;
  --accent-soft: #eef2fb;
  --on-accent: #ffffff;
  --error: #b3261e;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.06);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1c1f23;
    --hover: #22262b;
    --text: #e8e6e1;
    --body: #c9c7c2;
    --muted: #9aa0a6;
    --line: #2c3035;
    --accent: #8ab4f8;
    --accent-soft: #1f2a3d;
    --on-accent: #0f1b33;
    --error: #f2b8b5;
    --shadow: none;
  }
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

::selection { background: var(--accent-soft); }

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

/* ---------- Nav ---------- */
nav.site-nav {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.nav-logo { font-weight: 600; font-size: 16px; text-decoration: none; letter-spacing: -0.01em; }

.nav-links { display: flex; gap: 2rem; list-style: none; }

.nav-links a { font-size: 15px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { font-weight: 500; }

/* ---------- Layout ---------- */
section { padding: 4rem 2rem; max-width: 1040px; margin: 0 auto; }

.page-top { padding-top: 3rem; }

.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.big-text {
  font-size: clamp(36px, 5.5vw, 56px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.big-text span { color: var(--accent); }

.lede { font-size: 18px; color: var(--muted); max-width: 600px; margin-bottom: 2.5rem; }

.mono { font-size: 13px; font-weight: 500; }

.tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  white-space: nowrap;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--accent);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  transition: opacity 0.2s, background 0.2s;
}

.btn:hover { opacity: 0.9; }

.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); opacity: 1; }

.see-all { margin-top: 1.75rem; }

.status { font-size: 14px; color: var(--muted); min-height: 1.4em; margin: 1.25rem 0; }
.status.is-error { color: var(--error); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Sentence picker ---------- */
.picker {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--muted);
  margin-top: 2rem;
}

.picker .token {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0 0.4em 0 0.45em;
  margin: 0 0.1em;
  transition: filter 0.2s;
}

.picker .token:hover { filter: brightness(0.97); }

.picker .token::after { content: '▾'; font-size: 0.6em; margin-left: 0.25em; pointer-events: none; }

.picker select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0.05em 0;
  max-width: 100%;
}

.picker select option { font-size: 16px; color: var(--text); background: var(--surface); }

/* ---------- Training results ---------- */
.top-pick {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  margin-top: 0.5rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.top-pick:hover { transform: translateY(-2px); }

.top-pick .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 0.9rem;
}

.top-pick h3 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 650; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.top-pick p { color: var(--body); max-width: 640px; }
.top-pick .meta { color: var(--muted); font-size: 14px; margin-top: 0.9rem; }
.top-pick .go { font-size: 28px; color: var(--accent); line-height: 1; }

.list-head { margin: 2.5rem 0 0.75rem; color: var(--muted); font-size: 14px; font-weight: 600; }

.course-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.course {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  border-top: 1px solid var(--line);
  transition: background 0.2s;
}

.course:first-child { border-top: 0; }
.course:hover { background: var(--hover); }
.course-num { display: none; }
.course-name { font-weight: 600; font-size: 17px; line-height: 1.3; }
.course-desc { font-size: 14px; color: var(--muted); margin-top: 0.25rem; }
.course-meta { color: var(--muted); font-size: 13px; margin-top: 0.4rem; }
.course .tags { justify-content: flex-end; max-width: 260px; }

/* ---------- Stories ---------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.story {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.story:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.story .date { color: var(--muted); font-size: 13px; }
.story h3 { font-size: 21px; font-weight: 650; line-height: 1.25; letter-spacing: -0.015em; }
.story .hook { color: var(--body); font-size: 15px; }
.story .read { margin-top: auto; color: var(--accent); font-weight: 500; font-size: 14px; }

/* Full story view */
.reader { max-width: 680px; margin: 0 auto; }
.reader .back { display: inline-block; margin-bottom: 2rem; color: var(--muted); text-decoration: none; font-size: 14px; }
.reader .back:hover { color: var(--text); }
.reader .date { color: var(--muted) !important; font-size: 14px; }
.reader h1 { font-size: clamp(32px, 4.5vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; margin: 0.5rem 0 1.25rem; }
.reader .hook { font-size: 20px; color: var(--text); margin-bottom: 2rem; }
.reader .body p { font-size: 18px; color: var(--body); line-height: 1.75; margin-bottom: 1.35rem; }
.reader .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }

/* ---------- Footer ---------- */
footer {
  max-width: 1040px;
  margin: 3rem auto 0;
  border-top: 1px solid var(--line);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

footer p { font-size: 13px; color: var(--muted); }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---------- Motion (gentle; off for reduced motion) ---------- */
.fade-up { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-up.visible { opacity: 1; transform: none; }

.enter { animation: enter 0.35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.enter.d1 { animation-delay: 0.05s; }
.enter.d2 { animation-delay: 0.10s; }
.enter.d3 { animation-delay: 0.15s; }
.enter.d4 { animation-delay: 0.20s; }
.enter.d5 { animation-delay: 0.25s; }
.enter.d6 { animation-delay: 0.30s; }
.enter.d7 { animation-delay: 0.35s; }
.enter.d8 { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade-up { opacity: 1; transform: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  nav.site-nav { padding: 1.25rem; }
  .nav-links { gap: 1.25rem; }
  section { padding: 2.5rem 1.25rem; }
  .page-top { padding-top: 1.5rem; }
  .picker { font-size: 24px; }
  .picker .token { display: flex; margin: 0.3em 0; }
  .picker .token select { width: 100% !important; }
  .picker-end { display: none; }
  .top-pick { grid-template-columns: 1fr; padding: 1.5rem; }
  .top-pick .go { display: none; }
  .course { grid-template-columns: 1fr; padding: 1.1rem 1.25rem; }
  .course .tags { display: none; }
  .story-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; text-align: center; padding: 2rem 1.25rem; }
}

[hidden] { display: none !important; }
