/* ==========================================================================
   Miami — kaupunkiopas aamusta yöhön
   Tokenit ja periaatteet: ../DESIGN.md
   ========================================================================== */

:root {
  /* Paletti: logon värit */
  --navy-950: #000c30;
  --navy-900: #00183c;
  --navy-700: #003054;
  --cyan: #00c0cc;
  --pink: #fc3084;
  --orange: #fc9030;
  --sun: #fcd800;

  /* Päivän pastellit */
  --cream: #fff6e9;
  --flamingo: #ffe3ec;
  --seafoam: #dff4f1;

  /* Tekstisävyt */
  --ink: #00183c;
  --ink-2: #3a4e6a;
  --pink-ink: #b8115a;   /* pinkki tekstinä vaalealla, ≥6:1 */
  --teal-ink: #006b74;   /* turkoosi tekstinä vaalealla, ≥5,5:1 */
  --mist: #b9c3d9;       /* toissijainen teksti tummalla, ≥7:1 */

  /* Typografia */
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-head: "Josefin Sans", "DM Sans", sans-serif;
  --font-neon: "Monoton", "Josefin Sans", sans-serif;

  /* Välit (8 px rytmi) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Layout */
  --container: 1280px;
  --gutter: 40px;
  --nav-h: 80px;
  --section-y: var(--space-32);

  /* Muoto */
  --radius: 4px;
  --radius-pill: 999px;
  --arch: 999px 999px var(--radius) var(--radius);

  /* Liike */
  --dur-fast: 150ms;
  --dur-base: 300ms;
  --dur-slow: 600ms;
  --dur-menu: 900ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);

  /* Z-index */
  --z-content: 1;
  --z-menu: 90;
  --z-nav: 100;
  --z-skip: 1000;

  /* Oletusteema = yö */
  --bg: var(--navy-950);
  --fg: #ffffff;
  --fg-2: var(--mist);
  --accent: var(--pink);
  --accent-text: var(--cyan);
  --line: rgb(255 255 255 / .16);
  --focus: var(--sun);
}

@media (max-width: 991px) {
  :root { --section-y: var(--space-20); }
}

@media (max-width: 767px) {
  :root { --gutter: 16px; --nav-h: 64px; --section-y: var(--space-16); }
}

/* ---------- Vuorokaudenajan teemat ---------- */

.theme-dawn,
.theme-flamingo,
.theme-seafoam {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --accent: var(--pink);
  --accent-text: var(--pink-ink);
  --line: rgb(0 24 60 / .14);
  --focus: var(--pink-ink);
}

.theme-dawn { --bg: var(--cream); }
.theme-flamingo { --bg: var(--flamingo); }
.theme-seafoam { --bg: var(--seafoam); --accent: var(--cyan); --accent-text: var(--teal-ink); --focus: var(--teal-ink); }

.theme-dusk {
  --bg: var(--navy-700);
  --fg: #ffffff;
  --fg-2: var(--mist);
  --accent: var(--orange);
  --accent-text: var(--orange);
  --line: rgb(255 255 255 / .16);
  --focus: var(--sun);
}

.theme-night {
  --bg: var(--navy-950);
  --fg: #ffffff;
  --fg-2: var(--mist);
  --accent: var(--pink);
  --accent-text: var(--cyan);
  --line: rgb(255 255 255 / .14);
  --focus: var(--sun);
}

.theme-sunrise {
  --bg: var(--navy-950);
  --fg: #ffffff;
  --fg-2: rgb(255 255 255 / .82);
  --accent: var(--sun);
  --accent-text: var(--sun);
  --line: rgb(255 255 255 / .45);
  --focus: var(--sun);
}

[class*="theme-"] {
  background-color: var(--bg);
  color: var(--fg);
}

/* ---------- Perusta ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  scrollbar-gutter: stable;
  scrollbar-color: var(--pink) var(--navy-950);
  accent-color: var(--pink);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  caret-color: var(--pink);
}

body.menu-open { overflow: hidden; }

::selection {
  background: var(--pink);
  color: #ffffff;
}

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

h1, h2, h3 { margin: 0; text-wrap: balance; }

h2 {
  margin-bottom: var(--space-4);
  font-family: var(--font-head);
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-6);
  /* n. 70 merkkiä riville; 65ch mitataan leveästä 0-merkistä ja antaa liian pitkän rivin */
  max-width: 36em;
  color: var(--fg-2);
  text-wrap: pretty;
}

