/* =========================================================
   still. — marketing site
   Palette + tokens ported 1:1 from
     water/CalmSip/Core/DesignSystem/Palette.swift
     water/CalmSip/Core/DesignSystem/AppTheme.swift
   ========================================================= */

:root {
  /* Background gradient — light mode (Palette.bg*) */
  --bg-top:    #F3F6F4;
  --bg-mid:    #DCE9EA;
  --bg-bottom: #B6D0D2;

  /* Ink */
  --ink:      #1E3A3D;
  --ink-soft: #2C4A4E;

  /* Accent (Sage by default; .theme-* classes override) */
  --tint:        #5B8A8E;
  --tint-deep:   #4A7276;
  --action-a:    #5B8A8E;
  --action-b:    #4A7276;
  --action-shadow: rgba(74, 114, 118, 0.28);

  /* Surfaces */
  --surface-muted:        rgba(255, 255, 255, 0.55);
  --surface-muted-strong: rgba(255, 255, 255, 0.50);
  --card-stroke:          rgba(255, 255, 255, 0.45);
  --glow:                 rgba(255, 255, 255, 0.55);

  /* Status */
  --danger: #B45A4E;

  /* Type — system fonts only, matching the app's
     .font(.system(..., design: .serif)) and .design(.rounded).
     On Apple platforms these resolve to New York and SF Pro Rounded,
     which is exactly what the iOS app uses. */
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "SF Pro Rounded", ui-rounded, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

/* Per-accent overrides (used by the theme picker JS).
   Hex values are 1:1 with AppTheme.swift > AccentPalette. */
.theme-sage {
  --tint: #5B8A8E; --tint-deep: #4A7276;
  --action-a: #5B8A8E; --action-b: #4A7276;
  --action-shadow: rgba(74, 114, 118, 0.28);
}
.theme-warm-sand {
  --tint: #B79468; --tint-deep: #9A7B52;
  --action-a: #B79468; --action-b: #9A7B52;
  --action-shadow: rgba(154, 123, 82, 0.28);
}
.theme-soft-lavender {
  --tint: #8A7895; --tint-deep: #73627E;
  --action-a: #8A7895; --action-b: #73627E;
  --action-shadow: rgba(115, 98, 126, 0.28);
}
.theme-sunrise {
  --tint: #E08A6A; --tint-deep: #C2734F;
  --action-a: #E08A6A; --action-b: #C2734F;
  --action-shadow: rgba(194, 115, 79, 0.28);
}

/* Dark mode — Palette.swift dark variants */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-top:    #0E1B1E;
    --bg-mid:    #14272B;
    --bg-bottom: #1C3438;

    --ink:      #E8F0EE;
    --ink-soft: #A9C0C3;

    --tint:        #8FB9BD;
    --tint-deep:   #6FA4A9;
    --action-a:    #4F8388;
    --action-b:    #3C6266;
    --action-shadow: rgba(0, 0, 0, 0.45);

    --surface-muted:        rgba(255, 255, 255, 0.06);
    --surface-muted-strong: rgba(255, 255, 255, 0.08);
    --card-stroke:          rgba(255, 255, 255, 0.10);
    --glow:                 rgba(255, 255, 255, 0.08);

    color-scheme: dark;
  }
  .theme-sage         { --tint: #8FB9BD; --tint-deep: #6FA4A9; --action-a: #4F8388; --action-b: #3C6266; }
  .theme-warm-sand    { --tint: #D9B886; --tint-deep: #BFA070; --action-a: #A88159; --action-b: #825F3B; }
  .theme-soft-lavender{ --tint: #B5A0C2; --tint-deep: #9786A0; --action-a: #7B6986; --action-b: #5E4F69; }
  .theme-sunrise      { --tint: #F0A88A; --tint-deep: #D49075; --action-a: #C97A5E; --action-b: #A55E3C; }
}

/* =========================================================
   Reset + base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-top);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(
      ellipse 120% 60% at 50% 12%,
      var(--glow) 0%,
      transparent 60%
    ),
    linear-gradient(
      to bottom,
      var(--bg-top) 0%,
      var(--bg-mid) 55%,
      var(--bg-bottom) 100%
    );
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   Layout primitives
   ========================================================= */
.shell {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

/* =========================================================
   Wordmark
   ========================================================= */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
}
.wordmark .word { display: inline-block; }
.wordmark .drop {
  display: inline-block;
  width: 0.30em;
  height: 0.30em;
  transform: translateY(0.04em);
  color: var(--tint);
  flex-shrink: 0;
}
.wordmark .drop svg {
  width: 100%; height: 100%;
  display: block;
  fill: currentColor;
}

/* =========================================================
   Animated wave background (mirrors WaterSplashBackground)
   ========================================================= */
.wave-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.wave-bg svg {
  position: absolute;
  bottom: 0; left: -10%;
  width: 220%;
  height: 38vh;
  min-height: 240px;
  opacity: 0.85;
}
.wave-bg .wave-fill { fill: var(--tint); opacity: 0.22; }

@media (prefers-reduced-motion: no-preference) {
  .wave-bg svg {
    animation: wave-drift 14s linear infinite;
  }
}
@keyframes wave-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 14px;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--bg-top) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
}
.nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav .wordmark {
  font-size: 22px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-soft);
  opacity: 0.78;
  transition: opacity .2s var(--ease), color .2s var(--ease);
}
.nav-links a:hover { opacity: 1; color: var(--ink); }
.nav-links .pill {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--action-a), var(--action-b));
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 18px -4px var(--action-shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.nav-links .pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -4px var(--action-shadow);
  opacity: 1;
}
@media (max-width: 640px) {
  .nav-links .hide-sm { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
  padding-block: clamp(60px, 10vh, 120px) clamp(40px, 8vh, 100px);
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
}

.hero h1.wordmark {
  font-size: clamp(96px, 16vw, 200px);
  margin: 0 0 28px;
}
@media (max-width: 880px) {
  .hero h1.wordmark { justify-content: center; }
}

.hero .tagline {
  /* Matches the app's WelcomeSplashView tagline:
     .font(.system(..., weight: .regular, design: .rounded)). */
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.35;
  color: var(--ink);
  opacity: 0.72;
  margin: 0 0 36px;
  max-width: 22ch;
}
@media (max-width: 880px) {
  .hero .tagline { margin-inline: auto; }
}

.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
@media (max-width: 880px) {
  .hero .cta-row { justify-content: center; }
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  padding: 12px 22px 12px 18px;
  border-radius: 14px;
  font-family: var(--font-sans);
  transition: transform .2s var(--ease);
}
.app-store-badge:hover { transform: translateY(-1px); }
.app-store-badge .glyph {
  width: 28px; height: 28px; fill: currentColor;
}
.app-store-badge .small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  line-height: 1;
  margin-bottom: 3px;
}
.app-store-badge .big {
  display: block;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.hero .micro {
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0.62;
  letter-spacing: 0.01em;
  margin: 0;
}

/* =========================================================
   Phone frame + mockups
   ========================================================= */
.phone {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 9 / 19.5;
  margin-inline: auto;
  border-radius: 46px;
  padding: 12px;
  background:
    linear-gradient(160deg, #0a1416 0%, #1d3236 50%, #0a1416 100%);
  box-shadow:
    0 30px 60px -20px rgba(20, 39, 43, 0.45),
    0 8px 22px -10px rgba(20, 39, 43, 0.4),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.06);
}
.phone::before {
  content: "";
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 96px; height: 26px;
  border-radius: 14px;
  background: #000;
  z-index: 3;
}
/* When the screen holds a real iOS screenshot, suppress the CSS chrome
   (notch, soft glow, animated wave) — the screenshot already includes
   the device's own dynamic island and the app's background. */
.phone.has-screenshot::before { display: none; }
.phone.has-screenshot .phone-screen .glow,
.phone.has-screenshot .phone-screen .mini-wave { display: none; }
.phone-screen > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.phone-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background:
    linear-gradient(
      to bottom,
      #F3F6F4 0%,
      #DCE9EA 55%,
      #B6D0D2 100%
    );
  isolation: isolate;
}

