/* ============================================================
   Gramma Robotics — Landing Page Styles
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-light: rgba(20, 184, 166, 0.15);
  --accent-glow: rgba(20, 184, 166, 0.35);
  --line: #cbd5e1;
  --border: #e2e8f0;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --anim-duration: 12s;
}

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

html {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  width: 100%;
  max-width: 100vw;
}

/* --- Header --- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.contact-link {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.contact-link:hover {
  color: var(--accent);
  background-color: var(--accent-light);
}

/* --- Hero --- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

/* --- Animation Container --- */
.animation-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(85vw, 750px);
  height: auto;
  z-index: 1;
  opacity: 0;
  animation: fade-in 1.5s ease-out 0.2s forwards;
  overflow: hidden;
}

@keyframes fade-in {
  to { opacity: 1; }
}

.facility-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: hidden;
}

/* --- Corridor Lines --- */
.corridors line {
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* --- Room Nodes --- */
.nodes circle {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1.5;
}

.node-centers circle {
  fill: var(--line);
}

/* --- Pulse Rings --- */
.pulse-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
  animation: node-pulse var(--anim-duration) ease-out infinite;
}

@keyframes node-pulse {
  0%    { transform: scale(1); opacity: 0.6; }
  7%    { transform: scale(3.5); opacity: 0; }
  7.01%, 100% { transform: scale(1); opacity: 0; }
}

/* Each pulse fires when the robot arrives at that node.
   Negative delays shift the animation so the pulse 
   aligns with the robot's position in the 12s cycle. */
.pulse-n1 { animation-delay: calc(var(--anim-duration) * -1); }
.pulse-n2 { animation-delay: calc(var(--anim-duration) * -6 / 7); }
.pulse-n3 { animation-delay: calc(var(--anim-duration) * -5 / 7); }
.pulse-n4 { animation-delay: calc(var(--anim-duration) * -4 / 7); }
.pulse-n5 { animation-delay: calc(var(--anim-duration) * -3 / 7); }
.pulse-n6 { animation-delay: calc(var(--anim-duration) * -2 / 7); }
.pulse-n7 { animation-delay: calc(var(--anim-duration) * -1 / 7); }

/* --- Robot Dot --- */
.robot-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

/* --- Hero Content --- */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  /* Soft radial glow behind text for readability over animation */
  background: radial-gradient(ellipse at center, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.85) 40%, 
    rgba(255, 255, 255, 0) 70%);
  padding: 3rem 5rem;
  border-radius: 999px;
  max-width: 90vw;
}

.company-name {
  font-size: clamp(1.65rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  white-space: nowrap;
}

.tagline {
  margin-top: 0.75rem;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
}

.descriptor {
  margin-top: 0.4rem;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

.cta-button {
  margin-top: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.cta-button:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-light);
  transform: translateY(-1px);
}

.cta-button:active {
  transform: translateY(0);
}

/* --- Footer --- */
.site-footer {
  padding: 1rem 2rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

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

/* --- Contact Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: var(--bg);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  transform: scale(1);
  transition: transform 0.25s ease;
}

.modal-overlay.hidden .modal-card {
  transform: scale(0.95);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.modal-email {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.modal-email:hover {
  background: var(--accent);
  color: #ffffff;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .pulse-ring {
    animation: none;
  }

  .animation-container {
    animation: none;
    opacity: 0.6;
  }

  .cta-button {
    transition: none;
  }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .site-header {
    padding: 1rem 1.25rem;
  }

  .logo-text {
    font-size: 0.85rem;
  }

  .contact-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: 6px;
  }

  .hero-content {
    padding: 2rem 2rem;
    border-radius: 0;
    background: radial-gradient(ellipse at center,
      rgba(255, 255, 255, 0.97) 0%,
      rgba(255, 255, 255, 0.9) 50%,
      rgba(255, 255, 255, 0) 75%);
  }

  .animation-container {
    width: 95vw;
  }

  .cta-button {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }

  .modal-card {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  .site-footer {
    padding: 0.75rem 1.25rem;
  }
}
