/* Anima landing, scoped styles. Loaded only by anima/_base_anima.html
 * so nothing here can leak into hooper, remindersync, or the root
 * Turquoise Hexagon page.
 *
 * The handoff CSS is reproduced almost verbatim. Two deviations:
 *  1. The phone frame in the pinned-story section uses the real
 *     iPhone 17 Mist Blue bezel asset (1350×2760, inner screen at
 *     +72+69 width 1206) layered over the simulator captures
 *     instead of the handoff's CSS-built mock frame.
 *  2. Reveal stagger is delivered with `data-reveal-stagger` so
 *     the JS port can apply it without relying on the handoff's
 *     React `nth-child` ordering.
 */

:root {
  --ink-deep:      #06050c;
  --ink:           #0a0913;
  --ink-soft:      #15131e;
  --cream:         #f6f3ec;
  --accent-blue:   #9bd4ff;
  --accent-indigo: #9bb3ff;
  --accent-violet: #7a3fb8;
  --accent-teal:   #3ed3d6;
}

.anima-root {
  background: #000;
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
.anima-root,
.anima-root :where(p, h1, h2, h3, blockquote) {
  text-wrap: pretty;
}

/* ─── nav ─── */
.anima-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.anima-progress {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-blue) 40%,
    var(--accent-indigo) 80%,
    transparent
  );
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.15s linear;
}

/* ─── reveal-on-scroll ─── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal[data-reveal-stagger="1"] { transition-delay: 0.06s; }
.reveal[data-reveal-stagger="2"] { transition-delay: 0.12s; }
.reveal[data-reveal-stagger="3"] { transition-delay: 0.18s; }

/* ─── hero ─── */
.hero {
  background: var(--ink-deep);
}
.hero-bg {
  background:
    radial-gradient(60% 50% at 50% 24%, rgba(155, 212, 255, 0.25), transparent 65%),
    radial-gradient(70% 70% at 80% 80%, rgba(122, 63, 184, 0.32), transparent 65%),
    radial-gradient(60% 60% at 18% 78%, rgba(62, 211, 214, 0.18), transparent 65%),
    linear-gradient(180deg, #0c0a30 0%, #06050c 100%);
}
.hero-beams {
  background: conic-gradient(
    from 200deg at 50% 100%,
    transparent 0deg,
    rgba(155, 212, 255, 0.10) 30deg,
    transparent 80deg,
    rgba(155, 179, 255, 0.08) 140deg,
    transparent 220deg
  );
  mix-blend-mode: screen;
  opacity: 0.7;
  animation: anima-beams 28s linear infinite;
  transform-origin: 50% 100%;
}
@keyframes anima-beams {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}

.hero-title { text-wrap: pretty; }
.hero-line { display: block; }
.not-italic-glow {
  font-style: italic;
  background: linear-gradient(180deg, #d6ecff 0%, #9bd4ff 60%, #6fa6dc 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(155, 212, 255, 0.35));
}

/* breathing orb */
.orb-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb-icon {
  position: relative;
  z-index: 3;
  width: 184px;
  height: 184px;
  border-radius: 44px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 80px rgba(155, 212, 255, 0.35);
  animation: anima-orb-float 6s ease-in-out infinite;
}
.orb-icon img,
.orb-icon picture { width: 100%; height: 100%; display: block; }
.orb-glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(155, 212, 255, 0.22) 0%,
    rgba(155, 179, 255, 0.10) 35%,
    transparent 65%
  );
  filter: blur(30px);
  animation: anima-orb-breath 4s ease-in-out infinite;
}
.orb-halo {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 63, 184, 0.12) 0%, transparent 60%);
  filter: blur(40px);
  animation: anima-orb-breath 6s ease-in-out infinite reverse;
}
.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(155, 212, 255, 0.18);
}
.orb-ring-1 { inset: -8%;  animation: anima-orb-ring 8s  ease-in-out infinite; }
.orb-ring-2 { inset: -22%; animation: anima-orb-ring 10s ease-in-out infinite reverse; border-color: rgba(155, 179, 255, 0.10); }

@keyframes anima-orb-breath {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}
@keyframes anima-orb-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes anima-orb-ring {
  0%, 100% { transform: scale(1);    opacity: 0.4; }
  50%      { transform: scale(1.06); opacity: 0.9; }
}

/* stars */
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  animation-name: anima-twinkle;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes anima-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* dot pulses */
.dot-pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue);
  animation: anima-dot-pulse 2s ease-in-out infinite;
}
@keyframes anima-dot-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
.breathe { animation: anima-dot-pulse 3s ease-in-out infinite; }

/* App Store badge */
.app-store-badge {
  display: inline-block;
  line-height: 0;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.25s;
  filter: drop-shadow(0 10px 30px rgba(155, 212, 255, 0.18));
}
.app-store-badge:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 14px 40px rgba(155, 212, 255, 0.32));
}
.app-store-badge img { display: block; width: auto; height: 60px; }
.app-store-badge-lg img { height: 72px; }

