:root {
  /* Nimoo System Tokens (Dark Mode Default - Matching DarkColors from NimooUi.kt) */
  --bg-top: #0E0D16;
  --bg-canvas: #0F0E17;
  --bg-surface: #17151F;
  --bg-nav: rgba(14, 13, 22, 0.85);
  --bg-footer: rgba(14, 13, 22, 0.75);

  --text-high: #F4F2FA;
  --text-secondary: #B9B2CC;
  --text-muted: #7A7791;

  --berry-1: #A9BCFF;
  --berry-2: #6C86F5;
  --berry-3: #4254D6;
  --berry-4: #2B2F8F;
  --berry-nose: #1C1F66;
  --blush: #F3A6D8;

  --bubble-bg: rgba(30, 27, 41, 0.94);
  --bubble-border: rgba(255, 255, 255, 0.14);
  --bubble-text: #F4F2FA;
  --bubble-shadow: rgba(0, 0, 0, 0.4);
  --trail-fill: #242136;
  --trail-stroke: rgba(169, 188, 255, 0.35);

  --hairline: rgba(255, 255, 255, 0.08);
  --glow-color: rgba(108, 134, 245, 0.28);
  --glow-color-deep: rgba(43, 47, 143, 0.14);

  --pill-bg: rgba(169, 188, 255, 0.08);
  --pill-border: rgba(169, 188, 255, 0.18);
  --pill-text: #A9BCFF;

  --title-gradient: linear-gradient(135deg, #FFFFFF 0%, #A9BCFF 50%, #6C86F5 100%);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  /* Nimoo System Tokens (Light Mode - Exact Colors from LightColors in NimooUi.kt) */
  --bg-top: #FBFAFF;
  --bg-canvas: #ECEAFB;
  --bg-surface: #FFFFFF;
  --bg-nav: rgba(251, 250, 255, 0.88);
  --bg-footer: rgba(251, 250, 255, 0.88);

  --text-high: #1A1830;
  --text-secondary: #7A7791;
  --text-muted: #8E8BA3;

  --berry-1: #5B6CF0;
  --berry-2: #4D5EE8;
  --berry-3: #3F4BC0;
  --berry-4: #2B2F8F;
  --berry-nose: #1C1F66;
  --blush: #F3A6D8;

  --bubble-bg: rgba(255, 255, 255, 0.96);
  --bubble-border: rgba(91, 108, 240, 0.18);
  --bubble-text: #1A1830;
  --bubble-shadow: rgba(91, 108, 240, 0.12);
  --trail-fill: #EDE7F6;
  --trail-stroke: rgba(91, 108, 240, 0.35);

  --hairline: rgba(26, 24, 48, 0.08);
  --glow-color: rgba(91, 108, 240, 0.22);
  --glow-color-deep: rgba(108, 134, 245, 0.10);

  --pill-bg: rgba(91, 108, 240, 0.10);
  --pill-border: rgba(91, 108, 240, 0.20);
  --pill-text: #3F4BC0;

  --title-gradient: linear-gradient(135deg, #1A1830 0%, #4D5EE8 55%, #3F4BC0 100%);
}

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

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(circle at 65% 50%, var(--glow-color) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, var(--glow-color-deep) 0%, transparent 65%);
  color: var(--text-high);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================
   HOMEPAGE ZERO-SCROLL DESKTOP CANVAS
   ========================================== */
body.page-home {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Minimal Top Navigation */
.top-nav {
  position: relative;
  flex-shrink: 0;
  z-index: 50;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 32px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-symbol {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(84, 104, 232, 0.28);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-brand:hover .brand-symbol {
  transform: rotate(-6deg) scale(1.08);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-high);
}

/* Top Navigation Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-community-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  text-decoration: none;
}

.nav-community-link:hover {
  background: var(--berry-1);
  color: #0E0D16;
  border-color: var(--berry-1);
  transform: translateY(-1px);
}

[data-theme="light"] .nav-community-link:hover {
  background: var(--berry-1);
  color: #FFFFFF;
}

.nav-community-link svg {
  flex-shrink: 0;
}

/* Theme Toggle Button (Matching Android ThemeToggleButton) */
.theme-toggle-btn {
  background: var(--pill-bg);
  border: 1px solid var(--hairline);
  color: var(--text-high);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover {
  transform: rotate(18deg) scale(1.08);
  border-color: var(--berry-1);
  color: var(--berry-1);
}

.theme-toggle-btn:active {
  transform: scale(0.92);
}

.sun-icon {
  display: block;
}
.moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: none;
}
[data-theme="light"] .moon-icon {
  display: block;
}

/* ==========================================
   HERO SCREEN - SIDE-BY-SIDE SPLIT COMPOSITION
   ========================================== */
.hero-screen {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px 40px 0;
  overflow: hidden;
}

.ambient-glow-bottom {
  position: absolute;
  bottom: 0;
  right: 5%;
  width: 820px;
  max-width: 100vw;
  height: 520px;
  background: radial-gradient(circle at bottom center, var(--glow-color) 0%, var(--glow-color-deep) 45%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transition: background 0.4s ease;
}

.hero-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 56px;
}

/* Left Column: Big Editorial & CTA */
.hero-content-col {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  justify-content: center;
  max-width: 600px;
  padding-bottom: 30px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pill-text);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
  transition: all 0.3s ease;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--berry-2);
  box-shadow: 0 0 8px var(--berry-2);
}

.hero-title {
  font-size: clamp(34px, 5.2vh, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-high);
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.hero-title-highlight {
  color: var(--berry-1);
  background: var(--title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(15px, 2.1vh, 19px);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 28px;
  font-weight: 400;
  max-width: 520px;
  transition: color 0.3s ease;
}

/* Primary CTA Group */
.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.cta-buttons-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.google-play-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #000000;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  padding: 12px 24px;
  border-radius: 14px;
  color: #FFFFFF;
  box-shadow: 
    0 10px 28px rgba(0, 0, 0, 0.4),
    0 0 28px var(--glow-color);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  cursor: pointer;
  text-decoration: none;
}

[data-theme="light"] .google-play-badge {
  background: #171520;
  border-color: rgba(91, 108, 240, 0.25);
  box-shadow: 0 10px 24px rgba(91, 108, 240, 0.18);
}

.google-play-badge:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--berry-1);
  box-shadow: 
    0 14px 35px rgba(0, 0, 0, 0.5),
    0 0 38px var(--glow-color);
}

.google-play-badge:active {
  transform: translateY(0) scale(0.99);
}

.google-play-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

/* Secondary Community / Google Group Badge */
.community-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--pill-border);
  padding: 12px 24px;
  border-radius: 14px;
  color: var(--text-high);
  box-shadow: 
    0 10px 24px rgba(0, 0, 0, 0.25),
    0 0 20px var(--glow-color-deep);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  cursor: pointer;
  text-decoration: none;
}

