/* ============================================================
   Parkcast — shared styles
   Powers the marketing landings (en / fi / sv) and the
   legal pages (terms / privacy). Legal page markup is left
   untouched; it is styled here via the base element rules.
   ============================================================ */

:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --text: #101a24;
  --muted: #566275;
  --border: #e2e7f0;
  --surface: #ffffff;
  --surface-2: #f0f3f9;

  --brand: #1f8fe6;
  --brand-2: #6a3cf0;
  --accent: #c930e0;
  --brand-ink: #0f6dc0;
  --good: #22c55e;
  --mid: #e6a11e;
  --full: #e0473a;
  --accent-soft: #e3eef9;

  --grad: linear-gradient(135deg, #2aa7ef 0%, #3f7bee 52%, #8a34e6 100%);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -28px rgba(24, 45, 92, 0.45);
  --shadow-sm: 0 10px 30px -18px rgba(24, 45, 92, 0.4);
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f16;
    --bg-elev: #121826;
    --text: #eaf0f8;
    --muted: #9aa7bd;
    --border: #232c3e;
    --surface: #141b29;
    --surface-2: #0f1521;

    --brand: #4fb0f2;
    --brand-2: #9a70f6;
    --accent: #e267f0;
    --brand-ink: #7cc4f7;
    --accent-soft: #16273a;
    --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.75);
    --shadow-sm: 0 12px 34px -20px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; }

/* ------------------------------------------------------------
   Legal / reading pages (terms, privacy) — narrow column
   ------------------------------------------------------------ */
body:not(.home) main {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

body:not(.home) main > nav {
  font-size: 0.95rem;
  margin-bottom: 28px;
  color: var(--muted);
}

body:not(.home) header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

body:not(.home) h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 2.8rem); }
body:not(.home) h2 { margin: 40px 0 10px; font-size: 1.3rem; }
body:not(.home) p,
body:not(.home) li { color: var(--muted); }
body:not(.home) ul { padding-left: 22px; margin: 0 0 16px; }
.meta { color: var(--muted); margin: 0; }

