/* ============================================================
   Cumpleaños de Carlos Colin — Tema "Code Editor Dark"
   ============================================================ */
:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-card: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --green: #3fb950;
  --neon: #00ff9d;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --orange: #ffa657;
  --pink: #ff7b72;
  --yellow: #e3b341;
  --radius: 14px;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

/* ---------- Fondos ---------- */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.14;
  pointer-events: none;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(88, 166, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

/* ---------- Barra de editor ---------- */
.editor-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.editor-dots { display: flex; gap: 7px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.editor-title {
  flex: 1;
  text-align: center;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-status { display: flex; gap: 14px; color: var(--text-dim); white-space: nowrap; }
.branch { color: var(--purple); }
.status-ok { color: var(--green); }

main { position: relative; z-index: 1; }

/* ---------- Sintaxis ---------- */
.keyword { color: var(--pink); }
.var-name { color: var(--blue); }
.operator { color: var(--text); }
.string { color: var(--green); }
.prop { color: var(--purple); }
.number { color: var(--orange); }
.constant { color: var(--orange); font-style: italic; }
.func { color: var(--yellow); }
.comment { color: var(--text-dim); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 20px 40px;
}

.hero-content {
  max-width: 780px;
  width: 100%;
  text-align: center;
}

.hero-tag {
  color: var(--text-dim);
  font-size: clamp(13px, 2vw, 16px);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(18px, 3.4vw, 28px);
  font-weight: 500;
  margin-bottom: 8px;
}

.hero-name {
  font-size: clamp(44px, 9vw, 92px);
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 36px;
  font-family: var(--sans);
}

.gradient-text {
  background: linear-gradient(120deg, var(--neon), var(--blue) 50%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(0, 255, 157, 0.25));
}

.cursor-blink {
  color: var(--neon);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Terminal ---------- */
.terminal {
  text-align: left;
  background: rgba(22, 27, 34, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 255, 157, 0.06);
  margin: 0 auto 40px;
  max-width: 640px;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.terminal-title { font-size: 12px; color: var(--text-dim); }

.terminal-body {
  padding: 18px;
  font-size: clamp(12.5px, 1.7vw, 14.5px);
  min-height: 200px;
}

.prompt { color: var(--neon); font-weight: 700; }
.terminal-cursor { color: var(--neon); animation: blink 0.9s steps(1) infinite; }

#terminal-output .out-line { color: var(--text-dim); animation: fadeInUp 0.35s ease both; }
#terminal-output .out-line.ok { color: var(--green); }
#terminal-output .out-line.hl { color: var(--yellow); }

/* ---------- Scroll hint ---------- */
.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12.5px;
  transition: color 0.25s;
}
.scroll-hint:hover { color: var(--neon); }
.scroll-hint .arrow { animation: bounce 1.6s ease infinite; font-size: 18px; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

/* ---------- Secciones ---------- */
section { padding: 70px 20px; max-width: 900px; margin: 0 auto; }

.section-title {
  font-size: clamp(17px, 2.8vw, 24px);
  font-weight: 500;
  margin-bottom: 26px;
}

.line-num {
  color: var(--text-dim);
  opacity: 0.55;
  margin-right: 10px;
  font-size: 0.85em;
}

.section-comment {
  color: var(--text-dim);
  margin-bottom: 22px;
  font-size: clamp(13px, 2vw, 15px);
}

/* ---------- Countdown ---------- */
.countdown-section { text-align: center; }

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vw, 16px);
  flex-wrap: wrap;
}

.count-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 24px) clamp(16px, 3.5vw, 30px);
  min-width: clamp(72px, 15vw, 110px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s, border-color 0.25s;
}

.count-card:hover { transform: translateY(-4px); border-color: var(--neon); }

.count-num {
  display: block;
  font-size: clamp(30px, 6.5vw, 54px);
  font-weight: 800;
  color: var(--neon);
  text-shadow: 0 0 22px rgba(0, 255, 157, 0.35);
  font-variant-numeric: tabular-nums;
}

.count-label {
  font-size: clamp(10px, 1.6vw, 12.5px);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.count-sep {
  font-size: clamp(24px, 5vw, 44px);
  color: var(--text-dim);
  font-weight: 300;
}

.countdown-live { margin-top: 24px; color: var(--yellow); font-size: 14px; }

/* ---------- Code block ---------- */
.code-block {
  display: flex;
  background: rgba(22, 27, 34, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 42px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}

.code-gutter {
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  opacity: 0.5;
  text-align: right;
  user-select: none;
  font-size: clamp(12px, 1.7vw, 14px);
  line-height: 1.75;
}

.code-content {
  padding: 20px 22px;
  font-size: clamp(12px, 1.7vw, 14px);
  line-height: 1.75;
  white-space: pre;
}

/* ---------- Detail cards ---------- */
.detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.detail-card:hover {
  transform: translateY(-6px);
  border-color: var(--blue);
  box-shadow: 0 18px 44px rgba(88, 166, 255, 0.12);
}

.detail-icon { font-size: 34px; margin-bottom: 10px; }
.detail-card h4 { color: var(--blue); font-size: 15px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; }
.detail-card p { font-size: 15px; margin-bottom: 12px; }
.detail-card strong { color: var(--neon); }

.detail-code {
  display: inline-block;
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
}

/* ---------- Mapa ---------- */
.map-button {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(0, 255, 157, 0.08), rgba(88, 166, 255, 0.08));
  border: 1px solid var(--neon);
  border-radius: var(--radius);
  padding: 22px 26px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 0 0 rgba(0, 255, 157, 0);
}

.map-button:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 50px rgba(0, 255, 157, 0.22);
}

.map-icon { font-size: 34px; }
.map-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.map-text strong { color: var(--neon); font-size: clamp(15px, 2.4vw, 18px); }
.map-text small { color: var(--text-dim); font-size: clamp(11px, 1.8vw, 13px); word-break: break-all; }
.map-arrow { font-size: 26px; color: var(--neon); transition: transform 0.25s; }
.map-button:hover .map-arrow { transform: translateX(6px); }

/* ---------- RSVP ---------- */
.rsvp-text { margin-bottom: 26px; font-size: clamp(14px, 2.2vw, 16px); color: var(--text-dim); }
.highlight { color: var(--neon); font-weight: 700; }
.strike { text-decoration: line-through; opacity: 0.6; }

.rsvp-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono);
  font-size: clamp(12.5px, 2vw, 14.5px);
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(120deg, var(--neon), #2ea043);
  color: #04140b;
  box-shadow: 0 10px 30px rgba(0, 255, 157, 0.25);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0, 255, 157, 0.35); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); transform: translateY(-3px); }

.rsvp-response { margin-top: 22px; min-height: 26px; color: var(--green); font-size: 14.5px; }
.closing-brace { margin-top: 30px; font-size: clamp(17px, 2.8vw, 24px); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 44px 20px 56px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.footer-exit { margin-top: 10px; color: var(--text-dim); }

/* ---------- Animaciones de aparición ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .editor-status { display: none; }
  .editor-title { text-align: right; }
  section { padding: 52px 16px; }
  .terminal-body { min-height: 180px; padding: 14px; }
  .rsvp-buttons { flex-direction: column; }
  .btn { width: 100%; }
  .map-button { padding: 18px 18px; gap: 12px; }
}

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