/*
 * Estimate AI landing.
 * Tokens mirror lib/common/theme/new_design_tokens.dart in the app repo, so the
 * site and the product stay visually in sync when either one is restyled.
 */

:root {
  /* Surfaces */
  --scaffold: #f0f1f9;
  --card: rgba(255, 255, 255, 0.9);
  --card-solid: #ffffff;
  --glass: rgba(234, 236, 245, 0.95);

  /* Grays (gray200 to gray900) */
  --gray-200: #e9eaeb;
  --gray-300: #d5d7da;
  --gray-400: #a4a7ae;
  --gray-500: #717680;
  --gray-600: #535862;
  --gray-700: #414651;
  --gray-800: #252b37;
  --gray-900: #181d27;
  --blue-gray-100: #eaecf5;

  /* Brand */
  --ink: #181818;
  --accent: #215bb7;
  --accent-gradient: linear-gradient(135deg, #1a4487 0%, #0251d0 100%);
  --hero-gradient: linear-gradient(
    180deg,
    #ffffff 0%,
    #eef2fd 62%,
    #dfe6fa 100%
  );
  --success: #039855;

  /* Feature tile gradients, taken from the in-app create sheet */
  --tile-estimate: linear-gradient(
    225deg,
    #8a8b8f 0%,
    #4f5154 51%,
    #181818 100%
  );
  --tile-invoice: linear-gradient(
    225deg,
    #8db9ff 0%,
    #0f6cff 48%,
    #0057e0 100%
  );
  --tile-room-scan: linear-gradient(
    45deg,
    #545376 0%,
    #646db2 54%,
    #8e9dd1 100%
  );
  --tile-render: linear-gradient(45deg, #ff6a00 0%, #ffaf77 100%);

  /* Radii */
  --radius-card: 16px;
  --radius-tile: 18px;
  --radius-description: 22px;
  --radius-lg: 24px;
  --radius-panel: 28px;
  --radius-pill: 59px;
  --radius-button: 64px;

  /* The hero reserves exactly this much room for the floating header. */
  --header-height: 44px;

  /* How far the hero devices slide behind the section that follows. */
  --device-bleed: 300px;

  /* Shadows */
  --shadow-card: 0 3px 12px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 1px 3px rgba(10, 13, 18, 0.1);
  --shadow-pill: 0 1px 5px rgba(10, 13, 18, 0.12);
  --shadow-dark-button: 0 10px 14px rgba(10, 13, 18, 0.32);

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /*
   * The app ships SF Pro. Apple's licence does not cover redistributing it as a
   * webfont, so the stack resolves to the same faces natively on Apple devices.
   */
  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;

  --measure: 1040px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--card-solid);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/*
 * The width/height attributes reserve layout space, but as presentational hints
 * they also pin the used height, which cancels any aspect-ratio set below.
 */
img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  color: var(--gray-900);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

.wrap {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-md);
}

/* Header: floating pill */

.site-header {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 1.25rem 0;
}

.header-pill {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: var(--header-height);
  background: var(--card-solid);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-medium);
  border-radius: var(--radius-pill);
  padding: 0 0.625rem 0 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-900);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 24px;
  height: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.375rem;
  font-size: 0.875rem;
  padding-right: 0.5rem;
}

.nav a {
  color: var(--gray-600);
  font-weight: 500;
}

.nav a:hover {
  color: var(--gray-900);
  text-decoration: none;
}

/* Hero */

/*
 * The gradient runs behind the floating header, so the hero is pulled up by the
 * header's full height and pays it back as top padding.
 *
 * Clip only the horizontal axis: the devices below are meant to run past the
 * hero and slide behind the next section, which `overflow: hidden` would cut.
 */
.hero {
  background: var(--hero-gradient);
  margin-top: calc(-1 * var(--space-lg) - var(--header-height));
  padding: calc(
      var(--space-lg) + var(--header-height) + clamp(2.5rem, 5vw, 4rem)
    )
    0 0;
  text-align: center;
  overflow-x: clip;
  overflow-y: visible;
}

