/* SafeBike CPH design system - PRD §5, tokens from design/homepage.html
   Final scheme: Plum accent on bright white (do not copy the mockup's
   Fjord-green/cream :root defaults). */

:root {
  --paper: #ffffff;
  --paper-2: #f4f4f2;
  --paper-3: #ebebe8;
  --ink: #1a1813;
  --ink-soft: #494539;
  --muted: #8c8678;
  --line: #e7e7e2;
  --white: #fff;
  --accent: #97386a;
  --accent-deep: #321f2c;
  --accent-contrast: #ffffff;
  --tint: #f0e6ec;
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 10px;
  --r-lg: 20px;
  --maxw: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); background: var(--paper); color: var(--ink);
  font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* buttons - pill-shaped, ≥48px touch targets (PRD §4.3) */
.btn {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans); font-weight: 600; font-size: 16px;
  padding: 14px 22px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast);
  cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease; min-height: 48px;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--accent); color: var(--accent-contrast); }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }

section { padding: 72px 0; }
.divide { border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-direction: column; gap: 14px; }
.sec-head h1, .sec-head h2 { font-size: clamp(30px, 5vw, 46px); }
.sec-head .lede { color: var(--ink-soft); max-width: 54ch; font-size: clamp(16px, 2.4vw, 19px); }
.cap { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 12px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav .row { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.02em; font-size: 19px; }
.brand .mark { width: 32px; height: 32px; display: block; flex: none; }
.brand .sub { color: var(--muted); font-weight: 500; margin-left: -8px; }
.nav nav { display: flex; gap: 30px; align-items: center; }
.nav nav a { font-size: 15.5px; color: var(--ink-soft); font-weight: 500; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--accent); }
.nav .right { display: flex; align-items: center; gap: 14px; }
.nav-cta { font-size: 15px; padding: 10px 18px; min-height: 42px; }
.burger { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer; }
.burger i { width: 18px; height: 1.6px; background: var(--ink); display: block; transition: .25s; }
.mobile-menu { display: none; flex-direction: column; gap: 2px; padding: 10px 24px 22px; border-bottom: 1px solid var(--line); background: var(--paper); }
.mobile-menu a { padding: 13px 4px; font-size: 18px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.mobile-menu a:last-of-type { border-bottom: 0; }
.mobile-menu .btn { margin-top: 14px; justify-content: center; }
body.menu-open .mobile-menu { display: flex; }
body.menu-open .burger i:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
body.menu-open .burger i:nth-child(2) { opacity: 0; }
body.menu-open .burger i:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

/* offline indicator (PRD §3.6) */
.offline-banner {
  display: none; background: var(--ink); color: var(--paper); text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; padding: 8px 16px;
}
body.is-offline .offline-banner { display: block; }

/* hero */
.hero { padding: 70px 0 26px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; font-size: clamp(46px, 7.2vw, 92px); line-height: .97; }
.hero h1 em { font-style: italic; }
.hero .sub { max-width: 46ch; margin-top: 24px; font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-soft); }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

/* hero crossfade - cycles through 5 city photos */
.hero-fade { position: relative; height: clamp(360px, 52vw, 560px); border-radius: 20px; overflow: hidden; background: var(--paper-3); }
.hero-fade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.hero-fade img.active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero-fade img { transition: none; }
}

/* hero stepper - quiet dots, barely-there until you look for them */
.hero-dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 5;
  display: flex; justify-content: center; gap: 2px;
  opacity: .55; transition: opacity .3s ease;
}
.hero-fade:hover .hero-dots, .hero-dots:focus-within { opacity: .9; }
.hero-dots button {
  width: 22px; height: 22px; padding: 0; border: 0; background: transparent;
  cursor: pointer; display: grid; place-items: center;
}
.hero-dots button::after {
  content: ''; width: 5px; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  transition: background .3s ease, transform .3s ease;
}
.hero-dots button:hover::after { background: rgba(255, 255, 255, .8); }
.hero-dots button.active::after { background: rgba(255, 255, 255, .95); transform: scale(1.3); }
.hero-dots button:focus-visible { outline: 1px solid rgba(255, 255, 255, .8); outline-offset: -6px; border-radius: 50%; }

