/* ============================================================
   Mark Tomaszewski — Movement Mortgage Loan Officer
   Design tokens + shared styles
   Mirrors src/lib/constants.ts token lock from the brief.
   BRAND COLOR — Movement Mortgage red (#A71E21).
   Sampled from the Movement Mortgage brand palette.
   Swap --brand-primary if Movement compliance specifies a
   different exact hex for co-branded LO sites.
   ============================================================ */

:root {
  /* ---- Brand color (Movement Mortgage red) ---- */
  --brand-primary:      #E40606;  /* Movement Mortgage red (movement.com) */
  --brand-primary-dark: #B00404;  /* hover / pressed */
  --brand-primary-soft: #FF4040;  /* brighter red for accents on dark sections */
  --brand-tint:         #FCEAEA;  /* faint red wash for soft fills */
  --brand-glow:         rgba(228,6,6,.32);

  /* ---- Neutrals ---- */
  --ink:        #141414;  /* true near-black: dark sections + headlines */
  --ink-soft:   #242424;  /* lifted dark for depth */
  --ink-deep:   #090909;  /* deepest layer for hero overlay */
  --paper:      #FAF7F2;  /* warm off-white: light section bg */
  --paper-grey: #EFEBE4;  /* alt light section */
  --paper-tan:  #E8E2D6;  /* warmer accent surface */
  --grey-text:  #4D4D4F;  /* body copy */
  --grey-accent:#8A8A8A;  /* labels, secondary text */
  --white:      #FFFFFF;
  --line:       rgba(20,16,8,0.10);   /* hairline dividers */
  --line-light: rgba(255,255,255,0.13);

  /* ---- Type ---- */
  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* ---- Layout ---- */
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(26,26,26,.06), 0 4px 16px rgba(26,26,26,.05);
  --shadow-md: 0 8px 30px rgba(26,26,26,.10);
  --shadow-lg: 0 24px 60px rgba(26,26,26,.16);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  /* faint film grain for atmosphere on dark sections */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
h1, h2, h3 { font-optical-sizing: auto; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; border-radius: 3px; }
:focus:not(:focus-visible) { outline: none; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--brand-primary); color: #fff; }
/* Kill the grey tap-flash on touch devices for a native-app feel */
a, button, input, textarea, select, label, .btn, .tile { -webkit-tap-highlight-color: transparent; }

/* ---- Atmosphere: subtle grain + glow on dark sections ---- */
.section--ink, .hero, .footer, .applyband, .foundation {
  position: relative;
}
.section--ink::before, .hero::after, .footer::before, .applyband::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: var(--grain); background-size: 140px 140px;
  opacity: .04; mix-blend-mode: overlay;
}
.hero::after { z-index: 4; opacity: .06; }
.applyband::before { z-index: 0; opacity: .08; }
.section--ink > .wrap, .footer > .wrap, .applyband > .wrap { position: relative; z-index: 2; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 10vw, 132px); position: relative; }
.section--ink   { background: var(--ink); color: var(--paper); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--grey  { background: var(--paper-grey); color: var(--ink); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1.5px;
  background: currentColor;
  display: inline-block;
  opacity: .85;
}
.section--ink .eyebrow, .hero .eyebrow, .footer .eyebrow, .applyband .eyebrow, .foundation .eyebrow { color: #FF3636; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.h-display { font-size: clamp(40px, 6.2vw, 78px); font-weight: 600; letter-spacing: -0.03em; }
.h-section { font-size: clamp(32px, 4.4vw, 52px); font-weight: 600; letter-spacing: -0.024em; }
/* emphasized word in a headline — Movement-style weight + color accent */
.accent-i { font-style: normal; font-weight: 600; }
.section--ink .accent-i, .hero .accent-i, .applyband .accent-i { color: #FF3636; }
.section--paper .accent-i, .section--grey .accent-i { color: var(--brand-primary); }
.foundation .accent-i { color: #FF3636; }
.lead { font-size: clamp(18px, 1.5vw, 21px); color: var(--grey-text); line-height: 1.62; }
.section--ink .lead { color: rgba(250,248,245,.74); }
.muted { color: var(--grey-accent); }

/* ---- Brand lockup (shared across all pages) ---- */
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand .brand__mtg + .brand__mark { margin-left: -3px; }
.brand__mark {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: radial-gradient(120% 120% at 30% 22%, var(--brand-primary-soft) 0%, var(--brand-primary) 42%, var(--brand-primary-dark) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 21px;
  font-style: normal; letter-spacing: -.02em;
  box-shadow: 0 6px 14px rgba(228,6,6,.34), inset 0 1px 0 rgba(255,255,255,.20), inset 0 -10px 16px rgba(0,0,0,.22);
  position: relative; overflow: hidden;
}
.brand__mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.18));
  pointer-events: none;
}
.brand__mark--photo { padding: 0; background: var(--brand-primary); box-shadow: 0 4px 12px rgba(228,6,6,.30), 0 0 0 1.5px rgba(255,255,255,.15) inset; }
.brand__mark--photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; border-radius: 50%; }

/* Footer brand: The MT Group wordmark chip (replaces the headshot in the footer) */
.brand__logo-mtg {
  display: inline-flex; align-items: center; justify-content: center;
  height: 79px; width: 185px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.6);
  flex: none;
  padding: 10px 18px;
}
.brand__logo-mtg img { height: 100%; width: 100%; object-fit: contain; display: block; }
.brand--footer { gap: 18px; flex-wrap: wrap; }
.brand--footer .brand__name { font-size: 19px; color: #fff; letter-spacing: -.012em; }
.brand--footer .brand__sub { color: rgba(250,248,245,.62); }

/* The MT Group co-brand chip — sits to the left of Mark's photo in every header */
.brand__mtg {
  width: 44px; height: 44px; flex: none;
  border-radius: 10px;
  background: #fff;
  display: grid; place-items: center;
  padding: 1px;
  box-shadow: 0 4px 10px rgba(20,16,8,.18), 0 0 0 1px rgba(20,16,8,.06);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.brand__mtg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand:hover .brand__mtg { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(20,16,8,.22), 0 0 0 1px rgba(20,16,8,.08); }
/* On the dark hero (header is transparent), give the chip a hint of inner light so it reads as intentional */
.hdr:not(.hdr--scrolled) .brand__mtg { box-shadow: 0 6px 14px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); }
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: -.012em; }
.brand__sub { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey-accent); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 15.5px; letter-spacing: .005em;
  padding: 15px 26px; border-radius: 999px;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
  white-space: nowrap; line-height: 1;
}
.btn svg { width: 17px; height: 17px; transition: transform .3s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary {
  background: linear-gradient(140deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(228,6,6,.30), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(228,6,6,.36), inset 0 1px 0 rgba(255,255,255,.14); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(26,26,26,.18); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-2px); }
.section--ink .btn--ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28); }
.section--ink .btn--ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; background: rgba(255,255,255,.06); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--sm { padding: 11px 20px; font-size: 14.5px; }
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease-out); }
.btn--primary:hover::after { transform: translateX(120%); }
.btn--primary > * { position: relative; z-index: 1; }