[data-theme="light"] .community-badge {
  background: #FFFFFF;
  border-color: rgba(91, 108, 240, 0.25);
  box-shadow: 0 10px 22px rgba(91, 108, 240, 0.12);
}

.community-badge:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--berry-1);
  box-shadow: 
    0 14px 35px rgba(0, 0, 0, 0.4),
    0 0 32px var(--glow-color);
}

.community-badge:active {
  transform: translateY(0) scale(0.99);
}

.community-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--berry-1);
  transition: transform 0.25s ease;
}

.community-badge:hover .community-icon {
  transform: scale(1.08);
}

.community-badge .badge-kicker {
  color: var(--berry-1);
}

[data-theme="light"] .community-badge .badge-kicker {
  color: var(--berry-2);
}

.community-badge .badge-title {
  color: var(--text-high);
}

.badge-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.badge-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #B9B2CC;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.badge-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.cta-micro-note {
  font-size: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  line-height: 1.4;
}

.cta-note-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--berry-2);
  box-shadow: 0 0 6px var(--berry-2);
  flex-shrink: 0;
}

/* Right Column: BIG Living Nimoo Character Anchored Flat to Ground */
.hero-character-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  align-self: flex-end;
  position: relative;
  min-height: 0;
  height: 100%;
  margin-bottom: 0;
  padding-bottom: 0;
}

.companion-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Thought Bubble */
.thought-bubble-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -18px;
  z-index: 5;
}

.companion-thought-bubble {
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  color: var(--bubble-text);
  font-size: clamp(13px, 1.8vh, 15px);
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 20px;
  box-shadow: 0 8px 25px var(--bubble-shadow), 0 0 25px var(--glow-color);
  max-width: 360px;
  text-align: center;
  transition: all 0.3s ease;
  user-select: none;
  cursor: pointer;
}

.companion-thought-bubble:hover {
  transform: translateY(-2px);
  border-color: var(--berry-1);
}

.thought-trail {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -2px;
}

