/* ==========================================================================
   Polypi website — single-file mobile-first stylesheet
   ========================================================================== */

/* Fonts: self-hosted (S-38 — nothing loads from Google). Inter is the app's
   own face, cut to Latin; Nunito ExtraBold draws the "Polypi" wordmark only. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-700.woff2") format("woff2");
  font-weight: 700 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

/* Design tokens ------------------------------------------------------------ */
/* Colours copied from the app's main/static/css/style.css (never linked). */
:root {
  --brand:        #0057B7;  /* app --primary: links, accent text on white (6.8:1) */
  --brand-ink:    #004692;  /* app link hover: header, dark bands, headings */
  --brand-soft:   #E9EFFC;  /* app --primary-light: tinted sections */
  --accent:       #F4B006;  /* app --secondary: main buttons, with --ink text (6.5:1); never text on white */
  --accent-hover: #FFC427;  /* app --secondary-hover */
  --accent-soft:  #FDF3D6;
  --ink:          #303649;  /* app --text-primary: body text */
  --muted:        #64748B;  /* app --text-secondary (4.7:1 on white) */
  --line:         #E5E7EB;  /* app --border-color */
  --paper:        #F8F9FA;  /* app --background */
  --white:        #FFFFFF;
  --on-dark-muted: #C9D6EA; /* secondary text on --brand-ink (6.6:1) */
  --success:      #2E7D32;
  --error:        #B3261E;

  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: var(--font-body);
  --font-wordmark: "Nunito", var(--font-body);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 1px rgba(16,24,40,.04);
  --shadow-md: 0 8px 24px rgba(0,38,84,.08), 0 2px 6px rgba(0,38,84,.05);
  --shadow-lg: 0 24px 60px rgba(0,38,84,.18), 0 6px 14px rgba(0,38,84,.06);

  --container-w: 1180px;
  --container-narrow: 760px;
  --header-h: 68px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Reset + base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip` is safer than `hidden` — does not establish a scroll container
     or break sticky positioning. Defends against off-screen decorative
     bleed without masking real overflow sources. */
  overflow-x: clip;
  /* Long unbreakable tokens (URLs, emails, hashes in future copy) must
     wrap instead of pushing the viewport wider at 320px. */
  overflow-wrap: break-word;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--brand-ink);
  margin: 0 0 .5em;
  font-weight: 800;
}
h1 {
  font-size: clamp(2.2rem, 6vw + .75rem, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h3 {
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h4 {
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; line-height: 1.6; }

/* Form fields need ≥16px to prevent iOS zoom on focus */
input, select, textarea, button { font: inherit; font-size: 16px; }

/* Utility ------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.container--narrow { max-width: var(--container-narrow); }

/* Accessible "visually hidden" utility. `!important` on every declaration so
   higher-specificity rules elsewhere (e.g. `.field input { width: 100% }`)
   cannot inflate a hidden control like the file picker into a 100%-wide,
   absolutely-positioned box that pushes document scrollWidth past the
   viewport and breaks mobile layout. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.accent { color: var(--accent); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 .75rem;
}

.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--brand-ink); color: #fff;
  padding: 12px 16px; z-index: 1000;
  text-decoration: none; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { top: 0; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 14px 22px;
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--brand-ink);
  transition: background-color .15s var(--ease), color .15s var(--ease),
              border-color .15s var(--ease), transform .15s var(--ease),
              box-shadow .15s var(--ease);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(244,176,6,.35);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--ink);
  text-decoration: none;
}
.btn--ghost {
  border-color: rgba(255,255,255,.85);
  color: #fff;
}
/* On the dark hero background, give the ghost button a frosted backdrop
   so the white text stays legible over bright spots in the photo. */
.hero .btn--ghost {
  background: rgba(0,38,84,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.btn--ghost:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  text-decoration: none;
}
.hero .btn--ghost:hover {
  background: rgba(0,38,84,.7);
  border-color: #fff;
}
.section--cta .btn--ghost,
.section:not(.hero):not(.section--dark) .btn--ghost {
  border-color: var(--brand-ink);
  color: var(--brand-ink);
}
.btn--lg { min-height: 56px; padding: 16px 28px; font-size: 1.05rem; }
.btn--sm { min-height: 40px; padding: 10px 16px; font-size: .95rem; }
.btn--block { display: flex; width: 100%; }

/* Loading state */
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"] .btn__label::after { content: "…"; }
.btn__spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn[aria-busy="true"] .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0,38,84,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--accent);
  color: #fff;
  transition: box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
  padding-block: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  flex: 0 0 auto;
  min-width: 0;
  border-radius: var(--radius-sm);
  outline-offset: 4px;
}
.brand:focus-visible {
  outline: 2px solid var(--accent);
}
/* The octopus mark and the "Polypi" word beside it, as the app's sign-in
   pages draw them (auth.css .auth-brand): the word in Nunito ExtraBold. */
.brand__logo {
  display: block;
  width: 40px;
  height: 40px;
  /* The mark is drawn for the app's white sidebar: its blue body vanishes on
     the dark header and footer, so it sits on a white tile there. */
  padding: 3px;
  background: #fff;
  border-radius: 10px;
}
.brand--on-light .brand__logo { padding: 0; background: none; }
.brand__text {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-wordmark);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
}
.brand__logo.is-broken { display: none; }

.site-nav { margin-left: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.nav-toggle:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.32);
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
  transition: transform .2s var(--ease), top .2s var(--ease), bottom .2s var(--ease), background-color .2s var(--ease);
}
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { bottom: -7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { bottom: 0; transform: rotate(-45deg); }

.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: none;
}
.nav-list a {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  font-weight: 600;
  color: rgba(255,255,255,.82);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  letter-spacing: .01em;
  position: relative;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.nav-list a:hover,
.nav-list a:focus-visible { color: #fff; }
.nav-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header__cta { display: none; }

/* Mobile open menu — drops below header as a dark panel */
.nav-list.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--brand-ink);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.12);
  padding: 8px 12px 14px;
  box-shadow: 0 16px 32px rgba(0,0,0,.4);
}
.nav-list.is-open li + li {
  border-top: 1px solid rgba(255,255,255,.06);
}
.nav-list.is-open a {
  padding: 16px 12px;
  font-size: 1rem;
  color: rgba(255,255,255,.88);
}
.nav-list.is-open a:hover,
.nav-list.is-open a:focus-visible {
  background: rgba(255,255,255,.04);
  color: #fff;
}

@media (min-width: 880px) {
  :root { --header-h: 80px; }
  .brand__logo { width: 46px; height: 46px; }
  .brand__text { font-size: 1.8rem; }
  /* Sign in closes the link row, set apart from the page links. */
  .nav-list__signin { margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.22); }
  .nav-list__signin a { color: #fff; }
  .header__inner { gap: 16px; }

  .nav-toggle { display: none; }
  .nav-list {
    display: flex !important;
    align-items: center;
    position: static !important;
    gap: 2px;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0;
  }
  .nav-list a { padding: 10px 14px; }
  /* Gold underline indicator on hover/focus/current */
  .nav-list a::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s var(--ease);
  }
  .nav-list a:hover::after,
  .nav-list a:focus-visible::after,
  .nav-list a[aria-current="page"]::after,
  .nav-list a.is-active::after {
    transform: scaleX(1);
  }
  .header__cta { display: inline-flex; margin-left: 4px; }
}

/* Sections ----------------------------------------------------------------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
/* Anchor-jump landing offset (used by native hash navigation + scrollIntoView).
   The JS smooth-scroll in main.js already subtracts the live header height; this
   rule covers the fallback paths (deep links, hash navigation without JS,
   prefers-reduced-motion users) and stays correct during iOS Safari's dynamic
   header collapse. */
.section, .hero {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.section--soft { background: var(--brand-soft); }
.section--dark { background: var(--brand-ink); color: #E9EFFC; }
.section--dark h2,
.section--dark h3 { color: #fff; }
.section--cta {
  background:
    radial-gradient(120% 80% at 50% 0%, var(--accent-soft) 0%, transparent 60%),
    var(--paper);
}

.section__head {
  text-align: center;
  margin-bottom: clamp(32px, 5vw, 56px);
  max-width: 720px;
  margin-inline: auto;
}
.section__head--light .eyebrow { color: var(--accent); }
.section__sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: .25rem;
}
.section--dark .section__sub { color: var(--on-dark-muted); }

/* The line under every "Start free trial" button. */
.cta-note {
  margin: 12px 0 0;
  font-size: .9rem;
  color: var(--muted);
}
.hero .cta-note,
.section--dark .cta-note { color: var(--on-dark-muted); }
.cta-band__actions { margin: 28px 0 0; display: flex; justify-content: center; }

/* The wordmark on a light background (404 page). */
.brand--on-light .brand__text { color: var(--brand-ink); }

/* Grid --------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(16px, 3vw, 24px);
}
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Two-column layout ------------------------------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) {
  .two-col { grid-template-columns: 1.1fr 0.9fr; }
}
.two-col__visual { order: -1; }
@media (min-width: 900px) {
  .two-col__visual { order: 0; }
}

/* Cards -------------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(244,176,6,.4);
}
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); }

.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-weight: 700;
  text-decoration: none;
  color: var(--brand-ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.card__cta:hover { color: var(--brand); }

/* Hero --------------------------------------------------------------------- */
.hero {
  position: relative;
  /* Pull the hero up under the translucent header so the frosted blur
     picks up the hero image instead of the white page background. */
  margin-top: calc(-1 * var(--header-h));
  /* `svh` = small-viewport height. Stable while iOS Safari toolbar collapses,
     so the hero won't suddenly snap taller mid-scroll. Bounded floor lowered
     for small-screen phones (e.g. iPhone SE @ 568px). */
  min-height: clamp(480px, 80svh, 760px);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}
.hero__media {
  position: absolute; inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(64,140,255,.35), transparent 60%),
    radial-gradient(120% 80% at 80% 90%, rgba(0,38,84,.45), transparent 60%),
    linear-gradient(135deg, #003A7A 0%, #0057B7 100%);
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
/* If the hero image is missing or 0-byte, the gradient stays visible */
.hero__media img:not([src]),
.hero__media img[src=""] { display: none; }
.hero__overlay {
  position: absolute; inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,38,84,.55) 0%, rgba(0,38,84,.35) 40%, rgba(0,38,84,.75) 100%);
}
.hero__content {
  /* Top padding clears the overlapping header + adds breathing room. */
  padding-block: calc(var(--header-h) + 32px) 64px;
  max-width: 760px;
  /* As the sole flex child of .hero, default min-width:auto would let
     intrinsic content (e.g. an unbroken h1 word) push past the viewport. */
  min-width: 0;
  color: #fff;
}
.hero__eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
  padding: 6px 14px;
  background: rgba(0,38,84,.6);
  border: 1px solid rgba(244,176,6,.35);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero h1 { color: #fff; margin-bottom: 16px; }
.hero__sub {
  font-size: clamp(1rem, 1vw + .8rem, 1.2rem);
  color: rgba(255,255,255,.92);
  max-width: 620px;
  margin-bottom: 28px;
}
.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.trust-strip {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .9rem;
  color: rgba(255,255,255,.92);
}
.trust-strip li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}
.trust-strip strong { color: #fff; font-weight: 700; }
.trust-strip .muted { color: rgba(255,255,255,.6); font-weight: 400; }
.trust-strip__icon {
  flex-shrink: 0;
  opacity: .85;
}

/* How it works ------------------------------------------------------------ */
.steps {
  list-style: none; padding: 0; margin: 0 0 32px;
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
  position: relative;
  padding: 28px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
}
.step h3 { color: #fff; }
.step p { color: var(--on-dark-muted); margin-bottom: 0; }
.step__num {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: var(--brand-ink);
  border-radius: 50%;
  font-weight: 900;
  font-size: 1.15rem;
  margin-bottom: 16px;
}

/* FAQ ---------------------------------------------------------------------- */
.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 700;
  color: var(--brand-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  min-height: 56px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brand);
  transition: transform .2s var(--ease);
  flex-shrink: 0;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--brand); }
.faq summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: var(--radius-md);
}
.faq__body { padding: 0 20px 20px; color: var(--ink); }
.faq__body p:last-child { margin-bottom: 0; }

/* FORM --------------------------------------------------------------------- */
.quote-form {
  background: #fff;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.form-legend { margin: 0 0 16px; }
.req { color: var(--error); font-weight: 700; }

.field { margin-bottom: 18px; }
.field label,
.field__label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--brand-ink);
  font-size: 1rem;
  line-height: 1.3;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--brand-ink);
  min-height: 52px;
  /* keep ≥16px to prevent iOS zoom */
  font-size: 16px;
  line-height: 1.4;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%230B0B0B' d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(244,176,6,.18);
}
.field input:invalid:not(:placeholder-shown),
.field select:invalid:not(:focus) { /* visual cue only after interaction */ }
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(179,38,30,.12);
}
.field__error {
  color: var(--error);
  font-size: .875rem;
  font-weight: 600;
  margin: 6px 0 0;
  display: none;
}
.field.has-error .field__error { display: block; }

.field-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-bottom: 0;
}
@media (min-width: 560px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  /* City gets more room, ZIP stays compact since it's always 5 digits */
  .field-row:has(.field--city):has(.field--zip) {
    grid-template-columns: 2fr 1fr;
  }
}

/* Visual group header for related fields (e.g. address block) */
.field-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
}
.field-group-label svg { flex-shrink: 0; }
.field-group-label .muted {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: .85rem;
  color: var(--muted);
}

/* Modern select dropdown — leading icon + animated chevron */
.select-wrap {
  position: relative;
  display: block;
}
.select-wrap select {
  padding-left: 48px;
  padding-right: 48px;
  font-weight: 600;
  cursor: pointer;
  /* override the default chevron from .field select */
  background-image: none;
  background-color: #fff;
  box-shadow: 0 1px 0 rgba(0, 38, 84, .02),
              0 2px 6px -3px rgba(0, 38, 84, .06);
  /* Lock to single-line; truncate long option text with ellipsis */
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-wrap select:hover {
  border-color: var(--accent);
  background-color: #F8FAFF;
}
/* Placeholder text — softer when nothing selected */
.select-wrap select:invalid {
  color: var(--muted);
  font-weight: 500;
}
.select-wrap select option {
  color: var(--brand-ink);
  font-weight: 500;
  padding: 12px;
  background: #fff;
}
.select-wrap select option:disabled { color: #94A3B8; }

.select-wrap__icon,
.select-wrap__chevron {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  pointer-events: none;
  line-height: 0;
}
.select-wrap__icon { left: 18px; }
.select-wrap__chevron {
  right: 18px;
  transition: transform .25s var(--ease), color .15s var(--ease);
}
.select-wrap:hover .select-wrap__chevron,
.select-wrap:hover .select-wrap__icon { color: var(--accent); }
.select-wrap:focus-within .select-wrap__icon { color: var(--accent); }
.select-wrap:focus-within .select-wrap__chevron {
  color: var(--accent);
  transform: translateY(-50%) rotate(-180deg);
}

/* Progressive enhancement: style the OPEN dropdown panel in browsers
   that support customizable select (Chrome 130+). Other browsers and
   mobile still get the native OS picker — preserves CLAUDE.md hard rule. */
@supports (appearance: base-select) {
  .select-wrap select,
  .select-wrap select::picker(select) {
    appearance: base-select;
  }
  /* Hide the native picker icon that base-select adds inside the button —
     we already render our own gold chevron via .select-wrap__chevron */
  .select-wrap select::picker-icon { display: none; }
  /* Ensure the selected value stays on one line and truncates cleanly
     inside the base-select button layout */
  .select-wrap select selectedoption {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    min-width: 0;
    flex: 1 1 auto;
  }
  .select-wrap select::picker(select) {
    border: none;
    border-radius: 14px;
    padding: 8px;
    margin-top: 8px;
    background: #fff;
    box-shadow: 0 24px 48px -12px rgba(0, 38, 84, .28),
                0 0 0 1px rgba(244, 176, 6, .25);
    max-height: 360px;
    overflow-y: auto;
    transform-origin: top;
    animation: selectPickerIn .18s var(--ease);
  }
  .select-wrap select option {
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    color: var(--brand-ink);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background-color .12s var(--ease), color .12s var(--ease);
  }
  /* Remove the native checkmark indicator that base-select adds to the
     selected option — the gold fill alone signals selection */
  .select-wrap select option::checkmark { display: none; }
  .select-wrap select option + option { margin-top: 2px; }
  .select-wrap select option:hover,
  .select-wrap select option:focus {
    background: var(--accent-soft);
    color: var(--brand-ink);
    outline: none;
  }
  .select-wrap select option:checked {
    background: var(--accent);
    color: var(--brand-ink);
    font-weight: 700;
  }
  .select-wrap select option:disabled {
    color: #94A3B8;
    cursor: not-allowed;
    background: transparent;
    font-style: italic;
  }
  .select-wrap select option:disabled:hover { background: transparent; }
  @keyframes selectPickerIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
  }
}

/* Footer ------------------------------------------------------------------- */
.site-footer {
  background: var(--brand-ink);
  color: var(--on-dark-muted);
  padding-block: 56px 24px;
}
.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.site-footer a {
  color: var(--on-dark-muted);
  text-decoration: none;
}
.site-footer a:hover { color: #fff; }
.footer__grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 32px;
}
@media (min-width: 600px) {
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
}
.brand__logo--footer { width: 40px; height: 40px; }
.footer__tag { margin-top: 12px; color: var(--on-dark-muted); max-width: 28ch; }

.footer__cta.btn--primary {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
  letter-spacing: .01em;
  padding: 14px 20px;
  margin-top: 4px;
  max-width: 280px;
  box-shadow: 0 6px 18px rgba(244,176,6,.35);
}
.footer__cta.btn--primary:hover {
  color: var(--ink);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(244,176,6,.45);
}
.footer__cta-icon {
  transition: transform .2s var(--ease);
}
.footer__cta:hover .footer__cta-icon {
  transform: translateX(3px);
}

.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { padding: 4px 0; }
.footer__legal {
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 16px;
  text-align: center;
}
.footer__legal .muted { color: var(--on-dark-muted); }

/* Sticky mobile CTA ------------------------------------------------------- */
.mobile-cta {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 40;
  box-sizing: border-box;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  /* Honor safe areas on every side — landscape iPhone has a notch inset on
     one horizontal edge, portrait has the home-indicator inset on the bottom.
     Horizontal inset matches `.container`'s `clamp(16px, 4vw, 32px)` so the
     inner button aligns with page sections at every mobile/tablet width. */
  padding:
    12px
    max(clamp(16px, 4vw, 32px), env(safe-area-inset-right))
    calc(12px + env(safe-area-inset-bottom))
    max(clamp(16px, 4vw, 32px), env(safe-area-inset-left));
  box-shadow: 0 -8px 24px rgba(0,38,84,.08);
  transform: translateY(0);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
/* Pin the inner CTA button to the page's `.container` max-width and center it,
   so its edges line up with on-page sections instead of stretching to the
   viewport edge on wider phones/landscape/tablet widths. */
.mobile-cta .btn {
  display: flex;
  width: 100%;
  max-width: var(--container-w);
  min-width: 0;
  margin-inline: auto;
  box-sizing: border-box;
}
.mobile-cta.is-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}
/* No space is reserved under the page for the bar: main.js hides it once the
   closing band or the footer is in view, so it never covers them. */
@media (min-width: 880px) {
  .mobile-cta { display: none; }
}

/* 404 page ---------------------------------------------------------------- */
.page-narrow {
  /* `svh` keeps the layout stable while iOS Safari's address bar shifts */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--paper);
}
.narrow-stack {
  text-align: center;
  max-width: 520px;
}
.narrow-stack .brand { display: inline-flex; margin-bottom: 24px; }

/* Reduce motion overrides ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .mobile-cta { transition: none; }
}