/* ---- Scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .09s; }
.reveal.d2 { transition-delay: .18s; }
.reveal.d3 { transition-delay: .27s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Placeholder media — designed slots for assets client will provide ---- */
.ph {
  position: relative;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(228,6,6,.06) 0%, transparent 60%),
    linear-gradient(165deg, var(--paper-tan) 0%, var(--paper-grey) 100%);
  display: grid; place-items: center; overflow: hidden;
  color: var(--grey-accent);
}
.ph::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(135deg, rgba(20,16,8,.04) 0 1px, transparent 1px 14px);
}
.ph--dark {
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(228,6,6,.20) 0%, transparent 60%),
    linear-gradient(165deg, #1A1A1A 0%, #0E0E0E 100%);
  color: rgba(255,255,255,.55);
}
.ph--dark::after {
  background-image: linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 14px);
}
.ph__tag {
  position: relative; z-index: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px; letter-spacing: .04em;
  border: 1px dashed currentColor; border-radius: 6px;
  padding: 8px 14px; max-width: 80%; text-align: center; line-height: 1.5;
  text-transform: uppercase;
}

/* ---- TODO flag chip (visible in design so nothing ships un-replaced) ---- */
.todo-chip {
  position: absolute; top: 10px; left: 10px; z-index: 5;
  font-family: ui-monospace, monospace; font-size: 10.5px; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
  background: #ffd23f; color: #4a3a00;
  padding: 4px 8px; border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  pointer-events: none;
}

/* ============================================================
   Mobile: form controls must be >=16px or iOS Safari zooms the
   viewport on focus. Applies site-wide (lead form, portal, gate).
   ============================================================ */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
}