/* photo bands + mosaic */
.band { display: block; width: 100%; height: clamp(280px, 42vw, 520px); object-fit: cover; border-radius: 20px; }
.band--page { height: clamp(220px, 32vw, 380px); margin-top: 34px; }
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 16px; margin-top: 40px; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.mosaic .m1 { grid-column: span 2; grid-row: span 2; }
.mosaic .m2 { grid-column: span 2; }
.stats { display: flex; gap: 46px; flex-wrap: wrap; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.03em; }
.stat span { font-size: 14px; color: var(--muted); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 13px; }
.card .num { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.card h3 { font-size: 22px; letter-spacing: -.01em; }
.card p { color: var(--ink-soft); font-size: 15.5px; }
.card.more-card { justify-content: center; align-items: flex-start; background: var(--tint); }
.card.more-card h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; }

/* dark feature panel (routes, CTA) */
.panel { background: var(--accent-deep); color: var(--paper); border-radius: 28px; padding: clamp(28px, 4vw, 56px); }
.panel .eyebrow { color: rgba(255, 255, 255, .6); }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5.5vw, 58px); margin-top: 10px; }
.panel .lede { color: rgba(255, 255, 255, .8); max-width: 52ch; margin-top: 14px; font-size: 18px; }
.panel .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); margin-top: 30px; }

/* route cards */
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.rcard { border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-lg); overflow: hidden; background: rgba(255, 255, 255, .03); display: flex; flex-direction: column; }
.rcard .rimg { position: relative; height: 170px; background: var(--paper-3); }
.rcard .rimg img { width: 100%; height: 100%; object-fit: cover; }
.rcard .rtag { position: absolute; top: 12px; left: 12px; z-index: 3; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; background: var(--paper); color: var(--ink); padding: 4px 9px; border-radius: 6px; }
.rcard .rbody { padding: 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.rcard h3 { font-size: 21px; }
.rcard p { color: rgba(255, 255, 255, .78); font-size: 14.5px; }
.rcard .rmeta { display: flex; gap: 16px; font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .6); margin-top: auto; padding-top: 6px; }

/* light list cards (directories, catalog on paper) */
.list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.lcard { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.lcard .limg { height: 170px; background: var(--paper-3); position: relative; }
.lcard .limg img { width: 100%; height: 100%; object-fit: cover; }
.lcard .ltag { position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; background: var(--paper); color: var(--ink); padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); }
.lcard .lbody { padding: 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.lcard h3 { font-size: 21px; }
.lcard p { color: var(--ink-soft); font-size: 15px; }
.lcard .lmeta { display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 8px; }
.lcard .more { font-weight: 600; display: inline-flex; gap: 8px; align-items: center; color: var(--accent); margin-top: 4px; }

/* partner disclosure label - mandatory for paid placements (PRD §1.4) */
.partner-badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  border: 1px solid currentColor; border-radius: 6px; padding: 2px 7px;
}

/* maps */
.map { width: 100%; height: clamp(320px, 50vw, 520px); border-radius: var(--r-lg); border: 1px solid var(--line); z-index: 1; }

.map--route { height: clamp(380px, 56vw, 580px); }

/* map markers - numbered ride-order pins; plum for food & drink, ink for sights */
.poi-pin {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(26, 24, 19, .4);
}
.poi-pin--food { background: var(--accent); }
.poi-pin--dot { width: 18px; height: 18px; }
.poi-pin { transition: transform .15s ease, box-shadow .15s ease; }
.poi-pin--hot { transform: scale(1.25); box-shadow: 0 5px 16px rgba(151, 56, 106, .5); }

/* map <-> card linking: highlighted card + clickable affordance */
[data-map-key], [data-poi] { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.lcard.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }

/* map legend */
.map-legend {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-soft);
}
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(26, 24, 19, .3); }
.legend-dot--sight { background: var(--ink); }
.legend-dot--food { background: var(--accent); }
.legend-line { width: 26px; height: 4px; border-radius: 2px; background: var(--accent); }

/* ride-order number on the stop cards, matching the map pins */
.stop-num {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; font-weight: 500; vertical-align: 3px;
}

