/* MTD Labs preview v2. Dark storefront over a living gold code-rain backdrop.
   One deliberate look (brand black), so a single dark palette is set on :root. */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root {
  color-scheme: dark;
  --bg: #0B0B0B;
  --veil: rgba(11, 11, 11, 0.86);
  --surface: #141413;
  --surface-2: rgba(20, 20, 19, 0.9);
  --raised: #1B1B1A;
  --line: #262624;
  --line-2: #34342F;
  --ink: #F4F1E9;
  --ink-2: #C9C4B8;
  --ink-3: #A8A397;
  --ash: #7D776A;
  --ember: #C8603F;
  --gold: #D4AF37;
  --gold-hi: #F2DC8C;
  --gold-deep: #9C7C1E;
  --gold-edge: rgba(212, 175, 55, 0.42);
  --gold-wash: rgba(212, 175, 55, 0.08);
  --on-gold: #0B0B0B;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.6; margin: 0; isolation: isolate; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--on-gold); }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.04; font-weight: 700; }
h3 { font-size: 21px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-2); }
.fine { font-size: 13px; color: var(--ink-3); }
.gold { color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
section { padding-block: 112px; position: relative; }
.check { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--gold); }

/* Backdrop rain: one viewport layer that sits behind every section */
#page-rain { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: -1; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(11, 11, 11, 0.7) 100%); }

