/* ==========================================================================
   Fanera — marketing site

   The site is built from the app's own components, ported one-to-one from
   the Flutter widgets named beside each block below. Someone who signs up
   should land in the product they were shown: the same black surface, the
   same white primary button, the same card with its glow off the top-right
   corner, the same chips. The site used to carry a navy-and-violet palette
   and pill buttons the app retired; that is what this file replaced.

   Tokens: frontend/lib/core/theme/app_colors.dart (AppColorsData),
   frontend/lib/design_system/tokens/colors/app_color_tokens.dart
   (AppColorTokens), radius.dart, spacing.dart, typography/type_scale.dart.
   When one changes there, change it here.

   The violet survives in one place: the dot in the brand mark, which is the
   app icon (frontend/web/icons). Nothing else on the page is violet.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* AppColorsData.dark + AppColorTokens.dark */
  --page:              #000000;                 /* pageBackground */
  --bento:             #09090B;                 /* bentoSurface */
  --card:              #141517;                 /* card, gray1 */
  --card-surface:      #191B1E;                 /* cardSurface, gray2 */
  --card-nested:       #212629;                 /* cardNested, gray3 */
  --border:            #212629;                 /* border */
  --border-subtle:     #191B1E;
  --hairline:          rgba(253, 253, 253, 0.10);

  --text:              #F0F0F0;                 /* textPrimary / textEmphasis */
  --text-2:            #A1A4A5;                 /* textSecondary / textDefault */
  --text-3:            #878F91;                 /* textMuted — 4.63:1 on elevated */

  --accent:            #FFFFFF;                 /* backgroundAccent */
  --accent-hover:      #F0F0F0;                 /* backgroundAccentHover */
  --on-accent:         #000000;                 /* textOnAccent */
  --interactive:       rgba(24, 25, 28, 0.88);  /* backgroundInteractive, grayA2 */
  --interactive-hover: rgba(176, 199, 217, 0.145); /* grayA3 */
  --ring:              #FFFFFF;                 /* ringFocus */

  --positive:          #00C758;
  --negative:          #FF9592;
  --warning:           #FFD60A;
  --caution:           #FFA057;
  --balanced:          #94A3B8;                 /* Bento.balanced */

  --bar-fill:          #FFFFFF;
  --bar-track:         #6C7478;
  --bar-empty:         #293034;

  --nav-active-bg:     #FFFFFF;
  --nav-active-text:   #09090B;
  --overlay-hover:     rgba(255, 255, 255, 0.05);

  /* Bento glow: the alpha each hue blooms at over the surface (Bento.bloomFor
     settles near 0.085 of luminance; these are its resolved values). */
  --glow-positive:     rgba(0, 199, 88, 0.16);
  --glow-negative:     rgba(255, 149, 146, 0.12);
  --glow-warning:      rgba(255, 214, 10, 0.10);
  --glow-balanced:     rgba(148, 163, 184, 0.07);

  --brand-dot:         #7C6CFF;

  /* AppRadius */
  --r-md:   6px;    /* chipRadius */
  --r-lg:   8px;
  --r-xl:   12px;   /* AppControl.radius — buttons, fields, pills */
  --r-2xl:  16px;   /* Bento.radius */

  /* AppControl */
  --control-h:    32px;
  --control-h-lg: 40px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 1160px;
  --gutter: 24px;
  --ease: cubic-bezier(0.05, 0.7, 0.1, 1.0);   /* AppMotion enter */

  color-scheme: dark;
}

