:root {
  --ink: #070809;
  --paper: #f4f2ec;
  --pulse: #ff7a00;
  --font-display: "Oswald", Impact, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--paper);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page-404 {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
}

/* ── Hero ── */
.hero {
  position: relative;
  flex: 1;
  min-height: calc(100dvh - 3.5rem);
  display: grid;
  place-items: center;
  padding:
    calc(0.5rem + var(--safe-top))
    calc(0.625rem + var(--safe-right))
    calc(0.35rem + var(--safe-bottom))
    calc(0.625rem + var(--safe-left));
}

.hero__stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--ink);
  pointer-events: none;
}

.hero__stage--static {
  background-image: url("assets/hero/poster-sm.jpg?v=13");
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center top;
  filter: saturate(1.1) contrast(1.05);
  transform: translateZ(0);
  z-index: 1;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(7, 8, 9, 0.02) 0%, rgba(7, 8, 9, 0.06) 35%, rgba(7, 8, 9, 0.55) 100%);
  pointer-events: none;
}

.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* ── Center card ── */
.hero__content {
  position: relative;
  z-index: 10;
  width: min(calc(100vw - 1rem - var(--safe-left) - var(--safe-right)), 680px);
  margin-inline: auto;
  padding: clamp(1rem, 3.5vw, 1.75rem) clamp(1rem, 3vw, 1.4rem) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  background: linear-gradient(180deg, rgba(7, 8, 9, 0.62), rgba(7, 8, 9, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: clamp(1rem, 3vw, 1.25rem);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero__content {
    background: rgba(7, 8, 9, 0.9);
  }
}

.hero__tag {
  margin: 0;
  font-size: clamp(0.6rem, 2.8vw, 0.72rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.hero__code {
  margin: 0.4rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 14vw, 6rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.hero__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__lede {
  margin: 0 auto 1.25rem;
  max-width: 38ch;
  font-size: clamp(0.85rem, 3.2vw, 1.02rem);
  line-height: 1.5;
  color: rgba(244, 242, 236, 0.82);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-size: clamp(0.85rem, 3vw, 0.9rem);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--pulse);
  color: #111;
  border: 1px solid var(--pulse);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--paper);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: #ff9224;
  }

  .btn--ghost:hover {
    border-color: rgba(255, 255, 255, 0.4);
  }
}

.hero__pulse-line {
  width: min(180px, 45vw);
  height: 3px;
  margin: 1.1rem auto 0;
  background: linear-gradient(90deg, transparent, var(--pulse), transparent);
  border-radius: 2px;
  animation: pulse-line 2.4s ease-in-out infinite;
}

@keyframes pulse-line {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleX(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.foot {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  padding:
    0.35rem
    calc(1rem + var(--safe-right))
    calc(1rem + var(--safe-bottom))
    calc(1rem + var(--safe-left));
  text-align: center;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.45);
}

.foot .byline {
  margin: 0.35rem 0 0;
  opacity: 0.38;
}

.foot .byline a {
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }

  .hero__stage--static,
  .hero__stage {
    background-image: url("assets/hero/poster-sm.jpg?v=13");
    background-size: contain;
    background-position: center top;
  }

  .hero__pulse-line {
    animation: none;
  }
}

/* phone compact 320–480 */
@media (max-width: 480px) {
  .hero {
    place-items: end center;
    align-content: end;
    min-height: calc(100dvh - 3rem);
    padding-bottom: calc(0.25rem + var(--safe-bottom));
  }

  .hero__content {
    width: 100%;
    max-width: none;
    margin-bottom: 0.25rem;
    padding-bottom: calc(1.25rem + var(--safe-bottom));
  }

  .hero__tag {
    letter-spacing: 0.16em;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* phone portrait — logo visible, card at bottom */
@media (max-width: 767px) and (orientation: portrait) {
  .hero {
    place-items: end center;
  }

  .hero__video,
  .hero__stage--static {
    object-fit: contain;
    object-position: center top;
    background-size: contain;
    background-position: center top;
  }

  .hero__content {
    margin-top: auto;
  }
}

/* phone landscape */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    place-items: center;
    min-height: 100dvh;
  }

  .hero__content {
    max-width: min(520px, 88vw);
    padding: 0.85rem 1rem 1rem;
  }

  .hero__code {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero__lede {
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
  }

  .hero__pulse-line {
    display: none;
  }
}

/* tablet portrait */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .hero__content {
    max-width: 620px;
  }

  .hero__stage--static {
    background-image: url("assets/hero/poster.jpg?v=13");
  }
}

/* tablet landscape */
@media (min-width: 768px) and (max-width: 1100px) and (orientation: landscape) {
  .hero__content {
    max-width: 560px;
    padding: 1rem 1.25rem 1.25rem;
  }

  .hero__code {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }
}

@media (min-width: 1024px) {
  .hero__stage--static {
    background-image: url("assets/hero/poster.jpg?v=13");
  }

  .hero__content {
    margin-top: clamp(0.5rem, 3vh, 2rem);
  }
}

@media (min-width: 1600px) {
  .hero__content {
    max-width: 720px;
  }
}
