/* Bricks & Freaks — landing page
   Palette lifted from the event poster: ink navy, cream, hazard yellow,
   magenta/green/cyan glitch trio, brick red/orange/purple/lime. */

:root {
  --ink: #14131f;
  --ink-deep: #0c0b14;
  --cream: #f1e2c4;
  --yellow: #f2c94c;
  --red: #d64545;
  --orange: #ef9d3d;
  --purple: #8b5cf6;
  --lime: #a6e22e;
  --magenta: #ff2fd0;
  --cyan: #38e0f2;
  --green: #7cff3c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--cream);
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  position: relative;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* film-grain texture over everything */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0.5px, transparent 0.5px),
    radial-gradient(circle at 60% 70%, #fff 0.5px, transparent 0.5px),
    radial-gradient(circle at 80% 20%, #fff 0.5px, transparent 0.5px);
  background-size: 3px 3px, 4px 4px, 5px 5px;
}

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1rem, 5vw, 3rem);
  position: relative;
  z-index: 10;
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.02em;
}

.nav__word {
  color: var(--cream);
}

.nav__cta {
  color: var(--ink);
  background: var(--yellow);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
  transition: transform 0.15s ease;
}

.nav__cta:hover { transform: translate(-2px, -2px); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem 4rem;
  overflow: hidden;
}

/* ---------- ambient background bricks ----------
   Three "families" echo the expo: glossy official-style bricks,
   two-tone alternative-brand bricks, and matte 3D-printed bricks
   with visible layer lines. Populated by script.js, drifting up
   from below the fold like they're being unpacked. */
.bg-bricks {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-brick {
  position: absolute;
  bottom: -15%;
  left: var(--x, 50%);
  width: var(--w, 32px);
  height: var(--h, 21px);
  opacity: var(--o, 0.5);
  filter: blur(var(--blur, 0px));
  animation: bg-rise var(--dur, 30s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.bg-brick::before,
.bg-brick::after {
  content: "";
  position: absolute;
  top: -25%;
  width: 28%;
  height: 35%;
  border-radius: 50%;
  background: inherit;
}
.bg-brick::before { left: 15%; }
.bg-brick::after { right: 15%; }

.bg-brick--classic {
  background: var(--c, var(--red));
  border-radius: 15%;
  box-shadow:
    inset 0 -4px 0 rgba(0,0,0,0.25),
    inset 0 3px 0 rgba(255,255,255,0.25);
}

.bg-brick--alt {
  background: linear-gradient(135deg, var(--c1, var(--purple)) 50%, var(--c2, var(--cyan)) 50%);
  border: 2px dashed rgba(241,226,196,0.4);
  border-radius: 15%;
}

.bg-brick--print {
  background: repeating-linear-gradient(0deg, var(--c, var(--orange)) 0 3px, rgba(0,0,0,0.22) 3px 5px);
  border-radius: 6%;
  filter: saturate(0.7) blur(var(--blur, 0px));
}

@keyframes bg-rise {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--r0, 0deg)); }
  50%  { transform: translate3d(var(--sway, 18px), -55vh, 0) rotate(var(--r1, 180deg)); }
  100% { transform: translate3d(0, -115vh, 0) rotate(var(--r2, 360deg)); }
}

.hero__title {
  position: relative;
  z-index: 1;
  margin: 1rem 0 2rem;
  line-height: 0.95;
}

.hero__title-line {
  display: block;
  font-size: clamp(2.2rem, 9vw, 5rem);
  letter-spacing: 0.02em;
}

.hero__title-line--cream { color: var(--cream); }

/* ---------- glitch text ---------- */
.glitch {
  position: relative;
  display: inline-block;
  color: var(--magenta);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.glitch--lg { font-size: clamp(2.6rem, 11vw, 6rem); }
.glitch--sm { font-size: inherit; }

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: inherit;
  background: var(--ink);
  overflow: hidden;
}

.glitch::before {
  color: var(--green);
  left: 2px;
  animation: glitch-top 3.2s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--cyan);
  left: -2px;
  animation: glitch-bottom 2.6s infinite linear alternate-reverse;
}

@keyframes glitch-top {
  0%   { clip-path: inset(0 0 82% 0); transform: translate(-2px, -1px); }
  10%  { clip-path: inset(10% 0 60% 0); transform: translate(2px, 0); }
  20%  { clip-path: inset(40% 0 40% 0); transform: translate(-1px, 1px); }
  30%  { clip-path: inset(5% 0 90% 0); transform: translate(3px, -1px); }
  40%  { clip-path: inset(60% 0 5% 0); transform: translate(-3px, 0); }
  50%  { clip-path: inset(20% 0 65% 0); transform: translate(1px, 1px); }
  60%  { clip-path: inset(0 0 82% 0); transform: translate(-2px, -1px); }
  70%  { clip-path: inset(50% 0 20% 0); transform: translate(2px, 1px); }
  80%  { clip-path: inset(30% 0 55% 0); transform: translate(-1px, -1px); }
  90%  { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); }
  100% { clip-path: inset(15% 0 70% 0); transform: translate(-2px, 1px); }
}

