/* =============================================
   SECTION STYLES
   ============================================= */

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

/* Circuit board background */
.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 100%);
}

/* Circuit nodes — positioned pseudo-dots */
.hero-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-node {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan-500);
  animation: nodePulse 3s ease-in-out infinite;
}

.hero-node:nth-child(1) { top: 20%; left: 15%; animation-delay: 0s; }
.hero-node:nth-child(2) { top: 35%; right: 20%; animation-delay: 0.5s; }
.hero-node:nth-child(3) { bottom: 30%; left: 25%; animation-delay: 1s; }
.hero-node:nth-child(4) { top: 55%; right: 35%; animation-delay: 1.5s; }
.hero-node:nth-child(5) { bottom: 20%; right: 15%; animation-delay: 2s; }
.hero-node:nth-child(6) { top: 15%; left: 45%; animation-delay: 0.7s; }
.hero-node:nth-child(7) { bottom: 40%; left: 60%; animation-delay: 1.3s; }
.hero-node:nth-child(8) { top: 70%; right: 45%; animation-delay: 2.3s; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 var(--container-padding);
}

.hero-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-xl);
}

.hero-logo svg {
  width: 100%;
  height: 100%;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--text-100);
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

.hero-tagline .accent {
  color: var(--red-500);
  position: relative;
  display: inline-block;
}

/* Typing effect for subtitle */
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--text-200);
  margin-bottom: var(--space-xl);
}

.hero-subtitle .cursor {
  border-right: 2px solid var(--cyan-500);
  animation: cursorBlink 1s step-end infinite;
  padding-right: 2px;
}

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

/* ---- Stats Bar ---- */
.stats {
  padding: var(--space-xl) 0;
  background: var(--bg-800);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  text-align: center;
}

.stat-item {
  padding: var(--space-md);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-100);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-value .stat-number {
  color: var(--red-500);
}

.stat-value .stat-suffix {
  color: var(--text-300);
  font-size: 0.6em;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-300);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Features Section ---- */
.features {
  background: var(--bg-900);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Ecosystem Flow ---- */
.ecosystem {
  background: var(--bg-800);
  overflow: hidden;
}

.ecosystem-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-xl) 0;
  flex-wrap: nowrap;
}

.eco-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 0 auto;
  width: 220px;
}

.eco-icon {
  width: 80px;
  height: 80px;
  border: 2px solid var(--cyan-500);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  position: relative;
  background: var(--bg-700);
}

.eco-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--cyan-500);
  fill: none;
  stroke-width: 1.5;
}

.eco-node--wt .eco-icon {
  border-color: var(--red-500);
  box-shadow: 0 0 20px var(--red-glow);
}

.eco-node--wt .eco-icon svg {
  stroke: var(--red-500);
}

.eco-node--wc .eco-icon {
  border-color: var(--purple-500);
}

.eco-node--wc .eco-icon svg {
  stroke: var(--purple-500);
}

.eco-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-100);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eco-subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

.eco-tech {
  font-size: var(--text-xs);
  color: var(--text-400);
  margin-top: var(--space-xs);
}

/* Arrows between nodes */
.eco-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 100px;
  position: relative;
}

.eco-arrow-line {
  width: 100%;
  height: 2px;
  position: relative;
  overflow: visible;
}

.eco-arrow-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--cyan-500) 0px,
    var(--cyan-500) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.5;
}

/* Traveling dot */
.eco-arrow-line::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-500);
  box-shadow: 0 0 8px var(--cyan-glow-strong);
  animation: dotSlide 2s linear infinite;
}

@keyframes dotSlide {
  from { left: 0; }
  to { left: calc(100% - 8px); }
}

.eco-arrow-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-sm);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .ecosystem-diagram {
    flex-direction: column;
    gap: var(--space-md);
  }

  .eco-arrow {
    width: auto;
    height: 60px;
  }

  .eco-arrow-line {
    width: 2px;
    height: 100%;
  }

  .eco-arrow-line::before {
    background: repeating-linear-gradient(
      180deg,
      var(--cyan-500) 0px,
      var(--cyan-500) 6px,
      transparent 6px,
      transparent 12px
    );
  }

  .eco-arrow-line::after {
    top: 0;
    left: -3px;
    animation: dotSlideV 2s linear infinite;
  }

  @keyframes dotSlideV {
    from { top: 0; }
    to { top: calc(100% - 8px); }
  }
}

/* ---- WooCreator Section ---- */
.woocreator {
  background: var(--bg-900);
}

.woocreator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