.lead {
  color: var(--fg);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.5;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--dur-fast);
}

button { font: inherit; color: inherit; }

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

main:focus { outline: none; }

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

.skip-link {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  background: var(--sun);
  color: var(--navy-950);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.wrapper {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Napit ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  /* Josefin Sans istuu korkealla; ylä- ja alapadding tasaavat sen optisesti */
  padding: 15px 28px 11px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.button-sun {
  background: var(--sun);
  color: var(--navy-950);
}

.button:active { transform: scale(.97); }

.button[aria-busy="true"] {
  background: rgb(252 216 0 / .6);
  cursor: progress;
}

.round-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .5);
  border-radius: 50%;
  background: rgb(0 12 48 / .35);
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--dur-base), border-color var(--dur-base), color var(--dur-base);
}


/* Hover vain osoitinlaitteille, ettei kosketus jätä tilaa päälle */
@media (hover: hover) {
  .button-sun:hover { background: var(--orange); }
  .button-line:hover { background: var(--ink); color: var(--cream); }
  .media-button:hover img { transform: scale(1.03); }

  .round-button:hover {
    border-color: var(--sun);
    background: var(--sun);
    color: var(--navy-950);
  }
}

.round-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-button svg .filled { fill: currentColor; stroke: none; }

/* ---------- Navigaatio ---------- */

.nav-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding-inline: var(--gutter);
  color: #ffffff;
  transition: background-color var(--dur-slow), box-shadow var(--dur-slow);
}

.nav-bar.is-scrolled {
  background-color: rgb(0 12 48 / .98);
  box-shadow: 0 8px 24px rgb(0 0 0 / .25);
}

.scroll-progress {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sun), var(--orange) 30%, var(--pink) 60%, var(--cyan));
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #ffffff;
  text-decoration: none;
}

.brand-mark { width: 48px; height: 48px; }

.brand-info { display: flex; flex-direction: column; }

.brand-text {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.brand-description {
  color: rgb(255 255 255 / .88);
  font-size: 13px;
  line-height: 1.3;
}

.navigation {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 26px;
}

.menu-icon span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur-base) var(--ease-out), width var(--dur-base) var(--ease-out);
}

.menu-icon span:last-child { width: 16px; margin-left: auto; }
.menu-button:hover .menu-icon span:last-child { width: 26px; }
.menu-button[aria-expanded="true"] .menu-icon span:first-child { transform: translateY(4.5px) rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-icon span:last-child { width: 26px; transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 479px) {
  .brand-info { display: none; }
}

/* Koko ruudun valikko */

.nav-wrapper {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: flex;
  align-items: center;
  overflow: auto;
  background: var(--navy-950);
  color: #ffffff;
  clip-path: circle(0% at calc(100% - 64px) 40px);
  transition: clip-path calc(var(--dur-menu) * .6) var(--ease-in-out);
}

.nav-wrapper[hidden] { display: none; }

.nav-wrapper.is-open {
  clip-path: circle(150% at calc(100% - 64px) 40px);
  transition-duration: var(--dur-menu);
}

.nav-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 2fr minmax(240px, 1fr);
  align-items: center;
  gap: var(--space-16);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: calc(var(--nav-h) + var(--space-6)) var(--gutter) var(--space-12);
}

.nav-links ol { margin: 0; padding: 0; list-style: none; }

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-4);
  padding-block: 1.2vh;
  color: #ffffff;
  font-family: var(--font-head);
  font-size: clamp(40px, 7.5vh, 84px);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--dur-base);
}

.nav-link-time {
  min-width: 4.5em;
  color: var(--cyan);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Nykyinen luku pinkki, osoitin ja fokus keltainen: kaksi eri tilaa */
.nav-link[aria-current="true"] { color: var(--pink); }
.nav-link:hover,
.nav-link:focus-visible { color: var(--sun); }

.nav-links li {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow), transform var(--dur-slow) var(--ease-out);
}

.nav-wrapper.is-open .nav-links li { opacity: 1; transform: none; }
.nav-wrapper.is-open .nav-links li:nth-child(1) { transition-delay: 250ms; }
.nav-wrapper.is-open .nav-links li:nth-child(2) { transition-delay: 290ms; }
.nav-wrapper.is-open .nav-links li:nth-child(3) { transition-delay: 330ms; }
.nav-wrapper.is-open .nav-links li:nth-child(4) { transition-delay: 370ms; }
.nav-wrapper.is-open .nav-links li:nth-child(5) { transition-delay: 410ms; }