.hero-copy {
  width: min(100% - 2.5rem, 820px);
  margin-inline: auto;
}

.badge {
  display: inline-block;
  margin: 0 0 1.75rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-pill);
  background: var(--card-solid);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 var(--space-lg);
  font-size: clamp(2.4rem, 5.6vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 auto 2.5rem;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--gray-600);
  max-width: 40rem;
}

.pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  list-style: none;
  margin: 0 0 clamp(2.5rem, 5vw, 3.5rem);
  padding: 0;
}

.pills li {
  background: var(--card-solid);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-pill);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* Hero device row */

/*
 * The devices overshoot the hero and the next section paints over their lower
 * half, so showing the whole phone screen costs the fold nothing.
 */
.hero-devices {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-lg);
  padding: 0 clamp(1.25rem, 4vw, 3.75rem);
  margin-bottom: calc(-1 * var(--device-bleed));
}

.phone {
  flex: 0 0 auto;
  width: 330px;
  background: #0b0b0c;
  border-radius: 50px;
  padding: 12px;
  box-shadow:
    0 32px 70px rgba(10, 13, 18, 0.3),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
}

.phone-screen {
  border-radius: 39px;
  overflow: hidden;
  background: var(--scaffold);
  aspect-ratio: 470 / 1024;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/*
 * Lifted by the bleed so they stay in view once the next section covers the
 * phone, keeping the same 28px stagger against the visible bottom edge.
 */
.plan-card,
.render-card {
  flex: 0 0 auto;
  width: 250px;
  transform: translateY(calc(28px - var(--device-bleed))) rotate(-3deg);
}

/* Squared off so the section cuts it at the same height as the render card. */
.plan-card {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: var(--card-solid);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.plan-card img {
  width: 100%;
}

.render-card {
  transform: translateY(calc(28px - var(--device-bleed))) rotate(3deg);
  border: 6px solid #0b0b0c;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(10, 13, 18, 0.2);
}

.render-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Sections */

/* Sits above the hero devices so their lower half is hidden behind it. */
.section {
  position: relative;
  z-index: 1;
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.section-tint {
  background: var(--scaffold);
}

.section-head {
  max-width: 39rem;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  text-align: center;
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  font-weight: 700;
}

.section-head p {
  margin: 0;
  color: var(--gray-500);
  font-size: 1.0625rem;
}

/* Feature cards */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.feature-card {
  background: var(--card-solid);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.tile {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-tile);
  display: grid;
  place-items: center;
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-medium);
}

.tile img {
  width: 28px;
  height: 28px;
}

.tile-estimate {
  background: var(--tile-estimate);
}

.tile-invoice {
  background: var(--tile-invoice);
}

.tile-room-scan {
  background: var(--tile-room-scan);
}

.tile-render {
  background: var(--tile-render);
}

.feature-card h3 {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: var(--space-lg);
}

.step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.step p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Showcase panels */

.showcase-stack {
  display: grid;
  gap: var(--space-lg);
}

.showcase {
  background: var(--card-solid);
  border-radius: var(--radius-panel);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.showcase-copy {
  padding: clamp(2rem, 4vw, 3rem);
}

.showcase-copy h2 {
  margin: 0 0 0.875rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
}

.showcase-copy > p {
  margin: 0 0 1.5rem;
  color: var(--gray-600);
  font-size: 1rem;
  line-height: 1.6;
}

.showcase-reverse .showcase-visual {
  order: -1;
}

.showcase-visual {
  background: var(--blue-gray-100);
  height: 100%;
  padding: clamp(2rem, 4vw, 3rem);
  display: grid;
  place-items: center;
}

.showcase-visual img {
  width: 100%;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--gray-700);
  font-size: 0.9375rem;
}

.check-list li::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--success);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><path d="M5.5 10.4 8.6 13.4 14.5 7" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

/* Before and after */

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  min-height: 320px;
}

