/* ============================================
   EternalMonitor — Marketing Site Styles
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg: #080808;
  --surface: #111111;
  --border: rgba(255, 255, 255, 0.06);
  --accent: #e8ff47;
  --accent-rgb: 232, 255, 71;
  --green: #1d9e75;
  --green-rgb: 29, 158, 117;
  --text: #f0f0f0;
  --muted: #888888;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --grid-size: 48px;
  --nav-height: 64px;
  --max-width: 1120px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(var(--accent-rgb), 0.25);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

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

/* --- Grid Texture Background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 0;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
}

p {
  line-height: 1.7;
}

.text-muted {
  color: var(--muted);
}

.text-mono {
  font-family: var(--font-mono);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(8, 8, 8, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link svg {
  width: 18px;
  height: 18px;
}

/* --- Logo Mark (3 bars) --- */
.logo-mark {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 22px;
  flex-shrink: 0;
}

.logo-mark span {
  display: block;
  height: 4px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: translateY(0);
}

/* --- Components --- */

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: border-color 0.25s ease;
}

.card:hover {
  border-color: rgba(var(--accent-rgb), 0.12);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-radius: 100px;
  font-weight: 400;
}

.badge-green {
  background: rgba(var(--green-rgb), 0.12);
  color: var(--green);
  border: 1px solid rgba(var(--green-rgb), 0.2);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
}

.hero-content {
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.1s;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}

.hero h1 {
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.2s;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  margin-bottom: 40px;
  line-height: 1.7;
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.3s;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.4s;
  flex-wrap: wrap;
}

.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.5s;
}

.trust-signal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.trust-signal::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.4);
}

/* --- Stats Bar --- */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  background: rgba(255, 255, 255, 0.01);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* --- How It Works --- */
.how-it-works {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: border-color 0.25s ease;
}

.step:hover {
  border-color: rgba(var(--accent-rgb), 0.12);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.step h3 {
  margin-bottom: 8px;
}

.step p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* --- Requirements --- */
.requirements {
  padding: 0 0 100px;
}

.requirements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.req-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
}

.req-card h3 {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.req-card h3 svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.req-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.req-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.req-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 8px;
}

/* --- Limitations Banner --- */
.limitations {
  padding: 0 0 100px;
}

.limitations-card {
  background: rgba(var(--accent-rgb), 0.03);
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.limitations-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 100px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  white-space: nowrap;
}

.limitations-card p {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
  min-width: 200px;
}

/* --- Roadmap --- */
.roadmap {
  padding: 0 0 100px;
}

.roadmap-track {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.milestone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.milestone-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.milestone-version {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  white-space: nowrap;
}

.milestone-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.milestone--done {
  border-color: rgba(var(--green-rgb), 0.2);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-brand .logo-mark {
  width: 16px;
}

.footer-brand .logo-mark span {
  height: 3px;
  gap: 2px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text);
}

/* --- Download Page --- */
.download-hero {
  padding: calc(var(--nav-height) + 80px) 0 60px;
  text-align: center;
}

.download-hero h1 {
  margin-bottom: 12px;
}

.download-hero p {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-bottom: 80px;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px;
}

.download-card--primary {
  border-color: rgba(var(--accent-rgb), 0.2);
}

.download-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.download-card-header svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.download-card-header h2 {
  font-size: 1.35rem;
}

.download-card > p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.download-requirements {
  margin-bottom: 24px;
}

.download-btn-wrap {
  margin-bottom: 20px;
}

.download-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
}

.sha256 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow-x: auto;
}

.sha256-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sha256 code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  word-break: break-all;
}

.download-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

/* Build from source */
.build-section {
  padding-bottom: 100px;
}

.build-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.build-details summary {
  padding: 20px 28px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}

.build-details summary::-webkit-details-marker {
  display: none;
}

.build-details summary::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.build-details[open] summary::before {
  transform: rotate(90deg);
}

.build-details summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.build-content {
  padding: 0 28px 28px;
  border-top: 1px solid var(--border);
}

.build-content h3 {
  margin: 24px 0 12px;
  font-size: 1rem;
}

.build-content .build-reqs {
  list-style: none;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.build-content .build-reqs li {
  font-size: 0.88rem;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
}

.build-content .build-reqs li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.build-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.build-content pre code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.8;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within a revealed section */
.reveal .step:nth-child(1),
.reveal .milestone:nth-child(1),
.reveal .req-card:nth-child(1) { transition-delay: 0s; }
.reveal .step:nth-child(2),
.reveal .milestone:nth-child(2),
.reveal .req-card:nth-child(2) { transition-delay: 0.08s; }
.reveal .step:nth-child(3),
.reveal .milestone:nth-child(3) { transition-delay: 0.16s; }
.reveal .milestone:nth-child(4) { transition-delay: 0.24s; }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --- Responsive: Tablet (768px) --- */
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .requirements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .roadmap-track {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Responsive: Desktop (1024px) --- */
@media (min-width: 1024px) {
  .container {
    padding: 0 40px;
  }

  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .roadmap-track {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero {
    padding-top: calc(var(--nav-height) + 80px);
    padding-bottom: 120px;
  }

  .how-it-works {
    padding: 120px 0;
  }
}
