/* Shared shell for every page on the site: design tokens, reset, animated
   background, and the terminal-window card chrome.
   Loaded before each page's own stylesheet, which adds page-specific rules and
   the card's dimensions (max-width and the body/footer padding are deliberately
   left out here — they differ per page). */

/* CSS Custom Properties */
:root {
  /* Colors */
  --bg-void: #050507;
  --bg-card: rgba(14, 15, 20, 0.72);
  --bg-chip: rgba(255, 255, 255, 0.04);
  --accent-cyan: #22d3ee;
  --accent-violet: #a855f7;
  --accent-lime: #4ade80;
  --text-primary: #f4f4f5;
  --text-secondary: #8b8b96;
  --text-dim: #56565f;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(34, 211, 238, 0.45);

  /* Typography */
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, 'JetBrains Mono', Menlo,
    Consolas, 'Liberation Mono', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto,
    'Helvetica Neue', Arial, sans-serif;

  /* Animation */
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-short: 220ms;

  /* Effects */
  --shadow-card: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  --radius: 14px;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Background */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  will-change: transform;
}

.blob--cyan {
  top: -22vmax;
  left: -14vmax;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 68%);
  animation: drift-a 22s var(--ease-smooth) infinite alternate;
}

.blob--violet {
  right: -20vmax;
  bottom: -24vmax;
  background: radial-gradient(circle, var(--accent-violet) 0%, transparent 68%);
  animation: drift-b 27s var(--ease-smooth) infinite alternate;
}

.grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(58deg);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 62%);
  animation: scroll-grid 14s linear infinite;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* Layout */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

/* Each page sets its own max-width. */
.card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: rise 700ms var(--ease-smooth) both;
}

/* Title bar */
.card__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}

.dot--red { background: #ff5f57; }
.dot--amber { background: #febc2e; }
.dot--green { background: #28c840; }

.card__path {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Footer — each page sets its own padding to match its body padding. */
.card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-lime);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

/* Footer link, pinned to the right edge */
.link {
  margin-left: auto;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--duration-short) var(--ease-smooth);
}

.link:hover { color: var(--accent-cyan); }

/* Animation Keyframes */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes shimmer {
  from { background-position: 0% center; }
  to { background-position: 200% center; }
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(14vmax, 8vmax, 0) scale(1.15); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to { transform: translate3d(-12vmax, -9vmax, 0) scale(1); }
}

@keyframes scroll-grid {
  from { background-position: 0 0; }
  to { background-position: 0 56px; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Accessibility - Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
