/* ===== Homify AI website ===== */
/* Light theme tokens. Dark theme = add a [data-theme="dark"] block later. */
[data-theme="light"] {
  --bg: #FAFAF6;
  --bg-alt: #F0EDE3;
  --surface: #FFFFFF;
  --navy: #0B3C5D;
  --navy-deep: #082C44;
  --gold: #D4AF37;
  --gold-deep: #B8941E;
  --ink: #0F1419;
  --ink-muted: #2A3540;
  --muted: #6E6E68;
  --subtitle: #5A6B5F;
  --border: #E5E2D8;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-btn: 8px;
  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow-widget: 0 18px 50px rgba(11, 60, 93, 0.14), 0 2px 8px rgba(11, 60, 93, 0.06);
  --maxw: 680px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink-muted);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1 { font-family: var(--font-display); color: var(--navy); line-height: 1.08; }
a { color: var(--navy); text-decoration: none; }
sup { font-size: 0.5em; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 48px);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--navy); letter-spacing: -0.2px; }
.wordmark b { color: var(--gold-deep); font-weight: 600; }
.topnav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); font-size: 0.9rem; font-weight: 500; }
.topnav a { color: var(--ink-muted); }
.topnav a:hover { color: var(--navy); }
.topnav-call { color: var(--navy); font-weight: 600; }
.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; }
.lang-switch { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted);
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); cursor: pointer; }
.lang-switch:hover { color: var(--navy); border-color: color-mix(in srgb, var(--navy) 30%, var(--border)); }
.lang-switch:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.lang-switch select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; color: inherit;
  cursor: pointer; padding-right: 14px; max-width: 9.5em; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 4px center, right 0 center; background-size: 4px 4px; background-repeat: no-repeat; }
.lang-switch select:focus { outline: none; }
.lang-code { display: none; }

/* ===== Hero ===== */
.hero { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: clamp(32px, 7vh, 88px) 24px; }
.hero-inner { width: 100%; max-width: var(--maxw); display: flex; flex-direction: column; align-items: center; }
.headline { font-weight: 600; font-size: clamp(2.6rem, 8vw, 4.6rem); letter-spacing: -1px; }
.headline b { color: var(--gold); font-weight: 600; }
.subhead { margin-top: 14px; font-size: clamp(1.05rem, 2.6vw, 1.4rem); font-weight: 600; color: var(--navy); }
.tagline { margin-top: 8px; font-size: 0.95rem; color: var(--subtitle); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }

/* ===== Stats ===== */
.stats { list-style: none; display: flex; gap: clamp(28px, 8vw, 64px); margin: 30px 0 8px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--navy); line-height: 1; }
.stat-label { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.stat-note { margin-top: 2px; font-size: 0.62rem; color: var(--muted); opacity: 0.8; }

/* ===== Voice widget ===== */
.widget { width: 100%; margin-top: 40px; display: flex; flex-direction: column; align-items: center; }
.widget-bar {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 10px 10px 10px 10px; box-shadow: var(--shadow-widget);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.widget-bar:focus-within { border-color: var(--gold); box-shadow: var(--shadow-widget), 0 0 0 3px rgba(212, 175, 55, 0.16); }
.widget-mic {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gold); color: var(--navy); display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.widget-mic:hover { background: var(--gold-deep); transform: translateY(-1px); }
.widget-mic.is-active { animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.5); } 50% { box-shadow: 0 0 0 10px rgba(212,175,55,0); } }
.widget-input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-family: var(--font-body); font-size: 0.98rem; color: var(--ink); padding: 0;
}
.widget-input::placeholder { color: var(--muted); opacity: 1; }
.widget-send {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.widget-send:hover { background: var(--navy-deep); transform: translateY(-1px); }
.widget-state { min-height: 1.3em; margin-top: 12px; font-size: 0.85rem; color: var(--subtitle); }

/* ===== Chips ===== */
.topic-note { margin-top: 18px; font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.chip {
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 500; color: var(--navy);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 9px 18px; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.chip.is-selected { background: var(--navy); color: var(--surface); border-color: var(--navy); }

/* ===== Footer ===== */
.site-footer { background: var(--navy-deep); color: rgba(250, 250, 246, 0.72); padding: 40px clamp(20px, 5vw, 48px); text-align: center; }
.site-footer strong { color: #fff; font-weight: 600; }
.site-footer a { color: var(--gold); }
.site-footer > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.foot-brand { font-size: 0.95rem; }
.foot-agent { margin-top: 12px; font-size: 0.88rem; line-height: 1.7; }
.foot-exp { margin-top: 8px; font-size: 0.82rem; }
.foot-brokerage { margin-top: 8px; font-size: 0.88rem; }
.foot-links { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 0.85rem; }
.foot-links span { color: rgba(250, 250, 246, 0.35); }
.foot-links a:hover { text-decoration: underline; }
.foot-copy { margin-top: 16px; font-size: 0.78rem; color: rgba(250, 250, 246, 0.5); }

/* ===== Inner pages: About Us and the legal pages ===== */
.topnav a[aria-current="page"] { color: var(--navy); box-shadow: 0 2px 0 var(--gold); }
.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vh, 64px) 24px clamp(48px, 8vh, 88px); }
.page h1 { font-weight: 600; font-size: clamp(2.1rem, 6vw, 3.2rem); letter-spacing: -0.6px; }
.page h2 { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: clamp(1.35rem, 3.4vw, 1.75rem); line-height: 1.2; letter-spacing: -0.2px; }
.page h3 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.page p, .page li { font-size: 1.02rem; }
.page a { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-deep); }
.page-head { display: flex; flex-direction: column; gap: 14px; }
.lede { font-size: 1.15rem !important; color: var(--ink-muted); }
.page-section { margin-top: clamp(40px, 6vh, 56px); display: flex; flex-direction: column; gap: 14px; }

.leader { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; }
.leader-photo { width: 100%; height: auto; border-radius: var(--radius-card); box-shadow: var(--shadow-widget); }
.leader-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.credential { margin-top: 6px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-btn); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; }
.credential strong { color: var(--navy); font-size: 1rem; }
.fine { font-size: 0.88rem !important; color: var(--muted); }
.page-cta { margin-top: clamp(40px, 6vh, 56px); padding: 28px; background: var(--bg-alt); border-radius: var(--radius-card); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-cta p { font-family: var(--font-display); font-size: 1.3rem; color: var(--navy); font-weight: 600; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff !important; text-decoration: none !important; font-weight: 600; font-size: 0.95rem; padding: 12px 22px; border-radius: var(--radius-pill); transition: background 0.2s ease, transform 0.2s ease; }
.btn:hover { background: var(--navy-deep); transform: translateY(-1px); }
.btn-apply { margin-top: 24px; background: var(--gold); color: var(--navy) !important; font-size: 1rem; padding: 14px 36px; box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35); }
.btn-apply:hover { background: var(--gold-deep); }

