/* =========================================================
   RedFin AI — main.css
   Design system: deep red + charcoal, modern, high contrast
   ========================================================= */

:root {
  /* Brand */
  --brand-red: #E11D2A;
  --brand-red-deep: #8B0D18;
  --brand-red-soft: #FEE2E4;
  --ink: #0E1116;
  --ink-2: #1F2328;
  --slate: #3A4150;
  --slate-2: #5A6270;
  --line: #E6E8EC;
  --line-2: #F1F3F5;
  --bg: #FFFFFF;
  --bg-soft: #FAFAFB;
  --bg-dark: #0E1116;
  --bg-dark-2: #14181F;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(14,17,22,0.04), 0 2px 6px rgba(14,17,22,0.05);
  --shadow-md: 0 6px 24px rgba(14,17,22,0.08);
  --shadow-lg: 0 20px 60px rgba(14,17,22,0.12);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
}

/* Reset */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-red); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand-red-deep); }
button { font: inherit; cursor: pointer; }
h1,h2,h3,h4,h5 { color: var(--ink); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1em; color: var(--slate); }
ul { margin: 0 0 1em 1.2em; padding: 0; color: var(--slate); }
li { margin: .35em 0; }
code, pre { font-family: var(--font-mono); font-size: .95em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }

/* Layout helpers */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 8vw, 110px) 0; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }
.section--dark { background: var(--bg-dark); color: #E8ECEF; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }
.section--dark p, .section--dark li { color: #B5BCC5; }
.section--soft { background: var(--bg-soft); }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Eyebrow / tags */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 600;
  color: var(--brand-red); margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 2px; background: var(--brand-red); display: inline-block;
}
.section--dark .eyebrow { color: #FF6B76; }
.section--dark .eyebrow::before { background: #FF6B76; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  border: 1.5px solid transparent; transition: transform .12s ease, background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-red); color: #fff; }
.btn--primary:hover { background: var(--brand-red-deep); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.section--dark .btn--ghost { color: #fff; border-color: rgba(255,255,255,.22); }
.section--dark .btn--ghost:hover { border-color: #fff; }
.btn--lg { padding: 16px 30px; font-size: 1.05rem; }
.btn-arrow { transition: transform .18s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 40px; width: auto; }
.brand-text { font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-size: 1.15rem; }
.brand-text span { color: var(--brand-red); }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--ink-2); font-weight: 500; font-size: .96rem;
  padding: 8px 0; position: relative;
}
.nav-links a:hover { color: var(--brand-red); }
.nav-links a.active { color: var(--brand-red); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none; background: transparent; border: 0; padding: 8px;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links, .nav-cta .btn--ghost { display: none; }
  .nav-open .nav-links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; padding: 22px var(--gutter); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .nav-open .nav-links a { font-size: 1.05rem; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(225,29,42,0.10), transparent 60%),
    radial-gradient(900px 400px at -10% 20%, rgba(225,29,42,0.06), transparent 60%),
    #fff;
  padding: clamp(64px, 9vw, 120px) 0 clamp(56px, 8vw, 96px);
}
.hero-inner {
  display: grid; gap: 48px;
  grid-template-columns: 1.15fr .85fr; align-items: center;
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } }
.hero h1 span.accent { color: var(--brand-red); }
.hero p.lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--slate); max-width: 60ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats {
  display: flex; gap: 32px; margin-top: 44px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 24px;
}
.hero-stat b { display: block; font-size: 2rem; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; }
.hero-stat span { font-size: .88rem; color: var(--slate-2); }

/* Hero visual */
.hero-visual {
  position: relative; aspect-ratio: 1/1; max-width: 480px; justify-self: end; width: 100%;
}
.hero-visual .halo {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(225,29,42,.22), rgba(225,29,42,0) 65%);
  filter: blur(20px);
}
.hero-visual .card {
  position: absolute; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--ink-2);
}
.hero-visual .card b { color: var(--ink); font-weight: 700; }
.hero-visual .card .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-red); box-shadow: 0 0 0 4px rgba(225,29,42,.15); }
.hero-visual .card--a { top: 8%;  left: 4%;  animation: float 6s ease-in-out infinite; }
.hero-visual .card--b { top: 44%; right: 0%;  animation: float 7s ease-in-out .8s infinite; }
.hero-visual .card--c { bottom: 6%;left: 14%; animation: float 8s ease-in-out .3s infinite; }
.hero-visual .fin-svg { width: 62%; margin: 12% auto 0; display: block; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-visual .card { animation: none; }
  html { scroll-behavior: auto; }
}

/* Section header */
.section-head { max-width: 780px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.1rem; color: var(--slate); }

/* Feature/Service cards */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.card .icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--brand-red-soft); color: var(--brand-red);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p  { color: var(--slate); font-size: .98rem; margin: 0 0 14px; }
.card .learn { font-weight: 600; font-size: .93rem; display: inline-flex; align-items: center; gap: 6px; }

