/*
  Milta website — shared styles.
  Palette comes from Support/MiltaPalette.swift so the site and the app match.
*/

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;

  --pine: #0A4E34;
  --pine-deep: #063725;
  --emerald: #2FA070;
  --mint: #BFE5D0;
  --cream: #FCF5E8;
  --paper: #FFFCF5;
  --map: #F1E8D3;
  --ink: #16241D;
  --muted: #55635B;
  --rule: #E2D8C2;
  --amber: #C8600A;
  --personal: #3F6EA6;

  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --page: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.625rem); }
h3 { font-size: 1.1875rem; letter-spacing: -0.012em; line-height: 1.25; }

p { margin: 0; text-wrap: pretty; }

a { color: var(--pine); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--cream); color: var(--pine);
  padding: 0.6rem 1rem; border-radius: 10px; font-weight: 600;
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

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

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font: 600 1.3125rem/1 var(--display);
  letter-spacing: -0.02em;
  color: inherit; text-decoration: none;
}
.brand img { width: 38px; height: 38px; display: block; }

.masthead nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 1.75rem); }
.masthead nav a {
  color: inherit; text-decoration: none; font-weight: 500; font-size: 1rem;
  padding-block: 0.4rem;
}
.masthead nav a:hover, .masthead nav a[aria-current="page"] { text-decoration: underline; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 1.0625rem/1.2 var(--display);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
}
.button--light { background: var(--cream); color: var(--pine); }
.button--light:hover { background: #fff; }
.button--pine { background: var(--pine); color: var(--cream); }
.button--pine:hover { background: var(--pine-deep); }
/* Until the App Store link exists the button is a plain statement, not a link. */
.button[aria-disabled="true"] {
  background: transparent; color: inherit; cursor: default;
  border-color: currentColor; border-style: dashed; opacity: 0.85;
}

/* ---------- Hero ---------- */

.topbar { background: var(--pine); color: var(--cream); }
.topbar a { color: inherit; }
.topbar :focus-visible { outline-color: var(--mint); }

.hero {
  background: var(--pine);
  color: var(--cream);
  /* a quiet shift toward the deeper pine at the foot, where the log sits */
  background-image: linear-gradient(180deg, var(--pine) 0%, var(--pine) 55%, var(--pine-deep) 100%);
}
.hero a { color: inherit; }
.hero :focus-visible { outline-color: var(--mint); }

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem);
  align-items: start;
}
@media (min-width: 920px) {
  .hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}