.legal .page-section { gap: 10px; margin-top: 36px; }
.legal ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.legal .updated { font-size: 0.88rem; color: var(--muted); }
.draft-note { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border)); border-radius: var(--radius-btn); padding: 12px 16px; font-size: 0.9rem !important; color: var(--ink); }
.todo { background: color-mix(in srgb, var(--gold) 22%, transparent); padding: 0 4px; border-radius: 3px; font-weight: 600; }

/* ===== Partner page ===== */
.partner .draft-note { margin-bottom: 28px; }
.partner-note { margin-top: clamp(40px, 6vh, 56px); }
.partner-types { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.partner-types li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem !important; }
.partner-types strong { color: var(--navy); font-size: 1rem; }
.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps b { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; }
.steps p { color: var(--ink-muted); }
.form-tabs { display: inline-flex; align-self: flex-start; padding: 4px; gap: 4px; background: var(--bg-alt); border-radius: var(--radius-pill); }
.form-tabs button { font: 600 0.92rem var(--font-body); color: var(--ink-muted); background: transparent; border: 0; border-radius: var(--radius-pill); padding: 10px 18px; cursor: pointer; }
.form-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; }
.pform { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: clamp(20px, 4vw, 32px); display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-widget); }
.pform[hidden] { display: none; }
.pform fieldset { border: 0; display: flex; flex-direction: column; gap: 16px; }
.pform legend { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 1.1rem; margin-bottom: 4px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--ink); min-width: 0; }
.field input, .field select, .field textarea { font: 400 1rem var(--font-body); color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 11px 12px; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18); }
.was-checked :invalid { border-color: #B3261E; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.btn-submit { align-self: flex-start; border: 0; cursor: pointer; font-family: var(--font-body); }
.btn-submit:disabled { opacity: 0.6; cursor: wait; }
.form-status { font-size: 0.92rem !important; min-height: 1.2em; }
.form-status.is-ok { color: #1E6B3A; }
.form-status.is-error { color: #B3261E; }

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .topbar { padding: 16px 20px; }
  .topnav { gap: 12px; font-size: 0.82rem; }
  .topnav a, .wordmark { white-space: nowrap; }
  /* Phones: globe + short code; the real menu sits invisibly on top so it still opens natively. */
  .lang-switch { padding: 4px 8px 4px 7px; gap: 4px; }
  .lang-code { display: inline; font-weight: 600; font-size: 0.78rem; letter-spacing: 0.02em; padding-right: 10px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: right 4px center, right 0 center; background-size: 4px 4px; background-repeat: no-repeat; }
  .lang-switch select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; }
  .stats { gap: 32px; }
  .widget-input { font-size: 0.9rem; }
  .widget-send { width: 38px; height: 38px; }
  .chips { gap: 8px; }
  .chip { padding: 8px 14px; font-size: 0.82rem; }
  .leader { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .leader-photo { max-width: 160px; }
  .page-cta { padding: 22px; }
  .partner-types, .field-row { grid-template-columns: minmax(0, 1fr); }
  .form-tabs button { padding: 9px 14px; font-size: 0.86rem; }
}
@media (max-width: 380px) {
  .topbar { padding: 14px 14px; }
  .topnav { gap: 10px; font-size: 0.78rem; }
  .wordmark { font-size: 1.12rem; }
}

/* ===== Minimal entrance: gentle staggered fade-up on load ===== */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .hero-inner > *:nth-child(1) { animation-delay: 0.02s; }
  .hero-inner > *:nth-child(2) { animation-delay: 0.09s; }
  .hero-inner > *:nth-child(3) { animation-delay: 0.16s; }
  .hero-inner > *:nth-child(4) { animation-delay: 0.24s; }
  .hero-inner > *:nth-child(5) { animation-delay: 0.34s; }
  .hero-inner > *:nth-child(6) { animation-delay: 0.44s; }

  /* Subhead second beat: reveal AI, Mortgage, Agent one by one after the line
     lands, with the same fade-up effect. */
  .subhead .reveal-word {
    display: inline-block;
    animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }
  .subhead .reveal-word:nth-child(1) { animation-delay: 0.60s; }
  .subhead .reveal-word:nth-child(2) { animation-delay: 0.85s; }
  .subhead .reveal-word:nth-child(3) { animation-delay: 1.10s; }
}
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