/* =========================================================
   Quiet promise
   ========================================================= */
.promise {
  padding-block: clamp(60px, 9vh, 110px);
  text-align: center;
}
.promise p {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 22ch;
  margin: 0 auto;
}
.promise p em {
  font-style: normal;
  color: var(--tint-deep);
  font-weight: 400;
}

/* =========================================================
   Feature grid
   ========================================================= */
.features {
  padding-block: clamp(40px, 7vh, 80px);
}
.section-head {
  text-align: center;
  margin-bottom: clamp(36px, 6vh, 64px);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 44px);
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.section-head p {
  color: var(--ink-soft);
  opacity: 0.75;
  font-size: 15px;
  max-width: 46ch;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
@media (max-width: 880px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature {
  position: relative;
  padding: 26px 24px 28px;
  border-radius: 22px;
  background: var(--surface-muted);
  border: 1px solid var(--card-stroke);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.feature:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tint) 35%, transparent);
}
.feature .icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint) 18%, transparent);
  color: var(--tint-deep);
  margin-bottom: 14px;
}
.feature .icon svg { width: 20px; height: 20px; fill: currentColor; }
.feature h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}
.feature p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  opacity: 0.82;
  line-height: 1.55;
}

/* =========================================================
   Theme picker
   ========================================================= */
