/* Estate Hub marketing site. Tokens from docs/DESIGN_SYSTEM.md (the river-blue
   tonalSpot scheme, sand tertiary, Manrope + Inter). Light and dark follow the
   visitor's system setting. */

@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("fonts/Manrope-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("fonts/Manrope-Bold.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("fonts/Manrope-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/Inter-Medium.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.ttf") format("truetype"); }

:root {
  --primary: #246488;
  --on-primary: #FFFFFF;
  --primary-container: #C8E6FF;
  --on-primary-container: #004C6E;
  --primary-deep: #00344D;
  --secondary-container: #D3E5F5;
  --on-secondary-container: #384956;
  --tertiary: #815511;
  --tertiary-container: #FFDDB5;
  --on-tertiary-container: #643F00;
  --page: #F1F4F9;
  --card: #FFFFFF;
  --surface: #F6F9FE;
  --surface-high: #E5E8ED;
  --surface-highest: #DFE3E8;
  --text: #181C20;
  --muted: #41474D;
  --outline: #71787E;
  --outline-variant: #C1C7CE;
  --error: #BA1A1A;
  --frame: #1C2024;
  --shadow: 0 24px 48px -24px rgba(0, 52, 77, 0.35);
  --radius: 12px;
  --radius-lg: 28px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #94CDF7;
    --on-primary: #00344D;
    --primary-container: #004C6E;
    --on-primary-container: #C8E6FF;
    --primary-deep: #C8E6FF;
    --secondary-container: #384956;
    --on-secondary-container: #D3E5F5;
    --tertiary: #F6BC70;
    --tertiary-container: #643F00;
    --on-tertiary-container: #FFDDB5;
    --page: #101417;
    --card: #1C2024;
    --surface: #181C20;
    --surface-high: #262A2E;
    --surface-highest: #313539;
    --text: #DFE3E8;
    --muted: #C1C7CE;
    --outline: #8B9198;
    --outline-variant: #41474D;
    --error: #FFB4AB;
    --frame: #313539;
    --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  --primary: #94CDF7;
  --on-primary: #00344D;
  --primary-container: #004C6E;
  --on-primary-container: #C8E6FF;
  --primary-deep: #C8E6FF;
  --secondary-container: #384956;
  --on-secondary-container: #D3E5F5;
  --tertiary: #F6BC70;
  --tertiary-container: #643F00;
  --on-tertiary-container: #FFDDB5;
  --page: #101417;
  --card: #1C2024;
  --surface: #181C20;
  --surface-high: #262A2E;
  --surface-highest: #313539;
  --text: #DFE3E8;
  --muted: #C1C7CE;
  --outline: #8B9198;
  --outline-variant: #41474D;
  --error: #FFB4AB;
  --frame: #313539;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 17px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Manrope", "Inter", system-ui, sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 1.3rem + 3.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 44ch; }
.eyebrow {
  display: inline-block;
  font: 600 0.8rem/1 "Inter", sans-serif;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--on-primary-container);
  background: var(--primary-container);
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.eyebrow.sand { color: var(--on-tertiary-container); background: var(--tertiary-container); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 1rem/1 "Inter", sans-serif;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--on-primary-container); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--on-primary-container); color: var(--primary-deep); }
.btn-tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn-tonal:hover { background: var(--primary-container); color: var(--on-primary-container); }
.btn-outline { border-color: var(--outline); color: var(--primary); }
.btn-outline:hover { background: var(--surface-high); }
.btn-inverse { background: var(--card); color: var(--primary); }
.btn-inverse:hover { background: var(--primary-container); color: var(--on-primary-container); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-variant);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text); font: 800 1.1rem/1 "Manrope", sans-serif; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); font-weight: 500; padding: 8px 12px; border-radius: 999px; font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); background: var(--surface-high); text-decoration: none; }
.site-nav .btn { margin-left: 8px; padding: 10px 18px; font-size: 0.95rem; color: var(--on-primary); }
.nav-state { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--outline-variant); color: var(--text); border-radius: 999px; padding: 8px 14px; font: 500 0.95rem "Inter", sans-serif; cursor: pointer; }
.nav-state:focus-visible + .nav-toggle { outline: 3px solid var(--primary); outline-offset: 3px; }
@media (max-width: 820px) {
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; background: var(--card); border-bottom: 1px solid var(--outline-variant); padding: 12px 16px 16px; gap: 2px; }
  .site-nav a { padding: 12px 12px; }
  .site-nav .btn { margin: 8px 0 0; justify-content: center; }
  .nav-state:checked ~ .site-nav { display: flex; }
  .nav-toggle { display: inline-block; }
  .site-nav.always { display: flex; position: static; flex-direction: row; background: none; border: 0; padding: 0; margin-left: auto; }
  .site-nav.always a { padding: 8px 10px; }
  .site-nav.always .btn { margin: 0 0 0 4px; }
}
@media (max-width: 520px) {
  .site-nav.always a:not(.btn) { display: none; }
}

