/* EsaRuta landing.
   Brand colours come from the logo (navy wordmark, blue pin, green route).
   Radius rule: cards 28px, phone 44px, every interactive control is a pill. */

@font-face {
  font-family: "Outfit";
  src: url("assets/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #edf1f6;
  --ink: #081441;
  --ink-2: #48515e;
  --line: #dee4ec;
  --brand: #0b65dd;
  --brand-ink: #0a55ba;
  --brand-tint: #e4edf7;
  --on-brand: #ffffff;
  --route: #19c57f;
  --net: #b3c0cf;
  --panel: #081441;
  --on-panel: #e8eef6;
  --shadow: 8 20 65;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 28px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light dark;
  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1117;
    --surface: #121a24;
    --surface-2: #1a2430;
    --ink: #e8eef6;
    --ink-2: #aeb9c6;
    --line: #26313d;
    --brand-ink: #7db3ff;
    --brand-tint: #16263a;
    --net: #2c3a4a;
    --panel: #0f1b3d;
    --shadow: 0 0 0;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 30;
  padding: 10px 16px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font: inherit; font-weight: 600; line-height: 1.2; white-space: nowrap;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.2s, box-shadow 0.25s var(--ease), border-color 0.2s;
}
.btn .ic { transition: transform 0.3s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand); color: var(--on-brand);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.2) inset, 0 8px 24px -10px rgb(11 101 221 / 0.6);
}
.btn-primary:hover { background: #0958c2; box-shadow: 0 1px 0 rgb(255 255 255 / 0.2) inset, 0 14px 32px -12px rgb(11 101 221 / 0.7); }

.btn-ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-2); }

.btn-sm { padding: 10px 18px; font-size: 0.95rem; }
.btn-lg { padding: 18px 30px; font-size: 1.125rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
}
.nav { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand img { height: 44px; width: auto; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 767px) {
  .nav { gap: 16px; height: 64px; }
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
  .brand img { height: 38px; }
}

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

.hero { padding-block: clamp(24px, 5vw, 64px) clamp(48px, 7vw, 96px); overflow: clip; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 1.05fr; align-items: center;
  gap: clamp(24px, 4vw, 64px); min-height: min(calc(100dvh - 72px - 96px), 680px);
}

.eyebrow {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-ink); margin-bottom: 20px;
}
.hero-title { font-size: clamp(3.25rem, 8.2vw, 6.5rem); line-height: 1; letter-spacing: -0.045em; font-weight: 750; }
.hero-title .line { display: block; overflow: clip; padding-bottom: 0.08em; }
.hero-title .line > span { display: block; }
.hero-title em { font-style: normal; color: var(--brand); }
.hero-sub { margin-top: 24px; max-width: 34ch; font-size: clamp(1.125rem, 1.6vw, 1.3rem); color: var(--ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-stage { position: relative; display: grid; align-items: center; justify-items: start; min-height: 600px; }

/* Network sits to the right of the phone so both pins stay visible. */
.net { position: absolute; top: 50%; left: 22%; width: 100%; height: auto; translate: 0 -50%; overflow: hidden; }
.net path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.net-base path { stroke: var(--net); stroke-width: 2.2; }
.net-hero { stroke: var(--route); stroke-width: 6; }
.net-pin { stroke: var(--bg); stroke-width: 4; transform-box: fill-box; transform-origin: center; }
.net-pin-a { fill: var(--brand); }
.net-pin-b { fill: #c0392b; }

.phone {
  margin: 0; position: relative;
  border-radius: 44px; padding: 10px;
  background: #0d1420;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.06) inset,
    0 40px 80px -30px rgb(var(--shadow) / 0.45),
    0 16px 32px -16px rgb(var(--shadow) / 0.3);
}
.phone img { border-radius: 34px; width: 100%; }
.hero-phone { width: clamp(230px, 20vw, 290px); }

@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-stage { min-height: 0; padding-block: 24px; }
  .net { left: 30%; width: 90%; }
  .hero-phone { width: min(240px, 58vw); }
}

/* ---------- Places marquee ---------- */

.places { padding-block: 16px 24px; border-block: 1px solid var(--line); background: var(--surface); }
.places-title { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); text-align: center; margin-block: 12px 20px; }
.marquee {
  display: flex; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; flex: none; gap: 12px; padding-right: 12px; }
.marquee-track li {
  padding: 10px 20px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); font-weight: 500;
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(72px, 10vw, 144px); }
.section-title { font-size: clamp(2.25rem, 5vw, 4rem); letter-spacing: -0.035em; max-width: 18ch; }

