:root {
  --bg: #050510;
  --ink: #f7f8ff;
  --muted: #b4bdd4;
  --line: rgba(247, 248, 255, 0.14);
  --blue: #5b7cff;
  --pad: 16px;
  --nav: 52px;
  --font: "Space Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (hover: none), (pointer: coarse) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

#heroCanvas {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none; display: block;
}
html[data-webgl="off"] #heroCanvas { display: none; }
html[data-webgl="off"] body {
  background:
    radial-gradient(65% 50% at 56% 48%, #1a1548 0%, transparent 55%),
    var(--bg);
}

.top, .hero, .close, .foot, .side-nav { position: relative; z-index: 5; }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 12;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--nav);
  padding: 10px var(--pad);
  padding-top: max(10px, env(safe-area-inset-top));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
.top-cta { margin-left: auto; min-height: 40px; }
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 12px; border-radius: 6px; border: 0;
  background: #fff; color: #0b0d18;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cta.solid {
  min-height: 46px; padding: 0 16px;
  font-size: 14px; font-weight: 600;
}
.menu-btn {
  width: 44px; height: 44px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(8, 10, 24, 0.45);
  color: var(--ink); display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; cursor: pointer;
  flex-shrink: 0;
}
.menu-btn span { width: 14px; height: 1.5px; background: currentColor; display: block; }