/* Sections */
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 104px 0; } }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* Hero */
.hero { padding-top: 56px; padding-bottom: 32px; overflow-x: clip; position: relative; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding-top: 72px; padding-bottom: 64px; }
  .hero .wrap { grid-template-columns: 1.05fr 1fr; gap: 48px; }
}
.hero h1 { margin-bottom: 20px; }
.hero .lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); margin-bottom: 28px; max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 28px; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.platforms span { display: inline-flex; align-items: center; gap: 6px; }
.platforms svg { width: 18px; height: 18px; fill: currentColor; }

.hero-art { position: relative; display: flex; justify-content: center; align-items: flex-start; }
.hero-art .phone { position: relative; z-index: 2; width: min(300px, 70vw); }
.hero-art .phone.back { position: absolute; z-index: 1; width: min(240px, 54vw); right: 0; top: 56px; transform: rotate(6deg); opacity: 0.95; }
.hero-art .phone.front { margin-right: 120px; }
@media (max-width: 480px) {
  .hero-art .phone.back { display: none; }
  .hero-art .phone.front { margin-right: 0; }
}
.hero-bg {
  position: absolute; inset: auto 0 0 0; height: 55%; z-index: 0;
  background: linear-gradient(180deg, transparent, var(--primary-container));
  opacity: 0.55; pointer-events: none;
}
@media (max-width: 899px) { .hero-bg { display: none; } }

/* Device frames */
.phone {
  background: var(--frame);
  border-radius: 46px;
  padding: 10px;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.phone img { width: 100%; aspect-ratio: 1206 / 2622; border-radius: 38px; background: var(--surface-highest); object-fit: cover; }
.phone.small { border-radius: 36px; padding: 8px; }
.phone.small img { border-radius: 29px; }

.browser {
  background: var(--frame);
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.browser .bar { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; background: var(--frame); }
.browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--outline); opacity: 0.6; }
.browser .bar b { flex: 1; height: 20px; margin-left: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); font: 400 0.72rem/20px "Inter", sans-serif; color: var(--outline); text-align: center; }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--surface-highest); }

/* Pain strip */
.pain { background: var(--primary-deep); color: var(--primary-container); }
:root[data-theme="dark"] .pain, .pain.dark-safe { color: var(--primary-container); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pain { background: var(--surface); color: var(--text); } }
:root[data-theme="dark"] .pain { background: var(--surface); color: var(--text); }
.pain h2 { color: inherit; }
.pain .section-head p { color: inherit; opacity: 0.85; }
.pain-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .pain-grid { grid-template-columns: repeat(3, 1fr); } }
.pain-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 24px;
}
.pain-card h3 { color: inherit; font-size: 1.1rem; }
.pain-card p { margin: 0; opacity: 0.85; }
.pain-card .quote { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 1.25rem; line-height: 1.3; margin-bottom: 10px; color: inherit; }