/* map popups - match the card design */
.leaflet-popup-content-wrapper {
  font-family: var(--sans); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(26, 24, 19, .18); border: 1px solid var(--line);
}
.leaflet-popup-content { margin: 14px 18px; font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.leaflet-popup-content b { font-size: 16px; letter-spacing: -.01em; }
.leaflet-popup-content .popup-type {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px;
}
.leaflet-popup-content .popup-addr {
  display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.leaflet-popup-content .popup-desc { margin: 8px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.leaflet-popup-content .popup-meta {
  display: flex; gap: 14px; align-items: center; margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.leaflet-popup-content .popup-meta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.leaflet-popup-tip { box-shadow: 0 8px 24px rgba(26, 24, 19, .18); }

/* type tag + number on stop cards */
.stop-type {
  align-self: flex-start; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px;
}
.stop-type--food { color: var(--accent); background: var(--tint); border-color: var(--tint); }
.stop-num--food { background: var(--accent); }

/* prose (guide sections, pages) */
.prose { max-width: 68ch; color: var(--ink-soft); }
.prose h2, .prose h3 { color: var(--ink); margin: 1.6em 0 .5em; }
.prose p { margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; }
.verified { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

/* faq */
.faq-item { border-bottom: 1px solid var(--line); padding: 6px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 18px; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; min-height: 48px; align-items: center; }
.faq-item summary::after { content: '+'; font-family: var(--mono); color: var(--muted); }
.faq-item[open] summary::after { content: '–'; }
.faq-item .answer { color: var(--ink-soft); padding-bottom: 18px; max-width: 68ch; }

/* bottom banners - cookie consent + PWA install (PRD §4.5, §3.6) */
.bottom-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80;
  max-width: 720px; margin-inline: auto;
  background: var(--ink); color: var(--paper); border-radius: 14px;
  padding: 16px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.bottom-banner[hidden] { display: none; }
.bottom-banner p { font-size: 14.5px; line-height: 1.45; flex: 1; min-width: 220px; }
.bottom-banner a { text-decoration: underline; }
.banner-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner-actions .btn { min-height: 42px; padding: 10px 18px; font-size: 15px; }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--outline { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, .4); }
.btn--outline:hover { background: rgba(255, 255, 255, .12); transform: none; }
#pwa-ios-hint { font-size: 13.5px; color: rgba(255, 255, 255, .8); max-width: 24ch; }

/* select - pill dropdown with a custom chevron (native arrow is off-design) */
.select {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center;
  font: inherit; font-weight: 600; font-size: 16px; color: var(--ink);
  background-color: var(--white); border: 1px solid var(--accent); border-radius: 999px;
  min-height: 48px; padding: 10px 46px 10px 22px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2397386a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 12px 8px;
  transition: background-color .2s ease;
}
.select:hover { background-color: var(--tint); }
.select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* contact form */
.form { display: grid; gap: 16px; max-width: 560px; margin-top: 30px; }
.form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.form input[type="text"],
.form input[type="email"],
.form textarea {
  width: 100%; min-height: 48px; padding: 12px 16px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
}
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* newsletter form (footer) */
.fcol--news { max-width: 320px; }
.news-form { display: flex; gap: 8px; flex-wrap: wrap; }
.news-form input[type="email"] {
  flex: 1; min-width: 170px; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
}
.news-form input[type="email"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.news-form .btn { font-size: 15px; padding: 10px 18px; }
.news-note { font-size: 12.5px; color: var(--muted); }
.news-ok { font-size: 14.5px; color: var(--accent); font-weight: 600; }
.news-err { font-size: 13px; color: #b3261e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.foot .frow { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot .fcol { display: flex; flex-direction: column; gap: 10px; }
.foot .fcol b { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.foot .fcol a { color: var(--ink-soft); font-size: 15px; }
.foot .fcol a:hover { color: var(--accent); }
.foot .fbottom { margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }

/* responsive - mobile-first breakpoints from the mockup */
@media (max-width: 900px) {
  .nav nav { display: none; }
  .burger { display: flex; }
  .cards, .route-grid, .list-grid { grid-template-columns: 1fr; }
  section { padding: 54px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-fade { height: clamp(300px, 70vw, 460px); order: -1; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .mosaic .m1 { grid-column: span 2; grid-row: span 1; }
  .mosaic .m2 { grid-column: span 2; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .nav-cta { font-size: 13.5px; padding: 8px 14px; min-height: 38px; }
  .brand { font-size: 17px; }
}
