/* iTrust Insights Consulting: Interchange, Pine line.
   Fonts are web stand-ins pending Steve's OK (brand guide: Lora headings, Segoe UI body). */

@font-face {
  font-family: "Pliant";
  src: url("../fonts/pliant-latin-var.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/notosans-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --pine: #213D33;
  --pine-deep: #1A3229;
  --sage: #90A77E;
  --terracotta: #9A5C38;      /* passes AA behind white text */
  --terracotta-hover: #87502F;
  --white: #FFFFFF;
  --ink-soft: #E4EBE6;        /* secondary text on pine, tinted from the field */

  --wayfinding: "Pliant", "Segoe UI", Arial, sans-serif;
  --body: "Noto Sans", "Segoe UI", Arial, sans-serif;
  --serif: "Lora", Georgia, serif;

  --gutter: 16px;
  --stroke: 10px;            /* route line weight on phones */
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--pine);
  color: var(--white);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--sage); color: var(--pine); }

/* No word left alone on the last line: headings balance their lines, running text avoids a one-word last line */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, summary, figcaption { text-wrap: pretty; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--white);
  color: var(--pine);
  font-family: var(--wayfinding);
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.chev {
  width: 0.5em;
  height: 0.8em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--wayfinding);
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  border-radius: 12px;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.btn--book { background: var(--terracotta); }
.btn--book:hover { background: var(--terracotta-hover); }
.btn--book:active { transform: translateY(1px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--body);
  text-decoration: none;
  border-bottom: 2px solid var(--sage);
  padding-bottom: 6px;
  transition: border-color 160ms ease-out;
}
.text-link:hover { border-color: var(--white); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.menu-toggle {
  order: 2;
  font: 600 0.9375rem/1 var(--wayfinding);
  color: var(--white);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}
.site-nav { order: 3; flex-basis: 100%; display: none; }
/* Narrow phones: the hero's own booking button sits one screen down, so the header keeps brand and menu. */
@media (max-width: 479px) {
  .site-head .btn--small { display: none; }
}
.site-nav.is-open { display: block; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 8px 0 4px;
  display: grid;
  gap: 2px;
}
.site-nav a {
  display: block;
  padding: 10px 0;
  font-family: var(--wayfinding);
  font-weight: 500;
  font-size: 1.125rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(144, 167, 126, 0.35);
}
.no-js .site-nav { display: block; }
.no-js .menu-toggle { display: none; }
.price-slot { white-space: nowrap; }
.hero__sub br, br.d { display: none; }

/* Route, vertical on phones: the Launch line runs down the left edge. */
.route { position: relative; margin-top: 44px; }

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--wayfinding);
  font-weight: 600;
  color: var(--pine);
  border-radius: 999px;
  line-height: 1;
}
.tag--launch { background: var(--white); font-size: 1.0625rem; padding: 8px 16px; }
.tag--repair { background: var(--sage); font-size: 1rem; padding: 8px 14px; }

.line { list-style: none; margin: 0; padding: 0; position: relative; }

.line--launch { margin-top: 14px; }
.line--launch::before {
  content: "";
  position: absolute;
  left: calc(22px - var(--stroke) / 2);
  top: 22px;
  bottom: 30px;
  width: var(--stroke);
  background: var(--white);
  border-radius: var(--stroke);
  transform-origin: top center;
  transform: scaleY(var(--draw, 1));
}
.dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pine);
  border: 6px solid var(--white);
  font-family: var(--wayfinding);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
}

.lbl { display: block; padding-top: 6px; }
.lbl strong {
  display: block;
  font-family: var(--wayfinding);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.2;
}
.lbl > span {
  display: block;
  margin-top: 2px;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

/* Ongoing loop on phones: a sage loop hanging off the interchange. */
.ongoing {
  position: relative;
  margin: 4px 0 0 22px;
  padding: 18px 20px 18px 30px;
  border: var(--stroke) solid var(--sage);
  border-left-width: 0;
  border-radius: 0 40px 40px 0;
}
.ongoing__ring, .ongoing__leg, .ongoing__stem, .ongoing__stop { display: none; }
.ongoing__text { margin: 0; font-weight: 500; font-size: 1rem; line-height: 1.4; }
.ongoing__text strong {
  display: block;
  font-family: var(--wayfinding);
  font-weight: 700;
  font-size: 1.1875rem;
}

/* Repair on phones: its own sage line, listed below. */
.repair { position: relative; margin-top: 40px; }
/* phones: the sage line runs from First patient, past the Ongoing loop, down to Repair */
.ongoing::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--stroke) / 2);
  top: -64px;
  bottom: calc(-40px - var(--stroke));
  width: var(--stroke);
  background: var(--sage);
}
.repair::before {
  content: "";
  position: absolute;
  left: calc(22px - var(--stroke) / 2);
  top: 0;
  height: 72px;
  width: var(--stroke);
  background: var(--sage);
}
@media (max-width: 999px) {
  .repair .tag--repair { position: relative; z-index: 1; }
}
.repair__join, .repair__bend { display: none; }
.line--repair { margin-top: 14px; }
.line--repair::before {
  content: "";
  position: absolute;
  left: calc(22px - var(--stroke) / 2);
  top: 22px;
  bottom: 40px;
  width: var(--stroke);
  background: var(--sage);
  border-radius: var(--stroke);
  transform-origin: top center;
  transform: scaleY(var(--draw, 1));
}
.line--repair .lbl { padding-top: 0; }

/* ---------- Desktop: the comp's measured frame ----------
   One comp pixel = --px. The stage is the 1536 x 1024 comp, scaled to fit the window,
   with a floor so labels never drop below a readable size on short screens. */

