/* ══════ RESET ══════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ══════ VARIABILI ══════ */
:root {
  --bg: #000;
  --bg2: #060606;
  --green: #00ff41;
  --cyan: #00d4ff;
  --red: #ff0040;
  --amber: #ffb800;
  --text: #c8c8c8;
  --text2: rgba(255, 255, 255, 0.4);
  --text3: rgba(255, 255, 255, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --border2: rgba(255, 255, 255, 0.1);
  --card: rgba(255, 255, 255, 0.02);
  --card2: rgba(255, 255, 255, 0.04);
  --mono: "JetBrains Mono", monospace;
  --r: 12px;
}

/* ══════ BASE ══════ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

/* ══════ SCANLINES (effetto CRT sottile) ══════ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.006) 2px,
    rgba(0, 255, 65, 0.006) 4px
  );
}

/* ══════ MATRIX CANVAS ══════ */
#matrix {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.12;
  pointer-events: none;
}

/* ══════ BOOT (placeholder — stile base) ══════ */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════ LANDING (nascosta per ora) ══════ */
#landing {
  position: relative;
  z-index: 3;
  display: none;
}

/* ══════ BOOT SEQUENCE ══════ */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

#boot.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-inner {
  max-width: 520px;
  width: 90%;
}

/* ── Righe ── */
.b-line {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 2px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.b-line.vis {
  opacity: 1;
  transform: translateY(0);
}

.b-line.hidden {
  opacity: 0;
  transform: translateY(6px);
}

.b-line.dim,
.b-line .dim {
  color: var(--text2);
}

/* ── Colori ── */
.b-brand {
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
}

.b-ok {
  color: var(--green);
  font-weight: 700;
}

.b-err {
  color: var(--red);
  font-weight: 700;
}

.b-warn {
  color: var(--amber);
  font-weight: 700;
}

.b-cyan {
  color: var(--cyan);
}

/* ── Progress Bar ── */
.b-bar {
  display: inline-flex;
  gap: 1px;
  vertical-align: middle;
}

.b-bar-block {
  width: 6px;
  height: 12px;
  display: inline-block;
  transition: opacity 0.08s;
}

.b-bar-block.on {
  background: var(--green);
  opacity: 1;
}

.b-bar-block.off {
  background: var(--text2);
  opacity: 0.15;
}

/* ══════ LANDING ══════ */
#landing {
  position: relative;
  z-index: 3;
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#landing.vis {
  opacity: 1;
}

/* ══════ LANDING CONTENT ══════ */
.landing-content {
  width: 90%;
  max-width: 480px;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Logo ── */
.logo {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-pr {
  color: var(--green);
}

.logo-pa {
  color: var(--text2);
  font-weight: 400;
}

.logo-nm {
  color: var(--text);
}

/* ── Tagline ── */
.tagline {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.tagline-green {
  color: var(--green);
}

/* ── Descrizione ── */
.desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 24px;
}

/* ── Status Box ── */
.status-box {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 32px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.status-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.status-line {
  font-size: 12px;
  line-height: 2;
}

.s-green {
  color: var(--green);
}

.s-dim {
  color: var(--text2);
}

.s-out {
  color: var(--text2);
  padding-left: 16px;
}

/* ══════ FORM ══════ */
.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.06);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Submit Button ── */
.btn-submit {
  width: 100%;
  padding: 13px 30px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--bg);
  background: var(--green);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-submit:hover {
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0);
}

/* ── Form Success ── */
.form-success {
  display: none;
  text-align: center;
  padding: 32px 0;
  width: 100%;
}

.form-success.vis {
  display: block;
}

.fs-icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--green);
}

.fs-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

.fs-sub {
  font-size: 12px;
  color: var(--text2);
}

/* ── Alt Email ── */
.alt-email {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 32px;
}

.alt-email a {
  color: var(--green);
  transition: opacity 0.2s;
}

.alt-email a:hover {
  opacity: 0.7;
}

/* ══════ MINI FOOTER ══════ */
.mini-footer {
  width: 100%;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.gdpr {
  font-size: 10px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 12px;
}

.copy {
  font-size: 11px;
  color: var(--text2);
}

/* ══════ KONAMI HINT ══════ */
.konami-hint {
  position: fixed;
  bottom: 10px;
  right: 14px;
  z-index: 100;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  letter-spacing: 0.5px;
  transition: color 1.5s ease;
}

/* ══════ SNAKE MOBILE CONTROLS ══════ */
.snake-controls {
  display: none;
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  user-select: none;
  -webkit-user-select: none;
}

.snake-controls.active {
  display: grid;
  grid-template-areas:
    ".    up    ."
    "left down  right";
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(2, 64px);
  gap: 6px;
  justify-items: center;
  align-items: center;
}

.snake-btn {
  width: 60px;
  height: 60px;
  background: rgba(0, 255, 65, 0.08);
  border: 2px solid var(--green);
  border-radius: 12px;
  color: var(--green);
  font-size: 1.5rem;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.snake-btn:active {
  background: rgba(0, 255, 65, 0.3);
  transform: scale(0.9);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.snake-btn[data-dir="up"]    { grid-area: up; }
.snake-btn[data-dir="left"]  { grid-area: left; }
.snake-btn[data-dir="down"]  { grid-area: down; }
.snake-btn[data-dir="right"] { grid-area: right; }

.snake-mobile-actions {
  display: none;
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10002;
  gap: 10px;
}

.snake-mobile-actions.active {
  display: flex;
}

.snake-action-btn {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.snake-action-btn.close-btn {
  border-color: var(--red);
  color: var(--red);
}

.snake-action-btn:active {
  transform: scale(0.9);
}

@media (hover: hover) and (pointer: fine) {
  .snake-controls,
  .snake-mobile-actions {
    display: none !important;
  }
}