/* ========================================
   metacosm.ai — Shared Styles
   ======================================== */

/* ---- Font Faces ---- */
@font-face {
  font-family: 'ChollaUnicaseWide';
  src: url('ChollaUnicaseWide.woff2') format('woff2'),
       url('ChollaUnicaseWide.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---- CSS Custom Properties ---- */
:root {
  --bg-deep: #060b10;
  --bg-surface: #0c1219;
  --bg-surface-alt: #111923;
  --border: #1a2535;
  --text-primary: #e2e8f0;
  --text-muted: #7a8ba3;
  --accent-green: #00e5a0;
  --accent-cyan: #00d4ff;
  --gradient: linear-gradient(135deg, #00e5a0, #00d4ff);
  --font-brand: 'ChollaUnicaseWide', 'Courier New', monospace;
  --font-body: Inter, system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --section-padding: 8rem 2rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---- Utility Classes ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-green);
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  background: rgba(6, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-brand);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.logo .dot-ai {
  color: var(--accent-green);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s ease-in-out;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--gradient);
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.btn-secondary:hover {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(0, 229, 160, 0.08);
}

/* ---- Mobile Menu Toggle ---- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Page Hero (sub-pages) ---- */
.page-hero {
  padding: 10rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0, 229, 160, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.page-hero .lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
}

/* ---- CTA Section (shared) ---- */
.cta-section {
  padding: var(--section-padding);
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(0, 229, 160, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cta-inner {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.cta-section h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.cta-section .subtext {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.cta-form {
  display: flex;
  gap: 0.75rem;
  max-width: 460px;
  margin: 0 auto;
}

.cta-form input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s ease-in-out;
}

.cta-form input::placeholder {
  color: var(--text-muted);
}

.cta-form input:focus {
  border-color: var(--accent-green);
}

/* ---- Footer ---- */
.footer {
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-tagline {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

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

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

.footer-copyright {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ---- Scan Line ---- */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.scan-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent-green), transparent);
  animation: scanSweep 3s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes scanSweep {
  0%, 100% { left: -2px; }
  50% { left: 100%; }
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root {
    --section-padding: 5rem 1.5rem;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 2rem;
    transition: right 0.3s ease-in-out;
    z-index: 99;
  }

  .nav.open {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .page-hero {
    padding: 8rem 1.5rem 3rem;
  }

  .cta-form {
    flex-direction: column;
  }

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

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  .scan-line::after {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
