/* =====================================================================
 * Calmir — marketing site
 *
 * Single shared stylesheet. Premium minimalism: dark backdrop, jewel
 * tone accents, ultra-light serif headlines, generous whitespace.
 * Design language mirrors the iOS app exactly.
 * ===================================================================== */

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg-0: #050507;
  --bg-1: #0a0a0e;
  --bg-2: #0e0e15;

  --fg-1: rgba(255, 255, 255, 0.94);
  --fg-2: rgba(255, 255, 255, 0.65);
  --fg-3: rgba(255, 255, 255, 0.42);
  --fg-4: rgba(255, 255, 255, 0.18);
  --hairline: rgba(255, 255, 255, 0.08);

  --emerald: #1ad88c;
  --sapphire: #2e6bf2;
  --amethyst: #9e4dec;

  --serif: "Cormorant Garamond", "EB Garamond", "Iowan Old Style",
           "Apple Garamond", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
           "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --max-w: 1080px;
  --gap-section: 160px;
  --radius: 18px;
  --duration-slow: 0.7s;
  --easing: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Body ────────────────────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg-1);
  background: radial-gradient(ellipse at 50% 25%,
                              #131320 0%,
                              var(--bg-0) 60%,
                              #020203 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Persistent particle canvas behind everything */
.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* All content layers float above the canvas */
main, header, footer { position: relative; z-index: 1; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

section {
  padding: var(--gap-section) 0;
}
@media (max-width: 720px) {
  :root { --gap-section: 100px; }
  section { padding: 100px 0; }
}

/* ── Typography ──────────────────────────────────────────────────────── */
.serif { font-family: var(--serif); font-weight: 300; letter-spacing: 0.01em; }
.mono  { font-family: var(--mono); font-size: 0.84em; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 200;
  letter-spacing: 0.005em;
  line-height: 1.15;
  color: var(--fg-1);
}

h1 {
  font-size: clamp(56px, 9vw, 110px);
  font-weight: 200;
  letter-spacing: 0.012em;
}
h2 {
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: 28px;
}
h3 {
  font-size: 22px;
  font-weight: 300;
  margin-bottom: 10px;
}

p {
  color: var(--fg-2);
  font-weight: 300;
  max-width: 60ch;
}
p.lead {
  font-size: 19px;
  color: var(--fg-2);
  line-height: 1.7;
}
p.tiny {
  font-size: 13px;
  color: var(--fg-3);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: inline-block;
  margin-bottom: 22px;
}

a.text-link {
  color: var(--fg-1);
  border-bottom: 1px solid var(--fg-4);
  transition: border-color 0.2s;
}
a.text-link:hover { border-bottom-color: var(--fg-1); }

/* ── Header / nav ────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 22px 28px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(8, 8, 12, 0.45);
  border-bottom: 0.5px solid var(--hairline);
}
.site-header .brand {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  letter-spacing: 0.10em;
  color: var(--fg-1);
}
.site-header nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 13px;
  font-weight: 400;
}
.site-header nav a {
  color: var(--fg-3);
  transition: color 0.2s;
}
.site-header nav a:hover { color: var(--fg-1); }

@media (max-width: 540px) {
  .site-header nav ul { gap: 16px; font-size: 12px; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 28px 80px;
  position: relative;
}
.hero .wordmark {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(72px, 12vw, 140px);
  letter-spacing: 0.03em;
  color: var(--fg-1);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 1.2s var(--easing) 0.2s forwards;
}
.hero .tagline {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
  margin-bottom: 80px;
  opacity: 0;
  animation: fadeUp 1.2s var(--easing) 0.5s forwards;
}
.hero .orb-stage {
  margin: 0 auto;
  opacity: 0;
  animation: fadeIn 1.6s var(--easing) 0.1s forwards;
}
.hero .pill-row {
  display: flex;
  gap: 14px;
  margin-top: 64px;
  opacity: 0;
  animation: fadeUp 1.2s var(--easing) 0.8s forwards;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Animated CSS orb ────────────────────────────────────────────────── */
.orb {
  width: clamp(220px, 38vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, transparent 18%),
    radial-gradient(circle at 35% 30%,
                    var(--sapphire) 0%,
                    #5a3acc 38%,
                    var(--amethyst) 62%,
                    #1a1028 95%);
  box-shadow:
    0 0 120px rgba(46, 107, 242, 0.40),
    0 0 60px rgba(158, 77, 236, 0.25),
    inset 0 -25px 60px rgba(0, 0, 0, 0.55),
    inset 8px 12px 30px rgba(255, 255, 255, 0.06);
  animation: breath 5.5s ease-in-out infinite;
}
.orb::before {
  /* outer atmospheric halo */
  content: "";
  position: absolute;
  inset: -28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,107,242,0.30) 0%, transparent 60%);
  filter: blur(40px);
  z-index: -1;
  animation: pulse 5.5s ease-in-out infinite;
}
.orb::after {
  /* fresnel rim */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  background: conic-gradient(from 0deg,
                             var(--emerald),
                             var(--sapphire),
                             var(--amethyst),
                             var(--emerald)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.45;
  filter: blur(0.6px);
}
@keyframes breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.05); opacity: 1.0;  }
}

