/* =========================================================
   House AI — houseaiapp.top
   ========================================================= */

:root {
  --bg:            #FFFFFF;
  --bg-alt:        #F8F9FB;
  --bg-hero-fallback: #E5E5E1;

  --text:          #111827;
  --text-soft:     #374151;
  --text-muted:    #6B7280;
  --text-mute:     #9CA3AF;

  --border:        #E5E7EB;
  --border-strong: #D1D5DB;

  --accent:        #0D9488;   /* teal-600 */
  --accent-hover:  #0F766E;   /* teal-700 */
  --accent-soft:   #F0FDFA;   /* teal-50 */
  --accent-line:   rgba(13, 148, 136, 0.25);

  --shadow-sm:  0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow:     0 4px 6px -1px rgba(17, 24, 39, 0.07), 0 2px 4px -1px rgba(17, 24, 39, 0.04);
  --shadow-lg:  0 20px 40px -8px rgba(17, 24, 39, 0.12), 0 8px 16px -4px rgba(17, 24, 39, 0.06);

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-btn: 999px;

  --font:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --gutter:  clamp(18px, 4vw, 32px);
  --max-w:   1200px;

  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/* Register --pos as an animatable percentage so CSS keyframes can drive
   the slider divider entirely on the compositor — no per-frame JS.
   inherits: true is critical — the animation runs on .ba, but the value
   is consumed by .ba-clip and .ba-line further down the tree. */
@property --pos {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 50%;
}
@keyframes ba-sweep {
  0%   { --pos: 0%;   }  /* start on the "after" — the payoff shown first */
  20%  { --pos: 0%;   }  /* hold on "after" for ~1.4s so the eye can land */
  60%  { --pos: 100%; }  /* slide left→right revealing "before" over ~2.8s */
  100% { --pos: 0%;   }  /* slide right→left back to "after" over ~2.8s */
}
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
input { font: inherit; color: inherit; }

/* --- Layout primitives -------------------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Nav ---------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  will-change: transform;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-dot {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: url('brand-mark.png') center / cover no-repeat;
  flex-shrink: 0;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  background: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  transition: background 0.15s var(--ease);
}
.nav-cta:hover { background: #000; }
.nav-cta svg { flex-shrink: 0; }

/* --- Hero banner -------------------------------------- */
.hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  color: white;
  background: var(--bg-hero-fallback);
  isolation: isolate;
  cursor: default;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0.05) 45%, rgba(0, 0, 0, 0.90) 100%),
    linear-gradient(90deg,  rgba(0, 0, 0, 0.60) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0) 70%);
  z-index: 1;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 2;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding-top: 72px;
  padding-bottom: 48px;
}
.hero-content { max-width: 560px; user-select: text; }
.hero h1 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: white;
  margin-bottom: 22px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
  max-width: 15ch;
}

/* Banner slider variant — fills the hero, no handle, subtle divider.
   Uses doubled-up class selector for specificity to override base .ba
   rules declared later in the file (aspect-ratio, background, etc.) */
.ba.ba--hero {
  position: absolute;
  inset: 0;
  z-index: 0;
  aspect-ratio: auto;
  border-radius: 0;
  cursor: default;
  touch-action: auto;
  user-select: auto;
  background: var(--bg-hero-fallback);
  height: 100%;
}
.ba.ba--hero .ba-handle,
.ba.ba--hero .ba-tag { display: none; }
.ba.ba--hero .ba-line {
  width: 1px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.35);
}

/* --- Buttons ------------------------------------------ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s var(--ease);
}
.btn-secondary:hover { background: var(--bg-alt); }

/* --- Sections ----------------------------------------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}
.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 14px;
}
.section-head p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --- Module grid -------------------------------------- */
.modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.module {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.module:hover {
  border-color: var(--border-strong);
}
.module-body { padding: 20px 24px 24px; }
.module-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.module-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.module-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}
.module-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* --- Before/after slider (auto-cycling, no interaction) ---- */
.ba {
  --pos: 0%;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-alt);
  isolation: isolate;
  cursor: default;
  animation: ba-sweep 7s ease-in-out infinite;
}
body.tab-hidden .ba { animation-play-state: paused; }
.ba-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.ba-after { position: absolute; inset: 0; }
.ba-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: white;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.ba-tag {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}
.ba-tag--before { left: 12px; }
.ba-tag--after  { right: 12px; }

/* --- Page hero (support/privacy/terms) ---------------- */
.page-hero {
  padding: 88px 0 40px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.page-hero .eyebrow { display: block; margin-bottom: 14px; }
.page-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 12px;
}
.page-hero .lede {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

/* --- Prose (privacy / terms) -------------------------- */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px var(--gutter);
}
.prose h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 10px;
  color: var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.prose ul { padding-left: 22px; margin: 6px 0 12px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-hover); }

/* --- Contact box + FAQ (support) --------------------- */
.support-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px var(--gutter) 80px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 56px;
}
.contact-card .icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
}
.contact-card .label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}
.contact-card a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}
.contact-card a:hover { color: var(--accent); }

.faq-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--text);
}
.faq-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:first-of-type { border-top: 1px solid var(--border); }
.faq-item .q {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.faq-item .a {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}
.faq-item .a strong { color: var(--text); font-weight: 600; }

/* --- Footer ------------------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 48px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.footer-tag {
  color: var(--text-muted);
  font-size: 14px;
}
.footer-links {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding-top: 4px;
}
.footer-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-copy a:hover { color: var(--accent); }

/* --- Responsive -------------------------------------- */
@media (max-width: 800px) {
  .nav-inner { height: 56px; }
  .nav-cta { padding: 7px 12px; font-size: 13px; }

  .hero { min-height: 380px; }
  .hero .container {
    min-height: 380px;
    padding-top: 40px;
    padding-bottom: 32px;
  }

  .section { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .modules { grid-template-columns: 1fr; gap: 20px; }
  .module-body { padding: 18px 20px 22px; }

  .page-hero { padding: 56px 0 32px; }
  .prose { padding: 40px var(--gutter) 56px; }
  .support-body { padding: 32px var(--gutter) 56px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-links { padding-top: 0; }
  .footer-copy { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
