/* ============================================================
   ECHO — design system
   Pure-black space, electric-cyan accent, chrome highlights,
   echo-wave motif. Inspired by the $ECHO key art.
   ============================================================ */

:root {
  --bg:        #04060a;
  --bg-2:      #070b12;
  --bg-3:      #0b121c;
  --line:      rgba(120, 160, 190, 0.12);
  --line-2:    rgba(120, 160, 190, 0.22);

  --cyan:      #25d8f5;
  --cyan-soft: #6fe6ff;
  --cyan-deep: #0a8db0;
  --cyan-glow: rgba(37, 216, 245, 0.55);
  --danger:    #ff5d6c;

  --text:      #eaf2f6;
  --muted:     #8c9aa8;
  --muted-2:   #5d6b78;

  --chrome: linear-gradient(180deg, #ffffff 0%, #cfd8de 38%, #8b97a1 60%, #e9eef1 100%);

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--cyan); color: #02141a; }

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

.wrap { width: min(var(--maxw), 90vw); margin-inline: auto; }

/* ---------- shared typography ---------- */
h2 {
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
h3 { font-weight: 700; letter-spacing: -0.01em; }

.kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.1rem;
}

.t-accent { color: var(--cyan); }

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-sub { color: var(--muted); font-size: 1.08rem; margin-top: 1.1rem; max-width: 56ch; }
.section-head em, .reset em, .intro em { color: var(--cyan-soft); font-style: normal; }

section { position: relative; }

/* ---------- buttons ---------- */
.btn {
  --pad: 0.85rem 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--pad);
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease),
              background 0.3s, border-color 0.3s, color 0.3s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn--primary {
  background: linear-gradient(180deg, var(--cyan-soft), var(--cyan));
  color: #02141a;
  box-shadow: 0 8px 30px -8px var(--cyan-glow), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--cyan-glow); }

.btn--ghost {
  background: rgba(255,255,255,0.02);
  border-color: var(--line-2);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan-soft); transform: translateY(-2px); }

.btn--danger {
  background: rgba(255, 93, 108, 0.08);
  border-color: rgba(255, 93, 108, 0.4);
  color: #ff8e98;
}
.btn--danger:hover { background: rgba(255, 93, 108, 0.16); border-color: var(--danger); transform: translateY(-2px); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.1rem clamp(1rem, 5vw, 3rem);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 900; letter-spacing: 0.12em; font-size: 1.05rem;
}
.nav__mark {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--chrome);
  box-shadow: 0 0 14px var(--cyan-glow), inset 0 0 4px rgba(0,0,0,0.4);
}
.nav__links { display: flex; gap: 1.7rem; margin-left: auto; }
.nav__links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: color 0.25s; }
.nav__links a:hover { color: var(--text); }
.nav__cta { padding: 0.55rem 1.15rem; font-size: 0.86rem; }

.nav__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: var(--muted); border: 1px solid var(--line);
  transition: color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.nav__x svg { width: 16px; height: 16px; }
.nav__x:hover { color: var(--cyan-soft); border-color: var(--cyan); transform: translateY(-2px); }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__x { margin-left: auto; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.92;
}
.hero__stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, transparent 0%, rgba(4,6,10,0.35) 70%, var(--bg) 100%),
    linear-gradient(180deg, rgba(4,6,10,0.5) 0%, transparent 22%, transparent 60%, var(--bg) 100%);
}
.hero__inner { position: relative; z-index: 3; padding: 0 1.2rem; }

.hero__eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.4em;
  color: var(--cyan-soft); margin-bottom: 1.4rem;
  text-shadow: 0 0 24px var(--cyan-glow);
}
.hero__title {
  font-size: clamp(4.5rem, 19vw, 15rem);
  font-weight: 900; letter-spacing: -0.05em; line-height: 0.85;
  background: linear-gradient(180deg, #ffffff 0%, #d6f6ff 55%, #7fc9dc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 80px rgba(37, 216, 245, 0.25);
  filter: drop-shadow(0 8px 40px rgba(37,216,245,0.18));
}
.hero__tag {
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 2.6vw, 1.7rem);
  font-weight: 600; letter-spacing: -0.01em;
}
.hero__tag-dim { color: var(--muted); font-weight: 500; }
.hero__actions { margin-top: 2.4rem; display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 26px; height: 42px; border: 1.5px solid var(--line-2); border-radius: 20px;
}
.hero__scroll span {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 4px; background: var(--cyan);
  animation: scroll 1.8s var(--ease) infinite;
}
@keyframes scroll { 0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 100% { opacity: 0; top: 24px; } }

/* ============================================================
   INTRO
   ============================================================ */
.intro { padding: clamp(6rem, 14vw, 11rem) 0; }
.intro__lead { color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); max-width: 60ch; }
.intro__big {
  margin-top: 1.5rem;
  font-size: clamp(1.6rem, 4.4vw, 3.1rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; max-width: 20ch;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how { padding: clamp(4rem, 9vw, 7rem) 0; border-top: 1px solid var(--line); }
.echo-stage {
  position: relative; margin-bottom: clamp(2.5rem, 6vw, 4rem);
  border-radius: 20px; overflow: hidden;
  background: radial-gradient(120% 140% at 75% 50%, rgba(37,216,245,0.06), transparent 55%), var(--bg-2);
  border: 1px solid var(--line);
}
.echo-stage canvas { display: block; width: 100%; height: clamp(240px, 38vw, 420px); }

.steps {
  list-style: none; display: grid; gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.step { background: var(--bg-2); padding: 1.8rem 1.5rem 2rem; transition: background 0.3s; }
.step:hover { background: var(--bg-3); }
.step__no { font-size: 0.8rem; font-weight: 700; color: var(--cyan); letter-spacing: 0.1em; }
.step h3 { margin: 0.9rem 0 0.5rem; font-size: 1.12rem; }
.step p { color: var(--muted); font-size: 0.95rem; }

.flow {
  margin-top: 2.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem); color: var(--muted); font-weight: 500;
}
.flow i { color: var(--cyan-deep); font-style: normal; }
.flow__accent { color: var(--cyan-soft); font-weight: 700; }

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

/* ============================================================
   SIMULATOR
   ============================================================ */
.sim { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(37,216,245,0.05), transparent 60%); }

.sim__panel {
  position: relative; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  box-shadow: 0 40px 120px -40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.03);
}
#simCanvas { display: block; width: 100%; height: clamp(300px, 44vw, 460px); cursor: pointer; }

