/* INTERVAL landing page. Shares tokens, base and the map component with the
   app; nothing heavy is loaded (no map library, no frameworks). */
@layer tokens, base, components, landing;
@import url('tokens.css') layer(tokens);
@import url('breakpoints.css') layer(tokens);
@import url('base.css') layer(base);
@import url('components/badge.css') layer(components);
@import url('components/map.css') layer(components);

@layer landing {
  body.landing { background: var(--paper); }
  .termini { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: 0.4em; }
  .termini__sep { color: var(--ink-3); stroke-width: 2; flex: 0 0 auto; }

  /* ---------- nav ---------- */
  .l-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--s-4);
    height: calc(64px + var(--safe-top));
    padding: var(--safe-top) var(--gutter) 0;
    background: color-mix(in srgb, var(--chrome) 94%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--chrome-ink);
  }
  .l-nav__brand { color: var(--chrome-ink); display: inline-flex; min-height: 44px; align-items: center; }
  .l-nav__brand interval-logo { height: 18px; }
  .l-nav__links { display: none; gap: var(--s-6); margin-left: var(--s-6); }
  .l-nav__links a { color: var(--chrome-ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500; }
  .l-nav__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
  .l-lang { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--chrome-2); }
  .l-lang button { min-width: 38px; height: 34px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--chrome-ink-2); font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.04em; }
  .l-lang button[aria-pressed='true'] { background: var(--chrome-ink); color: var(--chrome); }
  .l-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--chrome-ink-2); }
  @media (min-width: 900px) { .l-nav__links { display: flex; } }
  @media (max-width: 479px) { .l-nav .l-btn { display: none; } }
  @media (hover: hover) and (pointer: fine) {
    .l-nav__links a:hover, .l-icon:hover { color: var(--chrome-ink); }
  }

  /* ---------- buttons ---------- */
  .l-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 var(--s-5);
    border-radius: var(--r-pill);
    font-weight: 650;
    font-size: var(--t-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--d-1) var(--ease-out), background var(--d-1), color var(--d-1);
  }
  .l-btn:active { transform: translateY(1px); }
  .l-btn--light { background: var(--chrome-ink); color: var(--chrome); }
  .l-btn--ghost { color: var(--chrome-ink); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28); }
  @media (hover: hover) and (pointer: fine) {
    .l-btn--light:hover { background: #fff; }
    .l-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7); }
  }

  /* ---------- hero ---------- */
  .l-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-8);
    padding: var(--s-10) var(--gutter) var(--s-12);
    background: var(--chrome);
    color: var(--chrome-ink);
    overflow: hidden;
  }
  .l-eyebrow { font-size: var(--t-xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--chrome-ink-2); }
  .l-hero h1 { margin-top: var(--s-4); font-size: var(--t-3xl); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; max-width: 11ch; }
  .l-lede { margin-top: var(--s-5); max-width: 46ch; font-size: var(--t-md); line-height: 1.5; color: var(--chrome-ink-2); }
  .l-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); }
  .l-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(90deg, var(--line-L1, transparent) 0 10%, var(--line-L2, transparent) 10% 20%, var(--line-L3, transparent) 20% 30%, var(--line-L4, transparent) 30% 40%, var(--line-L5, transparent) 40% 50%, var(--line-L6, transparent) 50% 60%, var(--line-L7, transparent) 60% 70%, var(--line-L8, transparent) 70% 80%, var(--line-L9, transparent) 80% 90%, var(--line-L10, transparent) 90% 100%); }

  /* hero showcase: floating live cards, no map */
  .l-showcase { position: relative; min-height: 460px; width: 100%; max-width: 560px; justify-self: center; }

  .l-card {
    position: absolute;
    z-index: 2;
    width: min(320px, 82%);
    padding: var(--s-4);
    border-radius: var(--r-3);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    opacity: 0;
    animation: l-card-in 0.7s var(--ease-out) forwards, l-float 6s ease-in-out infinite;
  }
  .l-card--a { left: 0; top: 4%; animation-delay: 0.2s, 1s; z-index: 3; }
  .l-card--b { right: 0; top: 42%; animation-delay: 0.45s, 1.8s; }
  .l-card--c { left: 8%; bottom: 0; animation-delay: 0.7s, 2.6s; z-index: 1; }
  .l-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
  .l-card .status-pill { height: 20px; }
  @keyframes l-card-in { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
  @keyframes l-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
  .l-card__eyebrow { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--t-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-2); }
  .l-card__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-2); min-height: 32px; font-size: var(--t-sm); }
  .l-card__row strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .l-card__time { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
  .l-card__big { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .l-card__legs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: var(--s-2); }
  .l-card__walk { font-size: var(--t-xs); color: var(--ink-3); padding: 0 4px; }
  .l-card__dur { margin-left: auto; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
  .l-card__empty { font-size: var(--t-sm); color: var(--ink-2); }

  /* marquee of interchange stations */
  .l-marquee { overflow: hidden; background: var(--surface); border-bottom: var(--hairline) solid var(--rule); }
  .l-marquee__track { display: flex; width: max-content; gap: var(--s-10); padding: var(--s-5) 0; animation: l-marquee 60s linear infinite; }
  .l-marquee__item { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-weight: 600; font-size: var(--t-md); white-space: nowrap; }
  @keyframes l-marquee { to { transform: translateX(-50%); } }

  /* staggered reveal */
  .l-reveal { opacity: 0; translate: 0 24px; transition: opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out); }
  .l-reveal.is-in { opacity: 1; translate: 0 0; }
  .l-how li.l-reveal:nth-child(2), .l-lines li.l-reveal:nth-child(2n) { transition-delay: 0.08s; }
  .l-how li.l-reveal:nth-child(3) { transition-delay: 0.16s; }
  .l-how li.l-reveal:nth-child(4) { transition-delay: 0.24s; }

  @media (prefers-reduced-motion: reduce) {
    .l-card { opacity: 1; animation: none; }
    .l-marquee__track { animation: none; }
  }

  @media (min-width: 768px) {
    .l-hero { padding-top: var(--s-16); padding-bottom: var(--s-16); }
  }
  @media (min-width: 1024px) {
    .l-hero { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: var(--s-12); min-height: calc(100dvh - 64px); }
  }
  @media (min-width: 1536px) {
    .l-hero { padding-left: max(var(--gutter), calc((100vw - 1440px) / 2)); padding-right: max(var(--gutter), calc((100vw - 1440px) / 2)); }
  }
  @media (max-height: 500px) and (orientation: landscape) and (min-width: 560px) {
    .l-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-top: var(--s-6); }
    .l-hero h1 { font-size: var(--t-2xl); }
  }

  /* ---------- sections ---------- */
  .l-section { padding: var(--s-16) var(--gutter); max-width: 1440px; margin: 0 auto; }
  .l-section h2 { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; max-width: 16ch; }
  .l-section__head { display: grid; gap: var(--s-4); margin-bottom: var(--s-10); }
  .l-section__head p, .l-section > div > p { color: var(--ink-2); font-size: var(--t-md); max-width: 52ch; }
  .l-how { list-style: none; margin: var(--s-10) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .l-how li { padding: var(--s-6); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-card); }
  .l-how__n { display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .l-how h3 { margin-top: var(--s-8); font-size: var(--t-lg); font-weight: 700; }
  .l-how p { margin-top: var(--s-2); color: var(--ink-2); }
  @media (min-width: 600px) { .l-how { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1280px) { .l-how { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

  .l-how li { display: flex; flex-direction: column; }
  .l-widget { margin-top: auto; padding-top: var(--s-6); }
  .l-widget:empty { display: none; }
  .l-widget__card { padding: var(--s-4); border-radius: var(--r-2); background: var(--surface-2); font-size: var(--t-sm); display: grid; gap: var(--s-2); }
  .l-widget__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-2); align-items: center; }
  .l-widget__row strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .l-widget__time { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
  .l-widget__meta { font-size: var(--t-2xs); color: var(--ink-3); }
  .l-widget__badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .l-widget__big { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .l-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-radius: var(--r-3); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-card); }
  .l-lines li a { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: var(--s-4); min-height: 76px; padding: var(--s-3) var(--s-5); color: inherit; text-decoration: none; border-top: var(--hairline) solid var(--rule); }
  .l-lines li:first-child a { border-top: 0; }
  .l-lines strong { font-family: var(--font-display); font-size: var(--t-md); letter-spacing: -0.01em; }
  .l-lines small { display: block; color: var(--ink-3); font-size: var(--t-xs); margin-top: 2px; }
  .l-lines .l-lines__mode { font-size: var(--t-xs); color: var(--ink-3); }
  @media (min-width: 900px) {
    .l-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .l-lines li:nth-child(2) a { border-top: 0; }
    .l-lines li:nth-child(odd) a { border-right: var(--hairline) solid var(--rule); }
  }
  @media (hover: hover) and (pointer: fine) { .l-lines li a:hover { background: var(--surface-2); } }

  .l-data { margin: 0; display: grid; gap: 0; border-radius: var(--r-3); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-card); }
  .l-data > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); padding: var(--s-5); border-top: var(--hairline) solid var(--rule); }
  .l-data > div:first-child { border-top: 0; }
  .l-data dt { font-weight: 650; }
  .l-data dd { margin: 0; display: flex; gap: var(--s-2); align-items: baseline; color: var(--ink-2); }
  .l-data dd { align-items: center; }
  .l-tag { flex: 0 0 auto; color: var(--ink-2); }
  .l-tag[data-kind='official'] { color: var(--positive); }
  .l-tag[data-kind='none'] { color: var(--critical); }
  @media (min-width: 768px) { .l-data > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s-8); } }

  .l-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-12); }
  .l-split > div > p { margin-top: var(--s-4); }
  .l-strong { font-weight: 700; color: var(--ink) !important; }
  @media (min-width: 900px) { .l-split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

  .l-official { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s-5); padding: 6px 12px; border-radius: var(--r-pill); background: var(--chrome-2); color: var(--chrome-ink-2); font-size: var(--t-xs); font-weight: 600; }
  .l-official__icon { flex: 0 0 auto; color: var(--count-badge); }
  .l-btn--dark { background: var(--chrome); color: var(--chrome-ink); }
  .l-btn--outline { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
  .l-account { display: grid; gap: var(--s-6); align-items: center; padding: var(--s-10); margin-top: var(--s-4); margin-bottom: var(--s-16); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow-card); }
  .l-account p { margin-top: var(--s-3); color: var(--ink-2); font-size: var(--t-md); max-width: 52ch; }
  .l-account__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
  @media (min-width: 900px) { .l-account { grid-template-columns: minmax(0, 1fr) auto; margin-left: var(--gutter); margin-right: var(--gutter); } }
  @media (min-width: 1488px) { .l-account { margin-left: auto; margin-right: auto; max-width: calc(1440px - 2 * var(--gutter)); } }
  @media (max-width: 899px) { .l-account { margin-left: var(--gutter); margin-right: var(--gutter); padding: var(--s-6); } }
  @media (max-width: 639px) { .l-nav .l-auth { display: none; } }
  .l-foot__notice { color: var(--chrome-ink); font-weight: 600; }
  .l-foot__contact { margin-top: var(--s-2); }
  .l-foot__contact a { min-height: 0; display: inline; text-decoration: underline; text-underline-offset: 0.2em; }

  /* ---------- footer ---------- */
  .l-foot { padding: var(--s-12) var(--gutter) calc(var(--s-12) + var(--safe-bottom)); background: var(--chrome); color: var(--chrome-ink-2); font-size: var(--t-sm); }
  .l-foot__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-6); margin-bottom: var(--s-8); color: var(--chrome-ink); }
  .l-foot__top interval-logo { height: 18px; }
  .l-foot nav { display: flex; flex-wrap: wrap; gap: var(--s-6); }
  .l-foot a { color: var(--chrome-ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
  .l-foot__small { margin-top: var(--s-3); font-size: var(--t-xs); opacity: 0.8; }

  @media (pointer: coarse) {
    .l-lang button { min-width: 44px; height: 44px; }
    .l-nav__links a { min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; }
  }

  @media print {
    .l-nav, .l-showcase, .l-ctas, .l-marquee { display: none; }
    .l-hero, .l-foot { background: #fff; color: #000; }
  }
}
