:root {
  --bg: #050505;
  --text: #ede8de;
  --text-soft: #b4aea3;
  --line: #26231f;
  --placeholder-bg: #0b0b0b;
  --hero-title-size: clamp(1.6rem, 5.6vw, 4.9rem);
  --hero-subtitle-size: clamp(1.15rem, 4.2vw, 3.65rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.splash {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  opacity: 0;
  animation: page-fade-in 3200ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.frame {
  width: min(100%, 68rem);
  min-height: min(92svh, 58rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.consent-banner {
  position: fixed;
  left: 50%;
  bottom: clamp(0.85rem, 2.2vw, 1.35rem);
  transform: translateX(-50%);
  width: min(calc(100% - 1.25rem), 44rem);
  border: 1px solid #2b2824;
  background: rgba(8, 8, 8, 0.94);
  backdrop-filter: blur(8px);
  padding: clamp(0.8rem, 2vw, 1rem);
  z-index: 1000;
  display: grid;
  gap: 0.72rem;
}

.consent-banner.is-hidden {
  display: none;
}

.consent-banner__text {
  margin: 0;
  color: #d4cec2;
  font-size: clamp(0.78rem, 1.7vw, 0.9rem);
  line-height: 1.35;
}

.consent-banner__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.consent-btn {
  border: 1px solid #3b3731;
  background: #12110f;
  color: #ece7dc;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.consent-btn--primary {
  background: #e9e2d5;
  color: #0d0c0a;
  border-color: #e9e2d5;
}

.consent-btn:hover {
  filter: brightness(1.05);
}

.subtitle,
.footer-signature {
  margin: 0;
}

.hero {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: clamp(1rem, 2.8vw, 1.8rem);
}

.portrait-wrap {
  margin: 0;
  width: min(88vw, 31rem);
  position: relative;
  overflow: hidden;
  filter: contrast(1.03) saturate(0.9);
}

.portrait-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.34;
  background:
    radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 0) 48%,
      rgba(0, 0, 0, 0.24) 76%,
      rgba(0, 0, 0, 0.5) 100%
    ),
    linear-gradient(
      to right,
      rgba(255, 45, 45, 0.04),
      rgba(35, 240, 98, 0.03) 48%,
      rgba(70, 130, 255, 0.04)
    );
  mix-blend-mode: multiply;
  animation: portrait-crt-flicker 230ms steps(1, end) infinite;
}

.portrait-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.16;
  background:
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(210, 228, 255, 0.12) 46%,
      rgba(210, 228, 255, 0.22) 50%,
      rgba(210, 228, 255, 0.1) 54%,
      transparent 100%
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(6, 11, 18, 0.42) 0 1px,
      rgba(226, 239, 255, 0.03) 1px 2px,
      rgba(5, 8, 14, 0.35) 2px 3px
    );
  background-size: 100% 46%, 100% 100%;
  background-repeat: no-repeat, repeat;
  mix-blend-mode: multiply;
  animation: portrait-crt-scan 9s steps(1, end) infinite;
}

.portrait-image,
.portrait-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
}

.portrait-image {
  display: block;
  object-fit: cover;
  object-position: center top;
}

.portrait-image--base {
  position: relative;
  z-index: 1;
  animation: portrait-base-jitter 9s steps(1, end) infinite, portrait-crt-breathe 5.2s steps(1, end) infinite;
}

.portrait-image--glitch {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  animation: portrait-glitch-layer 9s steps(1, end) infinite;
}

.portrait-placeholder {
  display: none;
  border: 1px solid var(--line);
  place-items: center;
  background: var(--placeholder-bg);
  color: #8f897f;
  letter-spacing: 0.22em;
  font-size: clamp(0.56rem, 1.2vw, 0.69rem);
}

h1 {
  margin: 0;
  text-transform: uppercase;
  font-family: "Inter Tight", "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 0.97;
  letter-spacing: 0.012em;
  font-size: var(--hero-title-size);
  white-space: nowrap;
}

.title-stack {
  display: grid;
  justify-items: center;
  gap: clamp(0.42rem, 1.2vw, 0.7rem);
}

.binary-divider {
  margin: 0;
  width: min(100%, 34ch);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #7c766d;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(0.56rem, 1vw, 0.72rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1;
  user-select: none;
}

