/* walkstories.com. Colours match the app (src/ui/theme.ts). */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/fraunces-latin-opsz-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/fraunces-latin-ext-opsz-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/fraunces-latin-opsz-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/fraunces-latin-ext-opsz-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-alt: #f1ece3;
  --border: #e4ddd1;
  --text: #1d1b18;
  --muted: #6b645a;
  --accent: #c2562b;
  --accent-hover: #a8471f;
  --accent-text: #a8471f;
  --legend-text: #8a560b;
  --accent-soft: #f6e3d9;
  --on-accent: #ffffff;
  --real: #2f7d4f;
  --legend: #a5670f;
  --invented: #6b5ca5;
  --map-land: #f4efe6;
  --map-water: #d5e4e8;
  --map-street: #ffffff;
  --map-street-thin: #e9e2d6;
  --map-route: #8a8277;
  --accent-soft-map: #f6e3d9cc;
  --shadow: 0 1px 2px rgb(29 27 24 / 6%), 0 8px 24px rgb(29 27 24 / 8%);
  --shadow-phone: 0 2px 6px rgb(29 27 24 / 10%), 0 30px 60px -20px rgb(120 60 30 / 35%);

  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --surface: #1f1d1a;
    --surface-alt: #1b1a17;
    --border: #3a362f;
    --text: #f3efe8;
    --muted: #a89f92;
    --accent: #e27a4e;
    --accent-hover: #ec916a;
    --accent-text: #e27a4e;
    --legend-text: #e0a74a;
    --accent-soft: #3a2a22;
    --on-accent: #1d1b18;
    --real: #5fbf85;
    --legend: #e0a74a;
    --invented: #a596e0;
    --map-land: #24221e;
    --map-water: #1c2b30;
    --map-street: #34302a;
    --map-street-thin: #2c2924;
    --map-route: #8c8478;
    --accent-soft-map: #3a2a22cc;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    --shadow-phone: 0 2px 6px rgb(0 0 0 / 40%), 0 30px 60px -20px rgb(0 0 0 / 70%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.35rem, 5.6vw, 4rem);
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}
h3 {
  font-size: 1.3rem;
}
p {
  margin: 0 0 1em;
}
a {
  color: var(--accent-text);
}
img,
svg {
  display: block;
  max-width: 100%;
}
ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.9375rem;
}
.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 38em;
}
.label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 8px;
}
.skip:focus {
  left: 8px;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn-ghost {
  background: transparent;
  color: var(--accent-text);
}
.btn-ghost:hover {
  background: var(--accent-soft);
}
.btn-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9375rem;
}
.btn-invert {
  background: var(--on-accent);
  color: var(--accent-text);
  border-color: var(--on-accent);
}
.btn-invert:hover {
  background: var(--bg);
  border-color: var(--bg);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-decoration: none;
}
.text-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.15s;
}
.text-link:hover svg {
  transform: translateX(3px);
}
.badge {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.8125rem;
  font-weight: 700;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo-mark {
  width: 26px;
  height: 28.6px;
  flex: none;
}
.nav {
  display: none;
  gap: 24px;
}
.nav a,
.lang {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}
.nav a:hover,
.lang:hover {
  color: var(--accent-text);
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
@media (min-width: 880px) {
  .nav {
    display: flex;
  }
}
@media (max-width: 520px) {
  .header-actions .btn {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(32px, 6vw, 80px) clamp(48px, 7vw, 96px);
  background:
    radial-gradient(60% 50% at 85% 30%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
}
.hero-grid {
  display: grid;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}
.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 14px;
}
.hero h1 {
  max-width: 14em;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 18px;
}
.note {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 34em;
}

/* Phone mock of the walk screen */
.mock {
  margin: 0;
  justify-self: center;
  width: min(100%, 340px);
}
.mock-phone {
  border-radius: 44px;
  padding: 10px;
  background: #1d1b18;
  box-shadow: var(--shadow-phone);
}
.mock-screen {
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.mock-map {
  width: 100%;
  height: auto;
}
.mock-pulse {
  transform-origin: 160px 100px;
}
@media (prefers-reduced-motion: no-preference) {
  .mock-pulse {
    animation: pulse 2.4s ease-out infinite;
  }
  .mock-walked {
    stroke-dasharray: 260;
    stroke-dashoffset: 260;
    animation: draw 2.2s 0.3s ease-out forwards;
  }
}
@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.mock-num {
  font-family: var(--font-body);
}
.mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.mock-bar p {
  margin: 0;
}
.mock-title {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.3;
}
.mock-meta {
  color: var(--muted);
  font-size: 0.75rem;
}
.mock-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--legend-text);
  border: 1px solid var(--legend);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.mock-card {
  margin: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.mock-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 4px;
}
.mock-chapter {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.mock-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0 0 6px;
}
.mock-next {
  color: var(--muted);
  margin: 0;
}
.mock-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 16px;
}
.mock-play {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  flex: none;
}
.mock-end {
  flex: 1;
  text-align: center;
  border: 1.5px solid #b42318;
  color: #b42318;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .mock-phone {
    background: #0c0b0a;
    box-shadow:
      0 0 0 1px #3a362f,
      var(--shadow-phone);
  }
  .mock-end {
    border-color: #f97066;
    color: #f97066;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(56px, 8vw, 104px);
}
.section-alt {
  background: var(--surface-alt);
}
.section h2 + .lead {
  margin-top: -0.2em;
}

/* Steps */
.steps {
  display: grid;
  gap: 28px;
  margin-top: 36px;
  counter-reset: step;
}
@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
  .step {
    position: relative;
  }
  .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 60px;
    right: -14px;
    border-top: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  }
}
.step-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 16px;
}
.step p {
  color: var(--muted);
}

