/* Waijai homepage — dark security-forward aesthetic on the project's
   teal/coral design tokens (see frontend/design-system/theme.css). */

:root {
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-900: #134e4a;
  --coral-300: #f87171;
  --coral-400: #f05252;
  --emerald-400: #34d399;

  --ink-950: #060d0c;
  --ink-900: #0a1413;
  --ink-850: #0e1b19;
  --ink-800: #12211f;
  --ink-700: #1c312e;
  --line: rgba(94, 234, 212, 0.14);
  --line-soft: rgba(94, 234, 212, 0.08);
  --text: #e7f4f1;
  --text-dim: #9db8b2;
  --text-faint: #6d8781;

  --font-heading: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 18px;
  --pad-x: clamp(1.25rem, 5vw, 5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(20, 184, 166, 0.14), transparent 60%),
    radial-gradient(900px 700px at -15% 30%, rgba(13, 148, 136, 0.10), transparent 55%),
    var(--ink-950);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 40;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(45, 212, 191, 0.35); }

h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.02em; }

code { font-family: var(--font-mono); font-size: 0.92em; color: var(--teal-300); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
  padding: 0.62rem 1.15rem; border-radius: 999px;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn--lg { padding: 0.85rem 1.6rem; font-size: 1.02rem; }
.btn--primary {
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: #04211d;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.35), 0 8px 30px rgba(20, 184, 166, 0.28);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.5), 0 14px 40px rgba(20, 184, 166, 0.4); }
.btn--primary svg { width: 15px; height: 15px; }
.btn--outline {
  color: var(--teal-200); border: 1px solid rgba(94, 234, 212, 0.35);
}
.btn--outline:hover { background: rgba(20, 184, 166, 0.1); border-color: rgba(94, 234, 212, 0.65); transform: translateY(-2px); }
.btn--ghost { color: var(--text-dim); }
.btn--ghost:hover { color: var(--text); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem var(--pad-x);
  background: rgba(6, 13, 12, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.3rem;
  letter-spacing: -0.03em; color: var(--text); text-decoration: none;
}
.nav__mark { width: 28px; height: 28px; color: var(--teal-400); display: inline-flex; }
.nav__mark svg { width: 100%; height: 100%; }
.nav__links { display: flex; gap: 1.8rem; }
.nav__links a {
  color: var(--text-dim); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--teal-300); }
.nav__actions { display: flex; gap: 0.4rem; align-items: center; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(3.5rem, 8vh, 7rem) var(--pad-x) clamp(4rem, 9vh, 7rem);
  max-width: 1320px; margin: 0 auto;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal-300);
}
.eyebrow__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal-400);
  box-shadow: 0 0 12px var(--teal-400);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero h1 {
  margin: 1.1rem 0 1.3rem;
  font-size: clamp(2.9rem, 6.5vw, 5.2rem);
  font-weight: 800; line-height: 1.02;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--teal-300), var(--teal-500) 60%, var(--emerald-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { max-width: 34rem; color: var(--text-dim); font-size: 1.15rem; }
.hero__sub strong { color: var(--text); font-weight: 700; }
.hero__ctas { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2rem; }

.hero__stats {
  display: flex; gap: clamp(1.4rem, 3vw, 3rem); margin-top: 2.8rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line-soft);
}
.hero__stats dt {
  font-family: var(--font-heading); font-size: 1.7rem; font-weight: 800; color: var(--teal-300);
}
.hero__stats dd { font-size: 0.85rem; color: var(--text-faint); max-width: 9.5rem; }

/* ---------- Hero visual: scan card ---------- */
.hero__visual { position: relative; }
.hero__glow {
  position: absolute; inset: -12% -18%;
  background: radial-gradient(closest-side, rgba(20, 184, 166, 0.16), transparent 70%);
  z-index: -1; filter: blur(10px);
}
.scan-card {
  background: linear-gradient(170deg, var(--ink-800), var(--ink-900) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.3rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(94, 234, 212, 0.08);
  transform: rotate(1.4deg);
}
.scan-card__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.scan-card__cam {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral-400); box-shadow: 0 0 10px var(--coral-400);
  animation: pulse 1.6s ease-in-out infinite;
}
.scan-card__title { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.scan-card__badge {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--teal-300);
}
.scan-card__badge.is-verified { border-color: rgba(52, 211, 153, 0.5); color: var(--emerald-400); }

.scan-stage {
  position: relative; height: 240px; border-radius: 12px; overflow: hidden;
  background:
    linear-gradient(rgba(94, 234, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.05) 1px, transparent 1px),
    var(--ink-950);
  background-size: 22px 22px, 22px 22px, auto;
  display: grid; place-items: center;
}
.scan-face { width: 118px; }
.scan-face__oval { stroke: var(--teal-300); stroke-width: 2.2; stroke-dasharray: 6 7; opacity: 0.9; animation: rotateDash 24s linear infinite; }
@keyframes rotateDash { to { stroke-dashoffset: -260; } }
.scan-face__brow, .scan-face__nose, .scan-face__mouth { stroke: var(--text-dim); stroke-width: 2.4; stroke-linecap: round; }
.scan-face__eye { fill: var(--text-dim); }

