/* ============================================================
   MEL STACK BOX — synthwave brand hub
   Palette + type live in :root. Everything themes off these.
   ============================================================ */

:root {
  --void:    #08040f;
  --deep:    #0e0720;
  --panel:   rgba(30, 15, 58, 0.45);
  --panel-2: rgba(45, 22, 84, 0.35);

  --magenta: #ff2e97;
  --pink:    #ff6ad5;
  --cyan:    #21e6f0;
  --purple:  #a25bff;
  --amber:   #ffcf5c;

  --sun-a:   #ffe98a;
  --sun-b:   #ff9e4f;
  --sun-c:   #ff5c8a;
  --sun-d:   #ff2e97;

  --text:    #efe7ff;
  --muted:   #a595d6;
  --line:    rgba(162, 91, 255, 0.28);

  --display: "Orbitron", "Arial Narrow", sans-serif;
  --body:    "Chakra Petch", ui-monospace, monospace;

  --glow-m:  0 0 8px rgba(255, 46, 151, 0.75), 0 0 22px rgba(255, 46, 151, 0.45);
  --glow-c:  0 0 8px rgba(33, 230, 240, 0.75), 0 0 22px rgba(33, 230, 240, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--text);
  background: var(--void);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- atmospheric background ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 8%, #2a0f4a 0%, var(--deep) 42%, var(--void) 78%);
}

/* the outrun sun */
.sun {
  position: absolute;
  top: 12%;
  left: 50%;
  width: min(360px, 74vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(to bottom,
      var(--sun-a) 0%, var(--sun-b) 34%, var(--sun-c) 58%, var(--sun-d) 100%);
  box-shadow: 0 0 90px 24px rgba(255, 92, 138, 0.5),
              0 0 200px 60px rgba(255, 46, 151, 0.25);
  animation: sun-breathe 6s ease-in-out infinite;
}
/* horizontal scan-gaps carved into the lower half of the sun */
.sun::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-linear-gradient(to bottom,
      transparent 0 13px, var(--deep) 13px 17px);
  -webkit-mask: linear-gradient(to bottom, transparent 44%, #000 46%);
          mask: linear-gradient(to bottom, transparent 44%, #000 46%);
}

@keyframes sun-breathe {
  50% { box-shadow: 0 0 120px 34px rgba(255, 92, 138, 0.6),
                    0 0 260px 80px rgba(255, 46, 151, 0.32); }
}

/* horizon glow where sky meets grid */
.horizon {
  position: absolute;
  bottom: 42vh;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 14px 3px var(--cyan), 0 0 40px 8px rgba(33, 230, 240, 0.4);
  opacity: 0.85;
}
/* content subpages (e.g. blog) have no masking cards — hide the horizon line
   so it doesn't cut through text */
.subpage .horizon { display: none; }

/* perspective neon grid */
.grid-floor {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 260%;
  height: 46vh;
  transform: translateX(-50%) perspective(340px) rotateX(74deg);
  transform-origin: bottom center;
  background-image:
    linear-gradient(rgba(33, 230, 240, 0.5) 0 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 46, 151, 0.42) 0 2px, transparent 2px);
  background-size: 74px 74px;
  -webkit-mask: linear-gradient(to top, #000 12%, transparent 92%);
          mask: linear-gradient(to top, #000 12%, transparent 92%);
  animation: grid-run 4.5s linear infinite;
}

@keyframes grid-run {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 74px, 0 0; }
}

/* CRT scanlines + vignette + grain over everything */
.overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.16) 2px 3px);
  mix-blend-mode: multiply;
}
.overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(4, 2, 10, 0.8) 100%);
}

/* ---------- layout shell ---------- */

.wrap {
  width: min(1080px, 92vw);
  margin-inline: auto;
}

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
}
.brand img { width: 26px; height: 26px; filter: drop-shadow(var(--glow-m)); }
.brand span { color: var(--cyan); text-shadow: var(--glow-c); }

.status-pill {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); box-shadow: var(--glow-c);
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 8vh 0 10vh;
}
.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.42em;
  color: var(--cyan);
  text-shadow: var(--glow-c);
  margin-bottom: 26px;
}
.eyebrow .caret { animation: blink 1s steps(1) infinite; }

.title {
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.02em;
  font-size: clamp(2.7rem, 11vw, 7.2rem);
  background: linear-gradient(180deg, #fff 0%, #ffd9f4 30%, var(--pink) 55%, var(--magenta) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(255,46,151,0.5))
          drop-shadow(0 0 26px rgba(255, 46, 151, 0.55));
  text-transform: uppercase;
}
.title .stack { display: block; color: transparent; }

.tagline {
  max-width: 30ch;
  margin: 30px auto 0;
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  color: var(--text);
  text-shadow: 0 0 6px var(--void), 0 0 6px var(--void);
}
.tagline b { color: var(--cyan); text-shadow: var(--glow-c); font-weight: 500; }

/* ---------- signup form ---------- */

.signup {
  margin: 42px auto 0;
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
}
.signup .row { display: flex; gap: 12px; }
.field {
  flex: 1;
  min-width: 0;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(10, 5, 22, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: var(--muted); letter-spacing: 0.08em; }
.field:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--glow-c);
}
.btn {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--void);
  background: linear-gradient(180deg, var(--pink), var(--magenta));
  border: none;
  border-radius: 10px;
  padding: 15px 22px;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 108, 213, 0.6), 0 8px 24px rgba(255, 46, 151, 0.35);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08);
  box-shadow: 0 0 0 1px var(--pink), 0 12px 34px rgba(255, 46, 151, 0.5); }
