/* ============================================================================
   DoorYard — marketing site design system.

   Token VALUES here are mirrored from the product's canonical source of truth:
   C:\repos\dooryard\docs\BRAND.md, as resolved in apps/web/app/globals.css.
   If BRAND.md changes, this file is the only place to change on this site.

   Two brand rules that drive most of what follows:
     - Amber (#FFB020) means "take action". It is never a warning color.
     - Elevation is 1px borders, not shadows. No glassmorphism, no blur.
   ========================================================================= */

:root {
  /* --- brand --- */
  --brand: #3157f6; /* electric cobalt */
  --brand-dark: #172554; /* midnight indigo */
  --brand-hover: #2448d8;
  --brand-pressed: #1d3dba;

  /* --- action (amber = do the thing) --- */
  --action: #ffb020;
  --action-hover: #e99a00;
  --action-pressed: #cd8500;
  --on-action: #172033;

  /* --- surfaces --- */
  --page: #fafaf8; /* warm white */
  --card: #ffffff;
  --surface-brand: #eef3ff;
  --surface-sunk: #f4f5f3;

  /* --- text --- */
  --text: #172033; /* blue-black, never pure black */
  --text-2: #536078;
  /* BRAND.md's muted is #7A8498, which measures 3.6:1 on this page background —
     fine for de-emphasized UI chrome, short of AA for the running text this site
     uses it on (footer, captions, timestamps). Darkened to clear 4.5:1. */
  --text-muted: #667085;
  --on-brand: #ffffff;

  /* The CTA band must stay a dark surface in BOTH themes. --brand-dark inverts
     to a light tint under dark mode, so it cannot be used here. */
  --cta-surface: #172554;
  --cta-text: #ffffff;
  --cta-text-2: #c8d3ef;

  /* --- status --- */
  --success: #168a62;
  --error: #d94141;
  --success-surface: #e4f5ee;
  --warning-surface: #fff3d8;

  /* --- lines --- */
  --border: #e3e7ef;
  --border-strong: #c9d0dd;

  /* --- shape --- */
  --r-chip: 8px;
  --r-control: 12px;
  --r-card: 16px;
  --r-feature: 18px;
  --r-sheet: 24px;
  --shadow-card: 0 1px 2px rgba(23, 32, 51, 0.04), 0 6px 18px rgba(23, 32, 51, 0.06);

  /* --- 8-point spacing --- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --s20: 80px;

  /* --- type --- */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  /* Manrope is permitted on marketing headlines only — never inside the app. */
  --font-display: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --content: 1120px;
  --measure: 68ch;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Illustration-only tints. Kept as tokens so the scene retheme with the page. */
  --scene-sky: #eef3ff;
  --scene-ground: #e8efe6;
  --scene-road: #dfe3ea;
  --scene-roof: #c9d0dd;
  --scene-wall: #ffffff;
  --scene-wall-2: #f2f4f8;
  --scene-tree: #cfe0cb;
  --scene-line: #c9d0dd;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d1424;
    --card: #141d30;
    --surface-brand: #16213d;
    --surface-sunk: #101828;

    --text: #f5f7fb;
    --text-2: #bac3d3;
    --text-muted: #93a0b8;

    --brand: #6f8bff;
    --brand-dark: #afc0ff;
    --brand-hover: #8aa1ff;
    --brand-pressed: #6f8bff;
    /* The dark-mode brand blue is light; white on it is only 3.1:1. */
    --on-brand: #0d1424;

    --cta-surface: #182240;

    --success: #39b985;
    --error: #f06464;
    --success-surface: #123528;
    --warning-surface: #33280f;

    --border: #29344a;
    --border-strong: #3a4762;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.25);

    --scene-sky: #101a2e;
    --scene-ground: #16241f;
    --scene-road: #1c2740;
    --scene-roof: #33405c;
    --scene-wall: #1c2941;
    --scene-wall-2: #162034;
    --scene-tree: #1f3a2e;
    --scene-line: #33405c;

    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- reset -- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--brand-hover);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 700;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

ul[role="list"] {
  list-style: none;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-chip);
}

::selection {
  background: rgba(255, 176, 32, 0.35);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  position: fixed;
  top: var(--s4);
  left: var(--s4);
  z-index: 100;
  width: auto;
  height: auto;
  padding: var(--s3) var(--s5);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  border-radius: var(--r-control);
}

/* -------------------------------------------------------------- layout -- */
.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--s6);
}

