:root {
  --bg: #060a06;
  --bg-deep: #020402;
  --fg-bright: #d4ecc4;
  --fg-mid: #7a9472;
  --fg-faint: #2f3f2c;
  --accent: #6cdb2a;        /* sickly swamp green */
  --accent-glow: #4fa321;
  --eye: #f3c74b;           /* goblin eye / torch amber */
  --warn: #c8341f;          /* dried blood */
  --moss: #354f2a;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg-mid);
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Mono", "Courier New", monospace;
}

/* SWAMP AMBIENT — radial mist from below + faint top vignette */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 110%, rgba(108, 219, 42, 0.10), transparent 60%),
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(0, 0, 0, 0.6), transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 40%, var(--bg) 60%, var(--bg-deep) 100%);
  pointer-events: none;
  z-index: 0;
}

/* GRID OVERLAY — sicklier green, slightly off so it feels grimy */
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, rgba(108,219,42,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(108,219,42,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 999;
}

#screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#header {
  position: absolute;
  top: 22px;
  left: 26px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--fg-mid);
  font-family: inherit;
  z-index: 10;
}
#header .org { color: var(--fg-faint); }
#header .slash { color: var(--fg-faint); }
#header .repo {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(108,219,42,0.55);
}
#header .tag {
  color: var(--eye);
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-left: 6px;
  opacity: 0.8;
  text-transform: uppercase;
}

#canvas {
  font-family: inherit;
  line-height: 1.0;
  letter-spacing: 0;
  color: var(--accent);
  white-space: pre;
  margin: 0;
  display: block;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  font-kerning: none;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  transform: translateZ(0);
  filter:
    drop-shadow(0 0 6px rgba(108, 219, 42, 0.55))
    drop-shadow(0 0 18px rgba(108, 219, 42, 0.25));
  font-size: clamp(8px, calc((100vw - 56px) / 40), 14px);
  animation: green-pulse 4s ease-in-out infinite;
}
@keyframes green-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(108,219,42,0.55)) drop-shadow(0 0 18px rgba(108,219,42,0.25)); }
  50%      { filter: drop-shadow(0 0 10px rgba(108,219,42,0.7)) drop-shadow(0 0 26px rgba(108,219,42,0.4)); }
}

#hero-meta {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 800ms ease, visibility 0s;
  min-height: 90px;
}
#hero-meta.visible { opacity: 1; visibility: visible; }
#hero-meta.hidden  { display: flex !important; visibility: hidden; opacity: 0; }
.hidden { display: none !important; }

#tagline {
  color: var(--fg-mid);
  font-size: 13px;
  letter-spacing: 2px;
  text-align: center;
  line-height: 1.7;
}
#tagline .strike {
  color: var(--fg-faint);
  text-decoration: line-through;
  text-decoration-color: var(--warn);
}
#tagline .free {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(108,219,42,0.6), 0 0 12px rgba(108,219,42,0.25);
  font-weight: 600;
}

#button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

#enter-btn {
  font-family: inherit;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  letter-spacing: 2px;
  background: transparent;
  text-shadow: 0 0 6px rgba(108,219,42,0.55);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
  position: relative;
}
#enter-btn::before, #enter-btn::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border: 1px solid var(--accent);
}
#enter-btn::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
#enter-btn::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
#enter-btn:hover, #enter-btn:focus {
  background: var(--accent);
  color: #000;
  text-shadow: none;
  outline: none;
  box-shadow: 0 0 16px rgba(108,219,42,0.6);
}

#cursor {
  color: var(--accent);
  font-size: 16px;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

#social {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 20;
  color: var(--fg-mid);
  text-decoration: none;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 4px;
  transition: color 160ms ease, text-shadow 160ms ease;
}
#social .bracket { color: var(--fg-faint); }
#social .label { color: var(--fg-mid); }
#social .x {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 0 6px rgba(108,219,42,0.5);
}
#social:hover .bracket, #social:focus .bracket { color: var(--accent); }
#social:hover .label, #social:focus .label { color: var(--accent); }
#social:hover .x, #social:focus .x { text-shadow: 0 0 8px rgba(108,219,42,0.9), 0 0 16px rgba(108,219,42,0.45); }

