/* ==========================================================================
   Casventa Design System
   Tokens from the Claude Design output; chrome (header, footer, forms,
   motion) implemented here. Page bodies carry their own inline styles as
   authored, so this file deliberately stays small.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — self-hosted latin subsets, no third-party requests
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}
/* Mulish ships as a variable font — one file covers 400/600/700 */
@font-face {
  font-family: 'Mulish'; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url('../fonts/mulish-var.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   2. Color tokens
   Deep petrol structures, signature petrol leads, light accents.
   -------------------------------------------------------------------------- */
:root {
  --casventa-petrol: #0DA89B;
  --casventa-petrol-deep: #0A4A43;
  --casventa-black-teal: #06322D;
  --casventa-petrol-light: #8FE6DA;
  --casventa-petrol-mist: #C9F2EC;
  --casventa-ink: #08130F;
  --casventa-slate: #5E6E6B;
  --casventa-paper: #F4F6F5;
  --casventa-white: #FFFFFF;
  --casventa-paper-2: #EBEFEE;
  --casventa-mist-2: #DDE5E3;

  --casventa-grad-door-from: #0A8076;
  --casventa-grad-door-to: #13B8A9;

  /* Link colour on light grounds. The gradient stop #0A8076 measures 4.44:1
     on --casventa-paper, just under the 4.5:1 AA floor for body text, so
     links use this slightly deeper shade instead. Gradients keep the
     original stop, since they are decorative. */
  --link-on-light: #09786E;

  /* Semantic aliases */
  --bg-page: var(--casventa-paper);
  --bg-ink: var(--casventa-ink);
  --surface-card: var(--casventa-white);
  --surface-inset: var(--casventa-paper-2);
  --surface-dark: var(--casventa-black-teal);

  --text-strong: var(--casventa-ink);
  --text-body: #1A2622;
  --text-muted: var(--casventa-slate);
  --text-on-dark: var(--casventa-paper);
  --text-on-dark-muted: #7FA39D;
  --text-accent: var(--casventa-petrol-deep);

  --accent: var(--casventa-petrol);
  --accent-deep: var(--casventa-petrol-deep);
  --accent-light: var(--casventa-petrol-light);
  --on-accent: #03241F;

  --border: rgba(8, 19, 15, 0.12);
  --border-strong: rgba(8, 19, 15, 0.20);
  --border-on-dark: rgba(255, 255, 255, 0.12);

  --danger: #A3121B;
  --danger-soft: #FBE9EA;

  --focus-ring: rgba(13, 168, 155, 0.45);

  /* Type */
  --font-display: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-text: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(22px, 4vw, 40px);

  /* Radii */
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --enter: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg-ink);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
img, svg { max-width: 100%; }

a { color: var(--link-on-light); }
a:hover { color: var(--accent-deep); }

:focus-visible { outline: 2px solid var(--casventa-petrol); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(13, 168, 155, .35); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 18px; z-index: 200;
  background: var(--accent); color: var(--casventa-ink);
  font: 700 15px var(--font-text);
  padding: 12px 20px; border-radius: 11px; text-decoration: none;
}
.skip-link:focus { left: 22px; }

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */
/* Light bar. The brand mark's outer arch is #0A4A43 — near-invisible on the
   ink background it used to sit on. On bone the full mark reads, so the
   header text flips to the dark-on-light ramp to hold contrast. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 246, 245, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(8, 19, 15, .10);
}
.site-header__inner {
  max-width: var(--container); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
}

/* Brand — "Casventa" always outsizes any service name (Delaware standard) */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text-strong);
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; letter-spacing: -.02em; line-height: 1;
}
.brand:hover { color: var(--text-strong); }
/* Footer sits on ink — keep the light-on-dark treatment there. */
.brand--footer, .brand--footer:hover { color: var(--text-on-dark); }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand--footer { font-size: 30px; }
.brand--footer svg { width: 38px; height: 38px; }

.site-nav { display: flex; align-items: center; gap: clamp(4px, 1.4vw, 18px); }
.site-nav a {
  color: #3D5A54; text-decoration: none;
  font: 600 15px var(--font-text);
  padding: 12px 8px; white-space: nowrap;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 8px calc(100% - 8px);
  background-size: 0 1px;
  transition: background-size var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-strong);
  background-size: calc(100% - 16px) 1px;
}
.site-nav .nav-cta {
  color: var(--text-strong);
  font: 700 14.5px var(--font-text);
  padding: 11px 20px; margin-left: 8px;
  border: 1px solid rgba(8, 19, 15, .28);
  border-radius: 11px;
  background-image: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.site-nav .nav-cta:hover { border-color: rgba(8, 19, 15, .55); background-size: 0 1px; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .site-nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--casventa-paper);
    border-bottom: 1px solid rgba(8, 19, 15, .12);
    padding: 12px var(--gutter) 26px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  }
  .site-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav a {
    padding: 15px 0; font-size: 17px;
    border-bottom: 1px solid rgba(8, 19, 15, .10);
    background-image: none;
  }
  .site-nav .nav-cta {
    margin: 18px 0 0; text-align: center;
    border-bottom: 1px solid rgba(8, 19, 15, .28);
  }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; min-width: 46px;
    background: transparent; color: var(--text-strong);
    border: 1px solid rgba(8, 19, 15, .22);
    border-radius: 10px; cursor: pointer;
  }
}