.nav-logo { width: 120px; height: 120px; margin-bottom: var(--space-6); }

.nav-info-text { color: var(--mist); }

.nav-info-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #ffffff;
  font-size: 18px;
  text-decoration: none;
}

.nav-info-link:hover { color: var(--sun); }

.nav-alt {
  display: block;
  max-width: 34em;
  padding-block: 10px;
  margin-top: var(--space-4);
  line-height: 1.4;
  color: var(--mist);
  font-size: 17px;
  text-decoration: none;
}

.nav-alt span { color: #ffffff; text-decoration: underline; text-underline-offset: 4px; }
.nav-alt:hover span { color: var(--sun); }
.nav-alt[aria-current="true"] span { color: var(--pink); }

.nav-wrapper:focus { outline: none; }

.nav-link-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity var(--dur-slow);
}

.nav-link-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(0 12 48 / .92) 30%, rgb(0 12 48 / .6));
}

.nav-link-image.is-visible { opacity: 1; }

@media (max-width: 767px) {
  .nav-content { grid-template-columns: 1fr; gap: var(--space-8); align-self: start; }
  .nav-link { font-size: clamp(34px, 10vw, 48px); padding-block: var(--space-2); }
  .nav-link-time { font-size: 14px; min-width: 4em; }
  .nav-logo { display: none; }
}

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

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: var(--space-24);
  overflow: hidden;
  background: var(--navy-950);
  color: #ffffff;
}

.hero-image,
.hero-scrim { position: absolute; inset: 0; margin: 0; }

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 60%;
  animation: hero-push 14s var(--ease-out) both;
}

@keyframes hero-push {
  from { transform: scale(1.08); }
}

.hero-scrim {
  background:
    linear-gradient(180deg, rgb(0 12 48 / .7) 0%, rgb(0 12 48 / .25) 16%, transparent 30%),
    linear-gradient(0deg, rgb(0 12 48 / .92) 0%, rgb(0 12 48 / .45) 40%, transparent 72%);
}

.hero-content { max-width: none; }

/* Tumma tausta pitää tekstin luettavana myös vaalean taivaan päällä */
.hero-eyebrow {
  width: fit-content;
  margin: 0 0 var(--space-4);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgb(0 12 48 / .72);
  color: var(--sun);
  font: 600 clamp(14px, 1.4vw, 17px)/1.3 var(--font-head);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-heading {
  margin: 0 0 var(--space-6) -0.05em;
  font-family: var(--font-neon);
  font-size: clamp(80px, 24vw, 188px);
  font-weight: 400;
  line-height: .95;
  color: #fff;
  text-shadow:
    0 0 .02em #fff,
    0 0 .08em var(--pink),
    0 0 .22em rgb(252 48 132 / .55);
}

.hero-description {
  max-width: 34ch;
  margin-bottom: var(--space-8);
  color: #ffffff;
  font-size: clamp(19px, 1.8vw, 22px);
  line-height: 1.5;
}

/* Tekstilohko oikealle, ettei otsikko peitä tornia */
@media (min-width: 992px) {
  .hero-content { width: fit-content; margin-right: max(0px, (100% - var(--container)) / 2); }
  .hero-heading { font-size: min(13vw, 188px); }
}

@media (max-width: 767px) {
  .hero { padding-bottom: var(--space-16); }
  .hero-image img { object-position: 36% 60%; }
}

/* ---------- Intro ---------- */

.intro {
  position: relative;
  padding-block: var(--section-y) var(--space-16);
  overflow: hidden;
}

.intro-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-16);
  align-items: start;
}

.intro-heading {
  font-size: clamp(40px, 5.4vw, 76px);
  color: var(--ink);
}