/* Buttons */
.btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: var(--font-body); transition: transform .25s var(--ease), border-color .2s ease, color .2s ease; will-change: transform; }
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-gold { background: linear-gradient(180deg, #E3C352, #D4AF37 55%, #C09B2A); color: var(--on-gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-gold::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 250, 225, 0.7) 50%, transparent 70%); transform: translateX(-130%); transition: transform .8s var(--ease); }
.btn-gold:hover::after, .btn-gold.shine::after { transform: translateX(130%); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: rgba(11, 11, 11, 0.55); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.link-gold { color: var(--gold); font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); padding-bottom: 2px; }
.link-gold:hover { background-size: 100% 1px; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; border-bottom: 1px solid transparent; transition: background-color .35s ease, border-color .35s ease; }
.site-header.scrolled { background: var(--veil); backdrop-filter: blur(14px); border-color: #1E1E1C; }
.nav { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; margin-right: auto; }
.brand span { font-family: var(--font-display); font-size: 9px; font-weight: 600; letter-spacing: 0.5em; padding-left: 0.5em; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 26px; font-size: 15px; font-weight: 500; }
.nav-links a { position: relative; text-decoration: none; color: var(--ink-2); padding: 10px 0; white-space: nowrap; transition: color .2s ease; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav-links a:hover, .nav-links a.on, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.on::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-cta .signin { text-decoration: none; color: var(--ink-2); font-size: 15px; padding: 12px 10px; }
.nav-cta .signin:hover { color: var(--gold); }
.nav-cta .btn { min-height: 44px; font-size: 15px; padding: 0 20px; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--gold-deep), var(--gold) 60%, var(--gold-hi)); }
@media (max-width: 760px) {
  .nav-links { order: 3; width: 100%; gap: 0 20px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav-cta .signin { display: none; }
}

/* Scroll reveal. Content stays faintly visible before it animates in. */
.js .rv { opacity: .14; transform: perspective(1400px) translate3d(0, 56px, -110px) rotateX(11deg); transform-origin: 50% 100%; transition: opacity 1s var(--ease), transform 1.3s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .rv.in { opacity: 1; transform: none; }
.js .rv-x { opacity: .14; transform: perspective(1400px) translate3d(-50px, 0, -80px) rotateY(9deg); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .rv-x.in { opacity: 1; transform: none; }

/* Cursor spotlight: soft fill plus a gold rim that follows the pointer */
.spot { position: relative; isolation: isolate; }
.spot::before, .spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.spot::before { z-index: -1; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 175, 55, 0.13), transparent 62%); }
.spot::after { padding: 1px; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 220, 140, 0.95), transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.spot:hover::before, .spot:hover::after { opacity: 1; }

/* Rotating gold ring for the featured things */
.halo { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1.5px; background: conic-gradient(from var(--ang), transparent 0 55%, rgba(212, 175, 55, 0.2) 65%, var(--gold) 78%, var(--gold-hi) 82%, transparent 92%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spin 7s linear infinite; }
@keyframes spin { to { --ang: 360deg; } }

/* Hand-drawn gold underline */
.scribble { position: absolute; left: -2%; right: -2%; bottom: -0.16em; width: 104%; height: 0.32em; overflow: visible; pointer-events: none; }
.scribble path { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: draw 1.2s var(--ease) forwards; animation-delay: var(--d, 1.4s); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Footer */
.site-footer { position: relative; border-top: 1px solid #1E1E1C; padding-block: 0 40px; background: linear-gradient(180deg, rgba(11, 11, 11, 0.6), var(--bg) 40%); overflow: hidden; }
.outro { padding-block: 40px 64px; text-align: center; }
#logo3d { display: block; width: 100%; height: clamp(200px, 30vw, 380px); margin-bottom: 8px; }
.outro p { font-family: var(--font-display); font-weight: 800; font-size: clamp(46px, 11vw, 168px); line-height: .95; letter-spacing: -0.045em; color: transparent; -webkit-text-stroke: 1px rgba(212, 175, 55, 0.5); background: linear-gradient(var(--gold), var(--gold)) 0 0 / var(--fill, 0%) 100% no-repeat; -webkit-background-clip: text; background-clip: text; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px 56px; padding-top: 48px; border-top: 1px solid #1E1E1C; }
.foot h3 { font-family: var(--font-body); font-size: 16px; letter-spacing: 0; margin-bottom: 10px; }
.foot a { display: block; color: var(--ink-2); text-decoration: none; padding: 5px 0; transition: color .2s ease, transform .3s var(--ease); }
.foot a:hover { color: var(--gold); transform: translateX(4px); }
.legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid #1E1E1C; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-3); }
.motion-btn { white-space: nowrap; font: 12px var(--font-mono); letter-spacing: 0.04em; color: var(--ink-3); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 14px; min-height: 36px; cursor: pointer; }
.motion-btn:hover { color: var(--ink); border-color: var(--gold); }
@media (max-width: 760px) { .foot { grid-template-columns: minmax(0, 1fr); } }

/* Echo launcher and preview panel */
.echo-btn { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 25; display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; background: #111110; border: 1px solid rgba(212, 175, 55, 0.6); color: var(--ink); font: inherit; cursor: pointer; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); transition: transform .3s var(--ease); }
.echo-btn:hover { transform: translateY(-3px); }
.echo-btn::before { content: ""; position: absolute; left: 4px; top: 4px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--gold); animation: ping 2.8s var(--ease) infinite; pointer-events: none; }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.echo-btn img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg); object-fit: cover; }
.echo-btn span { display: grid; text-align: left; line-height: 1.2; }
.echo-btn small { font-size: 12px; color: var(--ink-3); }
.echo-tease { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 25; max-width: 250px; padding: 12px 38px 12px 16px; border-radius: 16px 16px 4px 16px; background: #171715; border: 1px solid var(--gold-edge); font-size: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); animation: pop .5s var(--ease) both; }
.echo-tease button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink-3); font-size: 18px; cursor: pointer; border-radius: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.echo-panel { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 26; width: min(420px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column; border-radius: 26px; background: #0E0E0D; border: 1px solid var(--gold-edge); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); overflow: hidden; transform-origin: 100% 100%; animation: panelIn .45s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
.echo-top { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #151513, #0E0E0D); }
.echo-top img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--gold); }
.echo-top .x { margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 20px; cursor: pointer; }
.echo-body { padding: 22px 18px; overflow-y: auto; display: grid; gap: 14px; }
.echo-hi { text-align: center; color: var(--ink-2); }
.starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.starters button { text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; min-height: 64px; transition: border-color .2s ease, transform .25s var(--ease); }
.starters button b { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.starters button:hover { border-color: var(--gold-edge); transform: translateY(-2px); }
.echo-q { justify-self: end; max-width: 86%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: #2A2414; border: 1px solid var(--gold-edge); font-size: 14px; animation: pop .35s var(--ease) both; }
.echo-reply { padding: 14px 16px; border-radius: 18px; background: #1A1A19; border: 1px solid #2A2A28; font-size: 15px; animation: pop .35s var(--ease) both; }
.echo-reply strong { color: var(--gold); }
.dots { display: inline-flex; gap: 5px; padding: 14px 16px; border-radius: 18px; background: #1A1A19; border: 1px solid #2A2A28; justify-self: start; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: bob 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-5px); opacity: 1; } }
.echo-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.echo-actions span { padding: 9px 14px; border-radius: 999px; border: 1px solid #33332F; font-size: 14px; }
.echo-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* Page intro: the storefront assembles itself on load */
.intro .site-header { animation: dropIn .9s var(--ease) both; }
@keyframes dropIn { from { transform: translateY(-110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.92) rotateX(8deg); } to { opacity: 1; transform: none; } }

.motion-off *, .motion-off *::before, .motion-off *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv, .js .rv-x { opacity: 1; transform: none; }
  .scribble path { stroke-dashoffset: 0; }
}

/* Cinematic intro curtain */
@property --iris { syntax: "<length>"; inherits: false; initial-value: 0px; }
.cine-on body { overflow: hidden; }
.cine { position: fixed; inset: 0; z-index: 100; background: #0B0B0B; --iris: 0px; -webkit-mask: radial-gradient(circle at 50% 46%, transparent var(--iris), #000 calc(var(--iris) + 2px)); mask: radial-gradient(circle at 50% 46%, transparent var(--iris), #000 calc(var(--iris) + 2px)); }
.cine canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cine.open { animation: iris 1s cubic-bezier(.7, 0, .84, 0) forwards; }
@keyframes iris { to { --iris: 150vmax; } }
.cine-line { position: absolute; left: 0; right: 0; bottom: calc(14vh + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 4px; text-align: center; padding-inline: 20px; font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3.2vw, 40px); letter-spacing: -0.02em; color: var(--ink); pointer-events: none; }
.cine-line span { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.cine-line span:first-child { color: var(--gold); }
.cine-line.show span { opacity: 1; transform: none; }
.cine-line.show span:last-child { transition-delay: .15s; }
.cine-skip { position: absolute; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(11, 11, 11, 0.6); color: var(--ink-2); font: 13px var(--font-mono); letter-spacing: 0.06em; cursor: pointer; }
.cine-skip:hover { color: var(--ink); border-color: var(--gold); }

/* Live quote and referral forms, styled for the new design. Field names and ids match forms.mjs and referral.mjs. */
.form input:not([type="radio"]):not([type="checkbox"]), .form select, .form textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid #33332F; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; transition: border-color .25s ease; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--gold-edge); }
.form .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form .field label { font-size: 14px; font-weight: 600; color: #D9D4C8; }
.field-bottom { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.contact-choices { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.callback-fields { display: grid; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(11, 11, 11, 0.5); }
.form-note { font-size: 13px; color: var(--ink-3); }
.form-note a, .sms-consent a, .form-feedback a { color: var(--gold); }
.sms-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); font-weight: 400; line-height: 1.5; }
.sms-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); flex-shrink: 0; }
.form-options { border: 1px solid var(--line); border-radius: 16px; background: rgba(11, 11, 11, 0.4); }
.form-options summary { cursor: pointer; list-style: none; padding: 14px 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.form-options summary::-webkit-details-marker { display: none; }
.form-options summary small { font-weight: 500; color: var(--ink-3); margin-right: auto; }
.form-options summary::after { content: "+"; color: var(--gold); font-size: 22px; line-height: 1; }
.form-options[open] summary::after { content: "\2212"; }
.optional-fields { display: grid; gap: 14px; padding: 0 16px 16px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-feedback { padding: 12px 14px; border-radius: 12px; font-size: 15px; border: 1px solid var(--line-2); color: var(--ink-2); }
.form-feedback[data-state="success"] { border-color: var(--gold-edge); background: var(--gold-wash); color: var(--gold-hi); }
.form-feedback[data-state="error"] { border-color: rgba(200, 96, 63, 0.6); background: rgba(200, 96, 63, 0.08); color: #F0B9A6; }
.form-submit[disabled], .ref-form [type="submit"][disabled] { opacity: .6; cursor: not-allowed; }
@media (max-width: 520px) { .form .form-row { grid-template-columns: minmax(0, 1fr); } }

/* Referral signup inside the referral card */
.ref-card { align-items: flex-start; }
.ref-copy { flex: 1 1 460px; min-width: 0; }
.ref-join { flex: 1 1 380px; min-width: 0; display: grid; gap: 16px; justify-items: start; }
.ref-join summary { list-style: none; }
.ref-join summary::-webkit-details-marker { display: none; }
.ref-join[open] summary { display: none; }
.ref-form, .referral-result { width: 100%; display: grid; gap: 14px; padding: 22px; border-radius: 20px; background: rgba(11, 11, 11, 0.6); border: 1px solid var(--line); }
.referral-result h3 { font-size: 22px; }

/* Footer links */
.legal a { color: var(--ink-3); text-decoration: none; }
.legal a:hover { color: var(--gold); }

/* Skip link for keyboard users */
.skip { position: absolute; left: -10000px; top: 0; z-index: 60; padding: 10px 16px; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-weight: 700; text-decoration: none; }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 12px); }