/* Mini orbs reused on feature cards */
.orb-mini {
  width: 72px; height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, transparent 22%),
    radial-gradient(circle at 35% 30%,
                    var(--sapphire) 0%,
                    var(--amethyst) 65%,
                    #0a0612 95%);
  box-shadow: 0 0 30px rgba(46,107,242,0.35),
              inset 0 -8px 20px rgba(0,0,0,0.5);
}
.orb-mini.emerald {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, transparent 22%),
    radial-gradient(circle at 35% 30%, var(--emerald) 0%, var(--sapphire) 70%, #06121a 95%);
  box-shadow: 0 0 30px rgba(26,216,140,0.35), inset 0 -8px 20px rgba(0,0,0,0.5);
}
.orb-mini.amethyst {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, transparent 22%),
    radial-gradient(circle at 35% 30%, var(--amethyst) 0%, var(--sapphire) 70%, #0e0820 95%);
  box-shadow: 0 0 30px rgba(158,77,236,0.35), inset 0 -8px 20px rgba(0,0,0,0.5);
}

/* ── Buttons / pills ─────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg,
                              rgba(255,255,255,0.16),
                              rgba(255,255,255,0.04));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255,255,255,0.30);
  color: var(--fg-1);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.25s var(--easing), border-color 0.25s;
  cursor: pointer;
}
.pill:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.55);
}
.pill .arrow { font-size: 16px; }

.pill.muted {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: var(--fg-2);
}

/* ── Generic centered text section ───────────────────────────────────── */
.text-block {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.text-block p { margin: 0 auto; }

/* ── Feature grid ────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 64px;
}
.feature-card {
  padding: 36px 30px 32px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  border: 0.5px solid var(--hairline);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.4s var(--easing), border-color 0.4s;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
}
.feature-card .glyph {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 0.5px solid var(--hairline);
  margin-bottom: 22px;
  color: var(--fg-1);
}
.feature-card h3 { margin-bottom: 10px; }
.feature-card p  { color: var(--fg-3); font-size: 14px; max-width: none; }

/* ── Pricing ─────────────────────────────────────────────────────────── */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 720px;
  margin: 64px auto 0;
}
.plan {
  position: relative;
  padding: 32px 28px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  border: 0.5px solid var(--hairline);
}
.plan.featured {
  border-color: rgba(46,107,242,0.55);
  box-shadow: 0 0 60px rgba(46,107,242,0.18);
}
.plan .badge {
  position: absolute;
  top: -10px; right: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sapphire);
  color: white;
  box-shadow: 0 0 18px rgba(46,107,242,0.6);
}
.plan .name {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--fg-3); margin-bottom: 6px;
}
.plan .price {
  font-family: var(--serif); font-weight: 200;
  font-size: 42px; color: var(--fg-1); line-height: 1.1;
}
.plan .price .period {
  font-family: var(--sans); font-size: 14px;
  color: var(--fg-3); font-weight: 300;
}
.plan .meta { font-size: 13px; color: var(--fg-3); margin-top: 10px; }

/* ── Privacy spotlight ───────────────────────────────────────────────── */
.privacy-spotlight {
  text-align: center;
  padding: 120px 28px;
  background: radial-gradient(ellipse at 50% 0%,
                              rgba(46,107,242,0.10),
                              transparent 60%);
}
.privacy-spotlight h2 {
  font-size: clamp(40px, 6vw, 72px);
  margin-bottom: 24px;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,0.55));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.privacy-spotlight p { margin: 0 auto; color: var(--fg-2); }

/* ── Long-form legal pages ───────────────────────────────────────────── */
.legal {
  padding: 160px 28px 120px;
  max-width: 720px;
  margin: 0 auto;
}
.legal h1 {
  font-size: clamp(40px, 6vw, 64px);
  margin-bottom: 18px;
}
.legal .updated {
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 56px;
}
.legal h2 {
  font-size: 22px;
  font-weight: 300;
  font-family: var(--sans);
  color: var(--fg-1);
  margin: 48px 0 14px;
  letter-spacing: 0.005em;
}
.legal p, .legal ul, .legal ol {
  color: var(--fg-2);
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.75;
  max-width: none;
}
.legal ul, .legal ol { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--fg-1); font-weight: 500; }
.legal a { color: var(--fg-1); border-bottom: 1px solid var(--fg-4); }
.legal a:hover { border-bottom-color: var(--fg-1); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 0.5px solid var(--hairline);
  padding: 60px 28px 80px;
  margin-top: 80px;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}
.site-footer .brand {
  font-family: var(--serif);
  font-weight: 200;
  font-size: 24px;
  letter-spacing: 0.10em;
}
.site-footer nav ul {
  display: flex;
  gap: 26px;
  list-style: none;
  font-size: 13px;
}
.site-footer nav a { color: var(--fg-3); transition: color 0.2s; }
.site-footer nav a:hover { color: var(--fg-1); }
.site-footer .copyright {
  font-size: 12px; color: var(--fg-4);
  width: 100%; text-align: center; margin-top: 32px;
}

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reveal-on-scroll classes (set by IntersectionObserver in animation.js) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--easing), transform 0.9s var(--easing);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