/* ---------- Steps ---------- */

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin-top: 48px; }
.steps-phone-col { position: relative; }
.steps-phone { position: sticky; top: max(96px, calc(50dvh - 340px)); width: min(300px, 100%, calc((100dvh - 120px) * 0.45)); margin-inline: auto; }
.steps-phone .shot { display: block; }
.steps-phone .shot + .shot { position: absolute; inset: 10px; }
.steps-phone .shot img { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.steps-phone .shot:not(:first-child) img { opacity: 0; transform: scale(0.98); }
.steps-phone[data-active="2"] .shot:first-child img,
.steps-phone[data-active="3"] .shot:first-child img { opacity: 0; }
.steps-phone[data-active="2"] [data-shot="2"] img,
.steps-phone[data-active="3"] [data-shot="3"] img { opacity: 1; transform: none; }

.steps-list { display: grid; }
.steps-section { padding-bottom: clamp(24px, 4vw, 48px); }
.step { min-height: 72dvh; display: flex; flex-direction: column; justify-content: center; gap: 16px; transition: opacity 0.5s var(--ease); }
.steps[data-enhanced] .step:not(.is-active) { opacity: 0.32; }
.step-ic {
  width: 52px; height: 52px; padding: 13px; border-radius: 999px;
  fill: var(--brand); background: var(--brand-tint);
}
.step h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.step p { color: var(--ink-2); max-width: 36ch; font-size: 1.15rem; }
.step-inline { display: none; }

@media (max-width: 899px) {
  .steps { grid-template-columns: 1fr; margin-top: 24px; }
  .steps-phone-col { display: none; }
  .step { min-height: 0; padding-block: 40px; }
  .steps[data-enhanced] .step:not(.is-active) { opacity: 1; }
  .step-inline { display: block; width: min(260px, 72vw); margin-top: 16px; }
}

/* ---------- Bento ---------- */

.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 48px; }
.cell {
  position: relative; overflow: hidden; border-radius: var(--radius);
  padding: clamp(24px, 3vw, 40px); background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.cell h3 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
.cell p { color: var(--ink-2); max-width: 42ch; }
.cell-ic { width: 28px; height: 28px; fill: var(--brand); margin-bottom: 8px; }

.cell-routes { grid-column: span 7; background: var(--panel); color: var(--on-panel); border-color: transparent; }
.cell-routes p { color: rgb(232 238 246 / 0.72); }
.cell-routes .cell-ic { fill: var(--route); }
.cell-routes .big { display: block; font-size: clamp(4.5rem, 10vw, 8rem); line-height: 0.9; letter-spacing: -0.05em; color: var(--route); }
.codes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 24px; }
.codes li {
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  font-variant-numeric: tabular-nums; background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.12);
}

.cell-fare { grid-column: span 5; background: var(--brand-tint); border-color: transparent; }
.cell .fare { font-size: clamp(4rem, 8vw, 6.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.05em; color: var(--ink); font-variant-numeric: tabular-nums; margin-block: auto 8px; padding-top: 24px; display: flex; overflow: clip; }
.fare-sign { font-size: 0.5em; margin-top: 0.15em; margin-right: 0.08em; color: var(--brand-ink); }
.fare [data-fare-value] { display: inline-block; }
.toggle { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); align-self: flex-start; }
.toggle button {
  font: inherit; font-weight: 500; font-size: 0.95rem; color: var(--ink-2);
  padding: 8px 16px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s;
}
.toggle button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.toggle button:active { transform: scale(0.97); }
.fine { font-size: 0.9rem; }

.cell-routine { grid-column: span 6; }
.week { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.week span {
  min-width: 48px; text-align: center; padding: 8px 10px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line);
}
.week .on { background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }
.cell .calc {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px;
  margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line);
  max-width: none; font-size: 0.95rem;
}
.calc strong { font-size: 1.6rem; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.cell-transfer, .cell-saved { grid-column: span 3; background: var(--surface-2); border-color: transparent; }

@media (max-width: 1023px) {
  .cell-routes, .cell-fare, .cell-routine { grid-column: span 12; }
  .cell-transfer, .cell-saved { grid-column: span 6; }
}
@media (max-width: 599px) {
  .cell-transfer, .cell-saved { grid-column: span 12; }
}

/* ---------- Manifesto ---------- */

.manifesto { text-align: center; }
.manifesto-text { font-size: clamp(1.9rem, 4.6vw, 3.75rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; max-width: 24ch; margin-inline: auto; }
.manifesto-text span { display: inline; }
.manifesto-text span:first-child { color: var(--brand-ink); }

/* ---------- FAQ ---------- */

.faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(24px, 6vw, 96px); align-items: start; }
.faq-title { position: sticky; top: 112px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding-block: 24px; cursor: pointer; list-style: none;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem); font-weight: 600; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic {
  width: 36px; height: 36px; padding: 9px; border-radius: 999px; background: var(--surface-2);
  transition: transform 0.4s var(--ease), background-color 0.2s;
}
.faq summary:hover .ic { background: var(--brand-tint); }
.faq details[open] summary .ic { transform: rotate(45deg); background: var(--brand); fill: var(--on-brand); }
.faq details p { padding-bottom: 24px; color: var(--ink-2); max-width: 60ch; }
@media (max-width: 899px) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-title { position: static; }
}

