:root {
  --ink: #17211d;
  --muted: #5e6b65;
  --soft: #f6f2ea;
  --paper: #fffaf0;
  --line: #ded7c8;
  --mint: #b7dfc8;
  --leaf: #2f7258;
  --coral: #ef7966;
  --berry: #8a4f7d;
  --blue: #4f78bd;
  --gold: #d39a37;
  --shadow: 0 18px 50px rgba(23, 33, 29, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ece6da;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .toast {
    transition: none;
  }
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  box-shadow: 0 0 80px rgba(42, 33, 22, 0.16);
}

.hero {
  position: relative;
  min-height: 92vh;
  padding: 18px clamp(18px, 5vw, 42px) 34px;
  display: grid;
  align-content: space-between;
  gap: 26px;
  overflow: hidden;
  background: #f4ead8;
}

/* Flipped so the parent + pram sits on the right, away from the headline. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/hero.png") center / cover;
  transform: scaleX(-1);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(255, 250, 240, 0.94) 34%, rgba(255, 250, 240, 0.55) 62%, rgba(255, 250, 240, 0.28)),
    linear-gradient(180deg, rgba(255, 250, 240, 0.1) 55%, rgba(255, 250, 240, 0.88) 82%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(28px, 7vw, 56px);
  line-height: 0.95;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-button {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(23, 33, 29, 0.24);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
  font-weight: 800;
}

.hero-copy {
  max-width: 680px;
}

.tagline {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 12vw, 86px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0;
}

.summary {
  max-width: 620px;
  margin: 18px 0 0;
  font-size: clamp(16px, 2.8vw, 20px);
  line-height: 1.45;
  color: #29362f;
}

.planner-card,
.venue-card,
.reasoning-panel,
.evidence-card,
.photo-demo,
.proof-form,
.privacy-grid {
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: var(--shadow);
}

.planner-card {
  padding: 16px;
  backdrop-filter: blur(14px);
}

.nl-label {
  display: block;
  margin-bottom: 6px;
}

.nl-row {
  display: flex;
  gap: 8px;
}

#nl-input {
  flex: 1;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 15px;
}

#nl-input::placeholder {
  color: #9aa59f;
}

.nl-parse {
  flex: none;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--leaf);
  color: white;
  font-weight: 850;
  white-space: nowrap;
}

.nl-parse:disabled {
  opacity: 0.6;
  cursor: default;
}

.nl-note {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

label,
legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
}

select {
  min-height: 42px;
  padding: 0 10px;
}

textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
  text-transform: none;
}

fieldset {
  min-width: 0;
  margin: 14px 0;
  padding: 0;
  border: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf7;
  color: var(--ink);
}

.chip.active {
  border-color: var(--leaf);
  background: var(--mint);
}

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.primary-action {
  background: var(--ink);
  color: var(--paper);
}

.secondary-action {
  background: var(--leaf);
  color: white;
}

.result-section,
.venue-section,
.evidence-section,
.core-section,
.ai-section,
.proof-section,
.privacy-section {
  padding: 38px clamp(18px, 5vw, 42px);
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(28px, 6vw, 46px);
}

.route-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.route-summary span {
  padding: 8px 10px;
  border-radius: 8px;
  background: #e7f0df;
  color: var(--leaf);
  font-weight: 800;
  font-size: 13px;
}

.core-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 10px;
}

.mode-switch {
  display: flex;
  flex: none;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf7;
}

.mode-option {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.mode-option.active {
  background: var(--ink);
  color: var(--paper);
}

.mode-status {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mode-status.warn {
  color: #9a4b32;
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.core-grid article {
  min-height: 210px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.core-grid span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.core-grid h3 {
  margin: 16px 0 8px;
  font-size: 18px;
}

.core-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.route-map {
  position: relative;
  min-height: 260px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(47, 114, 88, 0.12) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(rgba(47, 114, 88, 0.12) 1px, transparent 1px) 0 0 / 44px 44px,
    #e4edda;
}

.path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.path-svg .leg {
  fill: none;
  stroke: rgba(47, 114, 88, 0.62);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 2.6 2.4;
}

.path-svg .backup-leg {
  stroke: rgba(138, 79, 125, 0.55);
  stroke-width: 1.1;
  stroke-dasharray: 1.2 2.6;
}

.map-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.85);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-pin {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
  color: white;
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.22);
  font-weight: 900;
}

.pin-a {
  left: 18%;
  top: 60%;
}

.pin-b {
  left: 46%;
  top: 26%;
  background: var(--blue);
}

.pin-c {
  right: 18%;
  top: 54%;
  background: var(--gold);
}

.pin-d {
  right: 8%;
  bottom: 11%;
  background: var(--berry);
}

.route-timeline {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.reasoning-panel {
  margin-top: 18px;
  padding: 16px;
  background: #17211d;
  color: var(--paper);
}

.reasoning-panel.thinking {
  opacity: 0.6;
}

.source-pill {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.14);
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.source-pill.live {
  background: var(--mint);
  color: var(--ink);
}

.reasoning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.reasoning-grid p {
  margin: 0;
  line-height: 1.45;
}

.reasoning-grid .analysis-label {
  color: var(--mint);
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  /* Buttons center text by default; these are cards that happen to be clickable. */
  text-align: left;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.timeline-item h3,
.venue-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.timeline-item p,
.venue-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.score-pill {
  min-width: 58px;
  padding: 8px;
  border-radius: 8px;
  background: #e7f0df;
  color: var(--leaf);
  text-align: center;
  font-weight: 900;
}

.venue-card {
  padding: 18px;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--muted);
}

