:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --brand: #1f4fd8;
  --red: #ff3b30;
  --green: #34c759;
  --green-text: #248a3d;
  --red-text: #d70015;
  --road: #3a3a3c;
  --house: #e8e8ed;
  --glass-bg: rgba(255, 255, 255, .72);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #101012;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #38383a;
    --brand: #4c7dff;
    --red: #ff453a;
    --green: #30d158;
    --green-text: #30d158;
    --red-text: #ff6961;
    --road: #2c2c2e;
    --house: #2a2a2d;
    --glass-bg: rgba(22, 22, 24, .72);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }
.center { text-align: center; }

/* Translucent header: content scrolls under it */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
nav { display: flex; gap: 18px; }
nav a { color: var(--muted); text-decoration: none; font-size: .8125rem; letter-spacing: .01em; }
nav a:hover { color: var(--text); }
@media (max-width: 420px) { .brand span { display: none; } }

/* Hero */
.hero { text-align: center; padding: 72px 16px 40px; }
.hero .icon { width: 112px; height: 112px; border-radius: 25px; margin: 0 auto 28px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: 1.04; letter-spacing: -0.035em; margin: 0 0 20px; font-weight: 700; }
.enkelt { display: block; margin-top: .2em; }
.lede { font-size: clamp(1.1875rem, 2.6vw, 1.5rem); line-height: 1.35; letter-spacing: -0.01em; color: var(--muted); margin: 0 auto 32px; max-width: 640px; }
.red { color: var(--red-text); font-weight: 600; }
.green { color: var(--green-text); font-weight: 600; }
.cta {
  display: inline-block; background: var(--text); color: var(--bg); text-decoration: none;
  font-weight: 600; padding: 14px 28px; border-radius: 999px;
}
.cta[aria-disabled="true"] { cursor: default; }
.small { font-size: .875rem; color: var(--muted); margin-top: 28px; }