/* AppColorsData.light + AppColorTokens.light */
@media (prefers-color-scheme: light) {
  :root {
    --page:              #FDFDFD;
    --bento:             #FFFFFF;
    --card:              #FFFFFF;
    --card-surface:      #F0F0F0;
    --card-nested:       #EEEEEE;
    --border:            #D7D7D7;
    --border-subtle:     #EEEEEE;
    --hairline:          rgba(0, 0, 0, 0.10);

    --text:              #191919;
    --text-2:            #4D4D4D;
    --text-3:            #656565;

    --accent:            #000000;
    --accent-hover:      rgba(0, 0, 0, 0.90);
    --on-accent:         #FFFFFF;
    --interactive:       rgba(0, 0, 0, 0.08);
    --interactive-hover: rgba(0, 0, 0, 0.15);
    --ring:              #000000;

    --positive:          #00693C;
    --negative:          #C40006;
    --warning:           #945600;
    --caution:           #B04300;
    --balanced:          #475569;

    --bar-fill:          #191919;
    --bar-track:         #BEBEBE;
    --bar-empty:         #D7D7D7;

    --nav-active-bg:     #191919;
    --nav-active-text:   #FFFFFF;
    --overlay-hover:     rgba(0, 0, 0, 0.05);

    --glow-positive:     rgba(0, 154, 78, 0.13);
    --glow-negative:     rgba(251, 44, 54, 0.10);
    --glow-warning:      rgba(148, 86, 0, 0.10);
    --glow-balanced:     rgba(71, 85, 105, 0.08);

    color-scheme: light;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }

.muted { color: var(--text-3); }

/* ==========================================================================
   Brand mark — the app icon: a dark rounded square with one violet dot.
   ========================================================================== */

.brand-logo { display: inline-flex; align-items: center; color: var(--text); }

/* FaneraLockup — design_system/brand/fanera_lockup.dart. One inline SVG drawn
   in the text colour, so it follows the theme. 28px is the hand's height,
   which is the artwork's: the wordmark is centred on the hand and fits inside
   it (keep in step with backend/www-src/build.py). The wordmark's size and gap
   are fixed inside the artwork (BRAND_LOGO_GUIDELINES.md). The 20px floor is
   its minimum size. */
.brand-lockup { display: block; height: 28px; min-height: 20px; width: auto; }

/* ==========================================================================
   AppButton — core/ui/app_button.dart
   32px, 12px corner, 14/20 semibold. Primary is the accent fill (white on
   black, black on white); secondary is the interactive fill with a border,
   the same object as a text field. No pills, no glow: the app has neither.
   ========================================================================== */

.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--r-xl);
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 200ms ease-in-out, border-color 200ms ease-in-out;
}
.app-button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.app-button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.app-button.secondary { background: var(--interactive); border-color: var(--border); color: var(--text); }
.app-button.secondary:hover { background: var(--interactive-hover); }
.app-button.ghost { color: var(--text-2); }
.app-button.ghost:hover { background: var(--interactive-hover); color: var(--text); }
.app-button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.app-button.lg { height: var(--control-h-lg); padding: 0 18px; }
.app-button.block { width: 100%; }
.app-button svg { width: 16px; height: 16px; }

/* ==========================================================================
   AppChip — core/ui/app_chip.dart
   12px medium, 6px corner, the tone at 12% fill and 24% border.
   ========================================================================== */

.app-chip {
  --tone: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: var(--r-md);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 24%, transparent);
  white-space: nowrap;
}
.app-chip.positive { --tone: var(--positive); }
.app-chip.negative { --tone: var(--negative); }
.app-chip.warning  { --tone: var(--warning); }
.app-chip.caution  { --tone: var(--caution); }
.app-chip.neutral  { --tone: var(--text-2); }
.app-chip.outline  { background: none; border-color: var(--border); color: var(--text-2); }

/* AppPill / segmented control — core/ui/app_pill.dart. A row of 32px options
   on the interactive fill; the selected one takes the nav-active colours. */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-xl);
  background: var(--interactive);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; }

/* ==========================================================================
   Header — the app shell's nav: muted items, the active one on the
   nav-active fill (core/widgets/app_shell.dart).
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 24px; }

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 10px;
  border-radius: var(--r-xl);
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--overlay-hover); }
.nav-link.active { background: var(--nav-active-bg); color: var(--nav-active-text); }

.chevron-down { width: 12px; height: 12px; transition: transform 200ms ease; }
.has-dropdown:hover .chevron-down, .has-dropdown:focus-within .chevron-down { transform: rotate(180deg); }

/* AppMenu — 16px corner, 4px vertical padding, 32px items. */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 200ms var(--ease);
  z-index: 200;
}
.dropdown-menu::before { content: ""; position: absolute; inset: -8px 0 auto 0; height: 8px; }
.has-dropdown:hover .dropdown-menu, .has-dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: none; }

