/* Andanza — andanza.net
   Tokens, type roles and component metrics come from docs/andanza-visual-system.md
   in the walkinGuide repo, mirrored in mobile/lib/core/design_tokens.dart,
   app_typography.dart and app_theme.dart. Change them there first.

   Fonts are self-hosted (OFL licences in fonts/): the app bundles the same two
   families, and serving them from here means no visitor request reaches a
   third-party font CDN. Weights 400 and 500 only — the system has no others. */

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/fraunces-italic-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/fraunces-italic-latin.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-weight: 400 500;
  font-display: swap;
  src: url("fonts/fraunces-normal-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/fraunces-normal-latin.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: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter-normal-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter-normal-latin.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;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;

  /* Brand. Clay is Andanza, ochre is Cicerone, sage is live state. Nothing else takes colour. */
  --clay: #C75A3E;
  --ochre: #D98A2B;
  --sage: #6E8B5A;

  /* Neutrals: warm, never grey. */
  --page: #F5EFE6;
  --card: #FBF7F0;
  --raised: #FFFFFF;
  --border: #E3D9C9;
  --text: #1C1B19;
  --text-secondary: #6B655B;
  --text-muted: #8A8378;

  /* Tints. Text on a tint uses the deep variant, never black. */
  --clay-tint: #F6E7E0;
  --clay-tint-text: #9A4A32;
  --ochre-tint: #F7EBD8;
  --ochre-tint-text: #8A6420;

  /* The speaking-stop halo: ochre at 20 %, per the map overlay spec. */
  --ochre-halo: rgba(217, 138, 43, 0.2);

  --voice: "Fraunces", "Iowan Old Style", Georgia, serif;     /* Cicerone, and names */
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; /* the app */
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --clay: #E07551;
    --ochre: #E8A64A;
    --sage: #8FAE76;
    --page: #141310;
    --card: #1F1D18;
    --raised: #2A2721;
    --border: #3A362E;
    --text: #F0E9DD;
    --text-secondary: #A79E90;
    --text-muted: #7A7266;
    --clay-tint: #3A241D;
    --clay-tint-text: #E8967A;
    --ochre-tint: #3A2E17;
    --ochre-tint-text: #EFBE74;
    --ochre-halo: rgba(232, 166, 74, 0.2);
  }
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--ui);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--clay); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--clay-tint-text); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; }

.wrap {
  max-width: 62rem;
  margin-inline: auto;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

/* ---------- type roles ---------- */

h1, h2, .route .title, .doc h1, .doc h2 {
  font-family: var(--voice);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 18ch;
}

h1 em { font-style: italic; color: var(--clay); }

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 2rem;
}

h3 {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0 0 0.35rem;
}

.label {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metadata { font-size: 0.8125rem; line-height: 1.4; color: var(--text-secondary); }
.caption { font-size: 0.75rem; line-height: 1.3; color: var(--text-muted); }

/* ---------- masthead ---------- */

.masthead { padding-block: 1.5rem 0; }

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--clay);
  text-decoration: none;
}
.lockup:hover { color: var(--clay); }
.lockup svg { height: 28px; width: auto; display: block; }
.lockup .word { font-weight: 500; font-size: 1.05rem; letter-spacing: 0.04em; line-height: 1; }

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3rem, 9vw, 5.5rem) clamp(2.5rem, 7vw, 4rem);
  display: grid;
  gap: 2rem;
}

.standfirst {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0;
}

/* ---------- getting the app ---------- */

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

/* Apple's badge: official artwork, 40 px tall minimum on the web, never recoloured. */
.badge { display: inline-block; line-height: 0; border-radius: 6px; }
.badge img { height: 40px; width: auto; display: block; }

.availability { margin: 0; max-width: 40ch; }

/* ---------- a spoken line ---------- */

.spoken {
  border-left: 2px solid var(--ochre);
  padding-left: 1.4rem;
  display: grid;
  gap: 0.7rem;
  max-width: 46ch;
}

.spoken p {
  font-family: var(--voice);
  font-weight: 400;
  font-size: clamp(1.15rem, 2.3vw, 1.35rem);
  line-height: 1.5;
  margin: 0;
}

.attrib {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Cicerone is the ochre dot. No face, no mascot. */
.cicerone {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--ochre);
  flex: none;
}