.card--dark {
  background: var(--bg-dark-2); border-color: rgba(255,255,255,.06); color: #E8ECEF;
}
.card--dark h3 { color: #fff; }
.card--dark p, .card--dark li { color: #B5BCC5; }
.card--dark .icon { background: rgba(225,29,42,.15); color: #FF6B76; }

/* Numbered process steps */
.steps { counter-reset: step; }
.step {
  position: relative; padding-left: 74px;
  border-top: 1px solid var(--line); padding-top: 30px; padding-bottom: 30px;
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute; left: 0; top: 30px;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.4rem;
  color: var(--brand-red); letter-spacing: -0.02em;
}
.step h3 { margin: 0 0 6px; font-size: 1.2rem; }
.step p  { margin: 0; max-width: 70ch; }

/* Stats band */
.stats-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px; padding: 40px; background: var(--bg-dark); color: #fff;
  border-radius: var(--r-lg);
}
.stats-band .stat b { display: block; font-size: 2.6rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.stats-band .stat span { color: #B5BCC5; font-size: .95rem; }
.stats-band .stat b em { color: var(--brand-red); font-style: normal; }

/* Logos strip */
.marquee { color: var(--slate-2); text-align: center; }
.marquee p { font-size: .84rem; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 22px; }
.marquee-row {
  display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; align-items: center;
  opacity: .78;
}
.marquee-row span {
  font-weight: 700; font-size: 1.2rem; color: var(--slate); letter-spacing: -0.02em;
}

/* Testimonial */
.quote {
  background: linear-gradient(180deg, #fff, #FAFAFB);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 40px; position: relative;
}
.quote::before {
  content: "\201C"; position: absolute; top: -10px; left: 24px;
  font-size: 6rem; color: var(--brand-red); font-family: Georgia, serif; line-height: 1;
}
.quote blockquote { margin: 0 0 20px; font-size: 1.2rem; color: var(--ink); line-height: 1.5; }
.quote cite { color: var(--slate-2); font-style: normal; font-size: .95rem; }

/* CTA band */
.cta-band {
  background: var(--bg-dark); color: #fff; border-radius: var(--r-lg);
  padding: clamp(40px, 6vw, 72px); text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: -1px;
  background: radial-gradient(600px 260px at 20% 0%, rgba(225,29,42,.35), transparent 60%),
              radial-gradient(500px 260px at 100% 100%, rgba(225,29,42,.20), transparent 60%);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.cta-band p  { color: #C5CCD5; max-width: 60ch; margin: 0 auto 28px; }

/* Footer */
.site-footer {
  background: var(--bg-dark); color: #B5BCC5; padding: 72px 0 32px; font-size: .95rem;
}
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .12em; }
.site-footer a { color: #C5CCD5; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 8px 0; }
.footer-brand { max-width: 340px; }
.footer-brand p { color: #8A93A0; margin-top: 12px; }
.footer-bottom {
  margin-top: 56px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 22px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: #7B838F; font-size: .85rem;
}

/* Contact form */
.form { display: grid; gap: 16px; }
.form label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.form input, .form select, .form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; font: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 0; border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(225,29,42,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form small { color: var(--slate-2); font-size: .82rem; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-4 { margin-top: 32px; }
.mb-4 { margin-bottom: 32px; }
.mt-6 { margin-top: 48px; }
.mb-6 { margin-bottom: 48px; }

/* Breadcrumbs */
.crumbs { font-size: .85rem; color: var(--slate-2); margin-bottom: 12px; }
.crumbs a { color: var(--slate-2); }
.crumbs a:hover { color: var(--brand-red); }
.crumbs span { margin: 0 8px; opacity: .55; }

/* Prose (blog/legal) */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-2); font-size: 1.05rem; }
.prose ul { margin-left: 1.4em; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0; font-weight: 600; z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

/* Focus rings */
:focus-visible { outline: 2px solid var(--brand-red); outline-offset: 2px; border-radius: 4px; }

/* Blog post */
.post-meta {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  color: var(--slate-2); font-size: .92rem; margin: 8px 0 32px;
}
.post-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--slate-2); }
.post-meta .tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--brand-red-soft); color: var(--brand-red); font-weight: 600; font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase;
}
.prose blockquote {
  margin: 1.6em 0; padding: 12px 22px; border-left: 3px solid var(--brand-red);
  background: var(--bg-soft); color: var(--ink-2); font-style: italic;
}
.prose pre {
  background: var(--ink); color: #E8ECEF; padding: 18px 20px; border-radius: var(--r-md);
  overflow-x: auto; font-size: .92rem; line-height: 1.5;
}
.prose pre code { background: transparent; color: inherit; padding: 0; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--line); margin: 1.4em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose .callout {
  border-left: 3px solid var(--brand-red); background: var(--brand-red-soft);
  padding: 14px 18px; border-radius: 0 var(--r-md) var(--r-md) 0; margin: 1.6em 0;
}
.prose .callout p { margin: 0; color: var(--ink-2); }

.post-cta {
  margin-top: 3em; padding: 28px; border-radius: var(--r-md);
  background: var(--bg-dark); color: #E8ECEF;
}
.post-cta h3 { color: #fff; margin: 0 0 8px; }
.post-cta p  { color: #B5BCC5; margin: 0 0 16px; }

.related-posts { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--line); }
.related-posts h3 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-2); margin-bottom: 20px; }

.post-card {
  display: flex; flex-direction: column; height: 100%;
}
.post-card .tag { align-self: flex-start; margin-bottom: 12px; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--brand-red); }
.post-card time { color: var(--slate-2); font-size: .85rem; }