.side-nav {
  display: none;
  position: fixed; z-index: 11;
  right: 4.5vw; top: 18vh;
  flex-direction: column; gap: 10px;
  pointer-events: none;
}
.side-nav a {
  pointer-events: auto;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(220, 226, 242, 0.72);
}
.side-nav a:hover, .side-nav a:focus-visible { color: #fff; }

body.nav-open .side-nav {
  display: flex;
  left: var(--pad); right: var(--pad); top: calc(var(--nav) + 8px);
  padding: 10px 14px; border-radius: 12px;
  background: rgba(8, 10, 24, 0.94); border: 1px solid var(--line);
  pointer-events: auto;
}
body.nav-open .side-nav a { min-height: 44px; display: flex; align-items: center; }

.hero {
  min-height: 100svh;
  min-height: 100dvh;
  position: relative;
  padding: calc(var(--nav) + 16px) var(--pad) max(28px, env(safe-area-inset-bottom));
  overflow: clip;
  display: flex;
  flex-direction: column;
}
.hero-left {
  position: relative; z-index: 3;
  width: min(340px, 100%);
  --in: 1;
  flex-shrink: 0;
}
.hero-stage {
  flex: 1 1 auto;
  min-height: clamp(220px, 38vh, 360px);
  width: 100%;
  pointer-events: none;
}
.display {
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.375rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 24px rgba(5, 5, 16, 0.55);
  text-wrap: balance;
}
.display .line { display: block; white-space: nowrap; overflow: hidden; }
.display .line > span {
  display: inline-block;
  transform: translate3d(0, calc((1 - var(--in)) * 105%), 0);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.lede {
  margin: 14px 0 0;
  max-width: 34ch;
  color: #d5dbeb;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  text-shadow: 0 1px 12px rgba(5, 5, 16, 0.7);
}
.hero-actions {
  position: relative; z-index: 3;
  margin-top: 20px;
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center;
  flex-shrink: 0;
}
.ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  font-size: 14px; font-weight: 500; color: #eef1fb;
  white-space: nowrap;
}
.portrait {
  position: relative; z-index: 3;
  width: min(140px, 38vw);
  margin: 22px 0 0 auto;
  flex-shrink: 0;
}
.portrait-media {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.portrait-cap {
  margin: 8px 0 0;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.hero-aside {
  display: none;
  margin: 0;
  max-width: 22ch;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(210, 216, 234, 0.78);
}
.hero-meta {
  position: relative;
  z-index: 3;
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.hero-meta i {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, #7aa0ff, transparent);
}

.close {
  min-height: 36svh;
  display: grid; place-content: center; justify-items: start;
  gap: 14px; padding: 36px var(--pad);
  border-top: 1px solid var(--line);
  background: rgba(5, 5, 16, 0.86);
}
.close h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3.6vw, 1.85rem);
  font-weight: 600; letter-spacing: -0.02em;
}
.foot {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  align-items: center; justify-content: space-between;
  padding: 16px var(--pad) max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #050510;
}
.foot p { margin: 0; color: var(--muted); font-size: 12px; }

.panel[hidden] { display: none; }
.panel {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(3, 4, 12, 0.72);
  display: grid; place-items: end center; padding: 16px;
}
.panel form {
  width: min(400px, 100%);
  background: #0b0e1c; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; display: grid; gap: 12px;
}
.panel h2 { margin: 0; font-size: 22px; font-weight: 600; }
.panel p { margin: 0; color: var(--muted); font-size: 14px; }
.panel label {
  display: grid; gap: 6px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.panel input {
  min-height: 48px; border-radius: 10px; border: 1px solid var(--line);
  background: #080b18; color: var(--ink); padding: 0 14px; font-size: 16px;
}
.form-row { display: flex; gap: 12px; align-items: center; }
.form-error { color: #ffb4a8; }
.form-ok { color: #b7e3c4; }
.text-btn {
  background: none; border: 0; color: var(--muted);
  min-height: 44px; cursor: pointer; font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .display .line > span { transform: none; transition: none; }
}

/* —— Mobile intentional stack —— */
@media (max-width: 767px) {
  .side-nav { display: none; }
  body.nav-open .side-nav { display: flex; }

  .hero-left { display: contents; }
  .display { order: 1; }
  .hero-stage {
    order: 2;
    min-height: clamp(260px, 46vh, 400px);
  }
  .lede {
    order: 3;
    display: block;
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    max-width: 36ch;
    position: relative;
    z-index: 4;
    padding: 10px 0;
    background: linear-gradient(180deg, transparent, rgba(5, 5, 16, 0.55) 30%, rgba(5, 5, 16, 0.55) 70%, transparent);
  }
  .portrait {
    order: 4;
    margin: 22px 0 0 auto;
    width: min(136px, 36vw);
  }
  .hero-actions { order: 5; margin-top: 20px; }
  .hero-meta { order: 6; margin-top: 14px; }
}

@media (max-width: 359px) {
  :root { --pad: 14px; }
  .display {
    font-size: 2rem; /* 32px */
    letter-spacing: -0.025em;
    line-height: 1.02;
  }
  .lede { font-size: 15px; }
  .top-cta { font-size: 11px; padding: 0 10px; min-height: 40px; }
  .portrait { width: min(120px, 38vw); }
  .cta.solid, .ghost { min-height: 44px; font-size: 14px; }
}

@media (min-width: 360px) and (max-width: 374px) {
  .display { font-size: 2.125rem; line-height: 1; } /* 34px */
}

@media (min-width: 375px) and (max-width: 429px) {
  :root { --pad: 18px; }
  .display {
    font-size: clamp(2.25rem, 9.2vw, 2.5rem); /* 36–40px */
    line-height: 0.98;
  }
  .lede { font-size: 15px; }
  .portrait { width: min(140px, 37vw); }
}

@media (min-width: 390px) { :root { --pad: 18px; } }
@media (min-width: 414px) { :root { --pad: 20px; } }

@media (min-width: 430px) and (max-width: 767px) {
  :root { --pad: 20px; }
  .display {
    font-size: clamp(2.375rem, 8.5vw, 2.625rem); /* ~38–42px */
    line-height: 0.98;
  }
  .lede { font-size: 16px; }
  .portrait { width: 148px; }
  .hero-stage { min-height: clamp(260px, 40vh, 400px); }
}

/* —— Tablet intermediate —— */
@media (min-width: 768px) and (max-width: 980px) {
  :root { --pad: 28px; --nav: 56px; }
  .hero {
    display: block;
    padding: calc(var(--nav) + 20px) var(--pad) 48px;
    min-height: 100svh;
  }
  .hero-stage {
    display: none;
  }
  .hero-left {
    display: block;
    width: min(380px, 48%);
  }
  .display {
    font-size: clamp(2.625rem, 5.4vw, 3.125rem); /* 42–50 */
    line-height: 0.96;
    letter-spacing: -0.03em;
  }
  .lede {
    display: block;
    font-size: 15px;
    margin-top: 14px;
    max-width: 34ch;
  }
  .portrait {
    position: absolute;
    right: var(--pad);
    top: 42vh;
    width: 148px;
    margin: 0;
  }
  .hero-actions {
    margin-top: 28px;
  }
  .hero-meta {
    position: absolute;
    left: var(--pad);
    bottom: 24px;
    margin: 0;
  }
  .menu-btn { display: inline-flex; }
  .side-nav { display: none; }
  body.nav-open .side-nav { display: flex; }
}

@media (min-width: 820px) and (max-width: 980px) {
  :root { --pad: 32px; }
  .display {
    font-size: clamp(2.75rem, 5vw, 3.25rem); /* 44–52 */
  }
  .portrait { width: 154px; top: 40vh; }
}

/* —— Desktop approved (preserve) —— */
@media (min-width: 981px) {
  :root { --pad: 3.8vw; --nav: 56px; }
  .menu-btn { display: none; }
  .side-nav { display: flex; }
  .hero {
    display: block;
    padding: 0;
    min-height: 100svh;
  }
  .hero-stage { display: none; }
  .hero-left {
    display: block;
    position: absolute;
    left: 4.8vw;
    top: 24vh;
    width: min(380px, 28vw);
  }
  .display {
    font-size: clamp(54px, 4.35vw, 68px);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 0.93;
  }
  .lede {
    display: block;
    margin-top: 15px;
    font-size: 13px;
    max-width: 34ch;
  }
  .cta.solid { min-height: 40px; font-size: 13px; }
  .ghost { min-height: 40px; font-size: 13px; }
  .top .cta { min-height: 32px; font-size: 11px; }

  .hero-actions {
    position: absolute;
    left: 4.8vw;
    bottom: 7.5vh;
    margin: 0;
  }
  .portrait {
    position: absolute;
    right: 6.5vw;
    top: 48vh;
    width: 158px;
    margin: 0;
  }
  .hero-aside {
    display: block;
    position: absolute;
    right: 6.5vw;
    bottom: 9vh;
    width: 158px;
  }
  .hero-meta {
    position: absolute;
    left: 4.8vw;
    bottom: 3.6vh;
    margin: 0;
  }
  .side-nav {
    right: 5.5vw;
    top: 16vh;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .display { font-size: clamp(48px, 4.4vw, 58px); }
}

@media (min-width: 1280px) {
  .hero-left { width: min(400px, 30vw); left: 5vw; top: 23vh; }
  .display { font-size: clamp(56px, 4.2vw, 70px); }
  .portrait { width: 168px; right: 7vw; top: 46vh; }
  .hero-aside { right: 7vw; width: 168px; }
  .hero-actions { left: 5vw; }
}

@media (min-width: 1440px) {
  .hero-left { top: 24vh; left: 5vw; width: 400px; }
  .portrait { top: 45vh; width: 170px; }
}

@media (max-width: 980px) and (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: auto;
    padding-bottom: 32px;
  }
  .hero-stage { min-height: 160px; flex: 0 0 160px; }
  .portrait { width: 110px; }
  .display { font-size: clamp(1.75rem, 6vh, 2.25rem); }
}