/* ---------- bands and sections ---------- */

.band { background: var(--card); border-block: 0.5px solid var(--border); }
.section { padding-block: clamp(3rem, 7vw, 4.5rem); }

/* ---------- the walk: a dotted clay route with stops ----------
   The app draws a route as a 4 px clay line, dash pattern [1, 9] with round
   caps — which is to say a line of dots. Upcoming stops are clay; the stop
   where Cicerone is speaking is ochre with a 20 % halo. Same here. */

.steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 36px;
  display: grid;
  gap: 2rem;
}

.step { position: relative; }

/* The stop. */
.step::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--clay);
}

/* The leg to the next stop. None after the last one: a route ends at its last stop. */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: -30px;
  top: calc(0.5rem + 13px);
  bottom: calc(-2.5rem + 1px);
  width: 4px;
  background-image: radial-gradient(circle at 2px 2px, var(--clay) 2px, transparent 2.5px);
  background-size: 4px 10px;
  background-repeat: repeat-y;
}

.step.speaking::before {
  left: -34px;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  background: var(--ochre);
  box-shadow: 0 0 0 6px var(--ochre-halo);
  animation: halo 600ms ease-out both; /* "approaching a stop: halo expands once, 600 ms" */
}

@keyframes halo {
  from { box-shadow: 0 0 0 0 var(--ochre-halo); }
  to   { box-shadow: 0 0 0 6px var(--ochre-halo); }
}

.step p { margin: 0; color: var(--text-secondary); max-width: 58ch; }

/* ---------- refusals ---------- */

.refusals {
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.refusal { min-width: 0; }
.refusal h3 { margin-bottom: 0.5rem; }
.refusal p { margin: 0; color: var(--text-secondary); }

/* ---------- routes ---------- */

.routes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

/* Card: 12 px radius, 0.5 px border, 14–18 px padding. Raised surface because it sits on a band. */
.route {
  background: var(--raised);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.125rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1.5rem;
  align-items: center;
}

.route .place { grid-column: 1; }

/* Route title: Fraunces 400 — a route's own name, said in Cicerone's voice. */
.route .title {
  grid-column: 1;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0;
}

.route .meta {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 36rem) {
  .route { grid-template-columns: 1fr; }
  .route .meta { grid-column: 1; grid-row: auto; text-align: left; white-space: normal; margin-top: 0.35rem; }
}

.note { margin: 1.5rem 0 0; max-width: 52ch; font-size: 0.9rem; color: var(--text-secondary); }

/* ---------- closing ---------- */

.closing {
  padding-block: clamp(3.5rem, 8vw, 5rem);
  display: grid;
  gap: 2rem;
}

/* ---------- footer ---------- */

footer {
  border-top: 0.5px solid var(--border);
  padding-block: 2rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: baseline;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

footer a { color: var(--text-secondary); }
footer a:hover { color: var(--text); }
footer .spacer { flex: 1 1 2rem; }

/* ---------- documents (privacy, terms) ---------- */

.doc { max-width: 44rem; padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3rem); }

.doc h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  max-width: none;
}

.doc .updated { margin: 0 0 2rem; }

.doc .lede { font-size: 1.1rem; line-height: 1.55; color: var(--text-secondary); margin: 0 0 2rem; }

.doc h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 2.75rem 0 0.9rem;
}

.doc h3 { margin: 1.6rem 0 0.4rem; }

.doc p, .doc li { max-width: 68ch; }
.doc p { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.doc li { margin-bottom: 0.4rem; }
.doc li::marker { color: var(--text-muted); }

/* The short version, as a card. */
.summary {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 2rem;
}
.summary .label { color: var(--text-secondary); margin: 0 0 0.6rem; }
.summary ul { margin: 0; }
.summary li { margin-bottom: 0.35rem; }

/* Safety copy is the one string that must not be softened. It gets the clay tint. */
.notice {
  background: var(--clay-tint);
  color: var(--clay-tint-text);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
}
.notice p { margin: 0; color: inherit; }

.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; }

.doc table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 0.5px solid var(--border);
}
.doc th { font-weight: 500; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.doc td { color: var(--text); }
.doc td:first-child { font-weight: 500; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