/* ---------- Closing ---------- */

.closing { padding-top: 0; }
.closing-card {
  position: relative; overflow: hidden; text-align: center;
  border-radius: calc(var(--radius) + 8px); padding: clamp(56px, 9vw, 120px) var(--gutter);
  background:
    radial-gradient(60% 80% at 85% 110%, rgb(25 197 127 / 0.28), transparent 70%),
    radial-gradient(50% 70% at 10% -10%, rgb(11 101 221 / 0.45), transparent 70%),
    var(--panel);
  color: var(--on-panel);
}
.closing-card h2 { font-size: clamp(2.5rem, 7vw, 5.5rem); letter-spacing: -0.045em; }
.closing-card p { margin: 16px auto 36px; color: rgb(232 238 246 / 0.75); font-size: 1.2rem; }

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

.site-footer { padding-block: 48px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 24px 48px; }
.footer-logo { height: 48px; width: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; justify-self: end; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }
.footer-note { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.95rem; }
.footer-note a { color: var(--brand-ink); }
@media (max-width: 599px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-self: start; }
}

/* ---------- Motion (all of it opt-out under reduced motion) ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; translate: 0 24px; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.25); } }
@keyframes phone-in { from { opacity: 0; translate: 0 64px; rotate: 4deg; } }
@keyframes marquee { to { transform: translateX(-100%); } }
@keyframes solidify { to { border-bottom-color: var(--line); } }
@keyframes brighten { from { opacity: 0.18; } }

@media (prefers-reduced-motion: no-preference) {
  /* Hero choreography: title, copy, network, highlighted route, pins, phone. */
  .hero-title .line > span { animation: rise 1s var(--ease) both; }
  .hero-title .line:nth-child(2) > span { animation-delay: 0.08s; }
  .eyebrow, .hero-sub, .hero-cta { animation: fade-up 0.9s var(--ease) both; }
  .eyebrow { animation-delay: 0s; }
  .hero-sub { animation-delay: 0.2s; }
  .hero-cta { animation-delay: 0.3s; }

  .net path { stroke-dasharray: 1; }
  .net-base path { animation: draw 2.4s var(--ease) both; }
  .net-base path:nth-child(4n + 2) { animation-delay: 0.15s; }
  .net-base path:nth-child(4n + 3) { animation-delay: 0.3s; }
  .net-base path:nth-child(4n + 4) { animation-delay: 0.45s; }
  .net-hero { animation: draw 1.8s cubic-bezier(0.65, 0, 0.35, 1) 1s both; }
  .net-pin { animation: pop 0.6s var(--ease) both; }
  .net-pin-a { animation-delay: 0.9s; }
  .net-pin-b { animation-delay: 2.7s; }
  .hero-phone { animation: phone-in 1.2s var(--ease) 0.35s both; }

  .marquee-track { animation: marquee 60s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }

  .faq details::details-content {
    block-size: 0; overflow: clip;
    transition: block-size 0.45s var(--ease), content-visibility 0.45s allow-discrete;
  }
  .faq details[open]::details-content { block-size: auto; }

  @supports (animation-timeline: view()) {
    .site-header { animation: solidify linear both; animation-timeline: scroll(); animation-range: 0 120px; }

    .reveal { animation: fade-up linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    .bento .reveal:nth-child(even) { animation-range: entry 10% entry 50%; }

    .manifesto-text span { animation: brighten linear both; animation-timeline: view(); }
    .manifesto-text span:nth-child(1) { animation-range: cover 10% cover 30%; }
    .manifesto-text span:nth-child(2) { animation-range: cover 20% cover 40%; }
    .manifesto-text span:nth-child(3) { animation-range: cover 30% cover 50%; }
  }
}

@media not (prefers-reduced-motion: no-preference) {
  .marquee { mask-image: none; }
  .marquee-track { flex-wrap: wrap; justify-content: center; flex: 1; padding-inline: var(--gutter); }
  .marquee-track[aria-hidden] { display: none; }
}

@supports not (animation-timeline: scroll()) {
  .site-header { border-bottom-color: var(--line); }
}