.dropdown-item { display: block; margin: 0 0; padding: 8px 10px; border-radius: var(--r-xl); }
.dropdown-item:hover, .dropdown-item.active { background: var(--interactive-hover); }
.dropdown-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dropdown-desc { font-size: 12px; color: var(--text-3); line-height: 1.4; margin-top: 1px; }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.mobile-menu-btn { display: none; width: var(--control-h); height: var(--control-h); border-radius: var(--r-xl); place-items: center; }
.mobile-menu-btn:hover { background: var(--interactive-hover); }

.mobile-drawer {
  display: none;
  position: fixed;
  inset: 60px 0 0 0;
  background: var(--page);
  border-top: 1px solid var(--border);
  padding: 20px var(--gutter) 40px;
  overflow-y: auto;
  z-index: 99;
}
.mobile-drawer.is-open { display: block; }
.drawer-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.drawer-group .section-label { margin: 0 10px 6px; }
.drawer-actions { display: flex; flex-direction: column; gap: 8px; }

/* ==========================================================================
   SectionLabel — core/widgets/section_label.dart. 12px semibold, secondary.
   Sentence case: the app does not shout its headings.
   ========================================================================== */

.section-label { display: block; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text-2); }

/* ==========================================================================
   Bento — core/theme/bento.dart
   The one card recipe: the near-black fill, a radial glow off the top-right
   corner, a 16px corner, a hairline border, 16px padding. data-mood carries
   what the card is saying (CardMood); with none it is balanced, quiet but
   never unlit.
   ========================================================================== */

.bento {
  --glow: var(--glow-balanced);
  position: relative;
  background:
    radial-gradient(300px circle at 100% 0%,
      var(--glow) 0%,
      color-mix(in srgb, var(--glow) 26%, transparent) 28%,
      color-mix(in srgb, var(--glow) 6%, transparent) 65%,
      transparent 100%),
    var(--bento);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 16px;
}
.bento[data-mood="positive"] { --glow: var(--glow-positive); }
.bento[data-mood="negative"] { --glow: var(--glow-negative); }
.bento[data-mood="warning"]  { --glow: var(--glow-warning); }
.bento.roomy { padding: 24px; }
.bento.selected { border-color: var(--text-3); }

/* Bento.iconChip — 44px, corner at 30% of size, a 1.5px bevel. */
.icon-chip {
  --glow: var(--glow-balanced);
  width: 44px;
  height: 44px;
  padding: 1.5px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(154, 163, 178, 0.30), rgba(154, 163, 178, 0.05));
  flex: none;
}
.icon-chip > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 11.5px;
  background: radial-gradient(circle at 30% 20%, var(--glow), transparent 70%), var(--card);
  color: var(--text);
}
.icon-chip svg { width: 18px; height: 18px; }
.icon-chip[data-mood="positive"] { --glow: var(--glow-positive); }
.icon-chip[data-mood="negative"] { --glow: var(--glow-negative); }
.icon-chip[data-mood="warning"]  { --glow: var(--glow-warning); }

.bento-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bento-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.bento-body { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.bento-body + .bento-body { margin-top: 10px; }
.bento .spacer { flex: 1; }
.bento.stack { display: flex; flex-direction: column; }

/* ==========================================================================
   KpiTile — core/widgets/kpi_tile.dart
   Label, then the figure at display size (30 semibold, -0.8 tracking), then
   a micro line. The figure carries the meaning first (COPY_GLOSSARY rule 1).
   ========================================================================== */

.kpi-tile .kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -0.8px; line-height: 1.1; margin-top: 8px; }
.kpi-tile .kpi-value.words { font-size: 20px; letter-spacing: -0.4px; }
.kpi-tile .kpi-sub { font-size: 12px; color: var(--text-3); line-height: 1.35; margin-top: 6px; }

/* ==========================================================================
   FindingRowCard — core/widgets/finding_row_card.dart
   Chips row (priority, impact · effort) with the comment count boxed on the
   right; the finding in 14px medium; a 12px muted note.
   ========================================================================== */

.finding-card { padding: 14px; }
.finding-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.finding-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.finding-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-2);
  flex: none;
}
.finding-count svg { width: 10px; height: 10px; color: var(--text-3); }
.finding-name { margin-top: 10px; font-size: 14px; line-height: 1.35; font-weight: 500; }
.finding-note { margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--text-3); }

/* Scope line — COPY_GLOSSARY.md, "Scope". A label never appears without its
   support: the item names, the comment count and the number of people. */