/* Phone mockup — pure CSS */
.phone-mockup {
  width: 260px;
  height: 520px;
  border: 3px solid var(--text-400);
  border-radius: 36px;
  background: var(--bg-800);
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px var(--purple-glow);
}

/* Notch */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background: var(--bg-900);
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

/* Phone screen content */
.phone-screen {
  padding: 40px 16px 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-header {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--purple-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.phone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-700);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.phone-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--purple-500);
  opacity: 0.8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-item-icon svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.phone-item-text {
  font-size: var(--text-xs);
  color: var(--text-200);
  line-height: 1.4;
}

.phone-item-title {
  font-weight: 600;
  color: var(--text-100);
  font-size: var(--text-xs);
}

.woocreator-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .woocreator-layout {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .phone-mockup {
    order: -1;
  }
}

/* ---- Architecture Section ---- */
.architecture {
  background: var(--bg-800);
}

.architecture .terminal {
  max-width: 700px;
  margin: 0 auto;
}

.terminal-body .line {
  opacity: 0;
  animation: fadeIn 0.1s ease forwards;
}

/* ---- CTA Section ---- */
.cta {
  background: var(--bg-900);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-100);
  margin-bottom: var(--space-md);
}

.cta-subtitle {
  font-size: var(--text-lg);
  color: var(--text-200);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Registration Form */
.register-form {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-300);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-100);
  background: var(--bg-700);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-input:focus {
  border-color: var(--cyan-500);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.form-actions {
  text-align: center;
  margin-top: var(--space-lg);
}

.form-status {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
}

.form-status.success {
  color: #28CA42;
  border: 1px solid rgba(40, 202, 66, 0.3);
  background: rgba(40, 202, 66, 0.05);
}

.form-status.error {
  color: var(--red-400);
  border: 1px solid var(--border-red);
  background: rgba(220, 0, 0, 0.05);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  overflow-y: auto;
  padding: var(--space-xl) var(--container-padding);
}

.modal-overlay.open {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.modal {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  margin: var(--space-xl) auto;
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-800);
  border-radius: 12px 12px 0 0;
  z-index: 1;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-100);
}

.modal-title::before {
  content: '[ ';
  color: var(--cyan-500);
}

.modal-title::after {
  content: ' ]';
  color: var(--cyan-500);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-300);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--red-500);
  background: rgba(220, 0, 0, 0.1);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.modal-body {
  padding: var(--space-xl);
}

.modal-updated {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: var(--space-md);
  }
  .modal-header {
    padding: var(--space-md) var(--space-lg);
  }
  .modal-body {
    padding: var(--space-lg);
  }
}

/* ---- Privacy & Terms Content (reused in modals) ---- */
.privacy-updated {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: calc(-1 * var(--space-lg));
  margin-bottom: var(--space-2xl);
}

.privacy-content {
  max-width: 760px;
  margin: 0 auto;
}

.privacy-section {
  margin-bottom: var(--space-xl);
}

.privacy-section h2 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-100);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.privacy-section h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--cyan-500);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.privacy-section p {
  font-size: var(--text-base);
  color: var(--text-200);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.privacy-section ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.privacy-section li {
  font-size: var(--text-base);
  color: var(--text-200);
  line-height: 1.8;
  position: relative;
  padding-left: var(--space-md);
}

.privacy-section li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--red-500);
  font-family: var(--font-mono);
}

.privacy-contact-email {
  font-family: var(--font-mono);
  font-size: var(--text-base);
}

/* Cookie table */
.cookie-table {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: var(--space-md) 0;
  font-size: var(--text-sm);
}

.cookie-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px 80px;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--text-200);
}

.cookie-row:last-child {
  border-bottom: none;
}

.cookie-header-row {
  background: var(--bg-700);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-300);
  font-weight: 600;
}

.cookie-name {
  font-family: var(--font-mono);
  color: var(--cyan-500);
}

@media (max-width: 600px) {
  .cookie-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .cookie-header-row {
    display: none;
  }
  .cookie-row span::before {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-400);
    text-transform: uppercase;
  }
}

.privacy-contact-email a {
  color: var(--cyan-500);
  transition: color var(--transition-fast);
}

.privacy-contact-email a:hover {
  color: var(--cyan-400);
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  background: var(--bg-900);
}

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

.footer-copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-author {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-300);
  letter-spacing: 0.05em;
}

.footer-author a {
  color: var(--cyan-500);
  transition: color var(--transition-fast);
}

.footer-author a:hover {
  color: var(--cyan-400);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--cyan-500);
}

.footer-tech {
  display: flex;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