@keyframes glitch-bottom {
  0%   { clip-path: inset(78% 0 0 0); transform: translate(2px, 1px); }
  15%  { clip-path: inset(45% 0 30% 0); transform: translate(-2px, 0); }
  30%  { clip-path: inset(85% 0 0 0); transform: translate(3px, -1px); }
  45%  { clip-path: inset(20% 0 60% 0); transform: translate(-1px, 1px); }
  60%  { clip-path: inset(60% 0 15% 0); transform: translate(2px, -1px); }
  75%  { clip-path: inset(90% 0 0 0); transform: translate(-3px, 0); }
  90%  { clip-path: inset(35% 0 45% 0); transform: translate(1px, 1px); }
  100% { clip-path: inset(70% 0 5% 0); transform: translate(-2px, -1px); }
}

/* occasional harder glitch "jump" on the whole word */
.glitch--lg {
  animation: glitch-jump 5s infinite steps(1);
}

@keyframes glitch-jump {
  0%, 92%, 100% { transform: translate(0, 0) skewX(0); }
  93% { transform: translate(-4px, 2px) skewX(-3deg); }
  94% { transform: translate(3px, -2px) skewX(2deg); }
  95% { transform: translate(-2px, 0) skewX(0); }
  96% { transform: translate(0, 0) skewX(0); }
}

/* ---------- poster frame ---------- */
.poster-frame {
  position: relative;
  z-index: 1;
  width: min(340px, 80vw);
  border: 6px solid var(--cream);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  transform: rotate(-1.5deg);
  background: var(--ink-deep);
}

.poster-frame__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
}

.poster-frame__fallback { display: none; }

.poster-frame--empty {
  min-height: 420px;
}
.poster-frame--empty .poster-frame__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  height: 100%;
  min-height: 420px;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(139,92,246,0.15), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255,47,208,0.12), transparent 45%),
    var(--ink-deep);
}

.fallback__pile {
  position: relative;
  width: 100%;
  height: 220px;
}

.fbrick {
  position: absolute;
  width: 46px;
  height: 28px;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.fbrick::before, .fbrick::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 13px; height: 10px;
  border-radius: 50%;
  background: inherit;
}
.fbrick::before { left: 6px; }
.fbrick::after { right: 6px; }

.fbrick--1 { bottom: 0;   left: 30%; background: var(--yellow); transform: rotate(-3deg); }
.fbrick--2 { bottom: 26px; left: 45%; background: var(--red); transform: rotate(4deg); }
.fbrick--3 { bottom: 55px; left: 25%; background: var(--purple); transform: rotate(-8deg); }
.fbrick--4 { bottom: 90px; left: 50%; background: var(--lime); transform: rotate(10deg); }
.fbrick--5 { bottom: 120px; left: 32%; background: var(--magenta); transform: rotate(-15deg); }
.fbrick--6 { bottom: 150px; left: 55%; background: var(--cyan); transform: rotate(6deg); }

.fallback__hint {
  font-family: Arial, sans-serif;
  font-weight: normal;
  font-size: 0.75rem;
  color: rgba(241,226,196,0.6);
  margin: 0;
}
.fallback__hint code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.hero__sub {
  margin-top: 1.75rem;
  max-width: 32rem;
  font-family: Arial, sans-serif;
  font-weight: normal;
  color: rgba(241,226,196,0.75);
  font-size: 1rem;
  line-height: 1.5;
}

.hero__desc {
  margin-top: 0.75rem;
  max-width: 28rem;
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: var(--cream);
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ---------- signup ---------- */
.signup {
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  text-align: center;
  font-family: Arial, sans-serif;
}

.signup__title {
  font-family: inherit;
  font-size: 1.6rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.signup__copy {
  color: rgba(241,226,196,0.7);
  margin-bottom: 1.5rem;
}

.signup__form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.signup__input {
  flex: 1 1 220px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 2px solid rgba(241,226,196,0.25);
  background: rgba(255,255,255,0.05);
  color: var(--cream);
  font-size: 1rem;
}

.signup__input:focus {
  outline: none;
  border-color: var(--magenta);
}

.signup__button {
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: var(--magenta);
  color: var(--ink-deep);
  font-weight: bold;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
  transition: transform 0.15s ease;
}

.signup__button:hover { transform: translate(-2px, -2px); }

.signup__status {
  margin-top: 1rem;
  min-height: 1.2em;
  color: var(--lime);
  font-size: 0.9rem;
}

/* ---------- footer ---------- */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  color: rgba(241,226,196,0.4);
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, .glitch--lg, .bg-brick {
    animation: none !important;
  }
}
