/* Nuvella home page. Brand: evergreen + ivory + sage, terracotta only as decoration (docs/BRAND.md).
   Safe green / warning / danger appear ONLY inside the map illustration, where they carry meaning. */
:root {
  --ivory: #F4F1E9; --paper: #FBF9F4; --ink: #192C29; --muted: #4E5F5B; --sage: #DCE5D4;
  --rule: #D6DDCF; --evergreen: #192C29; --terracotta: #C87650; --bronze: #9C6B3F;
  --safe: #1FB979; --risk: #E5484D; --lamp: #F6D98B;
  --map-ground: #E9EDDF; --map-street: #FFFFFF; --map-street-edge: #D3DBC9; --map-campus: #CFDDBF;
  --focus: #0B6E5C;
  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', sans-serif;
  --body: 'Instrument Sans', -apple-system, 'Segoe UI', sans-serif;
  --step: clamp(1rem, .96rem + .2vw, 1.125rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ivory: #101C1A; --paper: #162522; --ink: #F4F1E9; --muted: #B7C4BF; --sage: #25403B;
    --rule: #2C4540; --focus: #7FD6BF;
    --map-ground: #1B2F2B; --map-street: #2C4640; --map-street-edge: #355650; --map-campus: #284A3F;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 400 var(--step)/1.6 var(--body); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.04; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 5.4rem); font-variation-settings: 'opsz' 96; }
h2 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.3rem); }
h3 { font-size: 1.3rem; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; }
.kicker { font: 600 .78rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ivory) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.35rem/1 var(--display); letter-spacing: -.02em; }
.nav ul { display: flex; gap: 26px; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: .95rem; }
.nav ul a { text-decoration: none; color: var(--muted); }
.nav ul a:hover { color: var(--ink); }
.btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 600 1rem/1 var(--body); text-decoration: none; border: 2px solid var(--evergreen); background: var(--evergreen); color: var(--ivory); transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 -4px color-mix(in srgb, var(--ink) 25%, transparent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { background: var(--ink); color: #192C29; border-color: var(--ink); } :root:not([data-theme="light"]) .btn.ghost { background: transparent; color: var(--ink); } }
.nav .btn { min-height: 40px; padding: 0 18px; font-size: .92rem; }
@media (max-width: 760px) { .nav ul { display: none; } .nav .btn { margin-left: auto; } }

/* Hero */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 7vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 em { font-style: normal; color: var(--terracotta); }
.hero .lede { margin-top: 24px; max-width: 34em; color: var(--muted); font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pilot-note { margin-top: 20px; font-size: .92rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--safe); box-shadow: 0 0 0 4px color-mix(in srgb, var(--safe) 25%, transparent); flex: none; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }
.hero .wrap > * { min-width: 0; }

/* The route illustration */
.route-card { max-width: 100%; background: var(--paper); border: 1px solid var(--rule); border-radius: 28px; padding: 14px; box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--ink) 35%, transparent); }
.route-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 14px; }
.seg { display: inline-flex; background: var(--sage); border-radius: 999px; padding: 4px; }
.seg button { font: 600 .85rem/1 var(--body); min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--evergreen); color: var(--ivory); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--ink); color: #192C29; } }
.route-card .label { font: 600 .72rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.map { display: block; width: 100%; height: auto; border-radius: 18px; background: var(--map-ground); transition: background .6s ease; }
.map .street { stroke: var(--map-street); stroke-width: 9; stroke-linecap: round; fill: none; }
.map .street-edge { stroke: var(--map-street-edge); stroke-width: 11; stroke-linecap: round; fill: none; }
.map .campus { fill: var(--map-campus); }
.map .fast { stroke: var(--muted); stroke-width: 4; stroke-dasharray: 2 9; stroke-linecap: round; fill: none; }
.map .fast-risk { stroke: var(--risk); stroke-width: 5; stroke-linecap: round; fill: none; opacity: 0; transition: opacity .6s ease; }
.map .safer { stroke: var(--safe); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.map .lamp { fill: var(--lamp); }
.map .glow { fill: var(--lamp); opacity: 0; transition: opacity .6s ease; }
.map .inc { fill: var(--risk); opacity: .85; }
.map text { font: 600 11px var(--body); fill: var(--ink); paint-order: stroke; stroke: var(--map-ground); stroke-width: 4px; }
.route-card[data-time="night"] .map { background: #0E1B19; }
.route-card[data-time="night"] .map .street { stroke: #223A35; }
.route-card[data-time="night"] .map .street-edge { stroke: #2C4741; }
.route-card[data-time="night"] .map .campus { fill: #17302A; }
.route-card[data-time="night"] .map text { fill: #E8EFEA; stroke: #0E1B19; }
.route-card[data-time="night"] .glow { opacity: .55; }
.route-card[data-time="night"] .fast-risk { opacity: 1; }
.route-card[data-time="night"] .fast { opacity: .35; }
.score { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 8px 6px; flex-wrap: wrap; }
.score strong { font: 700 2.1rem/1 var(--display); }
.score small { color: var(--muted); font-size: .9rem; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); padding: 4px 8px 6px; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.fine { font-size: .78rem; color: var(--muted); padding: 2px 8px 6px; }

@media (prefers-reduced-motion: no-preference) {
  .map .safer { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 2.4s .5s cubic-bezier(.5,0,.2,1) forwards; }
  .map .lamp { opacity: 0; animation: on .5s forwards; }
  .map .lamp:nth-of-type(1) { animation-delay: 1.0s; } .map .lamp:nth-of-type(2) { animation-delay: 1.3s; }
  .map .lamp:nth-of-type(3) { animation-delay: 1.6s; } .map .lamp:nth-of-type(4) { animation-delay: 1.9s; }
  .map .lamp:nth-of-type(5) { animation-delay: 2.2s; } .map .lamp:nth-of-type(6) { animation-delay: 2.5s; }
  .map .lamp:nth-of-type(7) { animation-delay: 2.8s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes on { to { opacity: 1; } }
}

/* Sections */
section { padding: clamp(56px, 8vw, 112px) 0; }
.head { max-width: 40rem; margin-bottom: clamp(32px, 4vw, 56px); }
.head .kicker { display: block; margin-bottom: 16px; }
.head p { margin-top: 18px; color: var(--muted); }
.band { background: var(--evergreen); color: #F4F1E9; --muted: #B9C7C1; --rule: #2E4741; }
.band .kicker { color: #B9C7C1; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.how > div { padding: 28px 28px 8px 0; border-right: 1px solid var(--rule); }
.how > div + div { padding-left: 28px; }
.how > div:last-child { border-right: 0; }
.how h3 { margin-bottom: 10px; }
.how p { color: var(--muted); }
@media (max-width: 800px) { .how { grid-template-columns: 1fr; } .how > div, .how > div + div { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--rule); } }

.feats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.feat { background: var(--paper); border: 1px solid var(--rule); border-radius: 22px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.feat p { color: var(--muted); }
.feat.a { grid-column: span 4; background: var(--sage); border-color: transparent; }
.feat.b { grid-column: span 2; }
.feat.c, .feat.d, .feat.e { grid-column: span 2; }
.feat.f { grid-column: span 6; flex-direction: row; align-items: center; gap: 28px; flex-wrap: wrap; }
.feat.f > div { flex: 1 1 320px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feat.a { background: #1E3A34; } }
.ico { width: 40px; height: 40px; flex: none; }
@media (max-width: 860px) { .feat, .feat.a, .feat.b, .feat.c, .feat.d, .feat.e, .feat.f { grid-column: span 6; } }

.trust { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 72px); }
.trust ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.trust li { padding-left: 28px; position: relative; color: var(--muted); }
.trust li::before { content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--terracotta); }
.trust li b { color: var(--ink); font-weight: 600; }
.band .trust li b { color: #F4F1E9; }
@media (max-width: 860px) { .trust { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip { border: 1px solid var(--rule); border-radius: 999px; padding: 8px 16px; font-size: .92rem; }
.band .chip { border-color: #3A554E; }

.get { text-align: center; }
.get h2 { margin-inline: auto; max-width: 14em; }
.get p { margin: 20px auto 0; max-width: 34em; color: var(--muted); }
.get .cta-row { justify-content: center; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 22px; border-radius: 16px; background: var(--evergreen); color: #F4F1E9; text-decoration: none; text-align: left; border: 2px solid var(--evergreen); }
.store small { display: block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.store b { font: 600 1.1rem/1.1 var(--body); }
.store[aria-disabled="true"] { opacity: .92; }
.store svg { width: 26px; height: 26px; flex: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .store { background: var(--paper); color: var(--ink); border-color: var(--rule); } }
.soon { font-size: .9rem; margin-top: 18px; color: var(--muted); }

footer { border-top: 1px solid var(--rule); padding: 40px 0 56px; color: var(--muted); font-size: .92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--evergreen); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
