:root {
  --terminal-bg: #0a0a0a;
  --terminal-fg: #33ff00;
  --terminal-secondary: #ffb000;
  --terminal-muted: #1f521f;
  --terminal-accent: #33ff00;
  --terminal-error: #ff3333;
  --terminal-panel: rgba(5, 5, 5, 0.92);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(
      circle at 20% 20%,
      rgba(31, 82, 31, 0.12),
      transparent 45%
    ),
    var(--terminal-bg);
  color: var(--terminal-fg);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  text-shadow: 0 0 5px rgba(51, 255, 0, 0.5);
}

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

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 48px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.page-shell--cards {
  max-width: 1400px;
  gap: 36px;
}

.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px
  );
  background-size: 100% 3px;
  opacity: 0.25;
  mix-blend-mode: screen;
  z-index: 0;
}

.terminal-logo {
  font-size: clamp(0.55rem, 1vw, 0.85rem);
  line-height: 1.2;
  color: var(--terminal-muted);
  margin: 0;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.15fr);
  gap: 32px;
  align-items: start;
}

.hero-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-title {
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0;
}

.typing-demo {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--terminal-fg);
  animation: typing 2.6s steps(22, end), blink 0.8s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--terminal-fg);
  }
}

.animate-blink {
  animation: blink 1s step-end infinite;
}

.panel-title {
  display: inline-block;
  padding: 4px 10px;
  background: var(--terminal-fg);
  color: #000;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--terminal-muted);
}

.button {
  border: 1px solid var(--terminal-fg);
  padding: 6px 14px;
  background: transparent;
  color: var(--terminal-fg);
  font-family: inherit;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: var(--terminal-fg);
  color: #000;
}

.submit-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.submit-panel {
  width: min(360px, 90vw);
  border: 1px solid var(--terminal-muted);
  padding: 16px;
  background: rgba(5, 5, 5, 0.98);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.form-row input,
.form-row textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--terminal-muted);
  color: var(--terminal-fg);
  padding: 6px 0;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  resize: vertical;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--terminal-muted);
  text-transform: uppercase;
}

.deck-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}

.deck-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

.deck-stack {
  position: relative;
  width: min(620px, 90vw);
  height: min(480px, 60vh);
}

.deck-card {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border: 1px solid var(--terminal-muted);
  background: rgba(5, 5, 5, 0.92);
}

.deck-card--active {
  cursor: pointer;
  outline: none;
  transition: transform 0.35s ease;
}

.deck-card--active:focus-visible {
  outline: 2px dashed var(--terminal-fg);
  outline-offset: 6px;
}

.deck-card--shadow {
  background: rgba(5, 5, 5, 0.82);
  border-color: rgba(51, 255, 0, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.deck-card--shadow-2 {
  transform: translate(16px, 16px);
  opacity: 0.7;
}

.deck-card--shadow-3 {
  transform: translate(32px, 32px);
  opacity: 0.5;
}

.deck-card--active.is-cutting {
  transform: translateX(36px) translateY(-8px) rotateZ(1deg);
}

.deck-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 4vw, 44px);
}

.deck-front {
  justify-content: center;
  font-size: clamp(1.05rem, 2vw, 1.6rem);
}

.card-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terminal-secondary);
}

.card-content {
  line-height: 1.6;
}

.card-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--terminal-muted);
}

.deck-status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  text-transform: uppercase;
  font-size: 0.75rem;
  justify-content: flex-end;
  width: 100%;
}

.status-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--terminal-muted);
}

.notice {
  font-size: 0.75rem;
  color: var(--terminal-muted);
}

.error {
  color: var(--terminal-error);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .page-shell {
    padding: 28px 16px 56px;
  }

  .layout-grid {
    grid-template-columns: 1fr;
  }

  .deck-area {
    align-items: stretch;
  }

  .submit-toggle {
    align-items: flex-start;
  }

  .deck-stack {
    width: 100%;
    height: min(420px, 60vh);
  }

  .deck-card--shadow-2 {
    transform: translate(12px, 12px);
  }

  .deck-card--shadow-3 {
    transform: translate(24px, 24px);
  }

  .deck-status {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing-demo,
  .animate-blink {
    animation: none;
  }

  .deck-card--active {
    transition: none;
  }
}
