/* =========================================================================
   ZENI — FEATURES PAGE
   Styles for /features.html only. Reuses tokens from styles.css.
   ========================================================================= */

/* =========================================================================
   INTRO SCENE — subtle radial gradient, faint grid
   ========================================================================= */
.feature-intro {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(240, 240, 250, 0.06) 0%, transparent 60%),
    var(--space-black);
  justify-content: center;
}

.feature-intro .scene__content {
  text-align: center;
  max-width: 720px;
}

.feature-intro__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240, 240, 250, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 240, 250, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 20%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}

/* =========================================================================
   FEATURE SECTION — grid layout, alternating
   ========================================================================= */
.feature {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 96px 48px;
  overflow: hidden;
  background: var(--space-black);
  border-top: 1px solid rgba(240, 240, 250, 0.08);
}

.feature__content {
  max-width: 560px;
  justify-self: end;
  padding-right: 24px;
}

.feature__visual {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 24px;
}

/* Right variant — text on right, visual on left */
.feature--right {
  grid-template-columns: 1fr 1fr;
}

.feature--right .feature__content {
  order: 2;
  justify-self: start;
  text-align: right;
  padding-right: 0;
  padding-left: 24px;
}

.feature--right .feature__visual {
  order: 1;
  padding-left: 0;
  padding-right: 24px;
}

.feature--right .feature__content .support {
  margin-left: auto;
}

/* Feature typography */
.feature__headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.5vw, 52px);
  text-transform: uppercase;
  letter-spacing: var(--track-display);
  color: var(--spectral-white);
  line-height: 1;
  margin: 0 0 24px 0;
}

.feature__fact {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--track-micro);
  color: var(--spectral-white);
  opacity: 0.6;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--ghost-border);
  display: inline-block;
}

/* =========================================================================
   VISUAL 01 — TRANSACTION INTELLIGENCE — 8x8 data grid
   ========================================================================= */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  width: min(420px, 80%);
  aspect-ratio: 1 / 1;
}

.visual-grid span {
  background: rgba(240, 240, 250, 0.04);
  border: 1px solid rgba(240, 240, 250, 0.06);
  border-radius: var(--radius-sharp);
}

/* ~30% filled, varying opacities */
.visual-grid span:nth-child(2),
.visual-grid span:nth-child(5),
.visual-grid span:nth-child(9),
.visual-grid span:nth-child(14),
.visual-grid span:nth-child(19),
.visual-grid span:nth-child(22),
.visual-grid span:nth-child(28),
.visual-grid span:nth-child(33),
.visual-grid span:nth-child(37),
.visual-grid span:nth-child(44),
.visual-grid span:nth-child(47),
.visual-grid span:nth-child(51),
.visual-grid span:nth-child(55),
.visual-grid span:nth-child(58),
.visual-grid span:nth-child(62) {
  background: rgba(240, 240, 250, 0.9);
  border-color: rgba(240, 240, 250, 1);
}

.visual-grid span:nth-child(3),
.visual-grid span:nth-child(11),
.visual-grid span:nth-child(17),
.visual-grid span:nth-child(26),
.visual-grid span:nth-child(31),
.visual-grid span:nth-child(40),
.visual-grid span:nth-child(49),
.visual-grid span:nth-child(60) {
  background: rgba(240, 240, 250, 0.5);
  border-color: rgba(240, 240, 250, 0.7);
}

.visual-grid span:nth-child(7),
.visual-grid span:nth-child(15),
.visual-grid span:nth-child(24),
.visual-grid span:nth-child(35),
.visual-grid span:nth-child(42),
.visual-grid span:nth-child(53) {
  background: rgba(240, 240, 250, 0.25);
  border-color: rgba(240, 240, 250, 0.35);
}

/* =========================================================================
   VISUAL 02 — PATTERN DETECTION — SVG line graph with pulses
   ========================================================================= */
.visual-graph {
  width: min(520px, 90%);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--ghost-border);
  background: var(--ghost-surface);
  border-radius: var(--radius-sharp);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-graph svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pulse-dot > circle:last-child {
  transform-origin: center;
  animation: pulse-ring 2.6s ease-out infinite;
}

