/*
  AI Frontdesk website.
  Layout: left-aligned editorial column with a 12-column grid; each page opens with a plain statement,
  then alternates full-bleed bands (canvas / surface) so sections read as distinct rooms, not cards.
  Type: Fraunces for headings (warm, residential, used sparingly), Public Sans for reading (shared with
  the staff app), IBM Plex Mono for the things this product actually prints: reference numbers, phone
  numbers, timestamps and SMS text.
*/
:root {
  color-scheme: light;
  --canvas: #f2f4f7;
  --surface: #ffffff;
  --sunken: #e6eaf0;
  --ink: #1b2433;
  --ink-muted: #4f5b6c;
  --line: #d6dce5;
  --signal: #1f5f8b;
  --signal-strong: #174a6d;
  --signal-ink: #ffffff;
  --signal-tint: #e3eef6;
  --urgent: #b4122c;
  --urgent-tint: #fbe9ec;
  --settled: #1f6e45;
  --phone-body: #1b2433;
  --phone-screen: #f7f8fa;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Public Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.2vw, 3.6rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --measure: 64ch;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --canvas: #11151c;
    --surface: #181e27;
    --sunken: #222a35;
    --ink: #e9edf3;
    --ink-muted: #a7b1bf;
    --line: #2e3744;
    --signal: #7cb8e4;
    --signal-strong: #a3cdec;
    --signal-ink: #0d1520;
    --signal-tint: #1c2d3d;
    --urgent: #ff7088;
    --urgent-tint: #3a1820;
    --settled: #6fd29c;
    --phone-body: #05070a;
    --phone-screen: #1e2530;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #11151c;
  --surface: #181e27;
  --sunken: #222a35;
  --ink: #e9edf3;
  --ink-muted: #a7b1bf;
  --line: #2e3744;
  --signal: #7cb8e4;
  --signal-strong: #a3cdec;
  --signal-ink: #0d1520;
  --signal-tint: #1c2d3d;
  --urgent: #ff7088;
  --urgent-tint: #3a1820;
  --settled: #6fd29c;
  --phone-body: #05070a;
  --phone-screen: #1e2530;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--signal);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--signal-strong);
}

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

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  line-height: 1.12;
}

h1 {
  font-size: var(--step-4);
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.3;
}

p {
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  left: 0.5rem;
  z-index: 50;
  width: auto;
  height: auto;
  clip-path: none;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
}

/* ---------- Header ---------- */

.masthead {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}

.brand-mark rect {
  fill: var(--signal);
}