/* --------------------------------------------------------------------------
   5. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--casventa-ink); padding: 0 var(--gutter) 56px; }
.site-footer__inner { max-width: var(--container); margin: 0 auto; padding-top: clamp(56px, 7vw, 88px); }

.threshold {
  width: 320px; max-width: 80%; height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(13, 168, 155, .35), transparent);
}

.footer-top {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(38px, 4vw, 56px); align-items: start;
}
.footer-brand { display: flex; flex-direction: column; gap: 18px; }
.footer-tagline { margin: 0; font: 400 15px/1.6 var(--font-text); color: #7FA39D; max-width: 30ch; }

.footer-col { display: flex; flex-direction: column; gap: 4px; }
.footer-col__head {
  margin: 0 0 10px; font: 700 12px/1 var(--font-text);
  letter-spacing: .22em; text-transform: uppercase; color: #7FA39D;
}
.footer-col a, .footer-col span {
  color: #C7D6D2; text-decoration: none;
  font: 400 15px var(--font-text); padding: 7px 0;
  transition: color var(--dur-fast);
}
.footer-col a:hover { color: var(--accent-light); }
.footer-col span { color: #7FA39D; }
.footer-address { margin: 6px 0 0; font: 400 15px/1.6 var(--font-text); color: #C7D6D2; }

.footer-rule { height: 1px; background: rgba(255, 255, 255, .1); margin: clamp(38px, 4vw, 56px) 0; }

/* Brokerage identification — legally required, every page */
.brokerage {
  display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: clamp(26px, 4vw, 56px); align-items: start;
}
@media (max-width: 760px) { .brokerage { grid-template-columns: 1fr; } }

.brokerage__name {
  margin: 0 0 8px;
  font: 600 26px/1.1 var(--font-display); letter-spacing: -.02em;
  color: var(--text-on-dark);
}
.brokerage__detail { margin: 0; font: 400 14.5px/1.75 var(--font-text); color: #C7D6D2; }
.brokerage__detail strong { color: var(--text-on-dark); font-weight: 700; }
.brokerage__detail a { color: #C7D6D2; }
.brokerage__detail a:hover { color: var(--accent-light); }

.brokerage__eho { display: grid; gap: 14px; align-content: start; }
.eho {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-md); justify-self: start;
}
.eho svg { width: 32px; height: 32px; flex: none; }
.eho span {
  font: 700 12px/1.4 var(--font-text);
  letter-spacing: .1em; text-transform: uppercase; color: #C7D6D2;
}

.footer-fine { margin: 0; font: 400 13px/1.7 var(--font-text); color: #7FA39D; max-width: 46ch; }
.footer-fine a { color: #C7D6D2; }
.footer-fine a:hover { color: var(--accent-light); }

.footer-legal { font: 400 14px/1.7 var(--font-text); color: #7FA39D; }
.disclaimer {
  margin: 26px 0 0;
  font: 400 12.5px/1.7 var(--font-text); color: #7FA39D; max-width: 92ch;
}

/* --------------------------------------------------------------------------
   6. Forms — visible labels, errors never signalled by colour alone
   -------------------------------------------------------------------------- */
.form-status { font: 700 14.5px var(--font-text); padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.form-status:empty { display: none; }

.field-error {
  display: none; align-items: center; gap: 6px;
  font: 700 13.5px var(--font-text); color: var(--danger);
  margin-top: 6px;
}
.has-error .field-error { display: flex; }
.has-error input, .has-error select, .has-error textarea {
  border-color: var(--danger) !important; border-width: 2px !important;
}

.consent {
  display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start;
  font: 400 12.5px/1.6 var(--font-text); margin-top: 16px;
}
.consent input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------------------
   7. Motion
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 620ms var(--enter), transform 620ms var(--enter);
}
.reveal.is-in { opacity: 1; transform: none; }

[data-doorbar] { transform-origin: top; }
[data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  [data-parallax] { transform: none !important; }
}

/* --------------------------------------------------------------------------
   8. Privacy notice
   -------------------------------------------------------------------------- */
.privacy-notice {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 60;
  width: min(680px, calc(100vw - 32px));
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-dark);
  color: var(--text-on-dark);
  border: 1px solid var(--border-on-dark);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(6, 50, 45, 0.34);
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.privacy-notice.is-in { opacity: 1; transform: translate(-50%, 0); }
.privacy-notice__text {
  margin: 0;
  flex: 1 1 340px;
  font: 400 14.5px/1.55 var(--font-text);
  color: var(--text-on-dark);
}
.privacy-notice__text a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy-notice__dismiss {
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font: 700 14px var(--font-text);
  cursor: pointer;
  transition: background 180ms ease;
}
.privacy-notice__dismiss:hover { background: var(--accent-light); }
.privacy-notice__dismiss:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .privacy-notice { transition: opacity 240ms ease; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   9. Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .nav-toggle, .skip-link, .privacy-notice { display: none !important; }
  body { background: #fff; }
  .site-footer { background: #fff; }
  .brokerage__name, .brokerage__detail, .footer-legal, .disclaimer { color: #000 !important; }
}