/* Features */
.feature { display: grid; gap: 32px; align-items: center; padding: 40px 0; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; padding: 48px 0; }
  .feature.flip .feature-text { order: 2; }
  .feature.flip .feature-art { order: 1; }
}
.feature + .feature { border-top: 1px solid var(--outline-variant); }
.feature h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.feature p { color: var(--muted); font-size: 1.05rem; }
.feature ul { padding-left: 0; list-style: none; margin: 16px 0 0; display: grid; gap: 10px; }
.feature li { padding-left: 30px; position: relative; color: var(--text); }
.feature li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-container) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23004C6E' d='M9.5 16.2 5.3 12l1.4-1.4 2.8 2.8 7.8-7.8L18.7 7z'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.feature-art { display: flex; justify-content: center; gap: 16px; }
.feature-art .phone { width: min(280px, 72vw); }
.feature-art .phone.small { width: min(200px, 44vw); }
.feature-art.pair .phone { width: min(230px, 44vw); }
.feature-art.pair .phone:last-child { margin-top: 48px; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary-container);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.feature-icon svg { width: 24px; height: 24px; fill: var(--on-primary-container); }
.feature-icon.sand { background: var(--tertiary-container); }
.feature-icon.sand svg { fill: var(--on-tertiary-container); }

/* Trio of small phones */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; margin-top: 40px; }
.trio figure { margin: 0; text-align: center; }
.trio .phone.small { width: min(260px, 100%); margin-inline: auto; }
.trio figcaption { margin-top: 14px; font-weight: 600; font-size: 0.95rem; }
.trio figcaption small { display: block; font-weight: 400; color: var(--muted); }
@media (max-width: 600px) { .trio { grid-template-columns: 1fr; max-width: 280px; margin-inline: auto; } .trio .phone.small { width: 100%; } }

/* Admin */
.admin { background: var(--surface); border-top: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.admin .browser { margin-top: 40px; }
.cards { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards.four { grid-template-columns: repeat(4, 1fr); } .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); padding: 24px; border: 1px solid var(--outline-variant); }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.card .feature-icon { width: 40px; height: 40px; margin-bottom: 14px; }
.card .feature-icon svg { width: 22px; height: 22px; }

/* Roles chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip { font: 500 0.9rem/1 "Inter", sans-serif; padding: 10px 14px; border-radius: 999px; background: var(--secondary-container); color: var(--on-secondary-container); }
.chip.sand { background: var(--tertiary-container); color: var(--on-tertiary-container); }

/* Steps */
.steps { display: grid; gap: 24px; counter-reset: step; margin-top: 40px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding: 28px 24px 24px; background: var(--card); border: 1px solid var(--outline-variant); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font: 800 1.1rem "Manrope", sans-serif; margin-bottom: 16px;
}
.step p { margin: 0; color: var(--muted); }

/* Security */
.security .cards { margin-top: 40px; }

/* Residents never pay */
.pay { background: var(--primary); color: var(--on-primary); }
.pay h2, .pay h3 { color: inherit; }
.pay .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .pay .wrap { grid-template-columns: 1.2fr 1fr; gap: 64px; } }
.pay p { opacity: 0.92; font-size: 1.1rem; }
.pay .card { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: inherit; }
.pay .card p, .pay .card li { color: inherit; opacity: 0.95; }
.pay .card ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* Founding estate */
.founding .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .founding .wrap { grid-template-columns: 1fr 1fr; gap: 64px; } }
.founding blockquote { margin: 0; font: 700 1.4rem/1.35 "Manrope", sans-serif; letter-spacing: -0.01em; }
.founding cite { display: block; margin-top: 16px; font: 400 0.95rem "Inter", sans-serif; color: var(--muted); font-style: normal; }

/* FAQ */
.faq details { border-top: 1px solid var(--outline-variant); padding: 4px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--outline-variant); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font: 600 1.05rem/1.4 "Inter", sans-serif; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.6rem/1 "Inter", sans-serif; color: var(--primary); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }

/* Final CTA */
.cta { text-align: center; }
.cta .lede { margin-inline: auto; }
.cta .cta-row { justify-content: center; }
.cta .fine { color: var(--muted); font-size: 0.9rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--outline-variant); padding: 40px 0; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Prose pages (privacy, support) */
.prose { padding: 56px 0 96px; }
.prose .wrap { max-width: 760px; }
.prose h1 { margin-bottom: 8px; }
.prose .meta { color: var(--muted); margin-bottom: 40px; }
.prose h2 { font-size: 1.5rem; margin-top: 48px; }
.prose h3 { margin-top: 28px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0 24px; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--outline-variant); vertical-align: top; }
.prose th { font-weight: 600; }
.prose .note { background: var(--tertiary-container); color: var(--on-tertiary-container); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 32px; }
.prose .note p { margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
