/* =====================================================
   EstateMate splash — styles
   Brand tokens from estate-mate/08-brand/guidelines/BRAND_GUIDELINES.md
   ===================================================== */

:root {
  /* Color */
  --color-primary: #1A332F;
  --color-primary-light: #234540;
  --color-accent: #D4A853;
  --color-accent-soft: rgba(212, 168, 83, 0.16);
  --color-bg-light: #F9F9F7;
  --color-card: #FFFFFF;
  --color-heading: #1F2937;
  --color-body: #374151;
  --color-secondary: #6B7280;
  --color-on-dark: #FFFFFF;
  --color-on-dark-muted: #A3B8B3;
  --color-border: rgba(255, 255, 255, 0.14);
  --color-input-border: rgba(255, 255, 255, 0.22);

  /* Type — Geist (brand spine, matches v3.0 product app).
     Geist runs slightly tighter than Inter at the same px, so the
     display sizes are nudged up to preserve perceived weight. */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --fs-display: clamp(2.625rem, 6.8vw, 4.75rem);  /* 42 → 76 */
  --fs-h1: clamp(2.375rem, 5.2vw, 3.125rem);      /* 38 → 50 */
  --fs-h2: clamp(1.875rem, 3.8vw, 2.375rem);      /* 30 → 38 */
  --fs-h3: 1.75rem;                                /* 28 */
  --fs-body-lg: 1.125rem;                          /* 18 */
  --fs-body: 1rem;                                 /* 16 */
  --fs-small: 0.875rem;                            /* 14 */
  --fs-eyebrow: 0.6875rem;                         /* 11 — matches v3.0 overline */

  /* Layout */
  --container: 1200px;
  --container-narrow: 880px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-py: clamp(5rem, 10vw, 9rem);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 180ms;
  --t-med: 360ms;
  --t-slow: 640ms;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-on-dark);
  background-color: var(--color-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ===== a11y ===== */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--color-accent); color: var(--color-primary);
  padding: 8px 16px; text-decoration: none; font-weight: 600;
  z-index: 100;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Type primitives ===== */
.display {
  display: block;
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.display--white { color: var(--color-on-dark); }
.display--gold { color: var(--color-accent); }
.text--gold { color: var(--color-accent); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;       /* matches v3.0 overline weight */
  letter-spacing: 0.1em;  /* matches v3.0 overline tracking */
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 1.5rem;
}
.eyebrow--on-light { color: var(--color-accent); }

/* ===== Button ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-primary);
}
.btn--primary:hover {
  background-color: #E2BC6A;
  transform: translateY(-1px);
}
.btn--primary:active { transform: translateY(0); }
.btn--lg {
  padding: 0.95rem 1.85rem;
  font-size: var(--fs-body-lg);
}

/* ===== Logo ===== */
.logo {
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  color: var(--color-on-dark);
}
.logo__pipe {
  color: var(--color-accent);
  margin: 0 0.35em;
  font-weight: 400;
}

/* ===== Navbar =====
   Solid forest with a hairline divider — the v3.0 pattern. Glassmorphism
   was the original treatment but reads as 2024-template-AI on a marketing
   page; the solid bg is calmer and matches the in-product sidebar mood. */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background-color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
}
.navbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar__logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-small);
  letter-spacing: 0.1em;
  color: var(--color-on-dark-muted);
}
.lang-toggle__btn {
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-on-dark-muted);
  padding: 0.25rem 0.15rem;
  transition: color var(--t-fast) var(--ease);
}
.lang-toggle__btn.is-active {
  color: var(--color-on-dark);
  font-weight: 600;
}
.lang-toggle__btn:hover { color: var(--color-on-dark); }
.lang-toggle__divider { color: var(--color-on-dark-muted); opacity: 0.5; }

.navbar__cta {
  padding: 0.55rem 1.1rem;
  font-size: var(--fs-small);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  background-color: var(--color-primary);
  overflow: hidden;
}

/* Inner content sits in the upper-left quadrant */
.hero__inner {
  position: relative;
  z-index: 3;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(7rem, 16vh, 11rem) var(--gutter) 5rem;
  width: 100%;
}
.hero__copy {
  max-width: 580px;
}
.hero__headline {
  margin: 0 0 1.5rem;
  font-weight: 700;
}
.hero__subhead {
  font-size: var(--fs-body-lg);
  color: var(--color-on-dark-muted);
  max-width: 520px;
  margin: 0 0 2.25rem;
  line-height: 1.55;
}

/* Cinematic media layer — fills the hero, gradients shape its visible mass */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero__media-asset {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 55%;
  filter: sepia(0.3) contrast(1.05) brightness(0.85);
}
img.hero__media-asset {
  animation: kenBurns 36s ease-in-out infinite alternate;
}
video.hero__media-asset {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero__media-asset { animation: none; }
}

/* Primary fade — radial shadow centered at upper-left over the text zone.
   Image is fully revealed at bottom-right and softly fades toward upper-left. */
.hero__media-fade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 78% 92% at 14% 30%,
      var(--color-primary) 0%,
      var(--color-primary) 28%,
      rgba(26, 51, 47, 0.92) 45%,
      rgba(26, 51, 47, 0.55) 65%,
      rgba(26, 51, 47, 0.18) 85%,
      transparent 100%
    );
}

/* Edge softening — image fades into forest green at top, right, and bottom edges
   so the visible video mass blends cleanly with the brand color. */
.hero__media-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--color-primary) 0%, transparent 22%),
    linear-gradient(to right, transparent 65%, rgba(26, 51, 47, 0.5) 90%, var(--color-primary) 100%),
    linear-gradient(to top, var(--color-primary) 0%, transparent 20%);
}