/* Live demo */
.demo-wrap { padding: 8px 0 80px; }
.demo {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  padding: 20px 20px 16px; box-shadow: var(--shadow); text-align: center; overflow: hidden;
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 18px; padding: 0 20px; justify-content: safe center; mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; border: 0; background: var(--bg-2); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, transform 100ms ease-out;
}
.chips button[aria-checked="true"] { background: var(--text); color: var(--bg); }
.chips button:active, .stepper button:active:not(:disabled) { transform: scale(.95); }
.demo-meta { margin: 0; font-size: .8125rem; color: var(--muted); letter-spacing: .01em; }
.demo-answer { font-size: clamp(1.5rem, 4.5vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; margin: 4px 0 12px; text-wrap: balance; }

.street { width: 100%; max-width: 520px; margin: 0 auto; display: block; }
.street .houses rect { fill: var(--house); }
.street .nums text { fill: var(--muted); font-size: 13px; font-weight: 600; text-anchor: middle; }
.street .road { fill: var(--road); }
.street .mid { stroke: rgba(255,255,255,.55); stroke-width: 2; stroke-dasharray: 14 12; }
.street .lane { stroke: var(--green); stroke-width: 7; stroke-linecap: round; transition: stroke 300ms ease; }
.demo[data-banned="odd"] .lane.odd, .demo[data-banned="even"] .lane.even { stroke: var(--red); }
.street .car .body { fill: #fff; }
.street .car .glass { fill: #8e8e93; }
/* The car makes a U-turn into the other lane */
.street .car {
  transform-box: fill-box; transform-origin: center;
  transition: transform 700ms cubic-bezier(.45, 0, .2, 1);
}
.demo[data-car="odd"] .car { transform: translate(-60px, -60px) rotate(180deg); }

.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: .9375rem; font-weight: 500; }
.stepper span { min-width: 15ch; font-variant-numeric: tabular-nums; }
.stepper button {
  width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; background: var(--bg-2);
  display: grid; place-items: center; cursor: pointer; transition: transform 100ms ease-out, opacity 200ms;
}
.stepper button:disabled { opacity: .35; cursor: default; }

/* Rules demo: date-only vs. all bans */
.rules { max-width: 680px; margin: 0 auto; }
.rules .chips { margin-bottom: 14px; }
.rules .street { max-width: 600px; }
.rules .lane.banned { stroke: var(--red); }
.rules .cut {
  fill: var(--road); transform-box: fill-box; transform: scaleX(0);
  transition: transform 450ms cubic-bezier(.2, .8, .2, 1);
}
.rules .cut.l { transform-origin: left center; }
.rules .cut.r { transform-origin: right center; }
.rules .mark { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.5); transition: opacity 200ms ease, transform 300ms ease; }
.rules[data-mode="full"] .cut { transform: scaleX(1); }
.rules[data-mode="full"] .cut.ban { transition-delay: 150ms; }
.rules[data-mode="full"] .mark { opacity: 1; transform: scale(1); transition-delay: 350ms; }
.rules .num { fill: #fff; }
.rules text { fill: #1d1d1f; font-size: 13px; font-weight: 700; text-anchor: middle; }
.rules .sign { fill: #1f4fd8; stroke: #ff3b30; stroke-width: 3; }
.rules .sign-x { stroke: #ff3b30; stroke-width: 3; }
.legend { list-style: none; margin: 12px auto 4px; padding: 0; display: grid; gap: 8px; text-align: left; max-width: 460px; font-size: .9375rem; color: var(--muted); transition: opacity 300ms ease; }
.rules[data-mode="date"] .legend { opacity: .35; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend svg { flex: none; width: 22px; height: 22px; }
.legend svg.wide { width: 38px; }
.rules .mark text, .legend .wide text { font-size: 11px; }
.legend .num { stroke: var(--line); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); margin-top: 48px; }

/* Sections */
section { padding: 88px 0; }
section.alt { background: var(--bg-2); }
h2 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 36px; text-align: center; font-weight: 700; }
h2 + .lede { margin-top: -16px; margin-bottom: 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
section.alt .card { border-color: transparent; }
.card h3 { margin: 0 0 8px; font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.2; }
.card p { margin: 0; color: var(--muted); }

.soon { display: inline-block; vertical-align: middle; background: var(--bg-2); color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.cities .tonight { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text); font-size: .9375rem; font-weight: 500; }
.cities .tonight:empty { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; }
.dot.off { background: var(--muted); }

.prices { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.price { flex: 1 1 240px; max-width: 320px; text-align: center; padding: 32px 26px; }
.price.featured { border: 2px solid var(--green); }
.price .amount { font-size: 3rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; color: var(--text); margin: 4px 0; }
.badge { display: inline-block; background: var(--green); color: #000; font-size: .8125rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.badge.ghost { background: var(--bg-2); color: var(--muted); }

/* FAQ: grouped list, answers open smoothly where supported */
.faq { background: var(--card); border-radius: 22px; padding: 0 22px; }
details { border-bottom: 1px solid var(--line); }
details:last-child { border-bottom: 0; }
summary { cursor: pointer; font-weight: 600; padding: 18px 28px 18px 0; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform 250ms ease;
}
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
details p { margin: 0; padding: 0 0 18px; color: var(--muted); }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details::details-content { height: 0; overflow: clip; transition: height 300ms ease, content-visibility 300ms allow-discrete; }
  details[open]::details-content { height: auto; }
}

/* Text pages (integritet) */
.doc { padding: 56px 0 80px; }
.doc h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
.doc h2 { font-size: 1.5rem; letter-spacing: -0.015em; text-align: left; margin: 40px 0 8px; }
.doc p, .doc li { color: var(--text); }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: .8125rem; color: var(--muted); }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer .links a { color: var(--muted); }
footer p { margin: 12px 0 0; max-width: 680px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, details::details-content { transition-duration: 0s !important; }
}
@media (prefers-reduced-transparency: reduce) {
  header.top { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Emoji icon tiles on the feature cards */
.card .emoji { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-2); font-size: 1.5rem; line-height: 1; margin-bottom: 14px; }

/* Cards lift toward the pointer (not on touch, where hover sticks) */
@media (hover: hover) {
  .card { transition: transform 300ms cubic-bezier(.2, .8, .2, 1), box-shadow 300ms ease; }
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero arrives in order: icon, headline, text, button */
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
  .hero > * { animation: rise 600ms cubic-bezier(.2, .8, .2, 1) both; }
  .hero > :nth-child(2) { animation-delay: 80ms; }
  .hero > :nth-child(3) { animation-delay: 160ms; }
  .hero > :nth-child(4) { animation-delay: 240ms; }

  /* Cards and demos fade up as they scroll in (browsers without scroll timelines show them as-is) */
  @supports (animation-timeline: view()) {
    @keyframes reveal { from { opacity: 0; transform: translateY(24px) scale(.98); } }
    .card, .demo, .faq { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  }
}
