/* FutureWave profit machine: homepage hero (live three.js adding machine) + the tape section.
   Namespaced mh- / mt- so nothing leaks into the rest of the site. */
:root {
  --mh-blue: #285CE8;
  --mh-blue-deep: #2254DB;
  --mh-cream: #F3EEE4;
  --mh-ink: #15171A;
  --mh-sans: 'Hanken Grotesk', system-ui, sans-serif;
  --mh-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
/* On the homepage the header joins the blue field. */
body:has(.mh-hero) .site-header { background: var(--mh-blue); border-bottom-color: rgba(243, 238, 228, 0.18); }
/* Blue-field logo: the usual logo's grey and light-blue parts disappear on blue (about 2:1). */
body:has(.mh-hero) .brand__logo { content: url('/assets/logo/logo-horizontal-onblue.svg'); }
body:has(.mh-hero) .site-header .btn--primary { background: var(--mh-cream); color: var(--mh-ink); box-shadow: none; }
body:has(.mh-hero) .site-header .btn--primary:hover { background: #fff; }
body:has(.mh-hero) .nav-toggle__summary { background: var(--mh-cream); color: var(--mh-ink); box-shadow: none; }
.mh-hero { color: var(--mh-cream); font-family: var(--mh-sans); }
.mh-hero.is-static { background-image: url('/assets/img/machine-poster.png'), radial-gradient(120% 90% at 60% 45%, #3367EE 0%, var(--mh-blue) 55%, var(--mh-blue-deep) 100%); background-repeat: no-repeat; background-size: cover; background-position: center; }
.mh-hero.is-static .mh-canvas { display: none; }
.mh-hero {
  position: relative; height: calc(100vh - 4.75rem); height: calc(100svh - 4.75rem); min-height: 620px; overflow: hidden;
  background: radial-gradient(120% 90% at 60% 45%, #3367EE 0%, var(--mh-blue) 55%, var(--mh-blue-deep) 100%);
}
.mh-word {
  position: absolute; left: 50%; top: 15%; transform: translateX(-50%);
  margin: 0; white-space: nowrap;
  font-weight: 800; letter-spacing: -0.02em; line-height: 0.8;
  font-size: clamp(7rem, 25vw, 30rem);
  color: transparent; -webkit-text-stroke: 4px rgba(243, 238, 228, 0.92);
  user-select: none;
}
.mh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mh-copy {
  position: absolute; left: clamp(20px, 4vw, 56px); bottom: clamp(28px, 7vh, 72px); z-index: 3;
  max-width: 60rem;
}
.mh-copy h1 {
  margin: 0; font-family: var(--mh-sans); color: var(--mh-cream); font-weight: 700; letter-spacing: -0.02em; line-height: 1.02;
  font-size: clamp(2.2rem, 4.4vw, 4.4rem);
}
@media (max-width: 760px) {
  .mh-word { top: 17%; -webkit-text-stroke-width: 2.5px; }
}

/* ---------- Hero form ---------- */
.mh-copy { max-width: min(62rem, calc(100vw - 40px)); }
.mh-form {
  display: grid; grid-template-columns: repeat(3, minmax(0, 11rem)) auto; gap: 12px 14px;
  align-items: end; margin-top: 28px;
}
.mh-field { display: grid; gap: 6px; }
.mh-field label { font-family: var(--mh-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.mh-field label span { opacity: 0.7; text-transform: none; letter-spacing: 0; }
.mh-field input {
  font: 500 1.15rem/1 var(--mh-mono); color: var(--mh-ink); background: var(--mh-cream);
  border: 2px solid transparent; border-radius: 10px; padding: 13px 14px; width: 100%;
}
.mh-field input::placeholder { color: #9A958A; }
.mh-field input:focus { outline: none; border-color: var(--mh-ink); box-shadow: 0 0 0 3px rgba(243, 238, 228, 0.5); }
.mh-field input[aria-invalid="true"] { border-color: #FFB4A2; }
.mh-print {
  font: 700 1rem/1 var(--mh-sans); color: var(--mh-cream); background: var(--mh-ink);
  border: 0; border-radius: 999px; padding: 16px 24px; cursor: pointer; white-space: nowrap;
}
.mh-print:hover { background: #000; }
.mh-print:focus-visible { outline: 3px solid var(--mh-cream); outline-offset: 3px; }
.mh-msg { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-size: 1rem; }
.mh-copy h1 { font-size: clamp(2.2rem, 3.8vw, 3.8rem); }

/* ---------- The tape section (concept C, on cream) ---------- */
.mt { background: var(--mh-cream); color: var(--mh-ink); padding: clamp(72px, 12vh, 140px) clamp(20px, 4vw, 56px) 72px; overflow: hidden; }
.mt__head { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.mt__head h2 { margin: 0; color: var(--mh-ink); font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 12ch; }
.mt__flag { margin: 0; font: 500 0.8rem/1.3 var(--mh-mono); text-transform: uppercase; letter-spacing: 0.06em; border: 1.5px solid var(--mh-ink); border-radius: 999px; padding: 8px 14px; }
.mt__flag.is-yours { background: var(--mh-ink); color: var(--mh-cream); }
.mt__body { position: relative; max-width: 1240px; margin: 56px auto 0; display: grid; justify-items: center; }
.mt__tape {
  list-style: none; margin: 0; padding: 40px 36px 28px; width: min(100%, 30rem);
  background: #FBFAF6; box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 30px 60px -30px rgba(40, 30, 10, 0.35);
  font-family: var(--mh-mono); position: relative;
}
.mt__line {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 16px;
  padding: 18px 0; border-bottom: 1px dashed #CFC8B8; position: relative;
  font-size: clamp(1.35rem, 2.6vw, 2rem); font-weight: 500;
}
.mt__line b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mt__line--total { border-bottom: 2px solid var(--mh-ink); }
.mt__line--total b { color: var(--mh-blue-deep); }
.mt__line.is-neg b { color: #C2381F; }
.mt__note {
  grid-column: 1 / -1; margin: 6px 0 0; font: 400 0.95rem/1.45 var(--mh-sans); color: #4A4740; max-width: 34ch;
}
/* Wide screens: notes leave the paper and sit to the right with a leader line, like the concept. */
@media (min-width: 1100px) {
  .mt__note {
    position: absolute; left: calc(100% + 36px + 64px); top: 50%; transform: translateY(-50%);
    width: 19rem; margin: 0; font-size: 1rem;
  }
  .mt__note::before {
    content: ''; position: absolute; right: calc(100% + 12px); top: 0.7em; width: 72px; border-top: 1.5px solid var(--mh-ink);
  }
}
.mt__tear {
  display: block; width: min(100%, 30rem); background: #FBFAF6; color: var(--mh-ink); text-align: center;
  padding: 26px 20px 44px; font: 500 1rem/1.3 var(--mh-mono); position: relative; transition: transform 0.6s cubic-bezier(.3,.7,.2,1), opacity 0.6s;
  box-shadow: 0 30px 60px -30px rgba(40, 30, 10, 0.35);
}
.mt__perf {
  position: absolute; left: 0; right: 0; top: -6px; height: 12px;
  background: radial-gradient(circle at 6px 6px, var(--mh-cream) 4.5px, transparent 5px) repeat-x;
  background-size: 16px 12px;
}
.mt__tear:hover .mt__tear-label, .mt__tear:focus-visible .mt__tear-label { text-decoration: underline; text-underline-offset: 4px; }
.mt__tear:focus-visible { outline: 3px solid var(--mh-blue); outline-offset: 4px; }
.mt__tear.is-torn { transform: translateY(40px) rotate(-4deg); opacity: 0; }
.mt__fine { margin: 18px 0 0; font: 400 0.85rem/1.4 var(--mh-sans); color: #6A665C; text-align: center; }
/* Lines print in as the section arrives. */
.js .mt__line { opacity: 0; transform: translateY(-14px); transition: opacity 0.5s, transform 0.5s cubic-bezier(.2,.7,.2,1); }
.js .mt__line.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .mt__line { opacity: 1; transform: none; transition: none; } }

@media (max-width: 760px) {
  .mh-copy { bottom: 22px; }
  .mh-copy h1 { font-size: 1.9rem; }
  .mh-form { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  .mh-field:nth-child(3) { grid-column: 1 / -1; }
  .mh-print { grid-column: 1 / -1; }
  .mh-field input { padding: 11px 12px; font-size: 1rem; }
}
.mt__line[hidden] { display: none; }