.section {
  padding-block: clamp(var(--s16), 9vw, 112px);
}

.section--sunk {
  background: var(--surface-sunk);
  border-block: 1px solid var(--border);
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s4);
}

.section-title {
  font-size: clamp(28px, 3.6vw, 42px);
  margin-bottom: var(--s4);
  max-width: 20ch;
}

.section-intro {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--text-2);
  max-width: var(--measure);
  margin-bottom: var(--s10);
}

.lede {
  color: var(--text-2);
  max-width: var(--measure);
}

/* -------------------------------------------------------------- header -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--s5);
  min-height: 72px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.brand-lockup img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.site-nav {
  display: none;
  gap: var(--s6);
}
.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--text);
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }
}

/* ------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 56px; /* homeowner-primary floor from BRAND.md */
  padding: var(--s3) var(--s6);
  border-radius: var(--r-control);
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease),
    color 180ms var(--ease), transform 180ms var(--ease);
}
.btn:active {
  transform: translateY(1px);
}

.btn--action {
  background: var(--action);
  color: var(--on-action);
}
.btn--action:hover {
  background: var(--action-hover);
  color: var(--on-action);
}
.btn--action:active {
  background: var(--action-pressed);
}

.btn--brand {
  background: var(--brand);
  color: var(--on-brand);
}
.btn--brand:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
}

.btn--quiet {
  background: var(--card);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--quiet:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn--sm {
  min-height: 44px;
  padding: var(--s2) var(--s5);
  font-size: 15px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ---------------------------------------------------------------- hero -- */
.hero {
  padding-top: clamp(var(--s12), 6vw, var(--s20));
  padding-bottom: clamp(var(--s12), 6vw, var(--s16));
}

.hero-grid {
  display: grid;
  gap: clamp(var(--s10), 5vw, var(--s16));
  align-items: center;
}
@media (min-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
  margin-bottom: var(--s5);
}
.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--action);
  flex: none;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  letter-spacing: -0.025em;
  margin-bottom: var(--s5);
  max-width: 16ch;
}

.hero-sub {
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--text-2);
  max-width: 52ch;
  margin-bottom: var(--s8);
}

.hero-note {
  margin-top: var(--s5);
  font-size: 14px;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero-figure {
  margin: 0;
}
.hero-figure figcaption {
  margin-top: var(--s3);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.scene {
  border: 1px solid var(--border);
  border-radius: var(--r-sheet);
  background: var(--scene-sky);
  overflow: hidden;
}
.scene svg {
  width: 100%;
  height: auto;
}

/* Pins bloom one house at a time — the offer moving down the block.
   The animated element is always an INNER <g>: a CSS transform replaces an
   element's SVG transform attribute outright, so animating the positioned
   <g> would yank every pin back to the origin. Outer g positions, inner g
   animates. transform-box makes `center bottom` resolve against the pin's
   own box, so it scales from its tip. */
.pin {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: pin-bloom 6s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.45s);
  opacity: 0;
}

@keyframes pin-bloom {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.6);
  }
  8%,
  62% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  74%,
  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .pin {
    animation: none;
    opacity: 1;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------- cards -- */
.grid {
  display: grid;
  gap: var(--s5);
}
.grid--2 {
  grid-template-columns: 1fr;
}
.grid--3 {
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1040px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.card h3 {
  font-size: 20px;
  letter-spacing: -0.01em;
}
.card p {
  color: var(--text-2);
  font-size: 16px;
}
.card--feature {
  border-radius: var(--r-feature);
  box-shadow: var(--shadow-card);
  padding: var(--s8);
  gap: var(--s4);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-chip);
  background: var(--surface-brand);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}
.card-icon svg {
  width: 22px;
  height: 22px;
}

.step-num {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand);
}

/* Numbers are the product — tabular everywhere.
   Selector is doubled up because `.card p` (0,1,1) would otherwise beat a bare
   `.stat` (0,1,0) and render the headline figure at body size. */
.card .stat,
.stat {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.card .stat-label,
.stat-label {
  color: var(--text-2);
  font-size: 15px;
  margin-top: var(--s2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s2);
}
.chip {
  padding: 6px var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}

.ticks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.ticks li {
  position: relative;
  padding-left: 30px;
  color: var(--text-2);
  font-size: 16px;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success-surface);
  border: 1px solid var(--success);
}
.ticks li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

