*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --bg-soft: #111;
  --text: #f5f5f5;
  --text-muted: #b0b0b0;
  --accent: #3b82f6;
  --border: rgba(255, 255, 255, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.9), transparent);
}

.logo-link {
  display: block;
}

.logo {
  height: 32px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Hero — full viewport: sphere spreads as you scroll, next section appears when fully spread */
.hero {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
}

#sphere-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#sphere-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0, 0, 0, 0.4), transparent 70%);
}

.hero-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  margin-top: -2.5rem;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-headline-inner {
  display: inline-block;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-headline-inner.hero-headline--fade {
  opacity: 0;
  transform: translateY(6px);
}

.hero-headline-word {
  color: #60a5fa;
  text-shadow: 0 0 40px rgba(96, 165, 250, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
  .hero-headline {
    line-height: 1.08;
  }
}

.hero-tagline {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  margin-top: -0.75rem;
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cta {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
}

.cta:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

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

/* Sections wrapper with particle background */
.sections-with-bg {
  position: relative;
}

#particle-bg-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}

#particle-bg-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Sections */
.products,
.about,
.contact {
  position: relative;
  z-index: 5;
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.products h2,
.about h2,
.contact h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

/* Neural Logic Graph */
.logic-graph-wrap {
  margin-top: 2.5rem;
  width: 100%;
  min-height: 420px;
}

.logic-graph {
  width: 100%;
  height: auto;
  display: block;
}

/* Dot-line edges: round dots along path + subtle flow */
.graph-edge {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 3 10;
  filter: url(#graph-glow);
  animation: graph-edge-flow 8s linear infinite;
}

@keyframes graph-edge-flow {
  to { stroke-dashoffset: -13; }
}

.graph-node-box {
  fill: rgba(15, 15, 15, 0.9);
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  filter: url(#graph-glow);
  transition: stroke 0.25s ease, fill 0.25s ease;
}

.graph-node:hover .graph-node-box {
  stroke: rgba(255, 255, 255, 0.5);
  fill: rgba(22, 22, 22, 0.95);
}

.graph-node-title {
  fill: #fafafa;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-anchor: middle;
  pointer-events: none;
}

.graph-node-sub {
  fill: var(--text-muted);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 11px;
  text-anchor: middle;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.graph-node--center .graph-node-title {
  font-size: 17px;
  font-weight: 700;
}

.graph-node-logo {
  pointer-events: none;
}

.about p,
.contact p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 1.5rem;
}

.cta-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.cta-outline:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Footer */
.footer {
  position: relative;
  z-index: 5;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.logo-small {
  height: 24px;
  width: auto;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Contact page */
.contact-page-bg-wrap {
  position: relative;
  min-height: 100vh;
}

.contact-page {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 8rem 2rem 5rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.contact-page-inner {
  max-width: 480px;
  width: 100%;
}

.contact-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.contact-page-intro {
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  line-height: 1.6;
}

.contact-form-wrap {
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: -0.35rem;
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.contact-input::placeholder,
.contact-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.contact-input:focus,
.contact-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-submit {
  align-self: flex-start;
  cursor: pointer;
  border: none;
  margin-top: 0.5rem;
}

.contact-success {
  text-align: center;
  padding: 2rem 0;
}

.contact-success-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.contact-success-text {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}