.subtitle {
  max-width: 44ch;
  color: var(--text-soft);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: var(--hero-subtitle-size);
  letter-spacing: 0.08em;
  line-height: 1.08;
}

.hero,
.footer-signature {
  opacity: 0;
  animation: reveal 900ms ease forwards;
}

.hero {
  animation-delay: 140ms;
}

.footer-signature {
  animation-delay: 280ms;
}

.footer-signature .container {
  width: min(100%, 68rem);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 1.5rem);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes portrait-base-jitter {
  0%,
  81%,
  86%,
  100% {
    transform: translate3d(0, 0, 0);
    filter: none;
  }
  82% {
    transform: translate3d(-0.18%, 0, 0);
  }
  83% {
    transform: translate3d(0.22%, 0, 0);
  }
  84% {
    transform: translate3d(-0.1%, 0.1%, 0);
    filter: saturate(1.04) contrast(1.02);
  }
  85% {
    transform: translate3d(0.15%, -0.1%, 0);
  }
}

@keyframes portrait-glitch-layer {
  0%,
  80%,
  100% {
    opacity: 0.12;
    transform: translate3d(0, 0, 0) scale(1);
    filter: none;
  }
  81% {
    opacity: 0.38;
    transform: translate3d(-0.9%, 0, 0) scale(1.004);
    filter: saturate(1.08) contrast(1.08) hue-rotate(-2deg);
  }
  82% {
    opacity: 0.16;
  }
  83% {
    opacity: 0.34;
    transform: translate3d(1.05%, -0.25%, 0) scale(0.997);
  }
  84% {
    opacity: 0.14;
  }
  85% {
    opacity: 0.42;
    transform: translate3d(-1.25%, 0.42%, 0) scale(1.008);
    filter: saturate(1.1) contrast(1.1) hue-rotate(1deg);
  }
  86% {
    opacity: 0.14;
  }
  92% {
    opacity: 0.32;
    transform: translate3d(0.8%, -0.3%, 0) scale(1.003);
  }
  93% {
    opacity: 0.14;
  }
  94% {
    opacity: 0.25;
    transform: translate3d(-0.6%, 0, 0) scale(0.998);
  }
  95% {
    opacity: 0.12;
  }
}

@keyframes portrait-crt-scan {
  0%,
  80%,
  100% {
    opacity: 0.16;
    background-position: 0 -130%, 0 0;
  }
  81% {
    opacity: 0.24;
    background-position: 0 -8%, 0 0;
  }
  82% {
    opacity: 0.15;
  }
  83% {
    opacity: 0.22;
    background-position: 0 38%, 0 0;
  }
  84% {
    opacity: 0.15;
  }
  85% {
    opacity: 0.26;
    background-position: 0 85%, 0 0;
  }
  86% {
    opacity: 0.15;
  }
  92% {
    opacity: 0.2;
    background-position: 0 30%, 0 0;
  }
  93% {
    opacity: 0.14;
  }
  94% {
    opacity: 0.18;
    background-position: 0 58%, 0 0;
  }
  95% {
    opacity: 0.14;
  }
}

@keyframes portrait-crt-flicker {
  0% {
    opacity: 0.28;
  }
  15% {
    opacity: 0.31;
  }
  28% {
    opacity: 0.29;
  }
  46% {
    opacity: 0.32;
  }
  59% {
    opacity: 0.27;
  }
  72% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.28;
  }
}

@keyframes portrait-crt-breathe {
  0%,
  100% {
    filter: contrast(1) brightness(1);
  }
  50% {
    filter: contrast(1.05) brightness(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash,
  .hero,
  .footer-signature {
    animation: none;
    opacity: 1;
  }

  .portrait-image--base,
  .portrait-image--glitch,
  .portrait-wrap::before,
  .portrait-wrap::after {
    animation: none;
    transform: none;
    filter: none;
  }
}

@media (max-width: 40rem) {
  .frame {
    min-height: 100svh;
    padding-block: 0.5rem;
  }

  .portrait-wrap {
    width: min(86vw, 21rem);
  }

  .subtitle {
    max-width: 31ch;
  }

  .consent-banner__actions {
    justify-content: stretch;
  }

  .consent-btn {
    flex: 1 1 0;
  }
}
