/* A Taste of UX v2 - modern editorial, mobile-first
   Base: cool paper #F7F7FB, deep indigo ink #17182B
   Each page sets --accent / --accent-ink / --accent-soft */

:root {
  --paper: #F7F7FB;
  --surface: #FFFFFF;
  --ink: #17182B;
  --muted: #5B5E73;
  --line: #E6E6F0;
  --accent: #6366F1;
  --accent-ink: #4338CA;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 24, 43, 0.05), 0 8px 24px rgba(23, 24, 43, 0.07);
  --measure: 42rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  font-weight: 400;
}

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

/* ---------- scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--accent); z-index: 40;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(20px, 5vw, 32px);
  background: rgba(247, 247, 251, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .home {
  font-family: "Sora", sans-serif; font-weight: 700; font-size: 0.95rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.topbar .home .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.topbar .crumb {
  font-family: "JetBrains Mono", monospace; font-size: 0.7rem;
  color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 84px) clamp(20px, 5vw, 32px) clamp(28px, 5vw, 44px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto -20%; height: 130%;
  background: radial-gradient(60% 70% at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: var(--measure); margin: 0 auto; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 20px;
}

h1 {
  font-family: "Sora", sans-serif; font-weight: 800;
  font-size: clamp(2.1rem, 7vw, 3.1rem);
  line-height: 1.12; letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.promise {
  font-size: clamp(1.1rem, 3.4vw, 1.25rem);
  line-height: 1.6; color: var(--muted); margin: 0;
  max-width: 36rem;
}

/* ---------- content ---------- */
main { max-width: var(--measure); margin: 0 auto; padding: 8px clamp(20px, 5vw, 32px) 56px; }

h2 {
  font-family: "Sora", sans-serif; font-weight: 700;
  font-size: clamp(1.3rem, 4vw, 1.5rem); letter-spacing: -0.015em;
  margin: 44px 0 14px;
}
p { margin: 0 0 20px; }
ul { padding-left: 22px; margin: 0 0 20px; }
li { margin-bottom: 10px; }
em { font-style: italic; }
strong { font-weight: 600; }

a { color: var(--accent-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

mark {
  background: var(--accent-soft);
  color: inherit;
  padding: 0.08em 0.35em;
  border-radius: 6px;
  font-weight: 600;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4.5vw, 26px);
  margin: 30px 0;
}
.card .label, .activity .label, .story .label {
  display: flex; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 12px;
}
.card .label { color: var(--accent-ink); }
.card p:last-child, .activity p:last-child, .story p:last-child { margin-bottom: 0; }

.activity {
  position: relative;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4.5vw, 26px);
  margin: 34px 0;
}
.activity .label { color: var(--accent-ink); }
.activity .label::before { content: "✦"; font-size: 0.85rem; }

.story {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px var(--radius) var(--radius) 12px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 24px);
  margin: 30px 0;
}
.story .label { color: var(--accent-ink); }

/* ---------- index ---------- */
.spectrum {
  display: flex; gap: 6px; margin: 30px 0 10px;
}
.spectrum span { height: 8px; flex: 1; border-radius: 99px; }

.toc { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.toc a {
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  color: var(--ink); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.toc a:hover, .toc a:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(23, 24, 43, 0.06), 0 14px 34px rgba(23, 24, 43, 0.11);
}
.toc .n {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: "Sora", sans-serif; font-weight: 700; font-size: 0.95rem;
  color: #fff;
}
.toc .t { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.06rem; letter-spacing: -0.015em; display: block; margin-bottom: 3px; }
.toc .d { color: var(--muted); font-size: 0.92rem; line-height: 1.55; display: block; }

/* ---------- pager ---------- */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 52px;
}
.pager a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  color: var(--ink); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pager a:hover, .pager a:focus-visible { transform: translateY(-2px); }
.pager .dir {
  display: block;
  font-family: "JetBrains Mono", monospace; font-size: 0.68rem;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-ink);
  margin-bottom: 4px;
}
.pager .pt { font-family: "Sora", sans-serif; font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; }
.pager .next { text-align: right; }
.pager .only { grid-column: 2; }
@media (max-width: 540px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .only { text-align: left; grid-column: auto; }
}

footer {
  max-width: var(--measure); margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px) 48px;
  font-size: 0.82rem; color: var(--muted);
}

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner, main { animation: rise 0.5s ease both; }
  main { animation-delay: 0.07s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}
