/* ===== Custom Properties ===== */
:root {
  --bg-deep: #0A0E17;
  --bg-dark: #0F1923;
  --surface: #141C2B;
  --accent: #E07A2F;
  --accent-glow: rgba(224, 122, 47, 0.15);
  --text-primary: #E2E8F0;
  --text-muted: #64748B;
  --border: #1E293B;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ===== Single Page Layout ===== */
.page {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-dark) 100%);
  overflow: hidden;
}

.bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 640px;
}

/* ===== Logo ===== */
.logo {
  width: min(220px, 50vw);
  height: auto;
  opacity: 0;
  animation: fade-in 1s ease-out 0.1s forwards;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* ===== Terminal Card ===== */
.terminal-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px);
  animation: card-appear 0.8s ease-out 0.3s forwards;
}

@keyframes card-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===== Terminal ===== */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.terminal-dot.pulse {
  animation: none;
}

.terminal-dot.active {
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0% { opacity: 0.5; transform: scale(1); }
  8% { opacity: 1; transform: scale(1.35); }
  18% { opacity: 0.4; transform: scale(0.95); }
  28% { opacity: 1; transform: scale(1.2); }
  38% { opacity: 0.5; transform: scale(1); }
  52% { opacity: 0.9; transform: scale(1.3); }
  60% { opacity: 0.45; transform: scale(0.9); }
  72% { opacity: 0.85; transform: scale(1.15); }
  82% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0.5; transform: scale(1); }
}

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.terminal-line {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  line-height: 1.8;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.terminal-line[data-copy] {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.terminal-line[data-copy]:hover {
  background: rgba(226, 232, 240, 0.05);
}

.terminal-line.copied {
  background: rgba(40, 200, 64, 0.08);
}

.terminal-prompt {
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}

.terminal-output {
  color: inherit;
}

.terminal-cursor {
  display: none;
  width: 0.6em;
  height: 1.15em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  flex-shrink: 0;
  animation: blink 1s step-end infinite;
}

.terminal-cursor.active {
  display: inline-block;
}

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

/* ===== Copy Icon ===== */
.copy-icon {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.terminal-line[data-copy]:hover .copy-icon {
  opacity: 1;
}

.terminal-line.copied .copy-icon {
  color: #28c840;
  opacity: 1;
}

/* ===== Footer ===== */
.footer {
  padding-top: 1rem;
  text-align: center;
  width: 100%;
  opacity: 0;
  animation: fade-in 1s ease-out 1.2s forwards;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner.dismissed {
  transform: translateY(100%);
}

.cookie-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
}

.cookie-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-btn--accept {
  background: var(--accent);
  color: var(--bg-deep);
}

.cookie-btn--accept:hover {
  background: #f08a3f;
  transform: translateY(-1px);
}

.cookie-btn--decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cookie-btn--decline:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

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

  .logo,
  .terminal-card,
  .footer {
    opacity: 1;
    transform: none;
  }

  .cookie-banner {
    transition: none;
  }

  .cookie-banner.visible {
    transform: translateY(0);
  }

  .copy-icon {
    opacity: 1;
  }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .terminal-line {
    white-space: normal;
    word-break: break-all;
  }

  .copy-icon {
    opacity: 1;
  }

  .cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem;
  }

  .terminal-body {
    padding: 1.25rem;
  }
}
