/* hum · rituals — marketing site
 * Single stylesheet for index.html, support.html, privacy.html.
 * Mobile-first. Matches the in-app design system (Wes Anderson Grand Budapest).
 *
 * NOTE on .phone aspect ratio:
 *   We do NOT use `aspect-ratio: 1206/2622` on the `.phone` wrapper.
 *   When a flex child has both `aspect-ratio` and `padding`, WebKit
 *   ignores the padding when computing main-axis size, which warps the
 *   image (vertically squished). Instead, the inner <img> drives the
 *   height via its intrinsic dimensions + width:100% / height:auto, and
 *   the bezel is a `border` on the <img> itself (no padding container).
 *   See: https://github.com/WebKit/WebKit/pull/49514 (fix in flight).
 */

:root {
  --bg: #0f0e14;
  --surface: #17151e;
  --card: #1e1c27;
  --card-soft: #1a1822;
  --border: #2e2938;
  --border-soft: rgba(46, 41, 56, 0.55);

  --text: #faf7f4;
  --muted: #ada7b3;
  --dim: #767089;

  --primary: #e8a09a;
  --secondary: #9fb8d2;
  --bloom: #a990c2;
  --spark: #9fb7ba;
  --sage: #b5c68f;
  --crimson: #d27373;
  --gold: #e9c685;

  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-deep: 0 32px 80px rgba(0, 0, 0, 0.55);

  --t-eyebrow: clamp(0.68rem, 0.62rem + 0.2vw, 0.78rem);
  --t-h1: clamp(2.6rem, 2rem + 4.5vw, 4.6rem);
  --t-h2: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem);
  --t-h3: clamp(1.05rem, 1rem + 0.4vw, 1.2rem);
  --t-body: clamp(0.95rem, 0.92rem + 0.2vw, 1.05rem);
  --t-sub: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto,
    'Helvetica Neue', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv11', 'tnum';
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient halo */
.halo {
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 90vh;
  background:
    radial-gradient(
      60% 60% at 50% 0%,
      rgba(232, 160, 154, 0.22) 0%,
      rgba(232, 160, 154, 0.1) 30%,
      rgba(232, 160, 154, 0.03) 55%,
      transparent 75%
    );
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

body.page-doc .halo {
  display: none;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover,
a:focus-visible {
  opacity: 0.85;
}

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

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

main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

/* TOP BAR ─────────────────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.1rem, 3vw, 1.5rem) clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #f6c5c0 0%,
    var(--primary) 55%,
    #b97c77 100%
  );
  box-shadow:
    0 0 0 1px rgba(232, 160, 154, 0.35),
    0 0 18px rgba(232, 160, 154, 0.45);
}

.brand-name {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.topnav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.6rem);
  font-size: 0.9rem;
  color: var(--muted);
}

.topnav a {
  color: var(--muted);
}

/* HERO ───────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.eyebrow-center {
  text-align: center;
}

.hero h1 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: var(--t-h1);
  font-weight: 200;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-accent {
  display: inline-block;
  background: linear-gradient(180deg, #f4b8b1 0%, var(--primary) 55%, #cc8b85 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: clamp(0.85rem, 2vw, 1.1rem) auto 0;
  max-width: 30ch;
  font-size: var(--t-sub);
  line-height: 1.45;
  color: var(--muted);
  font-weight: 300;
}

/* PHONE MOCKUP ────────────────────────────────────────────────────── */
.hero-stage {
  margin-top: clamp(2rem, 5vw, 3rem);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

/* Soft halo behind hero phone */
.hero-stage::before {
  content: '';
  position: absolute;
  width: clamp(280px, 80vw, 540px);
  height: clamp(280px, 80vw, 540px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(232, 160, 154, 0.32) 0%,
    rgba(232, 160, 154, 0.12) 38%,
    transparent 70%
  );
  filter: blur(14px);
  z-index: -1;
}

/*
 * `.phone` is a wrapper that gives the screenshot a device-style border
 * and shadow — but the *image itself* drives the height (no aspect-ratio
 * on the wrapper, no padding-based bezel). This sidesteps the WebKit
 * flex+aspect-ratio+padding bug entirely.
 */
.phone {
  --phone-w: clamp(200px, 58vw, 300px);
  width: var(--phone-w);
  display: block;
  position: relative;
  filter: drop-shadow(0 22px 56px rgba(0, 0, 0, 0.55));
}

/* Honest screenshot: the <img>'s intrinsic 1206×2622 ratio drives the
 * height. No crop, no aspect-ratio override — what the user sees in
 * the App Store is what they see here. */
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(26px, calc(var(--phone-w) * 0.12), 38px);
  border: 1px solid rgba(232, 160, 154, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.phone--hero {
  --phone-w: clamp(210px, 60vw, 310px);
}

/* TRUST ROW ──────────────────────────────────────────────────────── */
.trust-row {
  margin: clamp(2rem, 4vw, 2.5rem) auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.4rem;
  font-size: 0.85rem;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.trust-row li {
  position: relative;
  padding-left: 1rem;
}

.trust-row li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--primary);
  opacity: 0.65;
}

.trust-row li:first-child {
  padding-left: 0;
}

.trust-row li:first-child::before {
  display: none;
}

/* SECTIONS ───────────────────────────────────────────────────────── */
section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

section h2 {
  margin: 0 auto;
  max-width: 22ch;
  text-align: center;
  font-size: var(--t-h2);
  font-weight: 200;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}

/* FEATURES ────────────────────────────────────────────────────────── */
.features {
  position: relative;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.feature-rail {
  --gap: clamp(1rem, 3vw, 1.75rem);
  margin-top: clamp(2rem, 5vw, 3rem);
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(1rem, 4vw, 2.5rem);
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 1.5rem;
  margin-inline: calc(-1 * clamp(1rem, 4vw, 2.5rem));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.feature-rail::-webkit-scrollbar {
  display: none;
}

.feature {
  flex: 0 0 min(78vw, 290px);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 1.6rem 1.2rem 1.4rem;
  background: linear-gradient(
    180deg,
    rgba(30, 28, 39, 0.85) 0%,
    rgba(23, 21, 30, 0.85) 100%
  );
  border: 1px solid var(--feature-color, var(--border-soft));
  border-radius: var(--radius-lg);
  position: relative;
  isolation: isolate;
  backdrop-filter: blur(6px);
}

.feature::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    80% 50% at 50% 0%,
    var(--feature-glow, rgba(232, 160, 154, 0.2)) 0%,
    transparent 70%
  );
  opacity: 0.95;
  pointer-events: none;
  z-index: -1;
}

.feature--mood {
  --feature-color: rgba(169, 144, 194, 0.4);
  --feature-glow: rgba(169, 144, 194, 0.24);
  --feature-tag-color: var(--bloom);
}
.feature--habits {
  --feature-color: rgba(181, 198, 143, 0.4);
  --feature-glow: rgba(181, 198, 143, 0.22);
  --feature-tag-color: var(--sage);
}
.feature--decide {
  --feature-color: rgba(159, 183, 186, 0.42);
  --feature-glow: rgba(159, 183, 186, 0.24);
  --feature-tag-color: var(--spark);
}
.feature--awards {
  --feature-color: rgba(233, 198, 133, 0.4);
  --feature-glow: rgba(233, 198, 133, 0.24);
  --feature-tag-color: var(--gold);
}
.feature--reasons {
  --feature-color: rgba(210, 115, 115, 0.42);
  --feature-glow: rgba(210, 115, 115, 0.26);
  --feature-tag-color: var(--crimson);
}
.feature--you {
  --feature-color: rgba(232, 160, 154, 0.42);
  --feature-glow: rgba(232, 160, 154, 0.24);
  --feature-tag-color: var(--primary);
}

/* The phone inside a feature card — bigger relative to the card so the
 * screenshot is the dominant chunk (visual-first). */
.feature .phone {
  --phone-w: min(60vw, 200px);
}

.feature-meta {
  text-align: center;
}

.feature-tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--feature-tag-color, var(--primary));
  background: color-mix(in srgb, var(--feature-tag-color, var(--primary)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--feature-tag-color, var(--primary)) 30%, transparent);
}

.feature h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

@media (min-width: 880px) {
  .feature-rail {
    overflow: visible;
    scroll-snap-type: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-inline: 0;
    padding: 1rem 0 0;
  }
  .feature {
    flex: initial;
  }
  .feature .phone {
    --phone-w: min(220px, 100%);
  }
  .rail-hint {
    display: none;
  }
}

.rail-hint {
  margin: 0.4rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* PROMISE / MANIFESTO ────────────────────────────────────────────── */
.promise {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 0;
  position: relative;
}

.promise-headline {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(2rem, 1.6rem + 2.5vw, 3rem);
  font-weight: 200;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
}

.promise-accent {
  display: inline-block;
  background: linear-gradient(180deg, #f4b8b1 0%, var(--primary) 55%, #cc8b85 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.promise-list {
  list-style: none;
  margin: clamp(2rem, 4vw, 2.6rem) auto 0;
  padding: 1.4rem 1.6rem;
  max-width: 28rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1.4rem;
  background: rgba(232, 160, 154, 0.04);
  border: 1px solid rgba(232, 160, 154, 0.2);
  border-radius: var(--radius-lg);
  font-size: clamp(0.95rem, 0.9rem + 0.4vw, 1.08rem);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}

.promise-list li {
  position: relative;
  padding-left: 1.5rem;
  text-align: left;
}

/* Subtle ✕ marker — these are *absences*, not features. */
.promise-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background-image:
    linear-gradient(45deg, transparent 45%, var(--primary) 45%, var(--primary) 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, var(--primary) 45%, var(--primary) 55%, transparent 55%);
  opacity: 0.7;
}

@media (max-width: 480px) {
  .promise-list {
    grid-template-columns: 1fr;
    max-width: 22rem;
    gap: 0.55rem;
    padding: 1.2rem 1.4rem;
  }
}

.promise-coda {
  margin: clamp(1.6rem, 3vw, 2rem) auto 0;
  max-width: 30ch;
  font-size: clamp(0.95rem, 0.9rem + 0.4vw, 1.08rem);
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.005em;
}

/* FINAL CTA ──────────────────────────────────────────────────────── */
.final-cta {
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

.final-cta p {
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: var(--t-body);
}

/* FOOTER ─────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2.5rem) 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 0.65rem;
}

.footer-brand {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.4rem;
  font-size: 0.88rem;
}

.site-footer nav a {
  color: var(--muted);
}

.footer-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--dim);
}

/* DOC PAGES (support, privacy) ───────────────────────────────────── */
body.page-doc main {
  max-width: 720px;
  padding-bottom: 3rem;
}

body.page-doc h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.8rem);
  font-weight: 200;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
}

body.page-doc h2 {
  text-align: left;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 0.65rem;
  max-width: none;
}

body.page-doc p,
body.page-doc li {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

body.page-doc strong {
  color: var(--text);
  font-weight: 500;
}

.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem 1.25rem;
  margin-bottom: 1.1rem;
}

.card p,
.card li {
  margin: 0 0 0.6rem;
}

.card p:last-child,
.card li:last-child {
  margin-bottom: 0;
}

.card ul,
.card ol {
  margin: 0;
  padding-left: 1.2rem;
}

.card li {
  margin-bottom: 0.35rem;
}

.privacy h2 {
  margin: 1.6rem 0 0.6rem;
}

.privacy h2:first-of-type {
  margin-top: 0;
}

.meta {
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: 1rem;
}

/* REDUCE MOTION ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
