/* Shared structure for the three mockups. Each v*.css sets the tokens and its own layout. */
:root {
  --ink: #16171b; --paper: #fbfaf7; --orange: #EE4B2B; --amber: #FBAC3F; --night: #0a0e1a;
  --bg: var(--paper); --fg: var(--ink); --fg2: #555861; --line: #e4e1da; --surface: var(--sand);
  --accent: var(--orange); --flood: var(--sand);
  --hero-bg: var(--sand); --hero-fg: var(--fg); --hero-fg2: var(--fg2);
  --bar-bg: #fff; --bar-fg: var(--ink); --sand: #ebe6da;
  --go: linear-gradient(120deg, var(--orange), var(--amber));
  --btn-bg: var(--ink); --btn-fg: #fff;
  --field-bg: #fff; --field-line: #8a867c; --field-fg: var(--ink);
  --display: Archivo, "Helvetica Neue", Arial, sans-serif;
  --body: Archivo, "Helvetica Neue", Arial, sans-serif;
  --x: clamp(20px, 6vw, 112px); --y: clamp(60px, 8vw, 116px); --r: 20px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 18px; line-height: 1.55; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Header: clear over the 3D scene, then a solid white bar with The Mortgage Group logo */
.top { position: fixed; z-index: 20; inset: 0 0 auto 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 74px; padding: 12px var(--x); color: #fff; transition: background-color .35s ease, box-shadow .35s ease; }
.top__brand { display: flex; align-items: center; text-decoration: none; }
.top__logo { display: flex; flex: none; overflow: hidden; max-width: 0; opacity: 0; transition: max-width .5s ease, opacity .4s ease, margin .5s ease, padding .5s ease; }
.top__logo img { width: auto; height: 36px; max-width: none; }
.is-inside .top__logo { max-width: 250px; margin-right: 16px; padding-right: 16px; border-right: 1px solid #cfcabd; opacity: 1; }
.top__name { display: grid; gap: 1px; line-height: 1.25; white-space: nowrap; }
.top__name b { font-weight: 800; font-stretch: 112%; font-size: 1.02rem; }
.top__name span { font-size: .8rem; opacity: .8; }
.top__nav { display: flex; gap: clamp(14px, 1.7vw, 30px); font-size: .92rem; font-weight: 600; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s; }
.top__nav a { text-decoration: none; padding: 6px 0; }
.top__nav a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.top__end { display: flex; align-items: center; gap: 10px; }
.top__lang { min-width: 44px; height: 42px; border: 0; border-radius: 999px; background: none; font-weight: 700; font-size: .88rem; cursor: pointer; }
.top__lang:hover { text-decoration: underline; text-underline-offset: 5px; }
.top__book { padding: 11px 20px; border-radius: 999px; background: var(--go); color: var(--ink); font-weight: 750; font-size: .92rem; text-decoration: none; white-space: nowrap; transition: filter .2s ease; }
.top__book:hover { filter: brightness(1.08); }
.is-inside .top { color: var(--bar-fg); background: var(--bar-bg); box-shadow: 0 1px 0 rgba(22, 23, 27, .1), 0 16px 30px -26px rgba(10, 14, 26, .55); }
.is-inside .top__nav { opacity: 1; visibility: visible; }

/* Entrance: the stage stays put while the camera walks in */
.entry { position: relative; height: 420vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--night); }
.scene3d { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; }
.is-loaded .scene3d { opacity: 1; }
.nogl { display: none; }
.flood { position: absolute; inset: 0; background: var(--flood); opacity: 0; pointer-events: none; }
.cue { position: absolute; z-index: 3; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; color: #fff; font-size: .88rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .75), 0 0 18px rgba(0, 0, 0, .65); pointer-events: none; }
.cue i { display: block; width: 1.5px; height: 34px; background: linear-gradient(#fff, rgba(255, 255, 255, 0)); transform-origin: top; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.skip { --accent: #fff; position: absolute; z-index: 3; right: var(--x); bottom: 22px; padding: 9px 16px; border: 1.5px solid rgba(255, 255, 255, .65); border-radius: 999px; background: rgba(10, 14, 26, .5); color: #fff; font-size: .85rem; font-weight: 600; cursor: pointer; transition: opacity .3s ease, visibility .3s; }
.skip:hover { background: rgba(10, 14, 26, .8); }
.is-inside .skip { opacity: 0; visibility: hidden; }

/* Hero: the first screen inside the door */
.inside { position: absolute; z-index: 2; inset: 0; opacity: 0; visibility: hidden; background: var(--hero-bg); color: var(--hero-fg); }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: center; gap: clamp(24px, 5vw, 80px); padding: 96px var(--x) 40px; }
.hero__text p { margin: 22px 0 32px; max-width: 34em; color: var(--hero-fg2); font-size: clamp(1.02rem, 1.35vw, 1.25rem); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.hero__text .hero__with { margin: 30px 0 0; max-width: 46em; font-size: .88rem; }
.hero__portrait { position: relative; overflow: hidden; }
.hero__portrait img { position: absolute; left: 50%; bottom: 0; width: 108%; max-width: none; transform: translateX(-50%); }
.btn { display: inline-block; padding: 16px 26px; border: 0; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .2s ease, filter .2s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.12); }
.link { font-weight: 700; text-underline-offset: 5px; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }

/* Sections */
.sec { padding: var(--y) var(--x); }
.sec__head { max-width: 44rem; margin-bottom: clamp(32px, 5vw, 64px); }
.sec__head p, .contact__text > p { margin-top: 14px; color: var(--fg2); font-size: 1.1rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: block; font-family: var(--display); }
.steps h3, .card h3 { font-size: 1.28rem; line-height: 1.2; margin-bottom: 10px; }
.steps p, .card p { color: var(--fg2); font-size: 1rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }

.calc__body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: stretch; }
.calc__form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-content: center; }
label { display: grid; gap: 7px; font-size: .92rem; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--field-bg); color: var(--field-fg); font-size: 1.05rem; font-weight: 500; }
textarea { resize: vertical; }
.calc__label { font-size: .95rem; font-weight: 600; }
.calc__pay { font-family: var(--display); font-variant-numeric: tabular-nums; line-height: 1; margin: 8px 0 24px; }
.calc__out dl div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--out-line, var(--line)); font-size: .98rem; }
.calc__out dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.calc__note { margin-top: 14px; font-size: .9rem; opacity: .85; min-height: 2.8em; }

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.about__photo img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: var(--r); }
.about__text > p { margin: 18px 0 26px; color: var(--fg2); }
.promises li { padding: 14px 0; border-top: 1px solid var(--line); font-weight: 600; }
.promises li:last-child { border-bottom: 1px solid var(--line); }
.about__logos { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 30px; }
.logo { display: flex; align-items: center; height: 76px; padding: 0 18px; border-radius: 12px; background: #fff; border: 1px solid rgba(0, 0, 0, .08); }
.logo img { height: 50px; width: auto; }
.logo--tmg img { height: 24px; }

.faq__list { max-width: 52rem; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { position: relative; display: block; padding: 22px 48px 22px 0; font-family: var(--display); font-size: 1.15rem; font-weight: 700; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before, summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 16px; height: 2px; margin-top: -1px; background: currentColor; transition: transform .25s ease; }
summary::after { transform: rotate(90deg); }
details[open] summary::after { transform: rotate(0); }
details p { padding: 0 48px 24px 0; max-width: 42rem; color: var(--fg2); }

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
address { display: grid; gap: 6px; margin-top: 28px; font-style: normal; font-weight: 600; }
address a { width: fit-content; text-underline-offset: 4px; }
.contact__form { display: grid; gap: 18px; }
.contact__form .btn { justify-self: start; }
.contact__status { min-height: 1.5em; font-size: .95rem; font-weight: 600; }
.foot { padding: 28px var(--x) 96px; font-size: .85rem; color: var(--fg2); display: grid; gap: 4px; }

/* Preview control: lets the client flip between the three designs. Not part of the site. */
.switch { --accent: #fff; position: fixed; z-index: 30; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 14px; border-radius: 999px; background: rgba(16, 17, 21, .92); color: #fff; font: 600 .8rem/1 Archivo, Arial, sans-serif; box-shadow: 0 6px 24px rgba(0, 0, 0, .28); }
.switch span { margin-right: 6px; opacity: .8; }
.switch a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; text-decoration: none; }
.switch a:hover { background: rgba(255, 255, 255, .16); }
.switch a[aria-current] { background: #fff; color: #111; }

/* No WebGL: skip the walk and show the site */
.no-webgl .entry { height: auto; }
.no-webgl .stage { position: relative; height: auto; min-height: 100svh; }
.no-webgl .scene3d, .no-webgl .cue, .no-webgl .skip, .no-webgl .flood { display: none; }
.no-webgl .inside { position: relative; min-height: 100svh; opacity: 1; visibility: visible; }

@media (max-width: 900px) {
  .top__nav { display: none; }
  .steps { grid-template-columns: 1fr 1fr; }
  .cards, .calc__body, .about, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .top { padding: 12px var(--x); }
  .top__book { padding: 9px 14px; }
  .hero { grid-template-columns: 1fr; align-content: center; gap: 24px; padding-top: 84px; }
  .cue { bottom: 76px; }
  .skip { bottom: 16px; right: 14px; }
  .steps { grid-template-columns: 1fr; }
  .calc__form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .entry { height: 240vh; }
  .scene3d, .top, .btn, summary::after { transition: none; }
  .cue i { animation: none; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .hero__portrait { display: none; }
}
