/* ============================================================
   PENNAPPS — retro CRT / terminal landing
   Palette: deep phosphor green on near-black + cream accents
   ============================================================ */

:root {
  --bg: #070b07;
  --bg-panel: #0c140c;
  --phosphor: #39ff14;
  --phosphor-dim: #1f9a0c;
  --phosphor-glow: rgba(57, 255, 20, 0.45);
  --cream: #f4ecd8;
  --navy: #0a1628;
  --red: #e23d3d;
  --muted: #6a8a6a;
  --border: #1e3a1e;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  --font-pixel: "Press Start 2P", var(--font-mono);
  --radius: 4px;
  --max-card: 520px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--phosphor);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--phosphor);
  color: var(--bg);
}

a {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--phosphor);
  border-bottom-color: var(--phosphor);
  outline: none;
}

/* ---------- CRT overlays ---------- */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  opacity: 0.55;
  mix-blend-mode: multiply;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: rgba(57, 255, 20, 0.015);
  animation: flicker 6s infinite;
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  93% {
    opacity: 0.85;
  }
  94% {
    opacity: 1;
  }
  96% {
    opacity: 0.9;
  }
  97% {
    opacity: 1;
  }
}

/* ---------- Boot screen ---------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at center, #0d1a0d 0%, var(--bg) 70%),
    var(--bg);
  padding: 1.5rem;
  cursor: pointer;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-inner {
  width: min(100%, 640px);
  text-align: center;
}

.boot-logo {
  margin: 0 0 1.75rem;
  font-family: var(--font-mono);
  font-size: clamp(0.35rem, 1.6vw, 0.7rem);
  line-height: 1.15;
  color: var(--phosphor);
  text-shadow: 0 0 8px var(--phosphor-glow);
  overflow: hidden;
  white-space: pre;
  letter-spacing: 0.02em;
}

.boot-status {
  font-family: var(--font-pixel);
  font-size: clamp(0.55rem, 2vw, 0.75rem);
  letter-spacing: 0.08em;
  margin: 0 0 1.25rem;
  color: var(--cream);
  text-shadow: 0 0 10px rgba(244, 236, 216, 0.25);
}

.boot-bar {
  height: 10px;
  border: 2px solid var(--phosphor-dim);
  background: #050805;
  padding: 2px;
  margin: 0 auto 1.25rem;
  max-width: 360px;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.15);
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--phosphor-dim), var(--phosphor));
  box-shadow: 0 0 8px var(--phosphor-glow);
  transition: width 0.08s linear;
}

.boot-hint {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cursor-blink {
  display: inline-block;
  animation: blink 1.05s steps(1, end) infinite;
  color: var(--phosphor);
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

/* ---------- Main layout ---------- */
.main {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem 2.5rem;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #101a10 0%, var(--bg) 65%),
    var(--bg);
}

.main.hidden {
  display: none;
}

.bezel {
  width: min(100%, var(--max-card));
  padding: 10px;
  background: linear-gradient(160deg, #1a241a, #0a100a 40%, #121a12);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px #243024,
    0 20px 60px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.terminal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 40px rgba(57, 255, 20, 0.04),
    0 0 30px rgba(57, 255, 20, 0.06);
  animation: bootIn 0.55s ease both;
}

@keyframes bootIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    filter: brightness(1.4);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(180deg, #142014, #0e160e);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor-glow);
  flex-shrink: 0;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.header-label {
  color: var(--cream);
  font-weight: 600;
}

.header-meta {
  margin-left: auto;
  color: var(--phosphor-dim);
  font-size: 0.65rem;
}

.card-body {
  padding: 1.6rem 1.35rem 1.4rem;
}

.prompt-line {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.prompt {
  color: var(--phosphor);
  margin-right: 0.35rem;
}

.title {
  margin: 0 0 1.25rem;
  font-family: var(--font-pixel);
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0.06em;
  color: var(--phosphor);
  text-shadow:
    0 0 12px var(--phosphor-glow),
    0 0 28px rgba(57, 255, 20, 0.2);
}

.title-glitch {
  position: relative;
  display: inline-block;
}

.title-glitch::before,
.title-glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0.75;
  pointer-events: none;
}

.title-glitch::before {
  color: #7dff6a;
  clip-path: inset(0 0 55% 0);
  transform: translate(-1px, 0);
  animation: glitchTop 4.5s infinite linear alternate-reverse;
}

.title-glitch::after {
  color: var(--red);
  clip-path: inset(55% 0 0 0);
  transform: translate(1px, 0);
  animation: glitchBot 3.8s infinite linear alternate-reverse;
  mix-blend-mode: screen;
}

@keyframes glitchTop {
  0%,
  90%,
  100% {
    transform: translate(0);
  }
  92% {
    transform: translate(-2px, -1px);
  }
  94% {
    transform: translate(2px, 0);
  }
  96% {
    transform: translate(-1px, 1px);
  }
}

@keyframes glitchBot {
  0%,
  88%,
  100% {
    transform: translate(0);
  }
  91% {
    transform: translate(2px, 1px);
  }
  93% {
    transform: translate(-2px, 0);
  }
  95% {
    transform: translate(1px, -1px);
  }
}

.copy {
  margin-bottom: 1.5rem;
}

.copy p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: #b8d4b8;
}

.copy .invite {
  margin-top: 1rem;
  color: var(--cream);
}

.hl {
  color: var(--phosphor);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.25);
}

/* ---------- Form ---------- */
.notify-form {
  display: grid;
  gap: 0.9rem;
}

.honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--phosphor-dim);
  font-weight: 600;
}

.field input {
  width: 100%;
  appearance: none;
  background: #050905;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.75rem 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  caret-color: var(--phosphor);
}

.field input::placeholder {
  color: #3d5a3d;
}

.field input:hover {
  border-color: #2e4e2e;
}

.field input:focus {
  border-color: var(--phosphor-dim);
  box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.15), 0 0 16px rgba(57, 255, 20, 0.08);
}

.field input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(226, 61, 61, 0.2);
}

.form-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--red);
  letter-spacing: 0.02em;
}

.submit-btn {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid var(--phosphor);
  border-radius: var(--radius);
  background: rgba(57, 255, 20, 0.06);
  color: var(--phosphor);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  text-shadow: 0 0 8px var(--phosphor-glow);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.12);
}

.submit-btn:hover:not(:disabled) {
  background: rgba(57, 255, 20, 0.14);
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.22);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-bracket {
  color: var(--phosphor-dim);
}

/* ---------- Success ---------- */
.success {
  margin-top: 0.25rem;
  padding: 1.1rem 1rem;
  border: 1px dashed var(--phosphor-dim);
  background: rgba(57, 255, 20, 0.05);
  border-radius: var(--radius);
  animation: bootIn 0.4s ease both;
}

.success-line {
  margin: 0 0 0.4rem;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  line-height: 1.5;
}

.success-line .ok {
  color: var(--phosphor);
  margin-right: 0.5rem;
}

.success-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  background: #0a110a;
}

.card-footer a {
  color: var(--muted);
  border-bottom: none;
}

.card-footer a:hover,
.card-footer a:focus-visible {
  color: var(--cream);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .boot-logo {
    font-size: 0.32rem;
  }

  .card-body {
    padding: 1.25rem 1rem 1.15rem;
  }

  .header-meta {
    display: none;
  }

  .copy p {
    font-size: 0.9rem;
  }

  .submit-btn {
    font-size: 0.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scanlines,
  body::before {
    display: none;
  }
}