@media (min-width: 1000px) {
  :root {
    --px: max(0.64px, min(calc(100vw / 1536), calc(100svh / 1024)));
  }
  .brand { position: absolute; left: calc(54 * var(--px)); top: calc(38 * var(--px)); gap: 0; }
  .menu-toggle { display: none; }
  .site-nav { display: block; position: absolute; left: calc(831 * var(--px)); top: calc(52 * var(--px)); }
  .site-nav ul { display: flex; padding: 0; gap: calc(36 * var(--px)); }
  .site-nav a {
    padding: 0;
    border: 0;
    font-size: max(12.5px, calc(18 * var(--px)));
    line-height: calc(26 * var(--px));
    letter-spacing: -0.02em;
  }
  .site-nav a:hover { text-decoration: underline; text-decoration-color: var(--sage); text-underline-offset: 6px; text-decoration-thickness: 2px; }

  .hero { height: calc(1024 * var(--px)); }
  .hero__sub br, br.d { display: inline; }

  .route { position: absolute; inset: 0; margin: 0; pointer-events: none; }
  .route a { pointer-events: auto; }

  .route .tag--launch {
    position: absolute;
    left: calc(47 * var(--px));
    top: calc(563 * var(--px));
    width: calc(119 * var(--px));
    height: calc(36 * var(--px));
    padding: 0;
    justify-content: center;
    font-size: calc(22 * var(--px));
  }
  .route .tag--repair {
    position: absolute;
    left: calc(795 * var(--px));
    top: calc(843 * var(--px));
    width: calc(113 * var(--px));
    height: calc(36 * var(--px));
    padding: 0;
    justify-content: center;
    font-size: calc(21 * var(--px));
  }

  .line { position: absolute; inset: 0; margin: 0; }
  .line--launch::before {
    left: calc(96 * var(--px));
    top: calc(631 * var(--px));
    bottom: auto;
    width: calc(1099 * var(--px));
    height: calc(14 * var(--px));
    border-radius: 0;
    transform-origin: left center;
    transform: scaleX(var(--draw, 1));
  }
  .line--repair::before {
    left: calc(960 * var(--px));
    top: calc(876 * var(--px));
    bottom: auto;
    width: calc(464 * var(--px));
    height: calc(14 * var(--px));
    border-radius: calc(7 * var(--px));
    transform-origin: left center;
    transform: scaleX(var(--draw, 1));
  }

  .dot {
    width: calc(58 * var(--px));
    height: calc(58 * var(--px));
    border-width: calc(8 * var(--px));
    font-size: calc(25 * var(--px));
  }

  .lbl { padding-top: calc(11 * var(--px)); }
  .lbl strong { font-size: calc(21.5 * var(--px)); line-height: calc(26 * var(--px)); }
  .lbl > span {
    margin-top: calc(3 * var(--px));
    font-size: max(12px, calc(17 * var(--px)));
    line-height: calc(21.5 * var(--px));
  }

  /* Ongoing loop */
  .ongoing {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }
  .ongoing__ring, .ongoing__leg, .ongoing__stem, .ongoing__stop { display: block; position: absolute; }
  .ongoing::before, .repair::before { display: none; }
  .ongoing__ring {
    left: calc(1150 * var(--px));
    top: calc(295 * var(--px));
    width: calc(312 * var(--px));
    height: calc(300 * var(--px));
    border: calc(14 * var(--px)) solid var(--sage);
    border-radius: 50%;
  }
  .ongoing__leg {
    width: calc(13 * var(--px));
    background: var(--sage);
    border-radius: calc(7 * var(--px));
    transform-origin: top center;
  }
  .ongoing__stem {
    left: calc(1299 * var(--px));
    top: calc(302 * var(--px));
    width: calc(14 * var(--px));
    height: calc(92 * var(--px));
    background: var(--sage);
    border-radius: calc(7 * var(--px));
  }
  .ongoing__stop {
    left: calc(1287 * var(--px));
    top: calc(283 * var(--px));
    width: calc(38 * var(--px));
    height: calc(38 * var(--px));
    border-radius: 50%;
    background: var(--pine);
    border: calc(7 * var(--px)) solid var(--white);
  }
  .ongoing__text {
    position: absolute;
    left: calc(1196 * var(--px));
    top: calc(402 * var(--px));
    width: calc(220 * var(--px));
    text-align: center;
    font-size: calc(19.5 * var(--px));
    line-height: calc(25.5 * var(--px));
  }
  .ongoing__text strong { font-size: calc(25 * var(--px)); line-height: calc(34 * var(--px)); }

  /* Repair line and its join to the interchange */
  .repair { position: absolute; inset: 0; margin: 0; }
  .repair__join, .repair__bend { display: block; position: absolute; }
  .repair__bend {
    left: calc(898 * var(--px));
    top: calc(855 * var(--px));
    width: calc(72 * var(--px));
    height: calc(14 * var(--px));
    background: var(--sage);
    border-radius: calc(7 * var(--px));
    transform-origin: left center;
    transform: rotate(20deg);
  }
  .line--repair .dot {
    width: calc(50 * var(--px));
    height: calc(50 * var(--px));
    border-width: calc(7 * var(--px));
  }
  .line--repair .lbl { padding-top: calc(6 * var(--px)); }
  .line--repair .lbl strong { font-size: calc(23 * var(--px)); line-height: calc(28 * var(--px)); }
}

/* ==========================================================
   Sections below the first viewport (phone first)
   ========================================================== */

.wrap {
  width: min(1200px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

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

.needs-ok {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font: 600 0.75rem/1.5 var(--wayfinding);
  letter-spacing: 0.02em;
  color: var(--pine);
  background: #F2D27A;
  border-radius: 4px;
  vertical-align: 0.15em;
}

/* Everything below the first viewport (sections, bar, footer) lives in pages.css. */

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