.pulse-dot--2 > circle:last-child { animation-delay: 0.6s; }
.pulse-dot--3 > circle:last-child { animation-delay: 1.3s; }

@keyframes pulse-ring {
  0%   { transform: scale(1);  opacity: 0.9; }
  70%  { transform: scale(4);  opacity: 0;   }
  100% { transform: scale(4);  opacity: 0;   }
}

/* =========================================================================
   VISUAL 03 — ASK ZENI — chat bubbles
   ========================================================================= */
.visual-chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, 80%);
}

.chat-bubble {
  padding: 16px 22px;
  border: 1px solid var(--ghost-border);
  background: var(--ghost-surface);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  color: var(--spectral-white);
  max-width: 85%;
}

.chat-bubble--you {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: rgba(240, 240, 250, 0.16);
}

.chat-bubble--zeni {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: transparent;
}

/* =========================================================================
   VISUAL 04 — GOAL ENGINE — conic-gradient ring
   ========================================================================= */
.visual-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ring {
  position: relative;
  width: min(280px, 60%);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    conic-gradient(
      var(--spectral-white) 0 68%,
      rgba(240, 240, 250, 0.1) 68% 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--space-black);
}

.ring__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--spectral-white);
  display: flex;
  align-items: baseline;
  letter-spacing: var(--track-display);
}

.ring__value {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
}

.ring__pct {
  font-size: clamp(16px, 2vw, 22px);
  margin-left: 4px;
  opacity: 0.7;
}

/* =========================================================================
   VISUAL 05 — ACCOUNT AGGREGATION — stacked bars
   ========================================================================= */
.visual-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(460px, 85%);
}

.bar {
  height: 36px;
  background: var(--ghost-surface);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-sharp);
  position: relative;
  overflow: hidden;
}

.bar__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(240, 240, 250, 0.75);
}

.bar--a .bar__fill { width: 78%; }
.bar--b .bar__fill { width: 52%; }
.bar--c .bar__fill { width: 91%; }
.bar--d .bar__fill { width: 36%; }
.bar--e .bar__fill { width: 64%; }

/* =========================================================================
   VISUAL 06 — PRIVACY-FIRST — concentric lock rings
   ========================================================================= */
.visual-lock {
  position: relative;
  width: min(320px, 70%);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid var(--ghost-border);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.lock-ring--1 { width: 100%; height: 100%; opacity: 0.35; }
.lock-ring--2 { width: 66%;  height: 66%;  opacity: 0.55; }
.lock-ring--3 { width: 36%;  height: 36%;  opacity: 0.8;  border-color: rgba(240, 240, 250, 0.55); }

.lock-dot {
  position: relative;
  width: 18px;
  height: 18px;
  background: var(--spectral-white);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 24px rgba(240, 240, 250, 0.4);
  animation: lock-breathe 3.4s ease-in-out infinite;
}

@keyframes lock-breathe {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.12); opacity: 0.85; }
}

/* =========================================================================
   OUTRO SCENE
   ========================================================================= */
.feature-outro {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(240, 240, 250, 0.07) 0%, transparent 55%),
    var(--space-black);
  justify-content: center;
  border-top: 1px solid rgba(240, 240, 250, 0.08);
}

.feature-outro .scene__content {
  text-align: center;
  max-width: 720px;
}

.feature-outro .actions {
  justify-content: center;
}

/* =========================================================================
   RESPONSIVE — collapse to stacked under 900px
   ========================================================================= */
@media (max-width: 900px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 72px 24px;
    min-height: auto;
  }

  .feature__content,
  .feature--right .feature__content {
    order: 1;
    justify-self: start;
    text-align: left;
    padding: 0;
    max-width: 100%;
  }

  .feature--right .feature__content .support {
    margin-left: 0;
  }

  .feature__visual,
  .feature--right .feature__visual {
    order: 2;
    padding: 0;
  }

  .visual-grid {
    width: min(320px, 90%);
  }

  .visual-chat {
    width: 100%;
    max-width: 420px;
  }
}

@media (max-width: 768px) {
  .feature__headline {
    font-size: clamp(28px, 8vw, 44px);
  }
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .pulse-dot > circle:last-child,
  .lock-dot {
    animation: none;
  }
}