.themes {
  padding-block: clamp(60px, 9vh, 100px);
}
.theme-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--card-stroke);
  font-size: 14px;
  color: var(--ink);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.theme-chip:hover { transform: translateY(-1px); }
.theme-chip .swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 6px -1px rgba(0,0,0,0.18);
}
.theme-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--tint) 16%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--tint) 50%, transparent);
}
.theme-chip .lock {
  font-size: 10px;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* =========================================================
   Screens trio
   ========================================================= */
.screens {
  padding-block: clamp(40px, 7vh, 80px);
}
.screen-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: end;
}
@media (max-width: 880px) {
  .screen-row { grid-template-columns: 1fr; }
}
.screen-row .phone { max-width: 280px; }
.screen-row .caption {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  opacity: 0.7;
  text-align: center;
  margin-top: 18px;
}

/* =========================================================
   Support card
   ========================================================= */
.support {
  padding-block: clamp(60px, 9vh, 100px);
}
.support .card {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 44px);
  border-radius: 26px;
  background: var(--surface-muted);
  border: 1px solid var(--card-stroke);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  text-align: center;
}
.support .price {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.support .price .cur {
  font-size: 0.55em;
  vertical-align: top;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-right: 2px;
}
.support .price .once {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
}
.support h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -0.01em;
  margin: 18px 0 12px;
}
.support p {
  color: var(--ink-soft);
  opacity: 0.82;
  font-size: 15px;
  max-width: 44ch;
  margin: 0 auto 4px;
}
.support .perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.support .perk {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 25%, transparent);
}

/* =========================================================
   Disclaimer
   ========================================================= */
.disclaimer {
  padding-block: 40px 30px;
  text-align: center;
}
.disclaimer p {
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0.55;
  max-width: 56ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  padding-block: 40px 60px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.footer .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer .wordmark { font-size: 22px; }
.footer .links {
  display: flex;
  gap: 22px;
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0.7;
}
.footer .links a:hover { opacity: 1; color: var(--ink); }
.footer .copy {
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.5;
  width: 100%;
  text-align: center;
  margin-top: 12px;
}

/* =========================================================
   Reveal on scroll
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
