/* ============================================================================
   CYMATIX LANDING — main.css
   Dark, minimal, cymatics-inspired. Sound creates form.
   ============================================================================ */

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--text);
}

/* ========== VARIABLES ========== */
:root {
  /* Core palette — deep space / Cymatix purple */
  --bg: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;

  --text: #e2e8f0;
  --text-secondary: #8890a0;
  --text-muted: #555c6c;
  --text-accent: #c4b5fd;

  --accent: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --accent-bright: #a78bfa;
  --accent-gradient-start: #8b5cf6;
  --accent-gradient-end: #6366f1;

  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Spacing */
  --section-padding: 7rem 0;
  --container-width: 72rem;
  --container-padding: 0 2rem;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== LAYOUT ========== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ========== SECTION HEADERS ========== */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-desc {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ========== HERO ========== */
.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 canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 48rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-accent);
  border: 1px solid var(--border-light);
  padding: 0.4rem 1.2rem;
  border-radius: 2rem;
  margin-bottom: 2rem;
  background: var(--accent-glow);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-subtitle em {
  font-family: var(--font-serif);
  color: var(--text-accent);
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.hero-scroll-indicator span {
  display: block;
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scroll-fade 2s ease-in-out infinite;
}

@keyframes scroll-fade {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.6);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(1);
  }
}

/* ========== PRODUCTS ========== */
.products {
  padding: var(--section-padding);
  background: var(--bg);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.product-card-accent {
  width: 3rem;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.product-card h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.product-domain {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  margin-bottom: 1rem;
}

.product-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: auto;
  padding-bottom: 1.5rem;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--product-color, var(--accent));
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
  align-self: flex-start;
}

.product-link:hover {
  opacity: 0.85;
}

.product-link svg {
  flex-shrink: 0;
}

/* ========== PHILOSOPHY ========== */
.philosophy {
  padding: var(--section-padding);
  background: var(--bg-surface);
}

.philosophy-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.philosophy-lead {
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.philosophy-lead em {
  font-family: var(--font-serif);
  color: var(--text-accent);
  font-style: italic;
}

.philosophy-points {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.philosophy-point h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.philosophy-point p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.philosophy-point p em {
  font-family: var(--font-serif);
  color: var(--text-accent);
  font-style: italic;
}

/* Lambda diagram */
.philosophy-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lambda-diagram {
  text-align: center;
  font-family: var(--font-serif);
  color: var(--text-accent);
  position: relative;
  padding: 3rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-card);
}

.lambda-apex {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.lambda-arms {
  display: flex;
  justify-content: center;
  gap: 6rem;
  margin-bottom: 2rem;
}

.lambda-left,
.lambda-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lambda-left span,
.lambda-right span {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.7;
  transition: opacity 0.3s var(--ease);
}

.lambda-diagram:hover .lambda-left span,
.lambda-diagram:hover .lambda-right span {
  opacity: 1;
}

.lambda-left span:nth-child(1) {
  padding-right: 1.5rem;
}
.lambda-left span:nth-child(2) {
  padding-right: 3rem;
}
.lambda-left span:nth-child(3) {
  padding-right: 4.5rem;
}

.lambda-right span:nth-child(1) {
  padding-left: 1.5rem;
}
.lambda-right span:nth-child(2) {
  padding-left: 3rem;
}
.lambda-right span:nth-child(3) {
  padding-left: 4.5rem;
}

.lambda-caption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 20rem;
  margin: 0 auto;
}

/* ========== LINEAGE / TIMELINE ========== */
.lineage {
  padding: var(--section-padding);
  background: var(--bg);
}

.timeline {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 10%,
    var(--accent) 90%,
    transparent
  );
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  padding: 0 0 3rem 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -0.25rem;
  top: 0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  transition: opacity 0.3s var(--ease);
}

.timeline-item:hover::before {
  opacity: 1;
  box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.timeline-body h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.timeline-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.timeline-body p em {
  font-family: var(--font-serif);
  color: var(--text-accent);
}

/* ========== ENGINEERING ========== */
.engineering {
  padding: var(--section-padding);
  background: var(--bg-surface);
}

.engineering-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.engineering-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-card);
  transition: all 0.3s var(--ease);
}

.engineering-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.engineering-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
}

.engineering-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.engineering-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ========== PORTAL CTA ========== */
.portal {
  padding: var(--section-padding);
  background: var(--bg-surface);
}

.portal-inner {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
  padding: 3rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 1rem;
  background: rgba(139, 92, 246, 0.05);
}

.portal-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.portal-inner h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.portal-inner p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.portal-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.5rem;
  transition:
    opacity 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.portal-cta:hover {
  opacity: 0.9;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.portal-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition:
    color 0.15s,
    text-decoration-color 0.15s;
}

.portal-link:hover {
  color: var(--text);
  text-decoration-color: var(--text-muted);
}

/* ========== FOOTER ========== */
.footer {
  padding: 4rem 0 2rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

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

.footer-links {
  display: flex;
  gap: 4rem;
}

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

.footer-column h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

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

.build-stamp {
  display: block;
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 0.5rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 0;
    --container-padding: 0 1.25rem;
  }

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

  .philosophy-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .lambda-arms {
    gap: 4rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    gap: 3rem;
  }

  .hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 16rem;
  }

  .lambda-arms {
    gap: 3rem;
  }

  .lambda-left span:nth-child(1) {
    padding-right: 0.75rem;
  }
  .lambda-left span:nth-child(2) {
    padding-right: 1.5rem;
  }
  .lambda-left span:nth-child(3) {
    padding-right: 2.25rem;
  }
  .lambda-right span:nth-child(1) {
    padding-left: 0.75rem;
  }
  .lambda-right span:nth-child(2) {
    padding-left: 1.5rem;
  }
  .lambda-right span:nth-child(3) {
    padding-left: 2.25rem;
  }
}
