/* =====================================================================
   Airflows design system
   Tokens first, then the shared components built from them.
   Change a value here and it updates across the page.
   ===================================================================== */
:root {
  /* Colour: blue is the action colour, yellow is the accent */
  --blue: #2860EB;          /* 5.2:1 against white text */
  --blue-dark: #1D4BC4;
  --blue-tint: #E9EFFD;
  --yellow: #F9D601;
  --yellow-dark: #E8C700;

  --ink: #171717;           /* headings */
  --text: #3F4754;          /* body copy */
  --text-soft: #555E6D;     /* secondary copy */
  --link: var(--blue);

  --surface: #FFFFFF;
  --surface-alt: #F3F5FA;
  --card: #FFFFFF;
  --line: #E0E5EF;
  --field-line: #C5CDDC;

  /* Radius: a nested corner is its parent's radius minus the padding */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Spacing: sections are far apart, related items are close */
  --section-y: 64px;
  --head-gap: 32px;

  --shadow: 0 14px 34px -18px rgba(23, 23, 23, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 1024px) {
  :root {
    --section-y: 96px;
    --head-gap: 48px;
  }
}
body.dark-mode {
  --ink: #FFFFFF;
  --text: #D5D9E0;
  --text-soft: #B2BAC7;
  --link: #93B4FF;
  --blue-tint: rgba(96, 140, 255, 0.18);
  --surface: #181818;
  --surface-alt: #121212;
  --card: #202020;
  --line: #313131;
  --field-line: #454545;
}

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  text-wrap: balance;
}
p, li {
  text-wrap: pretty;
}
.title-xl {
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}
.title-lg {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.18;
  color: var(--ink);
}
.title-md {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.lead {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}
.copy {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-soft);
}
/* Figures line up and don't shift as they change */
.num,
a[href^="tel:"],
input[type="tel"],
input[type="date"],
#estimator-text {
  font-variant-numeric: tabular-nums;
}
/* Optical alignment: large letters carry side space that makes them look indented */
.title-xl {
  margin-left: -0.045em;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) {
  .wrap {
    padding-inline: 24px;
  }
}
@media (min-width: 1024px) {
  .wrap {
    padding-inline: 32px;
  }
}
.section {
  padding-block: var(--section-y);
  background: var(--surface);
}
.section-alt {
  background: var(--surface-alt);
}
.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: var(--head-gap);
}
.section-head .lead {
  margin-top: 10px;
  max-width: 52ch;
}
@media (min-width: 900px) {
  .section-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  /* Long headlines wrap; the controls beside them never do */
  .section-head > :last-child:not(:first-child) {
    flex-shrink: 0;
  }
}

/* ---------- Section numbers: 01, 02, 03 ---------- */
/* Counted automatically, so moving or adding a section renumbers the rest */
main {
  counter-reset: section;
}
main > section:not(#home) h2::before {
  counter-increment: section;
  content: counter(section, decimal-leading-zero);
  content: counter(section, decimal-leading-zero) / ""; /* not read aloud */
  display: block;
  width: max-content;
  margin-bottom: 12px;
  padding-right: 56px;
  background: linear-gradient(currentColor, currentColor) right center / 42px 2px no-repeat;
  color: var(--link);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
main > section h2.text-center::before {
  margin-inline: auto;
}
main > section.cta-banner:not(#home) h2::before {
  color: var(--yellow);
}

/* ---------- Links inside text ---------- */
.text-link {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link:hover {
  text-decoration-thickness: 2px;
}
/* Jump links stop below the fixed header */
#estimator {
  scroll-margin-top: 104px;
}
@media (max-width: 1023px) {
  section[id]:not(#home) {
    scroll-margin-top: 24px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s var(--ease);
}
.btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
/* Optical alignment: icons have built-in space, so trim the padding on their side */
.btn:has(> svg:last-child:not(:first-child)) {
  padding-right: 18px;
}
.btn:has(> svg:first-child:not(:only-child)) {
  padding-left: 18px;
}
.btn:active,
.icon-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.btn-sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 13px;
}
.btn-lg {
  min-height: 56px;
  padding: 0 30px;
  font-size: 15.5px;
}
.btn-lg:has(> svg:last-child:not(:first-child)) {
  padding-right: 24px;
}
.btn-lg:has(> svg:first-child:not(:only-child)) {
  padding-left: 24px;
}
/* The main call to action */
.btn-primary {
  background: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 12px 24px -12px rgba(40, 96, 235, 0.75);
}
.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 16px 28px -12px rgba(40, 96, 235, 0.8);
}
/* Main call to action on blue or black backgrounds */
.btn-accent {
  background: var(--yellow);
  color: #171717;
}
.btn-accent:hover {
  background: var(--yellow-dark);
}
.btn-secondary {
  background: var(--card);
  border-color: var(--field-line);
  color: var(--ink);
}
.btn-secondary:hover {
  border-color: var(--link);
  color: var(--link);
}
.btn-on-blue {
  border-color: rgba(255, 255, 255, 0.65);
  color: #FFFFFF;
}
.btn-on-blue:hover {
  background: rgba(255, 255, 255, 0.14);
}
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--link);
}
.btn-text svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}
.btn-text:hover svg {
  transform: translateX(3px);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--field-line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s var(--ease);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.icon-btn:hover:not(:disabled) {
  background: var(--blue);
  border-color: var(--blue);
  color: #FFFFFF;
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--blue-tint);
  color: var(--link);
}
.icon-tile svg {
  width: 20px;
  height: 20px;
}

/* ---------- Surfaces and fields ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--r-sm);
  background-color: var(--card);
  color: var(--ink);
  font-size: 15px;
}
.input::placeholder {
  color: var(--text-soft);
  opacity: 0.85;
}
.input:focus {
  border-color: var(--blue);
}
@media (max-width: 639px) {
  /* 16px stops iPhones zooming in when a field is tapped */
  .input {
    font-size: 16px;
  }
}

/* ---------- Loading states ---------- */
.is-loading {
  position: relative;
  background-color: var(--surface-alt);
}
.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(148, 163, 184, 0.28) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: shimmer 1.2s linear infinite;
  pointer-events: none;
}
.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.85;
}
.btn[aria-busy="true"]::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--r-pill);
  animation: spin 0.7s linear infinite;
}
.btn[aria-busy="true"] svg {
  display: none;
}

/* ---------- Feedback motion ---------- */
.anim-in,
.fix-grid li:not(.is-filtered),
.reel-list li:not(.is-filtered) {
  animation: riseIn 0.35s var(--ease) both;
}
.input.border-red-500 {
  border-color: #DC2626;
  animation: nudge 0.32s ease;
}
.field-error {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #C01F1F;
}
body.dark-mode .field-error {
  color: #FCA5A5;
}
.success-mark path,
.success-mark polyline {
  stroke-dasharray: 80;
  animation: draw 0.7s var(--ease) both;
}
.success-mark polyline {
  animation-delay: 0.25s;
}

@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -100% 0;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes nudge {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: 80;
  }
}
@media (prefers-reduced-motion: reduce) {
  .anim-in,
  .fix-grid li:not(.is-filtered),
  .reel-list li:not(.is-filtered),
  .input.border-red-500,
  .success-mark path,
  .success-mark polyline,
  .is-loading::after {
    animation: none;
  }
  .btn,
  .icon-btn,
  .btn-text svg {
    transition: none;
  }
}