.scan-line {
  position: absolute; left: 8%; right: 8%; height: 2px; top: 0;
  background: linear-gradient(90deg, transparent, var(--teal-300) 30%, var(--teal-300) 70%, transparent);
  box-shadow: 0 0 18px 3px rgba(45, 212, 191, 0.55);
  animation: sweep 3.2s ease-in-out infinite;
}
@keyframes sweep {
  0%, 100% { top: 8%; opacity: 0.2; }
  10% { opacity: 1; }
  50% { top: 88%; opacity: 1; }
  90% { opacity: 1; }
}
.scan-corner { position: absolute; width: 22px; height: 22px; border: 2.5px solid var(--teal-400); }
.scan-corner--tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.scan-corner--tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.scan-corner--bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.scan-corner--br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.scan-steps { list-style: none; margin-top: 1rem; display: grid; gap: 0.45rem; }
.scan-step {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.83rem; color: var(--text-faint);
  opacity: 0; transform: translateX(-6px);
  animation: stepIn 0.5s ease forwards;
  animation-delay: calc(0.9s + var(--step) * 0.85s);
}
@keyframes stepIn { to { opacity: 1; transform: none; } }
.scan-step__tick {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--emerald-400); position: relative;
}
.scan-step__tick::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 4.5px; height: 8px;
  border-right: 1.5px solid var(--emerald-400); border-bottom: 1.5px solid var(--emerald-400);
  transform: translate(-50%, -60%) rotate(42deg);
}
.scan-step--token { color: var(--teal-200); }

.token-chip {
  position: absolute; right: -6%; bottom: -7%;
  display: flex; gap: 0.6rem; align-items: baseline;
  background: var(--ink-850);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 12px; padding: 0.65rem 1rem;
  font-family: var(--font-mono); font-size: 0.8rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(52, 211, 153, 0.12);
  transform: rotate(-2deg);
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.token-chip__key { color: var(--text-faint); }
.token-chip__val { color: var(--emerald-400); }

/* ---------- Sections shared ---------- */
section { padding: clamp(3.5rem, 9vh, 6.5rem) var(--pad-x); }
.section-head { max-width: 1320px; margin: 0 auto 2.6rem; }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; line-height: 1.1;
  margin-top: 1rem;
}
.section-sub { color: var(--text-dim); margin-top: 0.9rem; max-width: 36rem; }

/* ---------- How it works ---------- */
.how { border-top: 1px solid var(--line-soft); }
.how__steps {
  list-style: none; max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem;
}
.how-step {
  position: relative;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.6rem 1.4rem 1.7rem;
  background: linear-gradient(180deg, rgba(18, 33, 31, 0.65), rgba(10, 20, 19, 0.4));
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.how-step:hover { border-color: rgba(94, 234, 212, 0.4); transform: translateY(-4px); }
.how-step__num {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--teal-400);
  letter-spacing: 0.1em;
}
.how-step h3 { font-size: 1.15rem; margin: 0.8rem 0 0.55rem; }
.how-step p { font-size: 0.94rem; color: var(--text-dim); }
.how-step--last { background: linear-gradient(180deg, rgba(20, 184, 166, 0.12), rgba(10, 20, 19, 0.4)); }

/* ---------- Features ---------- */
.features { border-top: 1px solid var(--line-soft); }
.features__grid {
  max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2rem;
}
.feature {
  grid-column: span 2;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.7rem 1.5rem;
  background: rgba(14, 27, 25, 0.5);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.feature--wide { grid-column: span 3; }
.feature:hover { border-color: rgba(94, 234, 212, 0.4); background: rgba(18, 33, 31, 0.7); transform: translateY(-4px); }
.feature__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; color: var(--teal-300);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.25);
  margin-bottom: 1.1rem;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.18rem; margin-bottom: 0.55rem; }
.feature p { font-size: 0.95rem; color: var(--text-dim); }

/* ---------- Stack ---------- */
.stack { border-top: 1px solid var(--line-soft); }
.stack__row {
  max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem;
}
.stack-item {
  display: flex; flex-direction: column; gap: 0.15rem;
  border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 0.85rem 1.25rem; background: rgba(14, 27, 25, 0.5);
}
.stack-item__k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.stack-item__v { font-family: var(--font-heading); font-weight: 600; font-size: 0.98rem; }

.stack__diagram {
  max-width: 1320px; margin: 2.2rem auto 0;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.7rem;
  font-family: var(--font-mono); font-size: 0.88rem;
  border: 1px dashed rgba(94, 234, 212, 0.25); border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
}
.flow-node {
  padding: 0.45rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim);
  background: var(--ink-900);
}
.flow-node--accent { color: var(--coral-300); border-color: rgba(248, 113, 113, 0.4); }
.flow-node--token { color: var(--emerald-400); border-color: rgba(52, 211, 153, 0.4); }
.flow-node--room { color: var(--teal-200); border-color: rgba(94, 234, 212, 0.5); box-shadow: 0 0 20px rgba(20, 184, 166, 0.18); }
.flow-arrow { color: var(--text-faint); }