/* DRIPPING TORCHES at sides — purely decorative */
.torch {
  position: fixed;
  bottom: 0;
  width: 6px;
  height: 30vh;
  background: linear-gradient(to top, transparent, rgba(243,199,75,0.0) 30%, rgba(243,199,75,0.18) 60%, rgba(243,199,75,0.0) 100%);
  pointer-events: none;
  z-index: 1;
  filter: blur(8px);
  animation: flicker 4.5s ease-in-out infinite;
}
.torch.left  { left: 12px; }
.torch.right { right: 12px; animation-delay: -2s; }
@keyframes flicker {
  0%, 100% { opacity: 0.7; }
  20%      { opacity: 0.4; }
  40%      { opacity: 0.85; }
  60%      { opacity: 0.5; }
  80%      { opacity: 0.75; }
}

/* LORE */
#lore {
  max-width: 620px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.terminal-block {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.75;
  color: var(--fg-mid);
  white-space: pre-wrap;
  margin: 0;
  word-break: break-word;
}

.terminal-block .head {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(108,219,42,0.4);
  letter-spacing: 1px;
}
.terminal-block .quote {
  color: var(--fg-bright);
  background: linear-gradient(90deg, rgba(108,219,42,0.07), rgba(108,219,42,0.02));
  border-left: 3px solid var(--accent);
  display: block;
  padding: 14px 16px;
  margin: 8px 0;
  position: relative;
}
.terminal-block .quote::before {
  content: "▾ leaked rule ▾";
  display: block;
  font-size: 9px;
  color: var(--eye);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
  opacity: 0.7;
}
.terminal-block .src {
  color: var(--fg-faint);
  font-size: 11px;
}
.terminal-block s { color: var(--fg-faint); }
.lore-link {
  color: var(--accent);
  text-decoration: none;
  transition: text-shadow 120ms ease, color 120ms ease;
  border-bottom: 1px dotted var(--moss);
}
.lore-link:hover {
  text-shadow: 0 0 6px rgba(108,219,42,0.7);
  color: var(--eye);
  border-bottom-color: var(--eye);
}

.crud-divider {
  text-align: center;
  color: var(--fg-faint);
  font-size: 14px;
  margin: 18px 0;
  letter-spacing: 6px;
  user-select: none;
}

/* CA box */
.ca-block {
  margin: 28px auto 0;
  max-width: 620px;
  border: 1px dashed var(--accent);
  background: rgba(108, 219, 42, 0.04);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--fg-mid);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
  position: relative;
}
.ca-block::before {
  content: "▼";
  color: var(--eye);
  position: absolute;
  top: 10px; right: 14px;
  font-size: 10px;
}
.ca-block:hover {
  background: rgba(108, 219, 42, 0.10);
  border-color: var(--eye);
}
.ca-block .lbl {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 4px rgba(108,219,42,0.4);
}
.ca-block .ca-val {
  color: var(--fg-bright);
  word-break: break-all;
  display: block;
  margin-top: 6px;
  font-size: 11px;
}
.ca-block .hint {
  color: var(--fg-faint);
  font-size: 10px;
  margin-top: 4px;
  display: block;
  letter-spacing: 1px;
}

@media (max-width: 640px) {
  #header { font-size: 12px; left: 12px; top: 14px; }
  #social { top: 14px; right: 12px; font-size: 10px; letter-spacing: 1.5px; }
  #social .x { font-size: 12px; }
  #screen { padding: 20px 12px; }
  #tagline { font-size: 11px; letter-spacing: 1px; }
  #enter-btn { font-size: 13px; padding: 11px 18px; letter-spacing: 1.5px; }
  #lore { padding: 30px 16px 70px; }
  .terminal-block { font-size: 12px; }
  .torch { width: 4px; }
}
