:root {
  --ink: #102f31;
  --deep: #082f34;
  --sea: #0a7d78;
  --aqua: #55d2c2;
  --coral: #f06d4f;
  --sand: #f5f0e5;
  --cream: #fbf8f0;
  --line: #d9e1dc;
  --muted: #607473;
  --white: #fff;
  --shadow: 0 22px 60px rgba(12, 53, 55, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: fixed; top: 8px; left: 8px; transform: translateY(-150%); z-index: 9999; background: white; color: var(--ink); padding: 10px 14px; border-radius: 6px; }
.skip-link:focus { transform: none; }

.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 78px); background: var(--cream); border-bottom: 1px solid rgba(16,47,49,.12); position: relative; z-index: 1001; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--deep); letter-spacing: .08em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.brand-mark circle { fill: var(--coral); stroke: var(--coral); }
.brand strong, .brand small { display: block; line-height: 1; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 5px; font-size: 9px; font-weight: 700; letter-spacing: .22em; color: var(--sea); }
nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 44px); font-size: 13px; font-weight: 700; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover { color: var(--sea); }
.topic-pill { padding: 9px 14px; color: var(--cream); background: var(--deep); border-radius: 999px; }

.hero { min-height: 650px; display: grid; grid-template-columns: 48% 52%; background: var(--deep); color: white; position: relative; overflow: hidden; }
.hero-copy { padding: clamp(78px, 10vw, 132px) 30px 90px clamp(30px, 8vw, 124px); position: relative; z-index: 2; }
.eyebrow { margin: 0 0 28px; font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .22em; color: var(--aqua); }
.eyebrow span { display: inline-block; width: 26px; height: 2px; margin: 0 10px 3px 0; background: currentColor; }
.eyebrow.dark { color: var(--sea); }
.eyebrow.light { color: var(--aqua); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.045em; }
h1 { margin: 0; font-size: clamp(54px, 6.5vw, 94px); line-height: .96; }
h1 em, h2 em { color: var(--aqua); font-weight: 400; }
.hero-lead { max-width: 580px; margin: 34px 0; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; color: #c9d8d5; }
.hero-cta { display: inline-flex; align-items: center; gap: 34px; padding-bottom: 8px; color: white; text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; border-bottom: 2px solid var(--coral); }
.hero-cta span { font-size: 20px; transition: transform .2s ease; }
.hero-cta:hover span { transform: translate(5px, 5px); }
.hero-art { position: relative; min-height: 570px; background: #0a6e6c; overflow: hidden; }
.hero-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 22px 22px; opacity: .3; }
.sun { position: absolute; width: 250px; height: 250px; right: 14%; top: 16%; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; }
.sun::before, .sun::after { content: ""; position: absolute; inset: 26px; border: inherit; border-radius: 50%; }
.sun::after { inset: 57px; background: rgba(85, 210, 194, .12); }
.coast-line { position: absolute; width: 115%; height: 82%; left: -15%; bottom: -47%; border: 2px solid rgba(255,255,255,.22); border-radius: 48% 56% 0 0; transform: rotate(-12deg); }
.line-b { bottom: -54%; left: -9%; }
.line-c { bottom: -61%; left: -3%; }
.route-sketch { position: absolute; inset: 12% 5% 7% 2%; width: 93%; height: 81%; z-index: 2; overflow: visible; }
.route-sketch path { fill: none; stroke: #fff9ed; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; }
.route-sketch circle { fill: var(--coral); stroke: white; stroke-width: 4; }
.place-label { position: absolute; z-index: 3; padding: 8px 11px; background: rgba(6,42,46,.75); border: 1px solid rgba(255,255,255,.18); border-radius: 4px; font-size: 11px; font-weight: 700; }
.label-a { right: 5%; top: 43%; }
.label-b { left: 5%; bottom: 12%; }
.compass { position: absolute; z-index: 3; right: 7%; bottom: 9%; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.compass span { font-size: 25px; color: var(--aqua); }
.hero-index { position: absolute; z-index: 3; bottom: 24px; left: clamp(30px, 8vw, 124px); display: flex; gap: 20px; color: #718f8d; font: 10px/1 monospace; letter-spacing: .08em; }

.planner-section { padding: 110px clamp(18px, 5vw, 78px) 126px; background: var(--cream); }
.section-heading { max-width: 1200px; margin: 0 auto 48px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.section-heading h2, .method-intro h2, .data-note h2 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1; }
.section-heading > p { max-width: 450px; margin: 0; color: var(--muted); line-height: 1.7; }
.planner-shell { max-width: 1200px; min-height: 620px; margin: auto; display: grid; grid-template-columns: 380px 1fr; background: white; box-shadow: var(--shadow); }
.route-panel { padding: 32px; border-right: 1px solid var(--line); }
.field { position: relative; margin-bottom: 18px; }
.field.compact { margin-top: 23px; }
.field label, .mode-fieldset legend { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.select-wrap { position: relative; }
.select-wrap::before { content: ""; position: absolute; z-index: 2; left: 15px; top: 50%; width: 8px; height: 8px; border: 3px solid var(--sea); border-radius: 50%; transform: translateY(-50%); pointer-events: none; }
.select-wrap.end-dot::before { border-color: var(--coral); }
.select-wrap::after { content: "⌄"; position: absolute; right: 15px; top: 50%; transform: translateY(-58%); color: var(--sea); pointer-events: none; }
.select-wrap.plain::before { display: none; }
select, .select-wrap input { width: 100%; height: 50px; padding: 0 39px 0 38px; color: var(--ink); background: #f8faf7; border: 1px solid var(--line); border-radius: 2px; appearance: none; outline: none; font-size: 14px; }
.select-wrap input { cursor: text; }
.select-wrap input::placeholder { color: #8a9a98; }
.select-wrap.plain select { padding-left: 14px; }
select:focus, .select-wrap input:focus { border-color: var(--sea); box-shadow: 0 0 0 3px rgba(10,125,120,.12); }
.pick-on-map { margin: 7px 0 0; padding: 0; color: var(--sea); background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 750; }
.pick-on-map:hover { text-decoration: underline; }
.pick-on-map.active { color: var(--coral); }
.map-wrap.picking, .map-wrap.picking #map { cursor: crosshair !important; }
.swap-button { position: relative; z-index: 4; display: block; width: 31px; height: 31px; margin: -12px 10px -3px auto; color: var(--sea); background: white; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.swap-button:hover { background: var(--sand); }
.mode-fieldset { margin: 24px 0 0; padding: 0; border: 0; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.mode-switch label { cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch span { height: 62px; display: grid; place-items: center; gap: 1px; color: var(--muted); background: white; border-right: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.mode-switch label:last-child span { border-right: 0; }
.mode-switch b { font-size: 18px; filter: grayscale(1); }
.mode-switch input:checked + span { color: white; background: var(--sea); }
.mode-switch input:checked + span b { filter: none; }
.mode-switch input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: -3px; }
.submit-button { width: 100%; height: 54px; margin-top: 8px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; color: white; background: var(--coral); border: 0; cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; transition: background .2s, transform .2s; }
.submit-button:hover { background: #dc5d42; transform: translateY(-1px); }
.submit-button:disabled { cursor: wait; opacity: .7; transform: none; }
.route-status { min-height: 61px; display: flex; gap: 10px; align-items: center; margin-top: 22px; padding: 12px; color: var(--muted); background: var(--sand); font-size: 12px; line-height: 1.45; }
.route-status p { margin: 0; }
.status-icon { font-size: 18px; color: var(--sea); }
.route-status.error { color: #8c3527; background: #fff0ec; }
.summary { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.summary-head { display: flex; justify-content: space-between; color: var(--sea); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.summary-head button { color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 11px; text-decoration: underline; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 17px; }
.summary-grid small { display: block; color: var(--muted); font-size: 9px; }
.summary-grid strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 22px; font-weight: 400; white-space: nowrap; }
.route-meter { height: 3px; margin-top: 17px; background: var(--line); }
.route-meter span { display: block; width: 0; height: 100%; background: var(--coral); transition: width .8s ease; }
.route-note { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.map-wrap { position: relative; min-height: 620px; }
#map { width: 100%; height: 100%; min-height: 620px; background: #dbe8e4; }
.map-key { position: absolute; z-index: 500; left: 20px; bottom: 20px; display: flex; gap: 14px; padding: 9px 12px; color: var(--muted); background: rgba(255,255,255,.93); box-shadow: 0 4px 15px rgba(15,47,49,.12); font-size: 10px; font-weight: 700; }
.map-key span { display: flex; align-items: center; gap: 5px; }
.map-key i { display: inline-block; width: 18px; height: 3px; background: var(--coral); }
.map-key .key-alt { height: 0; background: transparent; border-top: 2px dashed #557c7b; }
.map-reset { position: absolute; z-index: 500; top: 20px; right: 20px; width: 38px; height: 38px; color: var(--deep); background: white; border: 0; box-shadow: 0 4px 15px rgba(15,47,49,.14); cursor: pointer; font-size: 22px; }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 4px 15px rgba(15,47,49,.14) !important; }
.leaflet-control-zoom a { color: var(--deep) !important; }
.place-marker { width: 18px !important; height: 18px !important; margin: -9px 0 0 -9px !important; background: var(--cream); border: 4px solid var(--sea); border-radius: 50%; box-shadow: 0 2px 6px rgba(8,47,52,.3); }
.place-marker.endpoint { width: 22px !important; height: 22px !important; margin: -11px 0 0 -11px !important; border-color: var(--coral); }
.leaflet-popup-content-wrapper { border-radius: 2px; font-family: inherit; }

.method-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; padding: 120px clamp(30px, 8vw, 124px); color: white; background: var(--deep); }
.method-intro > p:last-child { max-width: 520px; margin: 32px 0 0; color: #a9c0bd; line-height: 1.75; }
.method-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.17); }
.method-steps li { display: grid; grid-template-columns: 65px 1fr; gap: 24px; padding: 27px 0; border-bottom: 1px solid rgba(255,255,255,.17); }
.method-steps > li > span { color: var(--aqua); font: 15px/1 Georgia, serif; }
.method-steps h3 { margin: 0 0 9px; font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.method-steps p { margin: 0; color: #a9c0bd; line-height: 1.6; font-size: 14px; }
.data-note { display: grid; grid-template-columns: 160px .8fr 1.2fr; gap: 55px; align-items: start; padding: 105px clamp(30px, 8vw, 124px); background: var(--sand); }
.note-number { margin: -15px 0 0; color: rgba(10,125,120,.15); font: 130px/.8 Georgia, serif; }
.note-copy { padding-top: 38px; color: var(--muted); line-height: 1.75; }
.note-copy p { margin: 0 0 16px; }

footer { min-height: 145px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; padding: 30px clamp(22px, 5vw, 78px); color: #9db0ae; background: #06282c; font-size: 11px; }
.footer-brand { color: white; }
.credits { text-align: right; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 65px; }
  .hero-art { min-height: 420px; }
  .hero-index { display: none; }
  .planner-shell { grid-template-columns: 330px 1fr; }
  .route-panel { padding: 24px; }
  .method-section { grid-template-columns: 1fr; gap: 55px; }
  .data-note { grid-template-columns: 100px 1fr; }
  .note-number { font-size: 90px; }
  .note-copy { grid-column: 2; padding-top: 0; }
}

@media (max-width: 760px) {
  .topbar { height: 65px; }
  nav a { display: none; }
  .hero { min-height: 0; }
  .hero-copy { padding: 70px 24px 58px; }
  .hero-art { min-height: 330px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 24px; }
  .planner-section { padding: 80px 15px; }
  .planner-shell { display: flex; flex-direction: column; }
  .route-panel { order: 1; border: 0; }
  .map-wrap, #map { min-height: 430px; }
  .method-section { padding: 85px 24px; }
  .data-note { grid-template-columns: 1fr; gap: 22px; padding: 80px 24px; }
  .note-number { position: absolute; right: 24px; font-size: 86px; }
  .note-copy { grid-column: auto; }
  footer { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-self: center; }
  .credits { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