.scope-line { margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--text-3); }
.scope-line b { color: var(--text-2); font-weight: 600; }

/* ==========================================================================
   Proportion bars — core/widgets/proportion_bar.dart, 8px
   ========================================================================== */

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 40px; align-items: center; gap: 10px; font-size: 12px; }
.bar-name { color: var(--text); font-weight: 500; }
.bar-track { height: 8px; border-radius: 4px; background: var(--bar-empty); overflow: hidden; }
.bar-fill { height: 100%; background: var(--bar-fill); border-radius: 4px; transition: width 400ms var(--ease); }
.bar-count { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero-section { padding: 88px 0 56px; text-align: center; }

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 880px;
  margin: 12px auto 20px;
}
.hero-lead { font-size: clamp(16px, 2vw, 18px); color: var(--text-2); max-width: 640px; margin: 0 auto 28px; }

.cta-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--text-3); }
.hero-note .sep { margin: 0 8px; opacity: 0.5; }

/* ==========================================================================
   Sample workspace (home page) — a page of the app, in its own components.
   ========================================================================== */

.demo-wrap { margin-top: 56px; text-align: left; }

.demo {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.demo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.demo-caption { font-size: 12px; color: var(--text-3); }

.demo-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; padding: 16px; }
.demo-grid .kpi-tile { grid-column: span 4; }
.demo-grid .ask-panel { grid-column: span 7; display: flex; flex-direction: column; }
.demo-grid .types-panel { grid-column: span 5; }
.demo-grid .findings-panel { grid-column: span 12; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-row button.app-chip { cursor: pointer; }
.chip-row button.app-chip.active { --tone: var(--text); }

.question { background: var(--card-surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 8px 12px; font-size: 14px; margin-bottom: 10px; }

.answer { font-size: 14px; line-height: 1.65; min-height: 96px; }
.answer .abstain { color: var(--text-2); }

.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  margin: 0 2px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--interactive);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}
.cite:hover, .cite[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.supporting {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  font-size: 13px;
  color: var(--text-2);
}
.supporting.is-visible { display: block; animation: fadeIn 200ms ease; }
.supporting .who { display: flex; gap: 8px; align-items: center; color: var(--text); font-weight: 600; font-size: 12px; margin-bottom: 4px; }

.finding-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 88px 0; }
.section.tight { padding-top: 0; }
.section.band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bento); }

.section-header { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 8px 0 12px; }
.section-desc { font-size: 16px; color: var(--text-2); }

.connectors-strip { padding: 36px 0; border-bottom: 1px solid var(--border); text-align: center; }
.connectors-strip .section-label { margin-bottom: 18px; }
.connectors-grid { display: flex; justify-content: center; gap: 36px; flex-wrap: wrap; }
.connector-item { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.connector-icon { width: 20px; height: 20px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.check-list li { display: flex; gap: 10px; font-size: 14px; }
.check-list li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  background: var(--positive);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.text-link { display: inline-flex; gap: 6px; margin-top: 18px; font-size: 14px; font-weight: 600; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* An example of what the product shows, set inside a card — the app's nested
   surface. */
.example { margin-top: 16px; background: var(--card-surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 12px 14px; font-size: 13px; color: var(--text-2); }
.example .section-label { margin-bottom: 8px; }
.example p + p { margin-top: 6px; }
.example .quote { color: var(--text); font-style: italic; }
.example .lead { font-size: 15px; color: var(--text); font-weight: 600; }
.example code { font-size: 12px; color: var(--text); }
.example .finding-card { margin: 0; }

/* ==========================================================================
   AppTable (comparison), estimator, pricing, FAQ, CTA
   ========================================================================== */

.table-wrap { background: var(--bento); border: 1px solid var(--border); border-radius: var(--r-2xl); overflow-x: auto; }
table.app-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.app-table th, .app-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.app-table tr:last-child td { border-bottom: none; }
.app-table th { font-size: 12px; color: var(--text-2); font-weight: 600; }
.app-table td:first-child { font-weight: 600; width: 24%; }
.app-table td:nth-child(2) { color: var(--text-3); }

.estimator { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.slider-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.slider-value { font-weight: 700; font-variant-numeric: tabular-nums; }

input[type="range"].slider { width: 100%; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; background: var(--bar-empty); }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid var(--page); cursor: pointer; }
input[type="range"].slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--page); cursor: pointer; }

.estimate-row + .estimate-row { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }

.price { font-size: 30px; font-weight: 600; letter-spacing: -0.8px; margin: 10px 0 8px; }
.price span { font-size: 14px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.pricing-foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-3); }

.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: var(--bento); border: 1px solid var(--border); border-radius: var(--r-2xl); overflow: hidden; }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; font-size: 15px; font-weight: 600; text-align: left; }
.faq-question:hover { background: var(--overlay-hover); }
.faq-chevron { width: 16px; height: 16px; flex: none; transition: transform 200ms ease; }
.faq-item.is-open .faq-chevron { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 300ms var(--ease); }
.faq-answer-inner { padding: 0 18px 18px; color: var(--text-2); font-size: 14px; }

