/* roundtriip.ca, the site layer on the kit (public/assets, MIT).
   Loaded last. Holds: the faces, the palette, the physical grounds (paper, concrete, glass),
   the one accent's three uses, and the page CSS the kit leaves to a page (visuals, the legal pages). */

/* ------------------------------------------------------------ faces (self-hosted, SIL OFL 1.1) */
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/red-hat-display-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Red Hat Text";
  src: url("/fonts/red-hat-text-latin.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------ palette (start.mjs brand, owner's rule)
   From the brand teal #235d5e (hue 181): one light neutral, the paper (#ecf0f0, the teal at 3%),
   one dark colour, the road teal (#0e3130) for type; the accent is traffic-paint yellow (#f0b81e,
   hue 44: the teal turned 137 degrees), used on the one button, one word and the live dot only. */
:root {
  --p-bg: #ecf0f0; --p-surface: #e0e5e5; --p-ink: #0e3130; --p-muted: #4d6463;
  --p-accent: #f0b81e; --p-accent-ink: #0e3130; --p-action: #0e3130; --p-action-ink: #ecf0f0;
  --p-inv-bg: #0e3130; --p-inv-surface: #1d3d3c; --p-inv-ink: #ecf0f0; --p-inv-muted: #a3b2b1;
  --p-inv-accent: #f0b81e; --p-inv-accent-ink: #0e3130; --p-inv-action: #f0b81e; --p-inv-action-ink: #0e3130;
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-text: "Red Hat Text", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.025em;
  --display-tracking-xl: -0.035em;

  /* headings, a step larger than the kit's: h2 64 at 1440 (36 on a phone), h3 24 (19) */
  --t-h2: clamp(36px, 2.9vw + 22px, 64px);
  --t-h3s: clamp(19px, 0.48vw + 17px, 24px);

  /* the materials */
  --tex-paper: url("/textures/paper.svg");
  --tex-concrete: url("/textures/concrete.svg");
  --tex-concrete-dark: url("/textures/concrete-dark.svg");
}

/* ------------------------------------------------------------ grounds: physical, never a flat fill
   Paper under the page, the header and the footer; light concrete under the questions; dark
   concrete (the road teal) under billing. Each texture is a small tiling SVG over its own token,
   so the colour holds if a texture fails to load. */
body { background: var(--p-bg) var(--tex-paper) 0 0 / 480px 480px; }
.nav { background: var(--p-bg) var(--tex-paper) 0 0 / 480px 480px; }
.tex-concrete { background: var(--p-surface) var(--tex-concrete) 0 0 / 640px 640px; }
.tex-concrete-dark { background: var(--p-inv-bg) var(--tex-concrete-dark) 0 0 / 640px 640px; }
@media (max-width: 639px) {
  /* the full-screen menu sheet sits on the same paper */
  .nav.is-open { background: var(--p-bg) var(--tex-paper) 0 0 / 480px 480px; }
}

/* ------------------------------------------------------------ the logo (the client's PNG) */
.nav__logo img { height: 40px; width: auto; }
@media (max-width: 639px) {
  .nav__logo img { height: 30px; }
  /* the bar keeps the logo and the menu button; the main action sits in the open menu and in the hero */
  .nav:not(.is-open) .nav__actions .btn--primary { display: none; }
}
.closing__links .nav__logo img { height: 44px; }
/* 1024 to 1279: the left third holds three words beside the larger logo; How it works and Billing stay in the footer */
@media (min-width: 1024px) and (max-width: 1279px) { .nav__item--wide { display: none; } }

/* ------------------------------------------------------------ the accent, three places only
   1. the main action: a painted yellow button with a teal label (7.7:1) and a teal-tinted edge
      so its outline reads on the paper; the focus ring stays the teal ink (--action). */
/* The kit's hover and press mix --action into the ground; scoped to the button, --action is
   the yellow, so every state stays yellow with the teal label (hover lighter, press deeper). */
.btn--primary {
  --action: var(--p-accent); --action-ink: var(--p-accent-ink);
  background: var(--p-accent); color: var(--p-accent-ink);
  border-color: color-mix(in oklab, var(--p-ink) 28%, transparent);
}
html:not([data-motion="off"]) .btn--primary:hover, .btn--primary:hover { background: color-mix(in oklab, var(--p-accent) 82%, #fff); color: var(--p-accent-ink); }
html:not([data-motion="off"]) .btn--primary:active, .btn--primary:active { background: color-mix(in oklab, var(--p-accent) 88%, var(--p-ink)); color: var(--p-accent-ink); }
.btn--primary:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 2px; }
/* 2. one word: a pass of road-line paint under "Calgary" in the hero */
.paint {
  background: url("/textures/paint-stroke.svg") no-repeat 0 92% / 100% 0.34em;
  padding-inline: 0.04em; margin-inline: -0.04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* 3. the subject: the driver on the live map in "How a delivery runs" (.driver-dot) */

/* ------------------------------------------------------------ glass: the driver card on the live map
   A sheet of frosted glass laid on the map: the streets blur through it, a lit top edge. */
.glass {
  background: color-mix(in oklab, var(--p-bg) 58%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in oklab, #fff 60%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in oklab, #fff 70%, transparent);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--p-bg); }
}

/* ------------------------------------------------------------ links inside running text */
.text-link {
  text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur, 160ms) ease;
}
.text-link:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------ #billing: the invoice, a sheet of paper on the concrete */
.invoice-stage { margin: 0; display: flex; justify-content: flex-end; align-items: flex-start; }
.invoice-stage img { width: 100%; max-width: 600px; height: auto; }
@media (max-width: 1023px) { .invoice-stage { margin-top: var(--s-5); justify-content: flex-start; } .invoice-stage img { max-width: 520px; } }
@media (max-width: 639px) { .invoice-stage img { max-width: 220px; } }

/* ------------------------------------------------------------ #questions: the lead line beside the answers */
#questions .t-lead { max-width: 34ch; color: var(--ink); }

/* ------------------------------------------------------------ the legal pages and the 404
   One reading column on the .wrap's left line, the kit's type scale, the same header and footer. */
.doc { padding-top: calc(var(--nav) + var(--s-9)); padding-bottom: var(--s-9); }
.doc__body { max-width: 68ch; }
.doc__body > h1 { font: var(--display-weight) var(--t-h2)/1.1 var(--font-display); letter-spacing: var(--display-tracking); }
.doc__updated { margin-top: var(--s-4); font-size: var(--t-small); color: var(--muted); }
.doc__lead { margin-top: var(--s-6); font-size: var(--t-lead); line-height: 1.5; }
.doc__body section { margin-top: var(--s-8); }
.doc__body h2 { font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.doc__body h2 + * { margin-top: var(--s-4); }
.doc__body p + p, .doc__body p + ul, .doc__body ul + p, .doc__body ol + p, .doc__body p + ol { margin-top: var(--s-4); }
.doc__body :is(ul, ol) { padding-left: 1.25em; display: grid; gap: var(--s-3); }
.doc__body li::marker { color: var(--muted); }
.doc__body a:not(.btn) { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.doc__body a:not(.btn):hover { text-decoration-color: currentColor; }
.doc__body code { font-size: 0.92em; padding: 0.1em 0.35em; border-radius: var(--r-sm); background: color-mix(in oklab, var(--ink) 7%, transparent); }
.doc__body .btn-row { margin-top: var(--s-6); }
.doc__note { margin-top: var(--s-5); font-size: var(--t-small); color: var(--muted); }
.doc__credits { display: grid; gap: var(--s-5); margin-top: var(--s-6); padding: 0; list-style: none; }
.doc__credits li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.doc__credits img { width: 96px; height: 64px; object-fit: cover; border-radius: var(--r-sm); }
/* the legal pages' footer: the links row only, on the page's paper */
.footer.closing--links { height: auto; padding-top: var(--s-9); padding-bottom: calc(var(--s-7) + var(--bar, 0px)); }
.footer.closing--links > .wrap { height: auto; display: block; }

/* ------------------------------------------------------------ the hero (owner's brief): the tagline set large,
   RoundTriip's own crew as the cut-out subject on the paper, a feature strip along the foot */
.hero--brand > .wrap > .hero-text.brand-hero {
  height: 100%;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter, 24px);
  grid-template-rows: minmax(0, 1fr) auto;
}
.brand-hero__copy { grid-column: 1 / span 7; grid-row: 1; align-self: start; position: relative; z-index: 2; }
.brand-hero__copy h1 { margin: 0; font: inherit; letter-spacing: normal; }
.brand-hero__tag {
  display: block; max-width: 10.5ch;
  font: 700 clamp(48px, 8vw, 124px)/0.93 var(--font-display);
  letter-spacing: -0.045em; color: var(--ink);
  text-wrap: balance;
}
.brand-hero__what {
  display: block; margin-top: var(--s-5);
  font: 500 clamp(22px, 1.2vw + 17px, 36px)/1.2 var(--font-display); letter-spacing: -0.015em; color: var(--ink);
}
.brand-hero__lead { margin-top: var(--s-4); max-width: 36ch; font-size: var(--t-lead); line-height: 1.5; color: var(--ink); }
.brand-hero__copy .btn-row { margin-top: var(--s-6); }
.brand-hero__crew {
  grid-column: 6 / -1; grid-row: 1; align-self: stretch; min-height: 0;
  position: relative; z-index: 1; margin: 0;
}
.brand-hero__crew img { width: 100%; height: 100%; object-fit: contain; object-position: right bottom; }
/* the crew stands on the strip's top rule, the way a counter cuts them off */
.brand-hero__strip {
  grid-column: 1 / -1; grid-row: 2;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0; padding: var(--s-5) 0 0; list-style: none; border-top: 1px solid var(--line-strong);
}
.brand-hero__strip li { display: grid; gap: var(--s-2); align-content: start; padding-right: var(--s-5); }
.brand-hero__strip li + li { border-left: 1px solid var(--line); padding-left: var(--s-5); }
.brand-hero__strip svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-hero__strip strong { display: block; font-weight: 500; font-size: var(--t-body); }
.brand-hero__strip li span span { display: block; font-size: var(--t-small); color: var(--muted); }
/* 1024 to 1279: the words keep six columns and the crew five, so no word sits on the picture */
@media (min-width: 1024px) and (max-width: 1279px) {
  .brand-hero__copy { grid-column: 1 / span 7; }
  .brand-hero__crew { grid-column: 8 / -1; }
}
@media (min-width: 1024px) { .brand-hero__copy .btn-row { flex-wrap: nowrap; } }
@media (max-width: 1023px) {
  .hero--brand > .wrap > .hero-text.brand-hero { display: flex; flex-direction: column; }
  .brand-hero__crew { flex: 1 1 0; min-height: 180px; margin: var(--s-5) 0 0; }
  .brand-hero__crew img { object-position: center bottom; }
  .brand-hero__strip { display: none; }
}
@media (max-width: 639px) {
  .brand-hero__what { font-size: 20px; margin-top: var(--s-4); }
  .brand-hero__lead { font-size: 17px; }
}

/* ------------------------------------------------------------ #deliver: the four drivers, each on a concrete slab */
.crew-cards { row-gap: var(--s-6); }
.crew-card { display: grid; gap: var(--s-2); align-content: start; }
.crew-card__frame {
  aspect-ratio: 7 / 10; overflow: hidden; border-radius: var(--r-lg);
  background: var(--p-surface) var(--tex-concrete) 0 0 / 640px 640px;
  margin-bottom: var(--s-3);
}
.crew-card__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.crew-card h3 { font: 500 var(--t-h3s)/1.25 var(--font-display); letter-spacing: -0.01em; }
.crew-card p { color: var(--ink); }
@media (min-width: 640px) and (max-width: 1023px) {
  .crew-cards > .crew-card { grid-column: auto / span 3; }
}
@media (max-width: 639px) {
  /* a phone keeps the four drivers and their names on one screen; the lines under them are for wider screens */
  .crew-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-5); }
  .crew-cards > .crew-card { grid-column: auto; }
  .crew-card__frame { aspect-ratio: 1 / 1; margin-bottom: var(--s-2); }
  .crew-card__frame img { object-position: 50% 30%; }

  .crew-card p { display: none; }
  #questions .faq p { font-size: 15px; }
  #questions .t-lead { font-size: 16px; }
}

/* ------------------------------------------------------------ #how: the three steps (each with its portal screen) */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5); counter-reset: step; }
.how-step { display: grid; grid-template-columns: minmax(0, 1fr) 136px; gap: var(--s-5); align-items: start;
  padding-top: var(--s-5); border-top: 1px solid var(--line); }