.sim__hud {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.stat { padding: 1.1rem 1.4rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat__label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-2); }
.stat__value {
  display: block; margin-top: 0.35rem; font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
#statReflected, #statTotal { color: var(--cyan-soft); }

.sim__controls {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  padding: 1.4rem; border-top: 1px solid var(--line);
}
.sim__hint { padding: 0 1.4rem 1.5rem; color: var(--muted); font-size: 0.92rem; min-height: 1.2em; }

@media (max-width: 700px) {
  .sim__hud { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .sim__controls .btn { flex: 1 1 auto; }
}

/* ============================================================
   RESET
   ============================================================ */
.reset { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); }
.reset__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.reset__body p { color: var(--muted); margin-bottom: 1.1rem; font-size: 1.05rem; }
.reset__note {
  border-left: 2px solid var(--cyan); padding-left: 1.1rem; color: var(--text) !important;
  font-size: 0.98rem !important;
}
@media (max-width: 820px) { .reset__grid { grid-template-columns: 1fr; } }

/* ============================================================
   WHY / CARDS
   ============================================================ */
.why { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line); border-radius: 18px; padding: 2rem 1.7rem;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.card:hover {
  transform: translateY(-6px); border-color: var(--line-2);
  box-shadow: 0 30px 60px -30px rgba(37,216,245,0.25);
}
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 1.3rem;
  background: rgba(37,216,245,0.08); border: 1px solid rgba(37,216,245,0.25);
  position: relative;
}
.card__icon::before, .card__icon::after { content: ""; position: absolute; inset: 0; }
/* swap */
.card__icon[data-icon="swap"]::before {
  inset: 14px 13px; border: 2px solid var(--cyan); border-radius: 2px;
  clip-path: polygon(0 35%, 70% 35%, 70% 12%, 100% 50%, 70% 88%, 70% 65%, 0 65%);
  background: var(--cyan); border: none;
}
/* wave */
.card__icon[data-icon="wave"]::before {
  inset: 12px; border-radius: 50%; border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(37,216,245,0.18);
}
.card__icon[data-icon="wave"]::after {
  inset: 21px; border-radius: 50%; background: var(--cyan);
}
/* reset */
.card__icon[data-icon="reset"]::before {
  inset: 13px; border: 2px solid var(--cyan); border-radius: 50%;
  border-right-color: transparent; border-top-color: transparent;
  transform: rotate(-45deg);
}
.card h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.card p { color: var(--muted); font-size: 0.96rem; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

/* ============================================================
   THE CYCLE — loop
   ============================================================ */
.cycle { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); }
.loop {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem;
  margin-bottom: 2.5rem;
}
.loop__node {
  position: relative; flex: 1 1 180px; max-width: 220px;
  padding: 1.6rem 1.2rem; border-radius: 16px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
}
.loop__node span { display: block; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.loop__node small { color: var(--muted); font-size: 0.82rem; }
.loop__node:not(:last-child)::after {
  content: "→"; position: absolute; right: -0.7rem; top: 50%; transform: translateY(-50%);
  color: var(--cyan-deep); font-size: 1.1rem; z-index: 2;
}
.loop__node:hover { transform: translateY(-4px); border-color: rgba(37,216,245,0.4); background: var(--bg-3); }
.loop__node[data-step="Reset"] span { color: var(--danger); }
.loop__node[data-step="Reset"]:hover { border-color: rgba(255,93,108,0.4); }

.cycle__line { text-align: center; color: var(--muted); font-size: 1.1rem; }
@media (max-width: 720px) { .loop__node:not(:last-child)::after { display: none; } }

/* ============================================================
   CLOSING
   ============================================================ */
.closing {
  position: relative; padding: clamp(7rem, 16vw, 13rem) 0; text-align: center;
  border-top: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(80% 90% at 50% 40%, rgba(37,216,245,0.06), transparent 60%);
}
.closing__stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.6; }
.closing__inner { position: relative; z-index: 2; }
.closing__title {
  font-size: clamp(3.5rem, 13vw, 10rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1;
  background: linear-gradient(180deg, #fff, #8fd8e8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 60px rgba(37,216,245,0.25));
}
.closing__poem { color: var(--muted); margin-top: 1.6rem; font-size: clamp(0.95rem, 2vw, 1.2rem); line-height: 1.9; }
.closing__slogan { margin-top: 1.8rem; font-size: clamp(1.1rem, 2.6vw, 1.6rem); font-weight: 700; letter-spacing: -0.01em; }
.closing__actions { margin-top: 2.4rem; display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.foot__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem; }
.foot__brand { font-weight: 900; letter-spacing: 0.1em; }
.foot__meta { color: var(--muted-2); font-size: 0.88rem; }
.foot__x {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--muted); font-size: 0.88rem; font-weight: 600;
  transition: color 0.25s;
}
.foot__x svg { width: 15px; height: 15px; }
.foot__x:hover { color: var(--cyan-soft); }
.foot__silence { margin-left: auto; color: var(--muted-2); font-size: 0.88rem; font-style: italic; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