.compare figure {
  margin: 0;
  position: relative;
  background: var(--gray-200);
}

.compare img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare figcaption {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(24, 24, 24, 0.72);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3125rem 0.625rem;
  border-radius: var(--radius-pill);
}

.compare figcaption.after {
  background: rgba(2, 81, 208, 0.85);
}

/* Pro band */

.pro {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-panel);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  box-shadow: var(--shadow-dark-button);
}

.pro h2 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 700;
}

.pro > p {
  margin: 0 0 2.5rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.0625rem;
}

.pro-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  text-align: left;
  max-width: 45rem;
}

.pro-list li {
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-dark-button);
}

.btn:hover {
  text-decoration: none;
  background: var(--gray-900);
}

/* Footer */

.site-footer {
  background: var(--card-solid);
  border-top: 1px solid var(--gray-200);
  padding: 2.25rem 0;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  justify-content: space-between;
  align-items: center;
}

.footer-meta {
  margin: 0;
}

.footer-meta a,
.footer-links a {
  color: var(--gray-600);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

/* Legal pages */

.legal-hero {
  background: var(--hero-gradient);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0;
  border-bottom: 1px solid rgba(213, 215, 218, 0.5);
}

.legal-hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 700;
}

.legal-meta {
  margin: 0.6rem 0 0;
  color: var(--gray-500);
  font-size: 0.95rem;
}

.legal {
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  background: var(--scaffold);
}

.legal-inner {
  width: min(100% - 2.5rem, 48rem);
  margin-inline: auto;
  background: var(--card-solid);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-description);
  box-shadow: var(--shadow-card);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.legal-inner > :first-child {
  margin-top: 0;
}

.legal-inner h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.legal-inner h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.legal-inner p,
.legal-inner li {
  color: var(--gray-600);
  font-size: 0.98rem;
}

.legal-inner ul,
.legal-inner ol {
  padding-left: 1.35rem;
}

.legal-inner li {
  margin-bottom: 0.5rem;
}

.legal-inner strong {
  color: var(--gray-800);
}

.legal-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.legal-inner th,
.legal-inner td {
  border: 1px solid var(--gray-200);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.legal-inner th {
  background: var(--blue-gray-100);
  color: var(--gray-800);
  font-weight: 600;
}

.legal-inner .table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.legal-inner .table-wrap table {
  min-width: 30rem;
  margin: 0;
}

/* Not found */

.not-found {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--hero-gradient);
}

.not-found h1 {
  margin: 0 0 0.6rem;
  font-size: 1.85rem;
  font-weight: 700;
}

.not-found p {
  margin: 0 0 1.75rem;
  color: var(--gray-500);
}

/* Responsive */

@media (max-width: 1040px) {
  :root {
    --device-bleed: 240px;
  }

  .hero-devices {
    gap: var(--space-md);
  }

  .phone {
    width: 280px;
    border-radius: 44px;
  }

  .plan-card,
  .render-card {
    width: 210px;
  }
}

@media (max-width: 860px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .showcase,
  .showcase-reverse {
    grid-template-columns: 1fr;
  }

  .showcase-reverse .showcase-visual {
    order: 0;
  }

  .compare {
    min-height: 260px;
  }

  .plan-card,
  .render-card {
    display: none;
  }

  .hero-devices {
    padding: 0 1.25rem;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 2rem, var(--measure));
  }

  .header-pill {
    gap: 1rem;
    padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  }

  .nav {
    gap: 0.875rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .feature-grid,
  .pro-list {
    grid-template-columns: 1fr;
  }

  .pro {
    text-align: left;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* The in-page anchors stop fitting next to the wordmark; the sections follow
   each other anyway, so drop them rather than let the header wrap. */
@media (max-width: 400px) {
  .nav {
    display: none;
  }
}

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