/* Strict 2-3 Color System: Warm Eye Care Light, Pure AMOLED Black, Vibrant Red Buttons */
:root,
[data-theme="light"] {
  --bg: #FAF7F2;
  --surface: #F3EEE5;
  --border: rgba(17, 17, 17, 0.12);
  --text: #111111;
  --muted: #4B4B4B;
  --btn-bg: #EF4444;
  --btn-hover: #DC2626;
  --btn-text: #FFFFFF;
  --header-bg: rgba(250, 247, 242, 0.88);
  --footer-bg: #111111;
  --footer-text: #FFFFFF;
  --footer-muted: #A3A3A3;
  --footer-border: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #0D0D0D;
  --border: rgba(255, 255, 255, 0.14);
  --text: #FFFFFF;
  --muted: #A3A3A3;
  --btn-bg: #EF4444;
  --btn-hover: #DC2626;
  --btn-text: #FFFFFF;
  --header-bg: rgba(0, 0, 0, 0.88);
  --footer-bg: #0A0A0A;
  --footer-text: #FFFFFF;
  --footer-muted: #A3A3A3;
  --footer-border: rgba(255, 255, 255, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

body,
.site-header,
.mission-stage-card,
.feature-stage,
.download-banner,
.faq-item,
.blog-article,
.legal-card,
.mission-pill,
.feature-tab,
.mini-pill,
.theme-toggle {
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  padding-top: 68px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1140px, 100% - 32px);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-logo { border-radius: 9px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
}

.nav-links a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 9px 6px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: width 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span:nth-child(1) { width: 24px; }
.nav-toggle span:nth-child(2) { width: 17px; }
.nav-toggle span:nth-child(3) { width: 11px; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 6px 2px; font-weight: 600; color: var(--muted); }
.mobile-nav a.btn { color: var(--btn-text); }

/* Buttons
 * Adapted from Uiverse.io by Creatlydev - https://uiverse.io/Creatlydev/grumpy-crab-66
 * MIT License, Copyright (c) Creatlydev (Samir Yangua Ruiz)
 */
.btn {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42em;
  padding: 0.68em 1.15em;
  border-radius: 2em;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.btn__icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

.btn:active { transform: scale(0.98); }
.btn-sm { padding: 0.56em 1em; font-size: 0.82rem; }
.btn-lg { padding: 0.72em 1.25em; font-size: 0.9rem; }
.btn-full { width: 100%; }

.btn-red {
  color: var(--btn-text);
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 0.65em 1.4em -0.5em rgba(239, 68, 68, 0.65);
}

.btn-red:hover {
  border-color: #f4f5f2;
  filter: brightness(1.05);
}

.btn-red:active {
  box-shadow: 0 0.45em 1.2em -0.5em rgba(239, 68, 68, 0.65);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover { border-color: var(--text); }

/* Typography */
.kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--btn-bg);
  margin-bottom: 10px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.25;
}

.lead {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 56ch;
}

.lead strong { color: var(--text); }

/* Hero */
.hero { padding: 56px 0 72px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.how-step {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--btn-bg);
}

.how-step strong { font-size: 0.92rem; display: block; margin-bottom: 2px; }
.how-step p { margin: 0; font-size: 0.84rem; color: var(--muted); line-height: 1.45; }

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mockup-stage {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mockup-stage--hero3d {
  perspective: 1100px;
  padding: 16px 24px 22px;
}

.phone-mockup {
  width: min(175px, 42vw);
  max-height: 355px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.22));
}

.phone-mockup--hero3d {
  width: min(215px, 48vw);
  max-height: 430px;
  transform: rotateY(-22deg) rotateX(9deg) rotateZ(-11deg);
  transform-style: preserve-3d;
  filter:
    drop-shadow(3px 2px 0 rgba(36, 36, 40, 0.92))
    drop-shadow(6px 4px 0 rgba(22, 22, 26, 0.85))
    drop-shadow(18px 26px 28px rgba(0, 0, 0, 0.42));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
  will-change: transform;
}

.mockup-stage--hero3d:hover .phone-mockup--hero3d {
  transform: rotateY(-14deg) rotateX(5deg) rotateZ(-7deg) translateY(-6px);
  filter:
    drop-shadow(2px 2px 0 rgba(36, 36, 40, 0.9))
    drop-shadow(5px 3px 0 rgba(22, 22, 26, 0.82))
    drop-shadow(22px 32px 34px rgba(0, 0, 0, 0.48));
}

.mockup-stage--md .phone-mockup {
  width: min(160px, 40vw);
  max-height: 325px;
}

.mini-switcher,
.sub-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.mini-pill.is-active {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}

/* Sections */
.section { padding: 76px 0; }
.section-bordered { border-block: 1px solid var(--border); }

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.section-sub { margin: 0; color: var(--muted); }

/* 12 Missions */
.missions-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
  align-items: start;
}

