:root {
  --void: #06070a;
  --panel: #10131a;
  --panel-2: #151a23;
  --line: #212836;
  --text: #eceef2;
  --muted: #8891a0;
  --steel: #4fa7d6;
  --amber: #e8a33d;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

p { color: var(--muted); margin: 0; }

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

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn-primary { background: var(--text); color: var(--void); }
.btn-primary:hover { background: var(--amber); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--steel); }
.btn-lg { padding: 0.9rem 1.7rem; font-size: 1.02rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(6, 7, 10, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: auto;
}
.nav-links { display: flex; gap: 1.6rem; }
.nav-links a { color: var(--muted); font-size: 0.92rem; }
.nav-links a:hover { color: var(--text); }
.nav-cta { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 9.5rem 1.5rem 6rem;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}
.hero-text h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
}
.hero-sub {
  margin-top: 1.3rem;
  max-width: 46ch;
  font-size: 1.08rem;
}
.hero-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-note { margin-top: 1rem; font-size: 0.85rem; color: #626b7a; }

.hero-visual { display: flex; justify-content: center; }
.receipt {
  width: 260px;
  background: #f4f1ea;
  color: #26241d;
  border-radius: 3px;
  padding: 1.3rem 1.2rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
  transform: rotate(2.5deg);
  animation: receipt-float 6s ease-in-out infinite;
}
@keyframes receipt-float {
  0%, 100% { transform: rotate(2.5deg) translateY(0); }
  50% { transform: rotate(1.2deg) translateY(-8px); }
}
.receipt-head { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 0.9rem; }
.receipt-shop { font-weight: 700; letter-spacing: 0.02em; }
.receipt-date { color: #6b6858; font-size: 0.72rem; }
.receipt-line { display: flex; justify-content: space-between; padding: 0.18rem 0; }
.receipt-rule { border-top: 1px dashed #b9b4a1; margin: 0.5rem 0; }
.receipt-total { font-weight: 700; }
.receipt-seal {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px dashed #b9b4a1;
  font-size: 0.66rem;
  color: #6b6858;
}
.seq { color: var(--amber); font-weight: 700; }

/* ---------- Stat strip ---------- */
.stat-strip {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 0.4rem; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
}
.stat-label { font-size: 0.9rem; max-width: 26ch; }

/* ---------- Section head ---------- */
.section-head {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: left;
  padding: 0 1.5rem;
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 0.8rem; }

/* ---------- Modules ---------- */
.modules { max-width: 1180px; margin: 6rem auto; padding: 0 1.5rem; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.module {
  background: var(--panel);
  padding: 1.6rem 1.5rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.module h3 { font-size: 1.02rem; }
.module p { font-size: 0.87rem; }
.module-lg { grid-column: span 2; min-height: 190px; background: var(--panel-2); }
.module-lg h3 { font-size: 1.25rem; }
.module-lg p { font-size: 0.92rem; }

/* ---------- Network ---------- */
.network {
  max-width: 1180px;
  margin: 6rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: center;
}
.network-svg { width: 100%; height: auto; }
.net-lines line { stroke: var(--line); stroke-width: 1.5; }
.net-nodes circle { fill: var(--steel); opacity: 0.85; }
.net-hub { fill: var(--amber); }
.net-nodes circle:not(.net-hub) { animation: pulse 3s ease-in-out infinite; }
.net-nodes circle:nth-child(3) { animation-delay: 0.4s; }
.net-nodes circle:nth-child(4) { animation-delay: 0.8s; }
.net-nodes circle:nth-child(5) { animation-delay: 1.2s; }
.net-nodes circle:nth-child(6) { animation-delay: 1.6s; }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.network-text h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); margin-bottom: 1rem; }
.network-text p { max-width: 46ch; }

/* ---------- Compliance ---------- */
.compliance { max-width: 1180px; margin: 6rem auto; padding: 0 1.5rem; }
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
}
.compliance-item {
  border: 1px solid var(--line);
  padding: 1.4rem;
  border-left: 2px solid var(--amber);
}
.compliance-item h3 { font-size: 0.98rem; margin-bottom: 0.5rem; }
.compliance-item p { font-size: 0.86rem; }

/* ---------- Demo ---------- */
.demo { border-top: 1px solid var(--line); background: var(--panel); }
.demo-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}
.demo-text h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 1.1rem; max-width: 20ch; }
.demo-text > p { max-width: 50ch; margin-bottom: 1.6rem; }
.demo-steps {
  margin: 0 0 2rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.demo-steps li { font-size: 0.92rem; color: var(--muted); }
.demo-steps strong { color: var(--text); }

.demo-terminal {
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: #14171f;
  border-bottom: 1px solid var(--line);
}
.terminal-bar span { width: 9px; height: 9px; border-radius: 50%; background: #333a48; }
.terminal-body { padding: 1.4rem 1.3rem 1.6rem; font-family: var(--font-mono); font-size: 0.88rem; }
.term-row { margin-bottom: 0.7rem; color: var(--muted); }
.term-val { color: var(--steel); }
.term-status { margin-top: 1rem; font-size: 0.78rem; color: #5f6a7a; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 1.5rem; }
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.footer-muted { font-family: var(--font-body); color: var(--muted); font-size: 0.85rem; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 5, 7, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 1.2rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2.2rem 1.8rem 1.8rem;
}
.modal-close {
  position: absolute; top: 0.8rem; right: 0.9rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-state[hidden] { display: none; }
.modal-state { text-align: left; }
.modal h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.modal-sub { font-size: 0.85rem; margin-bottom: 1.3rem; }
.modal-creds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.modal-creds div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
}
.modal-creds span { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.25rem; }
.modal-creds strong { font-family: var(--font-mono); font-size: 1.05rem; color: var(--steel); }
.modal-expiry { font-size: 0.8rem; margin-bottom: 1.3rem; color: #626b7a; }
.modal .btn { width: 100%; }

.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--amber);
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#demo-modal-loading p, #demo-modal-error p { text-align: center; font-size: 0.9rem; }
#demo-modal-loading h3, #demo-modal-error h3 { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .stat-strip { grid-template-columns: 1fr; gap: 1.6rem; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .module-lg { grid-column: span 2; }
  .network { grid-template-columns: 1fr; }
  .compliance-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-inner { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-lg { grid-column: span 1; }
  .compliance-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