/* ---------- CTA ---------- */
.cta { padding-bottom: clamp(4rem, 10vh, 7rem); }
.cta__inner {
  max-width: 1320px; margin: 0 auto; text-align: center;
  border: 1px solid var(--line); border-radius: 26px;
  padding: clamp(2.5rem, 6vw, 4.5rem);
  background:
    radial-gradient(600px 260px at 50% -20%, rgba(20, 184, 166, 0.18), transparent 70%),
    linear-gradient(180deg, var(--ink-850), var(--ink-900));
}
.cta h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; line-height: 1.08; }
.cta h2 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--teal-300), var(--emerald-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cta p { color: var(--text-dim); margin: 1.1rem auto 1.6rem; max-width: 34rem; }
.cta p strong { color: var(--text); }
.cta__regions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem;
  margin-bottom: 1.9rem;
}
.region-pill {
  font-family: var(--font-mono); font-size: 0.85rem;
  padding: 0.42rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--line-soft); color: var(--text-dim);
  background: var(--ink-950);
}
.region-pill--more {
  color: var(--teal-200); border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 0 18px rgba(20, 184, 166, 0.15);
}
.cta .hero__ctas { justify-content: center; margin-top: 0; }

/* ---------- Waitlist form ---------- */
.waitlist { max-width: 44rem; margin: 0 auto; }
.waitlist__lead { color: var(--text); font-weight: 500; }
.waitlist__fields {
  display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1.4rem;
}
.waitlist__input {
  flex: 1 1 14rem; min-width: 0; max-width: 20rem;
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  background: var(--ink-950);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.82rem 1.3rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.waitlist__input::placeholder { color: var(--text-faint); }
.waitlist__input:focus {
  outline: none; border-color: rgba(94, 234, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}
.waitlist__input[aria-invalid="true"] { border-color: rgba(248, 113, 113, 0.7); }
.waitlist__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.waitlist__note { font-size: 0.85rem; color: var(--text-faint); margin-top: 0.9rem; }
.waitlist__msg { margin-top: 0.9rem; font-weight: 500; min-height: 1.4em; }
.waitlist__msg.is-ok { color: var(--emerald-400); }
.waitlist__msg.is-err { color: var(--coral-300); }
.waitlist.is-done .waitlist__fields,
.waitlist.is-done .waitlist__note,
.waitlist.is-done .waitlist__lead { display: none; }
.waitlist.is-done .waitlist__msg { font-size: 1.15rem; }

/* Hero variant: left-aligned, sits where the CTA buttons used to be */
.waitlist--hero { margin: 2rem 0 0; max-width: 34rem; }
.waitlist--hero .waitlist__fields { justify-content: flex-start; margin-top: 0; }
.waitlist--hero .waitlist__input { max-width: 19rem; }
.waitlist--hero .waitlist__note { text-align: left; }
.waitlist--hero .waitlist__note a { color: var(--teal-300); text-decoration: none; }
.waitlist--hero .waitlist__note a:hover { text-decoration: underline; }
.waitlist--hero .waitlist__msg { text-align: left; }
.waitlist--hero.is-done .waitlist__msg { font-size: 1.05rem; }

/* ---------- Contact dialog (stub form) ---------- */
.contact {
  margin: auto; width: min(92vw, 26rem);
  background: linear-gradient(170deg, var(--ink-800), var(--ink-900) 70%);
  color: var(--text);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 1.6rem 1.6rem 1.8rem;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
}
.contact::backdrop { background: rgb(4 10 9 / 0.7); backdrop-filter: blur(4px); }
.contact__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.1rem;
}
.contact__head h3 { font-size: 1.35rem; }
.contact__close {
  background: none; border: 0; color: var(--text-faint);
  font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem;
}
.contact__close:hover { color: var(--text); }
.contact__form { display: grid; gap: 0.7rem; }
.contact__input { width: 100%; max-width: none; flex: none; }
.contact__textarea { border-radius: 16px; resize: vertical; min-height: 6rem; font-family: var(--font-body); }
.contact__submit { justify-content: center; }
.contact .waitlist__msg { text-align: center; margin-top: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  padding: 1.6rem var(--pad-x) 2rem;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint); font-size: 0.9rem;
}
.footer__brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.footer__brand .nav__mark { width: 22px; height: 22px; }
.footer__links { display: flex; gap: 1.4rem; }
.footer__links a { color: var(--text-faint); text-decoration: none; transition: color 0.15s ease; }
.footer__links a:hover { color: var(--teal-300); }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease var(--d, 0s), transform 0.7s ease var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero__visual { max-width: 480px; }
  .how__steps { grid-template-columns: repeat(2, 1fr); }
  .feature, .feature--wide { grid-column: span 3; }
  .stack__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .nav__links { display: none; }
  .nav__actions .btn--ghost { display: none; }
  .nav__actions .btn { padding: 0.5rem 0.95rem; font-size: 0.88rem; }
  .how__steps { grid-template-columns: 1fr; }
  .feature, .feature--wide { grid-column: span 6; }
  .stack__row { grid-template-columns: 1fr; }
  .hero__stats { flex-wrap: wrap; }
  .token-chip { right: 0; }
}