.hero h1 {
  font-size: clamp(2.75rem, 1.4rem + 6.2vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.hero h1 span { display: block; }

.hero__lede {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.5;
  color: #E4EFE6;
}
.hero__actions {
  margin-top: 2.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
}
.hero__note { font-size: 0.9375rem; color: var(--mint); max-width: 18rem; line-height: 1.4; }

/* ---------- The demo drive ---------- */

.demo { min-width: 0; }

.ticket {
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(2, 24, 15, 0.7);
  will-change: transform;
}
.ticket.is-leaving-right { transform: translateX(42px) rotate(3deg); opacity: 0; transition: transform 0.24s ease-in, opacity 0.24s ease-in; }
.ticket.is-leaving-left { transform: translateX(-42px) rotate(-3deg); opacity: 0; transition: transform 0.24s ease-in, opacity 0.24s ease-in; }
.ticket.is-arriving { transform: translateY(10px); opacity: 0; }
.ticket.is-settling { transition: transform 0.28s ease-out, opacity 0.28s ease-out; }

.ticket__map { display: block; width: 100%; height: auto; background: var(--map); }
.map-streets { stroke: #DDD0B3; stroke-width: 6; stroke-linecap: round; fill: none; }
.map-streets--minor { stroke-width: 3; }
.map-water { fill: #D5E6DE; }
.map-route-ghost { stroke: #CBBE9F; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-dasharray: 2 10; }
.map-route { stroke: var(--pine); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.map-start { fill: var(--paper); stroke: var(--pine); stroke-width: 4; }
.map-car { fill: var(--emerald); stroke: var(--paper); stroke-width: 4; }

.ticket__body { padding: 1.25rem 1.5rem 1.5rem; }

.ticket__status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9375rem; font-weight: 500; color: var(--muted);
  min-height: 1.5rem;
}
.ticket__status::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--amber);
}
.ticket.is-tracking .ticket__status::before { background: var(--emerald); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.ticket__route {
  margin-top: 0.35rem;
  font: 600 1.375rem/1.2 var(--display);
  letter-spacing: -0.02em;
}

.readout {
  margin: 1.1rem 0 0; padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}
.readout div { min-width: 0; }
.readout dt { order: 2; font-size: 0.875rem; color: var(--muted); }
.readout dd {
  margin: 0;
  font: 600 clamp(1.5rem, 1.1rem + 1.6vw, 2rem)/1.1 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.readout div { display: flex; flex-direction: column; }
.readout .is-value dd { color: var(--pine); }

.choices { margin-top: 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.choice {
  min-height: 3.25rem; border-radius: 14px; border: 2px solid transparent;
  font: 600 1.0625rem/1 var(--display); cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.2s ease;
}
.choice--personal { background: transparent; border-color: var(--personal); color: var(--personal); }
.choice--personal:hover:not(:disabled) { background: #E9F0F8; }
.choice--business { background: var(--pine); color: var(--cream); }
.choice--business:hover:not(:disabled) { background: var(--pine-deep); }
.choice:disabled { opacity: 0.35; cursor: default; }

.ticket__done { padding: 2.25rem 1.5rem 2rem; }
.ticket__done h3 { font-size: 1.625rem; letter-spacing: -0.025em; }
.ticket__done p { margin-top: 0.6rem; color: var(--muted); }
.ticket__done button { margin-top: 1.4rem; }
[hidden] { display: none !important; }

/* the log that fills up under the ticket */
.log { margin-top: 1.5rem; color: var(--cream); }
.log__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: 0.9375rem; color: var(--mint);
  padding-bottom: 0.6rem; border-bottom: 1px solid rgba(191, 229, 208, 0.3);
}
.log__head strong { font: 600 1.25rem/1 var(--display); color: var(--cream); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.log ol { list-style: none; margin: 0; padding: 0; }
.log li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.25rem 1rem; align-items: baseline;
  padding: 0.6rem 0; border-bottom: 1px solid rgba(191, 229, 208, 0.16);
  font-size: 0.9375rem;
}
.log li span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .log__kind { color: var(--mint); }
.log .log__amount { font-variant-numeric: tabular-nums; min-width: 4.2rem; text-align: right; font-weight: 600; }
.log__empty { padding: 0.75rem 0 0; font-size: 0.9375rem; color: var(--mint); }
.demo__footnote { margin-top: 0.9rem; font-size: 0.8125rem; color: rgba(191, 229, 208, 0.8); }

/* ---------- Sections on paper ---------- */

.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section + .section { padding-top: 0; }
.section__intro { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section__intro p { margin-top: 1rem; color: var(--muted); font-size: 1.125rem; }

/* three steps: a real sequence, so they are numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem clamp(1.5rem, 4vw, 3rem); counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; border-top: 3px solid var(--pine); padding-top: 1.1rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font: 600 3.25rem/1 var(--display);
  letter-spacing: -0.04em;
  color: var(--emerald);
  margin-bottom: 0.9rem;
}
.steps p { margin-top: 0.5rem; color: var(--muted); }

/* the feature list is set as a ruled logbook */
.ledger { margin: 0; border-top: 2px solid var(--ink); }
.ledger > div {
  display: grid; gap: 0.35rem 2.5rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) { .ledger > div { grid-template-columns: 17rem minmax(0, 1fr); } }
.ledger dt { font: 600 1.1875rem/1.3 var(--display); letter-spacing: -0.015em; }
.ledger dd { margin: 0; color: var(--muted); max-width: 44rem; }

/* where the data goes */
.band {
  background: var(--pine-deep); color: var(--cream);
  padding-block: clamp(4rem, 9vw, 7rem);
}
.band a { color: var(--mint); }
.band :focus-visible { outline-color: var(--mint); }
.band .section__intro p { color: var(--mint); }
.destinations { display: grid; gap: 2.5rem clamp(1.5rem, 4vw, 3.5rem); }
@media (min-width: 820px) { .destinations { grid-template-columns: repeat(3, 1fr); } }
.destinations h3 { color: var(--mint); font-weight: 500; font-size: 1.0625rem; letter-spacing: 0; }
.destinations .big {
  margin-top: 0.5rem;
  font: 600 clamp(2rem, 1.4rem + 2.4vw, 3rem)/1.02 var(--display);
  letter-spacing: -0.035em;
}
.destinations p:not(.big) { margin-top: 0.9rem; color: #D8E8DE; font-size: 1rem; }

/* definition pairs in two columns */
.pairs { margin: 0; display: grid; gap: 1.75rem clamp(2rem, 5vw, 4rem); }
@media (min-width: 760px) { .pairs { grid-template-columns: repeat(2, 1fr); } }
.pairs dt { font: 600 1.1875rem/1.3 var(--display); letter-spacing: -0.015em; }
.pairs dd { margin: 0.35rem 0 0; color: var(--muted); }

/* tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font: 600 0.9375rem/1.3 var(--display); color: var(--muted); border-bottom: 2px solid var(--ink); }
tbody th { font-weight: 500; }
td.yes { color: var(--pine); font-weight: 600; }
td.no { color: #A39A86; }
.plans { max-width: 52rem; }
.plans th:not(:first-child), .plans td { width: 5.5rem; text-align: center; padding-right: 0; }
.plans th:last-child, .plans td:last-child { width: 9.5rem; }
@media (max-width: 520px) {
  .plans th:not(:first-child), .plans td { width: 3.5rem; }
  .plans th:last-child, .plans td:last-child { width: 6.75rem; }
}
.plans tfoot td, .plans tfoot th { border-bottom: 0; padding-top: 1.25rem; }
.plans tfoot td { font: 600 1.0625rem/1.3 var(--display); }
.plans tfoot small { display: block; font: 400 0.8125rem/1.35 var(--body); color: var(--muted); margin-top: 0.25rem; }
/* three-column reference tables read as stacked entries on a phone */
@media (max-width: 600px) {
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stack, .stack tbody, .stack tr, .stack th, .stack td { display: block; }
  .stack tr { padding-block: 1rem; border-bottom: 1px solid var(--rule); }
  .stack tr:first-child { border-top: 2px solid var(--ink); }
  .stack th, .stack td { border: 0; padding: 0; }
  .stack tbody th { font: 600 1.1875rem/1.3 var(--display); letter-spacing: -0.015em; }
  .stack td { color: var(--muted); margin-top: 0.25rem; }
}
.fine { margin-top: 1.5rem; font-size: 0.9375rem; color: var(--muted); max-width: 44rem; }

/* closing call */
.closing { border-top: 2px solid var(--ink); padding-block: clamp(3rem, 7vw, 5rem); }
.closing .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: center; justify-content: space-between; }
.closing h2 { max-width: 34rem; }

/* ---------- Footer ---------- */

.colophon { background: var(--pine); color: var(--mint); padding-block: 2.5rem; font-size: 0.9375rem; }
.colophon .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.colophon a { color: var(--cream); }
.colophon nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.colophon :focus-visible { outline-color: var(--mint); }

/* ---------- Inner pages (privacy, support) ---------- */

.pagehead { background: var(--pine); color: var(--cream); }
.pagehead a { color: inherit; }
.pagehead :focus-visible { outline-color: var(--mint); }
.pagehead__title { padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem); }
.pagehead h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.25rem); letter-spacing: -0.04em; line-height: 1; }
.pagehead p { margin-top: 1.1rem; color: var(--mint); max-width: 38rem; font-size: 1.125rem; }

.prose { max-width: 44rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.prose h2 { font-size: 1.625rem; margin-top: 3rem; letter-spacing: -0.02em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; }
.prose p, .prose ul { margin-top: 0.9rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--emerald); }
.summary {
  border-left: 4px solid var(--emerald);
  padding: 0.25rem 0 0.25rem 1.25rem;
  font-size: 1.1875rem; line-height: 1.5;
}

/* FAQ */
.faq-tools { margin-top: 2rem; }
.faq-tools label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.faq-tools input {
  width: 100%; max-width: 30rem; min-height: 3rem;
  padding: 0.65rem 1rem; border-radius: 12px;
  border: 2px solid var(--rule); background: var(--paper);
  font: inherit; color: inherit;
}
.faq-tools input:focus-visible { border-color: var(--pine); outline-offset: 1px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1.05rem 2.25rem 1.05rem 0; position: relative;
  font: 600 1.125rem/1.35 var(--display); letter-spacing: -0.012em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.35rem; top: 1.45rem;
  width: 0.6rem; height: 0.6rem;
  border-right: 2px solid var(--pine); border-bottom: 2px solid var(--pine);
  transform: rotate(45deg); transition: transform 0.18s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); top: 1.7rem; }
.faq details > div { padding: 0 0 1.25rem; color: var(--muted); }
.faq details > div p + p { margin-top: 0.75rem; }
.faq section { margin-top: 3.25rem; }
.faq h2 { border-bottom: 2px solid var(--ink); padding-bottom: 0.75rem; }

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

@media print {
  .hero, .pagehead, .colophon, .band { background: #fff !important; color: #000 !important; }
  .demo, .faq-tools { display: none; }
}

/* focus rings inside the cream ticket need the darker green to be seen */
.hero .ticket :focus-visible { outline-color: var(--pine); }
