/* ==========================================================================
   Yuliia.ai — route planner demo
   Self-contained page styles on top of tokens.css. Tokens only; no raw hex
   except values already defined as tokens.
   ========================================================================== */

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* visible keyboard focus everywhere (segment pills add their own ring) */
:focus-visible {
  outline: 2px solid var(--y-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.mono { font-family: var(--y-font-mono); }
.muted { color: var(--y-muted); }
.accent { color: var(--y-accent); }

.eyebrow {
  font-family: var(--y-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--y-muted);
  margin: 0;
}

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

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--y-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--y-ink);
}

.brand-mark { display: block; }

.brand-name {
  font-family: var(--y-font-display);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* ---- Layout -------------------------------------------------------------- */

.demo-main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3.5rem;
}

.demo-intro { max-width: 44rem; }

.demo-intro h1 {
  font-family: var(--y-font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.6rem;
}

.lede {
  color: var(--y-muted);
  font-size: 1.05rem;
  margin: 0 0 2rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 47.9rem) {
  .demo-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--y-surface);
  border: 1px solid var(--y-line);
  border-radius: 10px;
  padding: 1.5rem;
}

/* ---- Inputs -------------------------------------------------------------- */

.panel-inputs fieldset {
  border: 0;
  margin: 0 0 1.4rem;
  padding: 0;
}

.panel-inputs fieldset:last-child { margin-bottom: 0; }

.panel-inputs legend {
  font-family: var(--y-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--y-muted);
  padding: 0;
  margin-bottom: 0.55rem;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.seg-opt { position: relative; }

.seg-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.seg-opt span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--y-line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--y-muted);
  cursor: pointer;
  user-select: none;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.seg-opt input:hover + span { border-color: var(--y-muted); color: var(--y-ink); }

.seg-opt input:checked + span {
  border-color: var(--y-accent);
  color: var(--y-ink);
  box-shadow: inset 0 0 0 1px var(--y-accent);
}

.seg-opt input:focus-visible + span {
  outline: 2px solid var(--y-accent);
  outline-offset: 2px;
}

.rig-field { border-top: 1px solid var(--y-line); padding-top: 1.2rem !important; }

.check-opt {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 500;
}

.check-opt input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--y-accent);
  cursor: pointer;
  flex: none;
  transform: translateY(2px);
}

.field-note {
  margin: 0.45rem 0 0 1.55rem;
  font-size: 0.82rem;
  color: var(--y-muted);
}

/* ---- Output -------------------------------------------------------------- */

.panel-output { min-height: 20rem; }

.output-loading { padding: 2rem 0; }

.route-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.35rem 0 0.5rem;
}

.model-name {
  font-size: 1.45rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}

.lane-badge {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--y-line);
  border-radius: 999px;
  color: var(--y-muted);
}

.lane-badge[data-lane="hero"] {
  border-color: var(--y-accent);
  color: var(--y-accent);
}

.justification {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.route-note {
  margin: 0;
  font-size: 0.85rem;
}

.section-label {
  font-family: var(--y-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--y-muted);
  margin: 1.5rem 0 0.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--y-line);
}

.stages {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stages li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.32rem 0;
  font-size: 0.9rem;
}

.stage-dot {
  flex: none;
  width: 7px;
  height: 7px;
  transform: translateY(-1px);
  background: var(--y-ok);
}

.stages li.skipped .stage-dot { background: var(--y-line); }

.stage-name { font-weight: 500; white-space: nowrap; }

.stages li.skipped .stage-name { color: var(--y-muted); font-weight: 400; }

.stage-detail {
  color: var(--y-muted);
  font-size: 0.85rem;
}

.costs {
  margin: 0;
}

.cost-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
}

.cost-row dt { color: var(--y-muted); font-size: 0.9rem; }

.cost-row dd {
  margin: 0;
  font-size: 1rem;
}

.cost-row dd.accent { font-size: 1.15rem; font-weight: 500; }

.cost-row dd .unit-detail {
  color: var(--y-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.compare {
  margin: 1rem 0 0;
  padding: 0.8rem 0.95rem;
  border: 1px dashed var(--y-line);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--y-muted);
}

.compare strong {
  color: var(--y-ink);
  font-weight: 600;
}

.compare .savings { color: var(--y-ok); font-weight: 600; }

/* ---- Footnote ------------------------------------------------------------ */

.demo-footnote {
  max-width: 44rem;
  margin: 2rem auto 0;
  font-size: 0.85rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