.sun-stripes {
  position: absolute;
  right: calc(var(--gutter) * -1 - 80px);
  bottom: -140px;
  z-index: -1;
  width: 320px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sun), var(--orange) 50%, var(--pink));
  -webkit-mask:
    linear-gradient(#000 0 50%, transparent 50%),
    repeating-linear-gradient(#000 0 12px, transparent 12px 20px);
  mask:
    linear-gradient(#000 0 50%, transparent 50%),
    repeating-linear-gradient(#000 0 12px, transparent 12px 20px);
  opacity: .9;
}

/* Kapeampi leipäteksti, ettei se osu oikean reunan aurinkoon */
.intro-body p:not(.lead) { max-width: 28em; }

.intro-season {
  margin-bottom: 0;
  color: var(--accent-text);
  font-weight: 500;
}

@media (max-width: 991px) {
  .intro-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .sun-stripes { width: 220px; right: -60px; bottom: -110px; }
}

@media (max-width: 767px) {
  .intro { padding-bottom: 0; }
  .sun-stripes { display: none; }
}

/* Estää rivinvaihdon yhdysmerkkiliitteen kohdalla ("Art Deco -hotelleja") */
.nowrap { white-space: nowrap; }

/* ---------- Yhteiset lukuosat ---------- */

.chapter { position: relative; padding-block: var(--section-y); }

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin-bottom: var(--space-8);
  color: var(--fg-2);
  font-size: 16px;
  font-weight: 500;
}

.chapter-meta span:first-child { color: var(--accent-text); }

.chapter-meta span + span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-3);
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

/* Puhelimessa allekkain, ettei erotinpallo jää rivin alkuun */
@media (max-width: 479px) {
  .chapter-meta { flex-direction: column; gap: var(--space-1); }
  .chapter-meta span + span::before { display: none; }
}

.tip-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.tip-list li {
  position: relative;
  padding: var(--space-4) 0 var(--space-4) var(--space-8);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

.tip-list li::before {
  content: "";
  position: absolute;
  top: calc(var(--space-4) + .55em);
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.media { margin: 0; }

.media-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: rgb(0 24 60 / .08);
  overflow: hidden;
  cursor: zoom-in;
}

.media-button img {
  width: 100%;
  transition: transform var(--dur-slow) var(--ease-out);
}


.media figcaption {
  margin-top: var(--space-3);
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Ranta: jaettu asettelu ---------- */

.split-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-16);
  align-items: start;
}

.chapter-text {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-8));
}

.split-media { display: grid; gap: var(--space-8); }

.media-arch .media-button { border-radius: var(--arch); }
.media-arch img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 60%; }

@media (max-width: 991px) {
  .split-grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .chapter-text { position: static; }
  .split-media { order: -1; }
  .media-arch img { aspect-ratio: 4 / 3; }
}

/* ---------- Taide: täysleveä muraali ---------- */

.chapter-mural { padding-top: 0; }

.mural { position: relative; }

.mural-image {
  border-radius: 0;
  background: var(--navy-900);
}

.mural-image img {
  height: min(92vh, 960px);
  min-height: 520px;
  object-fit: cover;
}

.mural-panel-wrap {
  position: absolute;
  inset: auto 0 0;
  pointer-events: none;
}

.mural-panel {
  max-width: 560px;
  padding: var(--space-10);
  background: var(--pink);
  color: var(--ink);
  pointer-events: auto;
  transform: translateY(var(--space-16));
}

.mural-panel p { color: var(--ink); }
.mural-panel p:last-child { margin-bottom: 0; }
.mural-panel .chapter-meta span:first-child { color: var(--ink); }
.mural-panel .chapter-meta span + span::before { background: var(--sun); }

.mural-after {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-16);
  align-items: end;
  padding-top: calc(var(--space-16) + var(--space-16));
}

@media (max-width: 991px) {
  .mural-image img { height: 62vh; min-height: 360px; }
  .mural-panel-wrap { position: static; padding-inline: 0; }
  .mural-panel { max-width: none; padding: var(--space-8) var(--gutter); transform: none; }
  .mural-after { grid-template-columns: 1fr; gap: var(--space-10); padding-top: var(--space-12); }
}

/* ---------- Kaupunki ---------- */

/* Keskipäivän tauko: aikajanan aukko sanotaan ääneen */
.siesta {
  max-width: 44em;
  margin: 0 0 var(--space-16);
  padding-bottom: var(--space-6);
  border-bottom: 1px dashed var(--line);
  color: var(--fg-2);
  font-size: 16px;
}