@keyframes kenBurns {
  from { transform: scale(1.06) translate(1%, 0.5%); }
  to { transform: scale(1.16) translate(-1.5%, -1.5%); }
}

/* ===== Tension ===== */
.tension {
  position: relative;
  background-color: var(--color-bg-light);
  color: var(--color-heading);
  padding: clamp(5rem, 10vw, 9rem) 0;
  overflow: hidden;
  min-height: clamp(580px, 75vh, 880px);
}

/* Cinematic media layer — fills the section edge to edge, no border bands */
.tension__media {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.tension__media-asset {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 35% 50%;
  filter: grayscale(1) contrast(1.05) brightness(0.95);
}

/* Single radial gradient — origin pinned to the right edge, large reach.
   The right 38% stays fully off-white (covers the text zone completely),
   then fades softly across the middle, image fully revealed on the left. */
.tension__media-fade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 95% 130% at 100% 50%,
      var(--color-bg-light) 0%,
      var(--color-bg-light) 38%,
      rgba(249, 249, 247, 0.78) 55%,
      rgba(249, 249, 247, 0.35) 75%,
      transparent 100%
    );
}

.tension__inner {
  position: relative;
  z-index: 3;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}
.tension__copy {
  max-width: 520px;
  margin-left: auto;
}
.tension__headline {
  margin: 0 0 2rem;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-heading);
  max-width: 16ch;
}
.tension__body {
  font-size: var(--fs-body-lg);
  line-height: 1.7;
  color: var(--color-body);
  margin: 0;
}

/* ===== Provenance =====
   Calm pause: a single all-white headline floating on solid forest.
   The gold accent moves out of the headline (where it had become a
   typographic tic across three sections) and lives in the eyebrow,
   matching the v3.0 overline-as-accent pattern. */
.provenance {
  background-color: var(--color-primary);
  padding: var(--section-py) 0;
  text-align: left;
}
.provenance__inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.provenance__headline {
  margin: 0;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--color-on-dark);
  max-width: 22ch;
}

/* ===== Sign-up ===== */
.signup {
  background-color: var(--color-primary);
  padding: var(--section-py) 0;
  position: relative;
}
.signup::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 1px;
  background: var(--color-accent);
  opacity: 0.4;
}
.signup__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
}
.signup__headline {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--color-on-dark);
}
.signup__body {
  font-size: var(--fs-body-lg);
  color: var(--color-on-dark-muted);
  margin: 0 0 2.5rem;
  line-height: 1.6;
}
.signup__form {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto 1rem;
  max-width: 460px;
  flex-direction: column;
}
@media (min-width: 560px) {
  .signup__form { flex-direction: row; }
}
.signup__input {
  flex: 1;
  font: inherit;
  font-size: var(--fs-body);
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-on-dark);
  border: 1px solid var(--color-input-border);
  transition: border-color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.signup__input::placeholder { color: var(--color-on-dark-muted); }
.signup__input:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.08);
}
.signup__submit { padding: 0.95rem 1.5rem; }
.signup__input--error {
  border-color: #C75B4A;
  background-color: rgba(199, 91, 74, 0.06);
}
.signup__input--error:focus {
  border-color: #C75B4A;
  box-shadow: 0 0 0 3px rgba(199, 91, 74, 0.18);
}
.signup__error {
  margin: 0.85rem auto 0;
  max-width: 460px;
  font-size: var(--fs-small);
  color: #E0857A;
  line-height: 1.5;
  text-align: center;
}
.signup__success {
  display: inline-block;
  margin: 1.5rem auto 0;
  padding: 0.85rem 1.4rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.signup__privacy {
  font-size: var(--fs-small);
  color: var(--color-on-dark-muted);
  margin: 1.75rem auto 0;
  max-width: 400px;
  line-height: 1.5;
}

/* ===== Footer ===== */
.footer {
  background-color: var(--color-primary);
  border-top: 1px solid var(--color-border);
  padding: 1.75rem 0;
}
.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  font-size: var(--fs-small);
  color: var(--color-on-dark-muted);
}
@media (min-width: 720px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}
.footer__brand {
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-on-dark);
  font-size: 0.85rem;
}
.footer__contact {
  color: var(--color-on-dark);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
.footer__contact:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Responsive ===== */

/* Mobile spacing tweaks (and Tension layout flip).
   The Tension section's side-fade pattern (image left, off-white text
   zone right) needs ~640px of horizontal room to work. Below that the
   text spans the full viewport, lands over the laptop image, and goes
   half-unreadable. Switch to a clean off-white block — the image is
   decorative, copy isn't. */
@media (max-width: 640px) {
  .tension { min-height: 0; padding: 4.5rem 0; }
  .tension__media-asset { display: none; }
  .tension__media-fade { background: var(--color-bg-light); }
  .tension__copy { margin-left: 0; max-width: none; }
  .navbar__cta { display: none; }
  .navbar__inner { padding: 0.85rem var(--gutter); }
  .hero { min-height: auto; padding-top: 7rem; padding-bottom: 5rem; }
  .hero__inner { padding-top: clamp(6rem, 14vh, 8rem); padding-bottom: 3.5rem; }
  /* Pull the hero media's radial-fade origin to centre on stacked layouts so
     the text zone (which now spans full width) stays fully shrouded. */
  .hero__media-fade {
    background: radial-gradient(
      ellipse 120% 90% at 35% 35%,
      var(--color-primary) 0%,
      var(--color-primary) 38%,
      rgba(26, 51, 47, 0.85) 60%,
      rgba(26, 51, 47, 0.4) 82%,
      transparent 100%
    );
  }
  .provenance, .signup { padding: 4.5rem 0; }
}