/* grain overlay */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ─── live demo panel ─── */
.demo-panel {
  background: linear-gradient(180deg, rgba(20, 18, 40, 0.85), rgba(8, 6, 18, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  padding: 22px 20px 20px;
  box-shadow:
    0 60px 120px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(155, 179, 255, 0.06);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .demo-panel {
    border-radius: 28px;
    padding: 28px 32px 24px;
  }
}
.demo-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 100% 0%, rgba(155, 212, 255, 0.08), transparent 60%);
  pointer-events: none;
}
.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wave-row {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 56px;
  margin-bottom: 18px;
}
@media (min-width: 768px) {
  .wave-row {
    gap: 3px;
    height: 80px;
    margin-bottom: 22px;
  }
}
.wave-bar {
  flex: 1;
  min-width: 3px;
  max-width: 6px;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-indigo));
  border-radius: 99px;
  opacity: 0.85;
  transition: height 0.12s ease-out;
}
.demo-text { min-height: 120px; }
.caret {
  display: inline-block;
  color: var(--accent-blue);
  animation: anima-caret 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes anima-caret { 50% { opacity: 0; } }
.demo-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-blue);
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(155, 212, 255, 0.08);
  border: 1px solid rgba(155, 212, 255, 0.18);
}

/* ─── pinned story, real iPhone bezel + simulator screens ─── */
/* Bezel: 1350×2760 PNG with transparent inner area.
 * Inner screen offsets (frameit's offsets.json):
 *   top  = 69 / 2760 = 2.500%
 *   left = 72 / 1350 = 5.333%
 *   width  = 1206 / 1350 = 89.333%
 *   height ~ 2620 / 2760 = 94.928% (derived from the simulator
 *   capture's 1320×2868 aspect, the bezel doesn't ship an inner
 *   height in offsets.json, so we infer from the screen aspect)
 * Padding-top trick gives us a 1350×2760 ratio container that
 * scales with the wrapper width.
 */
.phone-frame {
  position: relative;
  /* Fluid width capped at 360px for desktop, scaling down on
   * narrow viewports so the bezel never overflows the column.
   * 78vw at the smallest end keeps the screenshots legible
   * without forcing a horizontal scroll. */
  width: min(360px, 78vw);
  aspect-ratio: 1350 / 2760;
  filter:
    drop-shadow(0 60px 120px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 80px rgba(155, 179, 255, 0.10));
}
/* Per-card phone in the mobile flipbook layout — smaller so
 * three of them stack comfortably on a phone-sized viewport
 * without dominating the scroll. */
.phone-frame-sm {
  width: min(260px, 60vw);
}
.phone-screen-stack {
  position: absolute;
  left:   5.333%;
  top:    2.500%;
  width:  89.333%;
  height: 94.928%;
  border-radius: 13.5%/6.4%;
  overflow: hidden;
  background: var(--ink);
}
.phone-bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.phone-state {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.phone-state.on {
  opacity: 1;
  transform: scale(1);
}
.phone-state img,
.phone-state picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ─── marquee ─── */
.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 48px;
  /* Duration scales with the fragment count: 38 items now vs.
   * the handoff's 14, so the duration scales by ~2.7× to keep
   * the same perceived pixels-per-second speed. */
  animation: anima-marquee 240s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.marquee-rev .marquee-track {
  animation-direction: reverse;
  animation-duration: 300s;
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  font-size: clamp(22px, 4vw, 38px);
}
.dot-sep {
  color: var(--accent-blue);
  opacity: 0.5;
  font-size: clamp(14px, 2.4vw, 22px);
}
@media (max-width: 640px) {
  .marquee-track { gap: 32px; }
}
@keyframes anima-marquee { to { transform: translateX(-50%); } }

/* ─── what anima isn't ─── */
.not-list { border-top: 1px solid rgba(255, 255, 255, 0.10); }
.not-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px 24px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  transition: background 0.4s;
}
@media (min-width: 768px) {
  .not-row {
    grid-template-columns: 60px 1fr 360px;
    gap: 32px;
    align-items: center;
    padding: 36px 0;
  }
}
.not-row > .font-serif {
  grid-column: 1 / -1;
}
@media (min-width: 768px) {
  .not-row > .font-serif { grid-column: auto; }
}
.not-row:hover {
  background: linear-gradient(90deg, transparent, rgba(155, 212, 255, 0.04), transparent);
}
.not-num { padding-top: 6px; }

/* ─── faq ─── */
.faq-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 22px 0;
}
.faq-row summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.faq-row summary::-webkit-details-marker { display: none; }
.faq-plus {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  color: rgba(246, 243, 236, 0.4);
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    color 0.35s;
}
.faq-row[open] .faq-plus {
  transform: rotate(45deg);
  color: var(--accent-blue);
}
.faq-row[open] summary span:first-child { color: var(--cream); }

/* ─── prefers-reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
  .hero-beams,
  .orb-icon,
  .orb-glow,
  .orb-halo,
  .orb-ring-1,
  .orb-ring-2,
  .star,
  .dot-pulse,
  .breathe,
  .marquee-track,
  .caret { animation: none !important; }
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
  .star { transform: none !important; }
}