.cta-banner { text-align: center; padding: 64px 24px; }
.cta-banner h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 12px; }
.cta-banner p { color: var(--text-2); max-width: 560px; margin: 0 auto 24px; }

/* ==========================================================================
   Sub-page hero
   ========================================================================== */

.page-hero { padding: 76px 0 36px; text-align: center; }
.page-hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; max-width: 800px; margin: 10px auto 16px; }
.page-hero p { font-size: 18px; color: var(--text-2); max-width: 620px; margin: 0 auto; }

/* ==========================================================================
   Legal pages
   ========================================================================== */

.legal { max-width: 720px; margin: 0 auto; padding: 56px var(--gutter) 80px; font-size: 14px; line-height: 1.7; }
.legal .draft { padding: 12px 14px; margin-bottom: 28px; border-radius: var(--r-xl); font-weight: 500; color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 24%, transparent); }
.legal h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.legal .updated { color: var(--text-3); font-size: 13px; margin-bottom: 32px; }
.legal h2 { font-size: 18px; font-weight: 600; margin: 36px 0 10px; }
.legal h3 { font-size: 15px; font-weight: 600; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--text-2); }
.legal p { margin-bottom: 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 13px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.legal th { color: var(--text); font-weight: 600; }
.legal td { color: var(--text-2); }
.legal .table-wrap { background: none; border: none; border-radius: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; font-size: 13px; color: var(--text-2); }
.footer-top { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 40px; margin-bottom: 44px; }
.footer-brand p { color: var(--text-3); margin: 12px 0 18px; max-width: 280px; }
.footer-cta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; font-size: 13px; }
.footer-legal a:hover { color: var(--text); }

/* ==========================================================================
   Motion — AppMotion: enter curve, 200ms controls.
   ========================================================================== */

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.js .reveal-on-scroll { opacity: 0; transform: translateY(12px); transition: opacity 450ms var(--ease), transform 450ms var(--ease); }
.js .reveal-on-scroll.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal-on-scroll { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .estimator { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .demo-grid .ask-panel, .demo-grid .types-panel { grid-column: span 12; }
  .finding-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-links, .nav-actions { display: none; }
  .mobile-menu-btn { display: grid; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .section { padding: 64px 0; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .demo-grid { padding: 12px; }
  .demo-grid .kpi-tile { grid-column: span 12; }
  .footer-top { grid-template-columns: 1fr; }
  .bento.roomy { padding: 18px; }
  .bar-row { grid-template-columns: 96px 1fr 36px; }

  /* Stack comparison table on mobile */
  table.app-table thead {
    display: none;
  }
  table.app-table,
  table.app-table tbody,
  table.app-table tr,
  table.app-table td {
    display: block;
    width: 100%;
  }
  table.app-table tr {
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }
  table.app-table tr:last-child {
    border-bottom: none;
  }
  table.app-table td {
    padding: 4px 0;
    border-bottom: none;
    width: 100% !important;
  }
  table.app-table td:first-child {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
  }
  table.app-table td:nth-child(2) {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.45;
  }
  table.app-table td:nth-child(2)::before {
    content: "Reading them yourself: ";
    font-weight: 600;
    color: var(--text-3);
  }
  table.app-table td:nth-child(3) {
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    margin-top: 6px;
  }
  table.app-table td:nth-child(3)::before {
    content: "With Fanera: ";
    font-weight: 600;
    color: var(--accent);
  }
}