.mission-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mission-pill {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mission-pill:hover { border-color: var(--text); }

.mission-pill.is-active {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}

.mission-stage-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mission-copy p { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }

/* Features */
.feature-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.feature-tab {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.feature-tab.is-active {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}

.feature-stage {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 36px;
  padding: 36px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.feature-fan {
  position: relative;
  height: 340px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.feature-fan.is-dragging { cursor: grabbing; }

.fan-phone {
  position: absolute;
  width: min(142px, 30vw);
  max-height: 290px;
  object-fit: contain;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.28));
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease,
    filter 0.35s ease;
  will-change: transform, opacity;
  pointer-events: none;
  opacity: 0;
}

.fan-phone[data-pos="center"] {
  transform: translate(0, -10px) rotate(0deg) scale(1);
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  cursor: grab;
}

.fan-phone[data-pos="left"] {
  transform: translate(-118px, 26px) rotate(-18deg) scale(0.84);
  z-index: 2;
  opacity: 0.94;
  pointer-events: auto;
  cursor: pointer;
}

.fan-phone[data-pos="left"]:hover {
  transform: translate(-124px, 18px) rotate(-15deg) scale(0.87);
  opacity: 1;
}

.fan-phone[data-pos="right"] {
  transform: translate(118px, 22px) rotate(18deg) scale(0.88);
  z-index: 2;
  opacity: 0.94;
  pointer-events: auto;
  cursor: pointer;
}

.fan-phone[data-pos="right"]:hover {
  transform: translate(124px, 14px) rotate(15deg) scale(0.91);
  opacity: 1;
}

.fan-phone[data-pos="hidden-left"] {
  transform: translate(-195px, 46px) rotate(-28deg) scale(0.68);
  z-index: 1;
  opacity: 0;
}

.fan-phone[data-pos="hidden-right"] {
  transform: translate(195px, 46px) rotate(28deg) scale(0.68);
  z-index: 1;
  opacity: 0;
}

.feature-info p { margin: 0 0 18px; color: var(--muted); }

.feature-list {
  margin: 0 0 22px;
  padding-left: 20px;
  display: grid;
  gap: 9px;
}

/* FAQ */
.faq-container { max-width: 820px; }
.faq-list {
  display: grid;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: 0; }

.faq-q {
  width: 100%;
  padding: 19px 22px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.faq-plus { font-size: 1.25rem; color: var(--muted); flex-shrink: 0; }
.faq-a { padding: 0 22px 18px; color: var(--muted); font-size: 0.94rem; }
.faq-a p { margin: 0; }
.faq-a a { color: var(--btn-bg); text-decoration: underline; }

/* Download Banner */
.download-banner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 32px;
  padding: 40px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.dl-meta {
  margin: 12px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.download-cta-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Footer (3-column + bottom bar) */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 0 28px;
  border-top: 1px solid var(--footer-border);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--footer-border);
}

.footer-tagline {
  margin: 14px 0 0;
  max-width: 34ch;
  color: var(--footer-muted);
  font-size: 0.92rem;
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--footer-text);
}

.footer-col h4 a {
  color: inherit;
  font-size: inherit;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: var(--footer-muted);
  font-size: 0.92rem;
}

.footer-col a:hover { color: var(--footer-text); }

.footer-bottom {
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--footer-muted);
  font-size: 0.86rem;
}