.how-step img { width: 136px; height: 102px; object-fit: cover; border-radius: var(--r-sm); }
.how-step h3 { font: 500 var(--t-h3s)/1.25 var(--font-display); letter-spacing: -0.01em; }
.how-step p { margin-top: var(--s-2); color: var(--ink); }
@media (max-width: 639px) {
  .how-steps { gap: var(--s-6); }
  .how-step { grid-template-columns: minmax(0, 1fr) 120px; gap: var(--s-4); }
  .how-step img { width: 120px; height: 90px; }
}

/* ------------------------------------------------------------ the quote calculator: a sheet of paper on light concrete */
.quote {
  padding: var(--s-6); border-radius: var(--r-lg);
  background: var(--p-surface) var(--tex-concrete) 0 0 / 640px 640px;
}
.quote__form, .quote__email {
  padding: var(--s-6); border-radius: var(--r-md);
  background: var(--p-bg) var(--tex-paper) 0 0 / 480px 480px;
  box-shadow: 0 1px 1px rgba(14, 49, 48, 0.12), 0 16px 32px -18px rgba(14, 49, 48, 0.45);
  display: grid; gap: var(--s-4);
}
.quote__summary { display: grid; gap: var(--s-1); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.quote__summary-price { font: 700 28px/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--ink); }
.quote__summary-route { font-size: var(--t-small); color: var(--muted); }
.quote__summary .quote__share { justify-self: start; min-height: 32px; }
.quote__head h3 { font: 500 var(--t-h3s)/1.25 var(--font-display); letter-spacing: -0.01em; }
#questions .faq :is(.faq__item > h3) { font: 500 var(--t-h3s)/1.3 var(--font-display); letter-spacing: -0.01em; }
/* "Get a price" in the header lands on the calculator, clear of the fixed header */
#quote { scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.quote__head p { margin-top: var(--s-1); font-size: var(--t-small); color: var(--muted); }
.quote__email h4 { font: 500 var(--t-lead)/1.3 var(--font-text); }
.qf { display: grid; gap: var(--s-1); min-width: 0; border: 0; padding: 0; margin: 0; }
.qf > label, .qf > legend { font-size: var(--t-small); font-weight: 500; color: var(--ink); padding: 0; margin-bottom: var(--s-1); }
.qf__opt { font-weight: 400; color: var(--muted); }
.qf input[type="text"], .qf input[type="email"], .qf input[type="tel"], .qf input[type="datetime-local"] {
  width: 100%; height: 48px; padding: 0 var(--s-4); font: 400 16px/1 var(--font-text); color: var(--ink);
  background: color-mix(in oklab, #fff 55%, var(--p-bg)); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
.qf input:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 1px; }
.qf input[aria-invalid="true"] { border-color: #a4262c; }
.qf__error { font-size: var(--t-small); color: #a4262c; }
.qf__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.qf__combo { position: relative; }
.qf__list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: var(--s-1); list-style: none;
  background: var(--p-bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: 0 12px 28px -12px rgba(14, 49, 48, 0.4); max-height: 260px; overflow: auto;
}
.qf__list li { padding: 10px var(--s-3); border-radius: calc(var(--r-sm) - 2px); cursor: pointer; font-size: var(--t-small); line-height: 1.4; }
.qf__list li[aria-selected="true"], .qf__list li:hover { background: color-mix(in oklab, var(--p-ink) 8%, transparent); }
.qf__list li.qf__none { color: var(--muted); cursor: default; background: none; }
.qf__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: var(--t-small); background: color-mix(in oklab, #fff 40%, var(--p-bg));
}
.chip input:checked + span { background: var(--p-ink); color: var(--p-bg); border-color: var(--p-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--p-ink); outline-offset: 2px; }
.qf--at { margin-top: var(--s-3); }
.qf__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.quote__result { border-top: 1px solid var(--line); padding-top: var(--s-4); min-height: 64px; }
.quote__empty, .quote__busy { color: var(--muted); }
.quote__amount { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.quote__amount [data-q="price"] { font: 700 clamp(36px, 4vw, 48px)/1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); }
.quote__amount-note { font-size: var(--t-small); color: var(--muted); }
.quote__lines { margin: var(--s-3) 0 0; display: grid; gap: var(--s-1); font-size: var(--t-small); }
.quote__lines > div { display: flex; justify-content: space-between; gap: var(--s-4); }
.quote__lines dd { margin: 0; font-variant-numeric: tabular-nums; }
.quote__fine { margin-top: var(--s-3); font-size: var(--t-small); color: var(--muted); }
.quote__fine a { text-decoration: underline; text-underline-offset: 3px; }
.quote__actions { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; }
.quote__share { background: none; border: 0; padding: 0; min-height: 44px; font: 500 var(--t-small) var(--font-text); color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; cursor: pointer; }
.quote__share:hover { text-decoration-color: currentColor; }
.quote__error { color: #a4262c; }
.quote__status { font-size: var(--t-small); min-height: 1.4em; }
.quote__status.is-ok { color: var(--ink); font-weight: 500; }
.quote__status.is-err { color: #a4262c; }
@media (max-width: 639px) {
  .quote { padding: var(--s-3); margin-top: var(--s-6); }
  .quote__form, .quote__email { padding: var(--s-5); }
  .qf__pair { grid-template-columns: 1fr; }
  .quote__actions .btn { width: 100%; }
}
@media (min-width: 640px) and (max-width: 1023px) { .quote { margin-top: var(--s-6); } }
