/* ==========================================================================
   MoodAura — landing page
   "Aura calme" design system. Light + dark, brand-aligned with the app.
   Brand: indigo #6171CC · teal #2688A6 · coral #FF7043
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Brand */
  --indigo: #6171cc;
  --teal: #2688a6;
  --coral: #ff7043;

  /* Light theme surfaces & text */
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f1f2fa;
  --text: #1f2233;
  --text-soft: #565a72;
  --border: rgba(31, 34, 51, 0.08);
  --shadow: 0 12px 40px rgba(31, 34, 51, 0.1);
  --shadow-soft: 0 6px 24px rgba(31, 34, 51, 0.07);

  /* Brand tints used on light */
  --primary: var(--indigo);
  --on-primary: #ffffff;
  --accent: var(--coral);
  --aura-1: rgba(97, 113, 204, 0.45);
  --aura-2: rgba(38, 136, 166, 0.4);
  --aura-3: rgba(255, 112, 67, 0.35);
  --hero-veil: rgba(247, 248, 252, 0.6);

  /* Type */
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    system-ui, sans-serif;

  --maxw: 1160px;
  --radius: 20px;
  --radius-sm: 14px;
}

[data-theme="dark"] {
  --bg: #0f1014;
  --surface: #1a1b22;
  --surface-2: #22232c;
  --text: #e7e8f0;
  --text-soft: #a2a5b8;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.4);

  /* Slightly lifted hues for contrast on dark */
  --primary: #8b97e0;
  --accent: #ff8a65;
  --aura-1: rgba(139, 151, 224, 0.34);
  --aura-2: rgba(79, 179, 206, 0.3);
  --aura-3: rgba(255, 138, 101, 0.26);
  --hero-veil: rgba(15, 16, 20, 0.55);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Aura background ------------------------------------------------------ */
.aura-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.9;
  animation: drift 22s ease-in-out infinite;
}

.orb.o1 {
  width: 46vw;
  height: 46vw;
  background: var(--aura-1);
  top: -12vw;
  left: -8vw;
}

.orb.o2 {
  width: 40vw;
  height: 40vw;
  background: var(--aura-2);
  top: 18vw;
  right: -12vw;
  animation-delay: -7s;
}

.orb.o3 {
  width: 34vw;
  height: 34vw;
  background: var(--aura-3);
  top: 60vw;
  left: 20vw;
  animation-delay: -13s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(4vw, 3vw) scale(1.08);
  }
  66% {
    transform: translate(-3vw, 2vw) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb {
    animation: none;
  }
}

/* ---- Top bar -------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-mark img {
  height: 32px;
  width: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.lang a {
  color: var(--text-soft);
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.lang a.active {
  color: var(--primary);
}

.lang .sep {
  color: var(--border);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* ---- Buttons -------------------------------------------------------------- */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.store-buttons a {
  transition: transform 0.2s ease, filter 0.2s ease;
}

.store-buttons a:hover {
  transform: translateY(-2px);
}

.store-buttons img {
  height: 54px;
  width: auto;
}

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

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 18px;
  background: linear-gradient(120deg, var(--indigo), var(--teal) 55%, var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-soft);
  max-width: 540px;
  margin-bottom: 32px;
}

/* Phone mockup */
.hero-visual {
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: 300px;
  max-width: 78vw;
  border-radius: 44px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.phone::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  border-radius: 0 0 16px 16px;
  background: var(--surface-2);
  z-index: 2;
}

.phone img {
  width: 100%;
  border-radius: 33px;
  display: block;
}

/* ---- Sections ------------------------------------------------------------- */
section.block {
  padding: 80px 0;
}

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

.section-head h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.section-head p {
  font-size: 1.15rem;
  color: var(--text-soft);
}

/* ---- Feature cards -------------------------------------------------------- */
.features ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.features li:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.features li h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.features li p {
  color: var(--text-soft);
  font-size: 0.98rem;
}

.features li .ic {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--indigo) 22%, transparent),
    color-mix(in srgb, var(--teal) 22%, transparent)
  );
  color: var(--primary);
  font-size: 1.3rem;
}

/* ---- Showcase (alternating rows) ----------------------------------------- */
.showcase {
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

.feature-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 88px;
}

.feature-item:last-child {
  margin-bottom: 0;
}

.feature-item.reverse .feature-image {
  order: 2;
}

.feature-image {
  display: flex;
  justify-content: center;
}

.feature-image .phone {
  width: 270px;
}

.feature-content h3 {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.feature-content .feature-desc {
  color: var(--text-soft);
  font-size: 1.08rem;
}

.feature-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ---- Download ------------------------------------------------------------- */
.download .wrap {
  text-align: center;
}

.download .panel {
  background: linear-gradient(135deg, var(--indigo), var(--teal));
  border-radius: 28px;
  padding: 64px 32px;
  color: #fff;
  box-shadow: var(--shadow);
}

.download .panel h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
}

.download .panel p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  margin-bottom: 32px;
}

.download .store-buttons {
  justify-content: center;
}

/* ---- Contact -------------------------------------------------------------- */
.contact .wrap {
  text-align: center;
}

.contact-email-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* ---- Footer --------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 40px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.footer-creator {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.footer-nav {
  display: flex;
  gap: 22px;
}

.footer-nav a {
  color: var(--text-soft);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--primary);
}

/* ---- Secondary pages (legal / restriction / changelog) ------------------- */
.doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-weight: 600;
  color: var(--text-soft);
}

.back-link:hover {
  color: var(--primary);
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 40px clamp(24px, 5vw, 56px);
}

/* Headings + injected markdown content (#content-area) */
.doc-card h1,
.doc-card h2,
.doc-card h3 {
  color: var(--text);
  margin: 1.6em 0 0.5em;
}

.doc-card h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  margin-top: 0;
}

.doc-card h2 {
  font-size: 1.4rem;
}

.doc-card h3 {
  font-size: 1.15rem;
}

.doc-card p,
.doc-card li {
  color: var(--text-soft);
  font-size: 1.02rem;
}

.doc-card ul,
.doc-card ol {
  padding-left: 1.3em;
}

.doc-card li {
  margin: 0.4em 0;
}

.doc-card a {
  color: var(--primary);
  text-decoration: underline;
}

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

.doc-card hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.doc-card blockquote {
  margin: 1.2em 0;
  padding: 0.6em 1.1em;
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
}

.doc-card code {
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.92em;
}

/* Restriction page emphasis */
.doc-card .warning {
  margin-top: 1.8em;
  padding: 16px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--coral) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--coral) 35%, transparent);
  color: var(--text);
  font-weight: 600;
}

/* Changelog */
.changelog .version {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.changelog .version:last-child {
  border-bottom: none;
}

.changelog .version h3 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-size: 0.95rem;
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-visual {
    order: -1;
  }
  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }
  .hero .store-buttons {
    justify-content: center;
  }
  .feature-item {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
    margin-bottom: 64px;
  }
  .feature-item.reverse .feature-image {
    order: 0;
  }
  .feature-content {
    order: 2;
  }
}

@media (max-width: 520px) {
  section.block {
    padding: 56px 0;
  }
  .download .panel {
    padding: 44px 22px;
  }
}