.siesta-time {
  margin-right: var(--space-2);
  color: var(--accent-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.city-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: end;
  margin-bottom: var(--space-12);
}

.city-head .chapter-meta { margin-bottom: 0; }
.city-head > p { margin-bottom: var(--space-2); }

.city-media {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.city-main { grid-row: span 2; }
.city-main .media-button img { aspect-ratio: 1600 / 1075; object-fit: cover; }
.city-media .media:not(.city-main) .media-button img { aspect-ratio: 4 / 3; object-fit: cover; }

.tip-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 var(--space-8);
  border-top: 0;
}

.tip-columns li { border-top: 1px solid var(--line); }

@media (max-width: 991px) {
  .city-head { grid-template-columns: 1fr; gap: var(--space-6); }
  .city-media { grid-template-columns: 1fr 1fr; }
  .city-main { grid-column: 1 / -1; grid-row: auto; }
  .tip-columns { grid-template-columns: 1fr; }
  .tip-columns li { border-top: 0; }
  .tip-columns { border-top: 1px solid var(--line); }
}

/* ---------- Lainaus: auringonlasku ennen yötä ---------- */

.quote-section {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 80vh;
  padding-block: var(--space-32);
  overflow: hidden;
  background: var(--navy-950);
  color: #ffffff;
}

.quote-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.8) brightness(.85);
}

/* Päivän siluetti sävytetään auringonlaskuksi, joka sulautuu yön väriin */
.quote-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(252 144 48 / .45) 0%, rgb(252 48 132 / .3) 45%, rgb(0 12 48 / .7) 80%, var(--navy-950) 100%);
}

blockquote {
  margin: 0 auto;
  text-align: center;
}

blockquote p {
  max-width: 20ch;
  margin: 0 auto;
  color: #ffffff;
  font-family: var(--font-head);
  font-size: clamp(30px, 4.4vw, 60px);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
  text-shadow: 0 2px 16px rgb(0 0 0 / .45);
}

/* ---------- Stadion: puolitettu näkymä ---------- */

.chapter-stadium { padding-block: 0; }

.stadium-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.stadium-hero {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  margin: 0;
}

/* Päiväkuva vedetään kohti hämärää */
.stadium-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(252 144 48 / .35) 0%, rgb(252 48 132 / .18) 40%, rgb(0 24 60 / .55) 100%);
  pointer-events: none;
}

.stadium-hero .media-button { height: 100%; border-radius: 0; }
.stadium-hero img { height: 100%; object-fit: cover; filter: saturate(.85) brightness(.88); }

.fork-note {
  margin-bottom: var(--space-8);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgb(252 144 48 / .7);
  color: #ffffff;
  font-weight: 500;
}

.stadium-content {
  padding: var(--section-y) var(--gutter) var(--section-y) var(--space-16);
  max-width: calc(var(--container) / 2);
}

.stadium-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: end;
  margin-top: var(--space-12);
}

.stadium-pair .media:last-child .media-button { border-radius: var(--arch); }
.stadium-pair .media:last-child img { aspect-ratio: 3 / 4; object-fit: cover; }

@media (max-width: 991px) {
  .stadium-grid { grid-template-columns: 1fr; }
  .stadium-hero { position: relative; height: 64vh; }
  .stadium-content { padding: var(--space-16) var(--gutter); max-width: none; }
}

/* ---------- Yö: immersiivinen ---------- */

.chapter-night { padding-top: 0; }

.night-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: var(--space-16);
}

.night-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.night-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--navy-950) 0%, rgb(0 12 48 / .5) 35%, transparent 65%);
}

.neon-heading {
  margin-bottom: var(--space-6);
  font-family: var(--font-neon);
  font-size: clamp(44px, 9vw, 140px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
  text-shadow:
    0 0 .02em #fff,
    0 0 .08em var(--cyan),
    0 0 .24em rgb(0 192 204 / .6);
}

.night-title .chapter-meta { margin-bottom: 0; font-size: 18px; }

.night-body {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-16);
  align-items: center;
  padding-top: var(--space-12);
}

.night-body .media .media-button { border-radius: var(--arch); background: var(--navy-900); }

@media (max-width: 991px) {
  .night-hero { min-height: 72svh; }
  .night-body { grid-template-columns: 1fr; gap: var(--space-10); }
}

/* ---------- Kaupungin vuodet ---------- */

/* ---------- Postikortit ---------- */

.postcards { padding-block: var(--space-16) var(--section-y); }

.postcards-intro { margin-bottom: var(--space-12); }

