/* ============================================
   PHOBOS ALPHA — Design System & Styles
   Bone & Saucer Team — 2026
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --ember: hsl(24, 90%, 52%);         /* #E8722A */
  --flame: hsl(32, 95%, 55%);         /* #F5A623 */
  --gold: hsl(42, 90%, 58%);          /* #E8B732 */
  --brick: hsl(8, 65%, 45%);          /* Alerts only */

  /* Surfaces */
  --surface-base: #0A0A0A;
  --surface-raised: #121212;
  --surface-overlay: #1a1a1a;
  --surface-border: #1f1c18;

  /* Text */
  --text-primary: #e6e3de;
  --text-secondary: #808080;
  --text-muted: #555555;

  /* Ember glow effects */
  --glow-ember: 0 0 30px rgba(232, 114, 42, 0.15);
  --glow-ember-strong: 0 0 60px rgba(232, 114, 42, 0.25);
  --glow-flame: 0 0 30px rgba(245, 166, 35, 0.12);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Container */
  --container-max: 1200px;
  --container-padding: clamp(16px, 4vw, 48px);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-base);
  overflow-x: hidden;
}

a {
  color: var(--ember);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
a:hover {
  color: var(--flame);
}

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

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  position: relative;
}

/* --- Greek Key Meander Border --- */
.greek-key {
  height: 12px;
  width: 100%;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 4px,
      rgba(232, 183, 50, 0.12) 4px,
      rgba(232, 183, 50, 0.12) 8px,
      transparent 8px,
      transparent 12px,
      rgba(232, 114, 42, 0.1) 12px,
      rgba(232, 114, 42, 0.1) 16px,
      transparent 16px,
      transparent 24px,
      rgba(232, 183, 50, 0.08) 24px,
      rgba(232, 183, 50, 0.08) 28px,
      transparent 28px,
      transparent 32px
    );
  position: relative;
}

.greek-key::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 114, 42, 0.2), rgba(232, 183, 50, 0.15), rgba(232, 114, 42, 0.2), transparent);
}

.greek-key--top {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.greek-key--bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
}

.greek-key--section {
  margin: var(--space-lg) 0;
}

/* --- Bronze Medallion --- */
.medallion {
  position: absolute;
  pointer-events: none;
  opacity: 0.6;
  animation: medallion-rotate 60s linear infinite;
}

.medallion--hero {
  bottom: 60px;
  right: 40px;
  width: 80px;
  height: 80px;
}

.medallion--stats {
  top: -20px;
  right: 60px;
  width: 100px;
  height: 100px;
}

@keyframes medallion-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Ember Particles --- */
#ember-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.ember-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(232, 114, 42, 0.06) 0%, transparent 60%);
  z-index: 1;
}

.hero__polygons {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-2xl) var(--container-padding);
  max-width: 800px;
}

.hero__logo {
  margin: 0 auto var(--space-xl);
  max-width: 500px;
}

.logo-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(232, 114, 42, 0.2));
}

.hero__subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 1.2vw, 1.125rem);
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-bottom: var(--space-2xl);
  text-transform: uppercase;
}

.hero__cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--ember), var(--flame));
  color: #0A0A0A;
  box-shadow: 0 4px 20px rgba(232, 114, 42, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232, 114, 42, 0.45);
  color: #0A0A0A;
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(232, 114, 42, 0.3);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(232, 114, 42, 0.3);
}

.btn--secondary:hover {
  background: rgba(232, 114, 42, 0.08);
  border-color: rgba(232, 114, 42, 0.5);
  transform: translateY(-2px);
  color: var(--text-primary);
}

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

.btn__icon {
  flex-shrink: 0;
}

/* ============================================
   SECTIONS (shared)
   ============================================ */
.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: var(--space-md);
  padding: 6px 16px;
  border: 1px solid rgba(232, 114, 42, 0.2);
  border-radius: 4px;
  background: rgba(232, 114, 42, 0.05);
}

.section__title {
  font-family: var(--font-body);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.section__desc {
  font-size: clamp(0.9375rem, 1.1vw, 1.0625rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products {
  background: var(--surface-base);
}

.products__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--ember);
  border-radius: 8px;
  padding: var(--space-xl);
  position: relative;
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
  cursor: default;
}

.product-card:hover {
  box-shadow: var(--glow-ember);
  border-color: rgba(232, 114, 42, 0.25);
  transform: translateY(-2px);
}

.product-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
}

.product-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.product-card__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.product-card__status {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ember);
  padding: 3px 10px;
  border: 1px solid rgba(232, 114, 42, 0.2);
  border-radius: 3px;
  background: rgba(232, 114, 42, 0.06);
}

.product-card__status--live {
  color: var(--gold);
  border-color: rgba(232, 183, 50, 0.25);
  background: rgba(232, 183, 50, 0.06);
}

.product-card__status--dev {
  color: var(--text-secondary);
  border-color: rgba(128, 128, 128, 0.2);
  background: rgba(128, 128, 128, 0.05);
}

/* ============================================
   FEATURES / WAR TABLE
   ============================================ */
.features {
  background: linear-gradient(180deg, var(--surface-base) 0%, #0d0c0b 100%);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  padding: var(--space-xl);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.6);
  border: 1px solid var(--surface-border);
  transition: box-shadow var(--transition-interactive),
              border-color var(--transition-interactive);
}

.feature-card:hover {
  border-color: rgba(232, 114, 42, 0.15);
  box-shadow: 0 0 20px rgba(232, 114, 42, 0.08);
}

.feature-card__icon {
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-md);
}

.feature-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.feature-card__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats {
  background: var(--surface-raised);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  overflow: hidden;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
  padding: var(--space-xl) 0;
}

.stat-card__number {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--ember);
  line-height: 1.1;
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 30px rgba(232, 114, 42, 0.3);
}

.stat-card__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: var(--space-2xl) 0;
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border);
}

.footer__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer__logo {
  width: 180px;
  height: auto;
  margin-bottom: var(--space-sm);
}

.footer__copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer__links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color var(--transition-interactive);
}

.footer__links a:hover {
  color: var(--ember);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children .fade-in-up:nth-child(1) { transition-delay: 0ms; }
.stagger-children .fade-in-up:nth-child(2) { transition-delay: 60ms; }
.stagger-children .fade-in-up:nth-child(3) { transition-delay: 120ms; }
.stagger-children .fade-in-up:nth-child(4) { transition-delay: 180ms; }
.stagger-children .fade-in-up:nth-child(5) { transition-delay: 240ms; }
.stagger-children .fade-in-up:nth-child(6) { transition-delay: 300ms; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .products__grid {
    grid-template-columns: 1fr;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }

  .hero__cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .medallion--hero,
  .medallion--stats {
    display: none;
  }

  .hero__logo {
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .stats__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .section {
    padding: var(--space-3xl) 0;
  }
}

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

  .ember-particle {
    display: none !important;
  }

  .medallion {
    animation: none;
  }

  .fade-in-up {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   FOCUS STYLES (Accessibility)
   ============================================ */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* --- Selection --- */
::selection {
  background: rgba(232, 114, 42, 0.3);
  color: var(--text-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface-base);
}
::-webkit-scrollbar-thumb {
  background: #2a2520;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3530;
}