/* Cards */
.cards {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}
@media (min-width: 760px) {
  .cards-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.card p {
  color: var(--muted);
  flex: 1;
}
.card-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 14px;
}
.card-icon svg {
  width: 32px;
  height: 32px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Recap */
.split {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}
.recap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.recap-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 4px 0 20px;
}
.fact-group {
  --kind: var(--real);
  margin-top: 18px;
}
.fact-group.legend {
  --kind: var(--legend);
}
.fact-group.invented {
  --kind: var(--invented);
}
.fact-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--kind);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.125rem;
  margin-bottom: 8px;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--kind);
}
.fact {
  border-left: 3px solid var(--kind);
  padding-left: 14px;
  margin: 0;
}
.fact-source {
  display: block;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Narrators */
.narrators {
  display: grid;
  gap: 14px;
  margin: 32px 0 18px;
}
@media (min-width: 560px) {
  .narrators {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .narrators {
    grid-template-columns: repeat(4, 1fr);
  }
}
.narrator {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.narrator.is-playing {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.narrator-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
}
.narrator-avatar .wave {
  position: absolute;
  inset: auto 0 -4px;
  margin: auto;
  width: 30px;
  fill: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.narrator.is-playing .narrator-avatar span {
  opacity: 0.2;
}
.narrator.is-playing .wave {
  opacity: 1;
  bottom: 18px;
}
@media (prefers-reduced-motion: no-preference) {
  .narrator.is-playing .wave rect {
    animation: bar 0.9s ease-in-out infinite alternate;
    transform-origin: center;
    transform-box: fill-box;
  }
  .narrator.is-playing .wave rect:nth-child(2) {
    animation-delay: 0.15s;
  }
  .narrator.is-playing .wave rect:nth-child(3) {
    animation-delay: 0.3s;
  }
  .narrator.is-playing .wave rect:nth-child(4) {
    animation-delay: 0.45s;
  }
}
@keyframes bar {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1);
  }
}
.narrator-info p {
  margin: 0;
}
.narrator-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.25rem;
}
.narrator-info .muted {
  font-size: 0.9375rem;
}
.play {
  --p: 0;
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.play:hover {
  transform: scale(1.05);
}
.play svg {
  width: 22px;
  height: 22px;
  grid-area: 1 / 1;
}
.play .i-pause,
.play[aria-pressed='true'] .i-play {
  display: none;
}
.play[aria-pressed='true'] .i-pause {
  display: block;
}
.play-ring {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) calc(var(--p) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  opacity: 0.55;
}
.narrator.is-unavailable .play {
  display: none;
}
.narrator-soon {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.875rem;
}
.narrator.is-unavailable .narrator-soon {
  display: block;
}

/* Principles */
.principles {
  display: grid;
  gap: 24px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
@media (min-width: 760px) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
  }
}
.principles li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.principle-icon {
  flex: none;
  color: var(--accent-text);
}
.principle-icon svg {
  width: 30px;
  height: 30px;
}
.principles h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
}
.principles p {
  color: var(--muted);
  margin: 0;
  font-size: 0.96875rem;
}

/* Coming soon / contact */
.launch {
  display: grid;
  gap: 28px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(28px, 5vw, 56px);
}
#contact {
  padding-top: clamp(8px, 2vw, 24px);
}
.launch .btn-invert {
  justify-self: start;
}

@media (min-width: 900px) {
  .launch {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 56px;
  }
}
.launch h2 {
  color: var(--on-accent);
}
.launch-copy p {
  font-size: 1.15rem;
  margin: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 36px 48px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer .brand {
  font-size: 1.1rem;
}
.site-footer p {
  margin: 8px 0 0;
  font-size: 0.9375rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 0.9375rem;
}
.footer-links a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--accent-text);
}

/* 404 */
.notfound {
  min-height: 70vh;
  display: grid;
  align-items: center;
}
.notfound .brand {
  margin-bottom: 32px;
}

@media (min-width: 1000px) {
  .narrator {
    gap: 10px;
    padding: 14px;
  }
  .narrator-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }
}