/* Language redirect splash (root index.html) */
.landing {
  width: min(560px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 22vh;
  text-align: center;
}
.landing h1 { font-size: clamp(2.4rem, 8vw, 3.6rem); margin: 0 0 10px; }
.landing .links { justify-content: center; }

/* ------------------------------------------------------------
   Shared layout helpers
   ------------------------------------------------------------ */
.wrap { width: min(var(--maxw), calc(100% - 44px)); margin-inline: auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  padding: 6px 14px; border-radius: 999px;
}
.eyebrow svg { width: 14px; height: 14px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 12px; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }

/* ------------------------------------------------------------
   Official App Store badge
   Apple-provided artwork, used unmodified. Guidelines:
   https://developer.apple.com/app-store/marketing/guidelines/
   - Never recreate, angle, animate or recolor the badge.
   - Height >= 40px; keep clear space >= 1/4 of the badge height
     free of other elements (handled via surrounding margins).
   ------------------------------------------------------------ */
.appstore-badge {
  display: inline-block; line-height: 0;
  /* clear space: badge renders at 52px tall -> >= 13px on all sides */
  margin: 13px 13px 13px 0;
  border-radius: 8px;
}
.appstore-badge img { height: 52px; width: auto; display: block; }
.appstore-badge:focus-visible { outline: 3px solid var(--brand); outline-offset: 6px; }

.hint { color: var(--muted); font-size: 0.9rem; margin: 14px 0 0; }

/* ------------------------------------------------------------
   Site header (landing)
   ------------------------------------------------------------ */
.home { overflow-x: hidden; }
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.brand picture { display: inline-flex; }

.lang-switch { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.lang-switch a { font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 999px; }
.lang-switch a:hover { text-decoration: none; color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.lang-switch a[aria-current="true"]:hover { color: #fff; }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; z-index: 0; pointer-events: none;
}
.hero::before { width: 640px; height: 640px; top: -280px; right: -160px; background: radial-gradient(circle, #8a34e6, transparent 70%); }
.hero::after { width: 560px; height: 560px; bottom: -320px; left: -200px; background: radial-gradient(circle, #2aa7ef, transparent 70%); }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }

.hero-copy h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); margin: 18px 0 18px; }
.hero-copy .lead { font-size: clamp(1.08rem, 2vw, 1.3rem); color: var(--muted); margin: 0 0 28px; max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* Gradient accent on a keyword */
.grad-text { background: linear-gradient(120deg, var(--brand) 0%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------
   App preview device
   ------------------------------------------------------------ */
/* Device — official Apple iPhone 16 Pro frame (light: white titanium, dark: black
   titanium) overlaid on the screen layer. Screen cutout measured from the frame PNG.
   Replace .device-screen contents with a real app screenshot before launch. */
.device { position: relative; justify-self: center; width: min(300px, 80vw); aspect-ratio: 1350 / 2760; }
.device-frame { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.device-frame img { width: 100%; height: 100%; display: block; }
.device-screen {
  position: absolute; z-index: 1; overflow: hidden;
  top: 2.5%; bottom: 2.54%; left: 5.33%; right: 5.41%;
  border-radius: 7% / 3.4%; background: #0c1220;
}

/* Hero screenshot carousel */
.hero-media { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.carousel { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; }
.carousel.is-dragging { cursor: grabbing; }
.carousel-track { display: flex; height: 100%; will-change: transform; transition: transform .55s cubic-bezier(.4, 0, .2, 1); }
.carousel-track .slide { min-width: 100%; width: 100%; height: 100%; }
.carousel-track img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.dots { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px; background: var(--border); cursor: pointer; transition: width .3s ease, background .3s ease; }
.dot.active { width: 22px; background: var(--brand); }
.dot:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (min-width: 900px) { .hero-media { margin-top: -28px; } }

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--border); }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.feature .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, var(--surface)); margin-bottom: 18px; }
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.16rem; margin: 0 0 8px; }
.feature p { color: var(--muted); margin: 0; font-size: 0.98rem; }

/* Steps — numbered cards (01 / 02 / 03 via CSS counter) */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.step { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px 22px; }
.step::before { content: counter(step, decimal-leading-zero); display: block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.1rem; margin: 0 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: 0.93rem; }

/* Coverage band — accent-soft panel with language pills */
.coverage { padding-block: 0; }
.coverage .wrap { background: var(--accent-soft); border-radius: 26px; padding: 44px clamp(24px, 5vw, 56px); }
.coverage h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 10px; }
.coverage p { color: var(--muted); margin: 0; max-width: 42rem; }
.coverage .flags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.coverage .flags li { font-size: 0.85rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }

/* Final CTA */
.cta-final { text-align: center; }
.cta-final .panel {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: #fff; border-radius: 28px;
  padding: clamp(40px, 6vw, 72px) 28px; box-shadow: var(--shadow);
}
.cta-final h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; color: #fff; }
.cta-final p { color: rgba(255,255,255,0.9); margin: 0 auto 22px; max-width: 46ch; font-size: 1.08rem; }
.cta-final .appstore-badge { margin: 0; }

/* ------------------------------------------------------------
   Footer (landing)
   ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer .brand { font-size: 1rem; margin-bottom: 10px; }
.site-footer .f-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer .f-links a { color: var(--muted); }
.site-footer .f-links a:hover { color: var(--text); }
.site-footer .f-legal { max-width: 42ch; }
.legal-note { flex-basis: 100%; margin: 4px 0 0; font-size: 0.72rem; line-height: 1.6; color: var(--muted); opacity: 0.8; text-align: left; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .lead { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .eyebrow { margin-inline: auto; }
  .hero-media { grid-row: 1; margin-top: 0; margin-bottom: 8px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .coverage .wrap { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
  .site-header .brand span { display: none; }
  .lang-switch a { padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