.postcard-list {
  columns: 3;
  column-gap: var(--space-10);
  max-width: 1040px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.postcard .media-button {
  padding: 10px 10px 0;
  border-radius: 2px;
  background: var(--cream);
  box-shadow: 0 14px 30px rgb(0 0 0 / .35);
  transform: rotate(var(--tilt, 0deg));
  transition: transform var(--dur-slow) var(--ease-out);
}

/* Postikortin leveämpi alareunus */
.postcard .media-button::after {
  content: "";
  display: block;
  height: 28px;
}

.postcard img { aspect-ratio: 4 / 3; object-fit: cover; }
.postcard figcaption { margin-top: var(--space-4); }

.postcard-list li:nth-child(1) { --tilt: -2deg; }
.postcard-list li:nth-child(2) { --tilt: 1.5deg; }
.postcard-list li:nth-child(3) { --tilt: -1deg; }

@media (hover: hover) {
  .postcard .media-button:hover { transform: rotate(0deg) translateY(-4px); }
  .postcard .media-button:hover img { transform: none; }
}

@media (max-width: 767px) {
  .postcard-list { columns: 2; column-gap: var(--space-4); }
  .postcard .media-button { padding: 6px 6px 0; }
  .postcard .media-button::after { height: 18px; }

}

/* ---------- Matkalista: aamunkoitto ---------- */

.plan {
  position: relative;
  padding-block: var(--section-y) calc(var(--section-y) + 280px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--navy-950) 0%, #1b1550 45%, #4a1a5c 75%, #7a2160 100%);
}

.plan-inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-16);
  align-items: start;
}