/* Blog Page */
.blog-hero { padding: 56px 0 28px; }
.blog-grid { display: grid; gap: 22px; padding-bottom: 72px; }
.blog-article {
  padding: 28px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.blog-article h2 { font-size: 1.45rem; margin-bottom: 10px; }
.blog-article p { margin: 0 0 12px; color: var(--muted); }
.blog-article p:last-child { margin-bottom: 0; }

/* Legal Pages (Privacy & Terms) */
.legal-wrap { padding: 96px 0 72px; }
.legal-card {
  max-width: 820px;
  width: 100%;
  margin-inline: auto;
  padding: 36px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-wrap: break-word;
}
.legal-card h1 { font-size: clamp(1.85rem, 3.2vw, 2.5rem); margin-bottom: 10px; }
.legal-card h2 { font-size: 1.25rem; margin: 26px 0 10px; }
.legal-card p, .legal-card li { color: var(--muted); min-width: 0; }
.legal-card strong { color: var(--text); }
.legal-card a { color: var(--btn-bg); text-decoration: underline; overflow-wrap: anywhere; }
.legal-card ul { padding-left: 20px; display: grid; gap: 10px; }
.legal-meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 22px; }
.legal-card code {
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 640px) {
  .legal-wrap { padding: 24px 0 48px; }
  .legal-card { padding: 22px 18px; border-radius: 18px; }
}

/* CircularGallery (React Bits) */
.missions-gallery-wrap {
  width: 100%;
  max-width: 1320px;
  height: 550px;
  margin-inline: auto;
  position: relative;
  overflow: hidden;
}

.missions-gallery-wrap::before,
.missions-gallery-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(60px, 16vw, 220px);
  z-index: 5;
  pointer-events: none;
}

.missions-gallery-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 15%, transparent 100%);
}

.missions-gallery-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 15%, transparent 100%);
}

.mission-active-desc {
  max-width: 560px;
  margin: 4px auto 0;
  padding-inline: 16px;
  text-align: center;
  font-size: 0.94rem;
  color: var(--muted);
}

.missions-gallery-box {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

.circular-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.circular-gallery[data-pointer] { cursor: pointer; }
.circular-gallery[data-dragging] { cursor: grabbing; }

.circular-gallery-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.circular-gallery-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.circular-gallery-label {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 1.2;
  white-space: nowrap;
  will-change: transform, opacity;
}

.circular-gallery-caption {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(90%, 34rem);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.circular-gallery-caption-text {
  margin: 0;
  line-height: 1.5;
  opacity: 0.78;
}

.circular-gallery-close {
  position: absolute;
  top: 12px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.circular-gallery-close[data-visible] {
  opacity: 0.9;
  pointer-events: auto;
}

.circular-gallery-close:hover { opacity: 1; }

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

@media (max-width: 640px) {
  .missions-gallery-wrap { height: 420px; }
}

/* FadeContent Scroll Reveal (React Bits style: blur + opacity + focus scale) */
[data-fade] {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, filter, transform;
}

[data-fade].is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  [data-fade] {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .missions-layout,
  .mission-stage-card,
  .feature-stage,
  .download-banner,
  .footer-top {
    grid-template-columns: 1fr;
  }
  .how-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links,
  .nav-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .phone-mockup,
  .mockup-stage--md .phone-mockup {
    width: min(140px, 38vw);
    max-height: 285px;
  }
  .phone-mockup--hero3d {
    width: min(175px, 46vw);
    max-height: 350px;
    transform: rotateY(-20deg) rotateX(8deg) rotateZ(-10deg);
  }
  .feature-fan {
    height: 250px;
  }
  .fan-phone {
    width: min(106px, 28vw);
    max-height: 220px;
  }
  .fan-phone[data-pos="center"] {
    transform: translate(0, -6px) rotate(0deg) scale(1);
  }
  .fan-phone[data-pos="left"] {
    transform: translate(-84px, 18px) rotate(-18deg) scale(0.84);
  }
  .fan-phone[data-pos="right"] {
    transform: translate(84px, 16px) rotate(18deg) scale(0.88);
  }
  .mission-pills { grid-template-columns: 1fr; }
  .feature-stage,
  .download-banner,
  .mission-stage-card,
  .legal-card { padding: 22px; }
  .legal-wrap { padding: 88px 0 56px; }
  .footer-bottom { font-size: 0.8rem; }
}