/* --------------------------------------------------- offer illustration -- */
.offer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-feature);
  box-shadow: var(--shadow-card);
  padding: var(--s5);
  max-width: 380px;
}
.offer-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.offer-head img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.offer-app {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.offer-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s1);
}
.offer-body {
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: var(--s4);
}
.offer-actions {
  display: flex;
  gap: var(--s2);
}
.offer-actions .btn {
  flex: 1;
}

/* --------------------------------------------------------------- split -- */
.split {
  display: grid;
  gap: var(--s10);
  align-items: center;
}
@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  /* Source order is always the reading order (heading, then its supporting
     card) so the single-column mobile layout makes sense. This only pulls the
     card to the left once there are two columns to put it in. */
  .split--reverse > *:last-child {
    order: -1;
  }
}

/* ----------------------------------------------------------------- cta -- */
.cta-band {
  background: var(--cta-surface);
  border-radius: var(--r-sheet);
  padding: clamp(var(--s10), 6vw, var(--s16));
  text-align: center;
  color: var(--cta-text);
}
.cta-band h2 {
  color: var(--cta-text);
  font-size: clamp(26px, 3.2vw, 38px);
  margin-bottom: var(--s4);
  margin-inline: auto;
  max-width: 22ch;
}
.cta-band p {
  color: var(--cta-text-2);
  max-width: 56ch;
  margin: 0 auto var(--s8);
}
.cta-band .btn-row {
  justify-content: center;
}

/* -------------------------------------------------------------- footer -- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--s12) var(--s10);
  background: var(--page);
}
.footer-grid {
  display: grid;
  gap: var(--s8);
  margin-bottom: var(--s10);
}
@media (min-width: 820px) {
  .footer-grid {
    grid-template-columns: 1.6fr repeat(3, 1fr);
  }
}
.footer-about p {
  color: var(--text-2);
  font-size: 15px;
  max-width: 40ch;
  margin-top: var(--s4);
}
.footer-col h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s4);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.footer-col a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
}
.footer-col a:hover {
  color: var(--brand);
}
.footer-legal {
  border-top: 1px solid var(--border);
  padding-top: var(--s6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s6);
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}
.footer-legal a {
  color: var(--text-muted);
}

/* ------------------------------------------------------------ doc page -- */
.doc {
  padding-block: var(--s12) var(--s16);
}
.doc-inner {
  max-width: 760px;
  margin-inline: auto;
}
.doc h1 {
  font-size: clamp(30px, 4vw, 44px);
  margin-bottom: var(--s3);
}
.doc .updated {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: var(--s8);
}
.doc h2 {
  font-size: 22px;
  margin-top: var(--s10);
  margin-bottom: var(--s3);
  padding-top: var(--s6);
  border-top: 1px solid var(--border);
}
.doc h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: var(--s8);
}
.doc h3 {
  font-size: 18px;
  margin-top: var(--s6);
  margin-bottom: var(--s2);
}
.doc p,
.doc li {
  color: var(--text-2);
  font-size: 17px;
  margin-bottom: var(--s4);
}
.doc ul,
.doc ol {
  padding-left: var(--s6);
  margin-bottom: var(--s4);
}
.doc li {
  margin-bottom: var(--s2);
}
.doc strong {
  color: var(--text);
}
.callout {
  background: var(--surface-brand);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-control);
  padding: var(--s5);
  margin-block: var(--s6);
}
.callout p:last-child {
  margin-bottom: 0;
}
.doc-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s5) var(--s6);
  margin-bottom: var(--s10);
}
.doc-toc h2 {
  border: 0;
  padding: 0;
  margin: 0 0 var(--s3);
  font-size: 13px;
  font-family: var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.doc-toc ol {
  margin: 0;
  padding-left: var(--s5);
}
.doc-toc li {
  margin-bottom: var(--s2);
  font-size: 15px;
}

.contact-grid {
  display: grid;
  gap: var(--s4);
  margin-bottom: var(--s8);
}
@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s5);
}
.contact-card h3 {
  font-size: 17px;
  margin-bottom: var(--s1);
}
.contact-card p {
  font-size: 15px;
  margin-bottom: var(--s3);
}
.contact-card a {
  font-weight: 600;
  word-break: break-word;
}

/* ------------------------------------------------------- scroll reveal --
   Gated on .js, which a one-line inline script in <head> sets. If scripting
   is off — or app.js simply never arrives — the selector never matches and
   every section renders visible. Content must never depend on JS to be seen. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