.venue-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.big-score {
  flex: none;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 28px;
  font-weight: 950;
}

.score-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 132px 1fr 32px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #ebe3d5;
  overflow: hidden;
}

.bar-fill {
  /* Must be block: it is not a grid item, so as an inline span its width/height
     would be ignored and the bar would render empty. */
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--leaf);
}

.bar-fill.mid {
  background: var(--gold);
}

.bar-fill.low {
  background: var(--coral);
}

.bar-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.feature-list span {
  padding: 7px 9px;
  border-radius: 8px;
  background: #f2eadc;
  color: #39443f;
  font-size: 13px;
  font-weight: 750;
}

.proof-strip {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #e7f0df;
}

.proof-strip.empty {
  background: #f2eadc;
}

.proof-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-tally span {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.75);
  color: #39443f;
  font-size: 13px;
  font-weight: 700;
}

.proof-tally b {
  color: var(--leaf);
  font-weight: 900;
}

.proof-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.proof-target {
  margin: 0 0 12px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 800;
}

.photo-demo {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  padding: 16px;
}

.photo-stage {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.photo-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-picker {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.photo-option {
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.photo-option.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.analysis-panel {
  align-self: center;
}

.analysis-panel.thinking {
  opacity: 0.6;
}

.photo-source {
  margin-bottom: 12px;
  background: #f2eadc;
  color: var(--muted);
}

.photo-source.live {
  background: var(--mint);
  color: var(--ink);
}

.analysis-panel ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.confidence {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.confidence.high {
  background: #e7f0df;
  color: var(--leaf);
}

.confidence.medium {
  background: #f6ecd7;
  color: #9a7420;
}

.confidence.low {
  background: #f8e3dd;
  color: #a34a35;
}

.photo-unknowns {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.evidence-card {
  padding: 18px;
}

.evidence-card .source-pill {
  margin-bottom: 12px;
}

.evidence-live {
  margin-top: 16px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--leaf);
  color: white;
  font-weight: 850;
}

.evidence-live:disabled {
  opacity: 0.6;
  cursor: default;
}

.evidence-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.evidence-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.evidence-card dl div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.evidence-card dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.evidence-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.evidence-card dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.analysis-label {
  margin: 0 0 8px;
  color: var(--leaf);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.analysis-panel ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.caution {
  margin: 12px 0 0;
  color: var(--muted);
}

.proof-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--leaf);
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  box-shadow: none;
}

.privacy-grid p {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #fffdf7;
  color: #39443f;
  line-height: 1.45;
}

.app-footer {
  padding: 30px clamp(18px, 5vw, 42px) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.app-footer p {
  margin: 0 0 4px;
}

.app-footer strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  /* translateY must clear `bottom` too, or a sliver of the toast stays on screen. */
  transform: translateX(-50%) translateY(calc(100% + 18px));
  opacity: 0;
  max-width: calc(100% - 28px);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, opacity 180ms ease;
  z-index: 10;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .app-shell {
    width: 100%;
  }

  .field-grid,
  .core-grid,
  .reasoning-grid,
  .photo-demo,
  .privacy-grid {
    grid-template-columns: 1fr;
  }

  .evidence-card dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .core-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .nl-row {
    flex-direction: column;
  }

  .hero {
    min-height: 95vh;
  }

  .timeline-item {
    grid-template-columns: auto 1fr;
  }

  .timeline-item .score-pill {
    grid-column: 2;
    width: fit-content;
  }

  .venue-header {
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 110px 1fr 28px;
  }
}