.brand-mark path,
.brand-mark circle {
  fill: none;
  stroke: var(--signal-ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.brand-mark circle {
  fill: var(--signal-ink);
  stroke: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--sunken);
}

.site-nav .nav-cta,
.site-nav .nav-cta:hover {
  background: var(--signal);
  color: var(--signal-ink);
  margin-left: 0.5rem;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem var(--gutter) 1rem;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.7rem 0.8rem;
    font-size: 1rem;
  }

  .site-nav .nav-cta {
    margin-left: 0;
    text-align: center;
  }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.button.primary {
  background: var(--signal);
  color: var(--signal-ink);
}

.button.primary:hover {
  background: var(--signal-strong);
  color: var(--signal-ink);
}

.button.quiet {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button.quiet:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Sections ---------- */

.page-intro {
  padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) clamp(2rem, 1.5rem + 3vw, 3.5rem);
}

.page-intro .lede {
  margin-top: 1.1rem;
}

.kicker {
  color: var(--signal);
  font-weight: 650;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: var(--measure);
}

.fine {
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.band {
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.band.surface {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 0.75rem;
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--ink-muted);
}

.prose {
  max-width: var(--measure);
  display: grid;
  gap: 1rem;
}

.prose h2 {
  font-size: var(--step-2);
  margin-top: 1.5rem;
}

.prose ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: start;
}

@media (max-width: 860px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 2rem + 4vw, 5.5rem) clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.hero-copy {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.hero-copy .kicker {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The phone shows the product's real output: the urgent text and its take-it link. */
.phone {
  margin: 0;
  justify-self: center;
  width: min(100%, 22rem);
  display: grid;
  gap: 1rem;
}

.phone-frame {
  background: var(--phone-body);
  border-radius: 2.4rem;
  padding: 0.7rem;
  box-shadow: 0 24px 48px -24px rgb(16 24 40 / 0.45);
}

.phone-screen {
  background: var(--phone-screen);
  border-radius: 1.8rem;
  padding: 1.4rem 1rem 1.2rem;
  display: grid;
  gap: 0.9rem;
  min-height: 25rem;
  align-content: start;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-muted);
  padding-inline: 0.4rem;
}

.thread-name {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.sms {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem 1.1rem 1.1rem 0.35rem;
  padding: 0.85rem 0.95rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.sms-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  align-items: baseline;
  font-weight: 650;
}

.urgent-label {
  color: var(--urgent);
}

.sms-meta {
  color: var(--ink-muted);
}

.sms-link {
  color: var(--signal);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.taken {
  justify-self: end;
  background: var(--signal);
  color: var(--signal-ink);
  border-radius: 1.1rem 1.1rem 0.35rem 1.1rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.phone-note {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
}

.caller-quote {
  font-size: 0.95rem;
  color: var(--ink-muted);
  border-left: 3px solid var(--line);
  padding-left: 0.9rem;
}

.caller-quote strong {
  display: block;
  color: var(--ink);
  font-size: var(--step--1);
  margin-bottom: 0.2rem;
}

/* ---------- Steps (a real sequence) ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1.5rem 1.75rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  min-width: 0;
}

.steps li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.steps p {
  color: var(--ink-muted);
}

/* ---------- Timeline (how-it-works page) ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 52rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.timeline time {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-muted);
  padding-top: 0.15rem;
}

.timeline h3 {
  margin-bottom: 0.35rem;
}

.timeline p {
  color: var(--ink-muted);
}

.timeline .alert time {
  color: var(--urgent);
}

@media (max-width: 520px) {
  .timeline li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }
}

/* ---------- Rules list ---------- */

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.rules li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.rules li:first-child {
  border-top: 1px solid var(--line);
}

.rules li::before {
  content: '';
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.3rem;
  border-radius: 50%;
  border: 2px solid var(--urgent);
  background: linear-gradient(
    135deg,
    transparent calc(50% - 1px),
    var(--urgent) calc(50% - 1px),
    var(--urgent) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
}

/* ---------- Urgent cue list ---------- */

.cues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cues li {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.95rem;
}

/* ---------- Fact grid ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem 2rem;
  margin: 2.5rem 0 0;
}

.facts div {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-width: 0;
}

.facts dt {
  font-weight: 650;
}

.facts dd {
  margin: 0;
  color: var(--ink-muted);
}

/* ---------- Quote band ---------- */

.statement {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.2;
  max-width: 30ch;
  text-wrap: balance;
}

/* ---------- Pricing ---------- */

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
}

.cost-table th,
.cost-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.cost-table th {
  font-weight: 650;
  color: var(--ink-muted);
  font-size: var(--step--1);
}

.cost-table td:not(:first-child),
.cost-table th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.cost-table tfoot td {
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.plan {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.plan-name {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--signal);
}

.plan .price {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.1;
}

.plan ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 0;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq details:first-child {
  border-top: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  font-weight: 650;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--ink-muted);
  flex: none;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  padding-bottom: 1rem;
  color: var(--ink-muted);
  max-width: var(--measure);
}

/* ---------- Form ---------- */

.pilot-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.field.wide,
.wide {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.optional {
  font-weight: 400;
  color: var(--ink-muted);
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 0;
}

[aria-invalid='true'] {
  border-color: var(--urgent);
}

.field-error {
  color: var(--urgent);
  font-size: var(--step--1);
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.form-status {
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--signal-tint);
}

.form-status.error {
  background: var(--urgent-tint);
}

@media (max-width: 600px) {
  .pilot-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Closing CTA and footer ---------- */

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.footer nav {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.footer nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.footer nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer h2 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.footer .emergency {
  margin-top: 0.75rem;
}

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Small layout helpers ---------- */

.section-head.flush {
  margin-bottom: 0;
}

.facts.flush {
  margin-top: 0;
}

.follow-on {
  margin-top: 1.5rem;
}

.band-title {
  font-size: var(--step-2);
  margin-bottom: 1.5rem;
}

.pilot-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
  color: var(--ink-muted);
}

.pilot-steps li::marker {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--signal);
}