.btn:active { transform: translateY(0); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: left;
}
.consent input { accent-color: var(--magenta); margin-top: 2px; }

.form-note {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  text-shadow: var(--glow-c);
  min-height: 1em;
}

/* ---------- status modules ---------- */

.modules {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 4vh 0 5vh;
  text-align: left;
}
.module {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
a.module:hover { border-color: var(--cyan); transform: translateY(-3px); }
.mod-go {
  margin-top: 16px;
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  transition: color 0.2s, text-shadow 0.2s;
}
a.module:hover .mod-go { color: var(--cyan); text-shadow: var(--glow-c); }
.module::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta), var(--cyan), transparent);
}
.module .mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.module h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.14em;
}
.tag {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  padding: 4px 9px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--cyan);
  white-space: nowrap;
}
.module p {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: auto; /* pushes bar + link to the card bottom */
}

/* loading bar inside modules */
.bar {
  margin-top: 18px;
  height: 6px;
  border-radius: 100px;
  background: rgba(10, 5, 22, 0.7);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  box-shadow: 0 0 12px rgba(33, 230, 240, 0.6);
}

/* ---------- misfires / blog CTA ---------- */

.blog-cta {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 0 12vh;
  display: grid;
  gap: 22px;
  justify-items: center;
}
.blog-line { max-width: 42ch; font-size: 0.9rem; color: var(--muted);
  text-shadow: 0 0 6px var(--void), 0 0 6px var(--void); }
.tagline { text-shadow: 0 0 6px var(--void), 0 0 6px var(--void); }
.blog-line b { color: var(--cyan); text-shadow: var(--glow-c); font-weight: 500; }

/* hardware-style button: extruded 3D at rest, twitchy neon flicker on hover */
.btn-hw {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  padding: 16px 26px;
  border: none;
  border-radius: 0;
  border-left: 3px solid var(--magenta);
  border-top: 3px solid var(--cyan);
  border-right: 3px solid var(--purple);
  border-bottom: 3px solid transparent;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.45),
              inset 2px 2px 0 rgba(255, 255, 255, 0.12),
              0 0 20px rgba(162, 91, 255, 0.28);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.btn-hw:hover {
  transform: translateY(-2px);
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.5),
              inset 2px 2px 0 rgba(255, 255, 255, 0.14),
              0 0 24px rgba(255, 46, 151, 0.45);
  text-shadow: 0 0 8px rgba(255, 106, 213, 0.55);
  animation: hw-flicker 2.4s infinite;
}
.btn-hw:active { transform: translateY(0); }

@keyframes hw-flicker {
  0%, 8%, 10%, 22%, 24%, 39%, 41%, 43%, 62%, 64%, 78%, 100% {
    box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.5),
                inset 2px 2px 0 rgba(255, 255, 255, 0.14),
                0 0 26px rgba(255, 46, 151, 0.5),
                0 0 12px rgba(33, 230, 240, 0.35);
    text-shadow: 0 0 9px rgba(255, 106, 213, 0.65);
  }
  9%, 23%, 40%, 42%, 63%, 79% {
    box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.5),
                inset 2px 2px 0 rgba(255, 255, 255, 0.05),
                0 0 8px rgba(255, 46, 151, 0.14),
                0 0 4px rgba(33, 230, 240, 0.06);
    text-shadow: 0 0 2px rgba(255, 106, 213, 0.18);
  }
}

/* content page shell (blog, work, products, signal) */
.page {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6vh 0 14vh;
  display: grid;
  gap: 26px;
  justify-items: center;
}
/* eyebrow sits over the bright sun on subpages — dark halo keeps it legible */
.subpage .eyebrow {
  text-shadow: 0 0 6px var(--void), 0 0 6px var(--void), var(--glow-c);
}

/* ---------- marquee ---------- */

.marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 14px 0;
  white-space: nowrap;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee .track {
  display: inline-block;
  animation: slide 22s linear infinite;
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  color: var(--muted);
}
.marquee .track span { color: var(--magenta); margin: 0 22px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}
.foot a { transition: color 0.2s, text-shadow 0.2s; }
.foot a:hover { color: var(--cyan); text-shadow: var(--glow-c); }
.foot .sig b { color: var(--magenta); }

/* ---------- entrance animation ---------- */

.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.8s ease forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .signup .row { flex-direction: column; }
  .modules { grid-template-columns: 1fr; }
  .status-pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