.sunrise {
  position: absolute;
  left: 50%;
  bottom: -440px;
  width: 680px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sun), var(--orange) 45%, var(--pink) 80%);
  -webkit-mask:
    linear-gradient(#000 0 30%, transparent 30%),
    repeating-linear-gradient(#000 0 18px, transparent 18px 30px);
  mask:
    linear-gradient(#000 0 30%, transparent 30%),
    repeating-linear-gradient(#000 0 18px, transparent 18px 30px);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Delfiini hyppää auringon heijastuksesta sen yli. Vesiraja on kohdassa,
   jossa auringon raidat alkavat; sen alle jäävä osa rajataan pois. */
.dolphin-stage {
  --waterline: 36px;
  position: absolute;
  left: 50%;
  bottom: var(--waterline);
  width: 760px;
  height: 330px;
  transform: translateX(-50%);
  pointer-events: none;
}

.dolphin-clip { position: absolute; inset: 0; overflow: hidden; }

.dolphin {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 112px;
  margin-left: -56px;
  fill: var(--navy-950);
  opacity: 0;
  transform-origin: 50% 50%;
}

.splash {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 72px;
  height: 10px;
  margin-left: -36px;
  border: 2px solid rgb(255 255 255 / .8);
  border-radius: 50%;
  opacity: 0;
}

.plan-form { display: grid; gap: var(--space-8); }

.interests { margin: 0; padding: 0; border: 0; min-width: 0; }

.form-label {
  display: block;
  margin-bottom: var(--space-3);
  padding: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tags input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  border: 1px solid rgb(255 255 255 / .5);
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: border-color var(--dur-base), background-color var(--dur-base), color var(--dur-base);
}

.tag::before {
  content: "";
  display: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tag:hover { border-color: #ffffff; }

/* Valinta pinkki: keltainen jää toiminnoille */
.tags input:checked + .tag {
  border-color: var(--pink);
  background: var(--pink);
  color: var(--navy-950);
  padding-left: var(--space-4);
}

.tags input:checked + .tag::before { display: block; }

.tags input:focus-visible + .tag {
  outline: 2px solid var(--sun);
  outline-offset: 3px;
}


.tag-time {
  color: var(--fg-2);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tags input:checked + .tag .tag-time { color: var(--navy-900); }
.tag-alt { border-style: dashed; }
.tag-quiet { border-color: transparent; color: var(--fg-2); text-decoration: underline; text-underline-offset: 4px; }
.tags input:checked + .tag-quiet { border-color: rgb(255 255 255 / .5); background: transparent; color: #ffffff; text-decoration: none; }
.tags input:checked + .tag-alt { border-style: solid; }

/* Päiväohjelma */

.plan-tool { display: grid; gap: var(--space-10); }

.itinerary {
  padding: var(--space-8);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 18px 40px rgb(0 0 0 / .3);
}

.itinerary-title {
  margin-bottom: var(--space-6);
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.itinerary-title:focus { outline: none; }

.itinerary-list { margin: 0 0 var(--space-6); padding: 0; list-style: none; }

.itinerary-list li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-top: 1px solid rgb(0 24 60 / .14);
}

.itinerary-time {
  color: var(--pink-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.itinerary-place {
  display: block;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
}

.itinerary-place:visited { color: var(--ink); }
.itinerary-place:hover { color: var(--pink-ink); }

.itinerary-list p { margin: var(--space-1) 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }

.itinerary-alt .itinerary-time { color: var(--teal-ink); }

.itinerary-empty { margin: 0; color: var(--ink-2); }

.itinerary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.itinerary-actions[hidden],
.itinerary-list[hidden] { display: none; }

.button-line {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
  transition: background-color var(--dur-base), color var(--dur-base);
}

.itinerary-feedback { flex-basis: 100%; margin: 0; color: var(--teal-ink); font-size: 15px; }
.itinerary-feedback:empty { display: none; }

.itinerary .button:focus-visible { outline-color: var(--pink-ink); }

@media (max-width: 991px) {
  .plan-inner { grid-template-columns: 1fr; gap: var(--space-8); }
}

@media (max-width: 767px) {
  .itinerary .button { width: 100%; }
  .itinerary { padding: var(--space-6) var(--space-4); }
  .itinerary-list li { grid-template-columns: 1fr; gap: var(--space-1); }
  .sunrise { width: 440px; bottom: -270px; }
  .dolphin-stage { --waterline: 38px; width: 520px; height: 240px; }
  .dolphin { width: 80px; margin-left: -40px; }
  .splash { width: 52px; margin-left: -26px; }
  .plan { padding-bottom: calc(var(--section-y) + 240px); }
}

/* ---------- Footer ---------- */

.footer { padding-top: var(--space-20); }

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: var(--space-16);
  padding-bottom: var(--space-12);
}

.footer-brand img { width: 96px; height: 96px; margin-bottom: var(--space-4); }

.footer-heading {
  margin-bottom: var(--space-4);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.footer-nav { margin: 0; padding: 0; list-style: none; }

.footer-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  color: var(--fg);
  text-decoration: none;
}

.footer-alt a { color: var(--fg-2); }

.footer-nav a:hover,
.footer-nav a[aria-current="true"] { color: var(--accent-text); }

.footer-time {
  min-width: 3.6em;
  color: var(--accent-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.footer-credits p { font-size: 15px; line-height: 1.6; }
.footer-credits a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.footer-credits a:hover { color: var(--accent-text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: relative;
  padding-block: var(--space-4);
}

/* Viiva sisällön levyiseksi, ei wrapperin reunoihin asti */
.footer-bottom::before {
  content: "";
  position: absolute;
  inset: 0 var(--gutter) auto;
  border-top: 1px solid var(--line);
}

.footer-bottom p { margin: 0; font-size: 14px; }
.footer-bottom p a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom p a:hover { color: var(--pink-ink); }

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-6);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-pill);
  color: var(--fg);
  font-size: 15px;
  text-decoration: none;
  transition: background-color var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}

.top-link:hover { border-color: var(--sun); background: var(--sun); color: var(--navy-950); }

@media (max-width: 991px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: var(--space-10); }
  .footer-credits { grid-column: 1 / -1; }
}

@media (max-width: 479px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Ota mukaan, navigaatiopalkin tila, uudet kuvaryhmät ---------- */

.take-along {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-top: var(--space-6);
  padding: 0 var(--space-6);
  border: 1px solid var(--accent-text);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent-text);
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur-base), color var(--dur-base);
}

.take-along.is-on { background: var(--accent-text); color: var(--bg); }
.take-along.is-on::before { content: "✓"; }
.take-along:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.nav-current {
  margin: 0;
  color: var(--mist);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.nav-day {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid rgb(255 255 255 / .4);
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-size: 15px;
  text-decoration: none;
}

.nav-day[hidden] { display: none; }

/* Kielivalitsin: näyttää kielen, johon vaihdetaan */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid rgb(255 255 255 / .4);
  border-radius: var(--radius-pill);
  background: transparent;
  color: #ffffff;
  font: 600 14px/1 var(--font-head);
  letter-spacing: .08em;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}

.lang-toggle:hover { border-color: var(--sun); color: var(--sun); }

@media (max-width: 599px) {
  .lang-toggle { min-width: 40px; padding: 0; border-color: transparent; }
  .navigation { gap: var(--space-2); }
}

.nav-day-count { color: var(--pink); font-weight: 700; }

.plan-summary { color: var(--sun); font-weight: 600; }
.plan-summary[hidden] { display: none; }

.itinerary-check { margin: 0 0 var(--space-6); color: var(--ink-2); font-size: 14px; }
.itinerary-check[hidden] { display: none; }
.itinerary-note .itinerary-time { color: var(--ink-2); }
.itinerary-note .itinerary-place { font-size: 16px; color: var(--ink-2); }

.mural-side { display: grid; gap: var(--space-8); }

/* Leveä graffiti pysyy näkyvissä, kun korkea sivusarake vierii ohi */
@media (min-width: 992px) {
  .mural-after { align-items: start; }
  .mural-after > .media { position: sticky; top: calc(var(--nav-h) + var(--space-8)); }
}
.mural-side .media-arch img { aspect-ratio: 4 / 5; object-fit: cover; }

.night-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: end; }
.media-dusk img { aspect-ratio: 9 / 16; object-fit: cover; }

.postcard-tall img { aspect-ratio: 3 / 4; object-position: center bottom; }
.postcard-list li { break-inside: avoid; margin-bottom: var(--space-10); }
.postcard-list li:nth-child(4) { --tilt: 2deg; }
.postcard-list li:nth-child(5) { --tilt: -1.5deg; }
.postcard-list li:nth-child(6) { --tilt: 1deg; }

/* Työpöydällä luvut näkyvät suoraan palkissa, ja nykyinen luku korostuu niissä */
.nav-inline { display: none; }

@media (min-width: 992px) {
  .nav-inline { display: flex; gap: var(--space-6); margin-inline: auto; }
  .nav-inline a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    border-bottom: 2px solid transparent;
    color: #ffffff;
    font: 600 16px/1 var(--font-head);
    text-decoration: none;
    transition: border-color var(--dur-base);
  }
  .nav-inline a:hover,
  .nav-inline a[aria-current="true"] { border-bottom-color: var(--pink); }
  .nav-inline a:focus-visible { outline: 2px solid var(--sun); outline-offset: 4px; }
  .nav-inline-time { color: var(--mist); font: 400 13px/1 var(--font-body); font-variant-numeric: tabular-nums; }
  .nav-current { display: none; }
}

/* Puhelimella nykyinen luku näkyy palkissa ja lyhenee, jos tila loppuu */
@media (max-width: 991px) {
  .nav-current {
    flex: 1;
    min-width: 0;
    margin-inline: var(--space-2);
    overflow: hidden;
    font-size: 13px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .night-hero { padding-bottom: var(--space-6); }
  .night-body { padding-top: var(--space-6); }
}

@media (max-width: 767px) {
  .postcard-list li { margin-bottom: var(--space-6); }
}

@media print {
  .itinerary-check { display: block; }
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--space-16) var(--space-20) var(--space-10);
  border: 0;
  background: var(--navy-950);
  color: #ffffff;
  overscroll-behavior: contain;
}

.lightbox::backdrop { background: var(--navy-950); }

.lightbox[open] { display: flex; align-items: center; justify-content: center; }

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  touch-action: pan-y;
}

.lightbox-image {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 160px);
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-image.is-entering { animation: lightbox-in var(--dur-base) var(--ease-out); }

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(.98); }
}

.lightbox-caption {
  color: var(--mist);
  font-size: 15px;
  text-align: center;
}

.lightbox-close,
.lightbox-nav { position: fixed; width: 48px; height: 48px; }

.lightbox-close { top: var(--space-4); right: var(--space-4); }
.lightbox-prev { left: var(--space-4); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: var(--space-4); top: 50%; transform: translateY(-50%); }

@media (max-width: 767px) {
  .lightbox { padding: var(--space-16) var(--space-4) var(--space-20); }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: var(--space-4); transform: none; }
  .lightbox-prev { left: calc(50% - 60px); }
  .lightbox-next { right: calc(50% - 60px); }
}

/* ---------- Vähennetty liike ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }

  .hero-image img { animation: none; }
}

/* ---------- Tulostus: vain päiväohjelma ---------- */

@media print {
  @page { margin: 16mm; }

  body { background: #ffffff; }

  .skip-link,
  .nav-bar,
  .nav-wrapper,
  .footer,
  .lightbox,
  main > :not(.plan),
  .plan-intro,
  .plan-form,
  .sunrise,
  .dolphin-stage,
  .itinerary-actions { display: none !important; }

  .plan { padding: 0; background: none; overflow: visible; }
  .plan-inner,
  .plan-tool { display: block; padding: 0; }
  .itinerary { padding: 0; box-shadow: none; background: none; }
  .itinerary-list li { break-inside: avoid; }
}