.thought-trail-svg {
  display: block;
  overflow: visible;
}

.thought-trail-svg circle {
  fill: var(--trail-fill);
  stroke: var(--trail-stroke);
  transition: fill 0.3s ease, stroke 0.3s ease;
}

/* Ground Canvas - Huge & Sitting Directly on the Footer Ground Line */
.canvas-ground-wrap {
  position: relative;
  height: clamp(340px, 60vh, 520px);
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 0;
  padding-bottom: 0;
}

#nimooInteractiveCanvas {
  display: block;
  vertical-align: bottom;
  height: 100%;
  width: auto;
  aspect-ratio: 380 / 305;
  max-width: 100%;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  object-fit: contain;
  margin-bottom: -1px;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.45));
}

.bezel-ground-line {
  display: none;
}

/* Minimal Site Footer */
.site-footer {
  position: relative;
  flex-shrink: 0;
  border-top: 1px solid var(--hairline);
  padding: 12px 32px;
  background: var(--bg-footer);
  z-index: 20;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-brand {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-high);
  letter-spacing: -0.01em;
}

.footer-dot {
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0.5;
  user-select: none;
}

.footer-pkg code {
  font-size: 11.5px;
  color: var(--berry-1);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--berry-1);
}

/* ==========================================
   RESPONSIVE / MOBILE ADAPTATION
   ========================================== */
@media (max-width: 880px) {
  body.page-home {
    height: auto;
    max-height: none;
    overflow-y: auto;
  }

  .hero-screen {
    padding: 36px 24px 0;
    align-items: flex-start;
  }

  .hero-layout {
    flex-direction: column;
    gap: 36px;
    text-align: center;
  }

  .hero-content-col {
    align-items: center;
    text-align: center;
    max-width: 100%;
  }

  .hero-cta-group {
    align-items: center;
    width: 100%;
  }

  .cta-buttons-row {
    justify-content: center;
    width: 100%;
  }

  .cta-micro-note {
    justify-content: center;
    text-align: center;
  }

  .canvas-ground-wrap {
    height: 320px;
  }
}

@media (max-width: 520px) {
  .cta-buttons-row {
    flex-direction: column;
    width: 100%;
  }

  .google-play-badge,
  .community-badge {
    width: 100%;
    justify-content: center;
  }

  .nav-community-link span {
    display: none;
  }

  .nav-community-link {
    padding: 8px 10px;
  }
}

/* ==========================================
   NAV EXTRAS (privacy page Home link)
   ========================================== */
.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--berry-1);
}

/* ==========================================
   LEGAL DOCUMENT PAGE
   ========================================== */

body.page-legal {
  height: auto;
  max-height: none;
  overflow-y: auto;
  background: var(--bg-top);
}

.legal-document-wrapper {
  padding: 80px 24px 100px;
  min-height: calc(100vh - 140px);
}

.legal-document {
  max-width: 780px;
  margin: 0 auto;
  font-family: var(--font-sans);
}

.legal-header {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 28px;
  margin-bottom: 36px;
}

.legal-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-high);
  line-height: 1.1;
  margin-bottom: 14px;
}

.legal-metadata-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.legal-metadata-row strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.meta-sep {
  opacity: 0.4;
  user-select: none;
}

.legal-summary-callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-surface);
  border-left: 4px solid var(--berry-1);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 48px;
}

.callout-icon {
  color: var(--berry-1);
  flex-shrink: 0;
  padding-top: 2px;
  opacity: 0.9;
}

.callout-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.callout-content strong {
  color: var(--text-high);
  font-weight: 700;
}

.legal-body {
  display: flex;
  flex-direction: column;
}

.legal-section {
  margin-bottom: 44px;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-high);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  letter-spacing: -0.01em;
}

.legal-section h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--berry-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 22px 0 10px;
}

.legal-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal-section p strong,
.legal-section li strong {
  color: var(--text-high);
  font-weight: 600;
}

.legal-section ul {
  padding-left: 22px;
  margin-bottom: 14px;
}

.legal-section li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 10px;
}

.legal-section code {
  background: var(--pill-bg);
  color: var(--berry-1);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.legal-section a {
  color: var(--berry-1);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.legal-section a:hover {
  border-bottom-color: var(--berry-1);
}

.legal-contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 16px;
}

.legal-contact-card p {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.legal-contact-card p:last-child {
  margin-bottom: 0;
}

.legal-contact-card a {
  color: var(--berry-1);
  text-decoration: none;
}
