/* Roza — "Mesh Noir", mirrored from the app's DesignSystem package.
   Palette: Roza/Packages/DesignSystem/Sources/DesignSystem/Colors/Palette.swift */

@property --tint {
  syntax: "<color>";
  inherits: true;
  initial-value: #ff9db4;
}

@property --tint-deep {
  syntax: "<color>";
  inherits: true;
  initial-value: #d4536f;
}

@property --lum {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.7;
}

:root {
  color-scheme: dark;

  /* Canvas */
  --noir: #070409;
  --noir-raised: #0d0812;
  --plum: #251e2b;

  /* Labels — the app expresses on-dark roles as alpha-on-white */
  --label-primary: #ffffff;
  --label-secondary: rgb(255 255 255 / 0.64);
  --label-tertiary: rgb(255 255 255 / 0.42);
  --fill: rgb(255 255 255 / 0.06);
  --fill-strong: rgb(255 255 255 / 0.1);
  --separator: rgb(255 255 255 / 0.1);

  /* Phase accents (base / deep) */
  --menstrual: #ff5775;
  --menstrual-deep: #a12341;
  --follicular: #ff9db4;
  --follicular-deep: #d4536f;
  --ovulation: #ffb199;
  --ovulation-deep: #d96a55;
  --luteal: #d6b2ff;
  --luteal-deep: #8a6cc4;

  --tint: var(--follicular);
  --tint-deep: var(--follicular-deep);
  --lum: 0.7;

  /* Spacing — xxxs(4) … xxxl(48); md(16) default gap, lg(20) margins */
  --xxxs: 4px;
  --xxs: 8px;
  --xs: 12px;
  --md: 16px;
  --lg: 20px;
  --xl: 24px;
  --xxl: 32px;
  --xxxl: 48px;

  /* Corner radius — sm(12) … xxl(28), card(36) */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-xxl: 28px;
  --r-card: 36px;

  /* Motion */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --handoff: cubic-bezier(0.22, 1, 0.36, 1);
  --chrome-fade: 0.6s ease;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  transition: --tint 1.2s var(--handoff), --tint-deep 1.2s var(--handoff), --lum 1.2s var(--handoff);
}

:root[data-phase="menstrual"] {
  --tint: var(--menstrual);
  --tint-deep: var(--menstrual-deep);
  --lum: 0.35;
}

:root[data-phase="follicular"] {
  --tint: var(--follicular);
  --tint-deep: var(--follicular-deep);
  --lum: 0.7;
}

:root[data-phase="ovulation"] {
  --tint: var(--ovulation);
  --tint-deep: var(--ovulation-deep);
  --lum: 1;
}

:root[data-phase="luteal"] {
  --tint: var(--luteal);
  --tint-deep: var(--luteal-deep);
  --lum: 0.6;
}

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

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

body {
  margin: 0;
  background: var(--noir);
  color: var(--label-primary);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: var(--md);
  top: -100px;
  z-index: 100;
  padding: var(--xxs) var(--md);
  border-radius: 999px;
  background: var(--label-primary);
  color: var(--noir);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--md);
}

/* ---------- Sky: the app's drifting 3×3 mesh, as five breathing pools ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--noir);
  pointer-events: none;
}

.sky__pool {
  position: absolute;
  width: 80vmax;
  height: 80vmax;
  margin: -40vmax 0 0 -40vmax;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--tint) 20%, transparent),
    color-mix(in srgb, var(--tint) 7%, transparent) 55%,
    transparent
  );
  animation: pool-breathe 12s ease-in-out infinite alternate, pool-drift 24s ease-in-out infinite;
}

.sky__pool:nth-child(1) { left: 0; top: 0; animation-duration: 8s, 24s; }
.sky__pool:nth-child(2) { left: 100%; top: 0; animation-duration: 12s, 24s; animation-delay: -3s, -6s; }
.sky__pool:nth-child(3) { left: 50%; top: 50%; animation-duration: 6s, 24s; animation-delay: -2s, -12s; opacity: 0.7; }
.sky__pool:nth-child(4) { left: 0; top: 100%; animation-duration: 12s, 24s; animation-delay: -7s, -18s; }
.sky__pool:nth-child(5) { left: 100%; top: 100%; animation-duration: 8s, 24s; animation-delay: -5s, -3s; }

@keyframes pool-breathe {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

@keyframes pool-drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(6vmax, -4vmax); }
  50% { transform: translate(-3vmax, 5vmax); }
  75% { transform: translate(-6vmax, -2vmax); }
}

/* ---------- Layout ---------- */

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

section {
  padding: 120px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--xxs);
  margin: 0 0 var(--md);
  color: var(--tint);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

h1 {
  font-size: clamp(44px, 7.2vw, 88px);
}

h2 {
  font-size: clamp(34px, 5vw, 56px);
}

h3 {
  font-size: 21px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.lede {
  color: var(--label-secondary);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
}

.muted {
  color: var(--label-secondary);
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--xxxl);
}

.section-head .lede {
  margin-top: var(--md);
}

/* ---------- Glass card ---------- */

.card {
  position: relative;
  padding: var(--xxl);
  border-radius: var(--r-card);
  background: linear-gradient(160deg, rgb(255 255 255 / 0.07), rgb(255 255 255 / 0.025));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.12),
    inset 0 0 0 1px rgb(255 255 255 / 0.06),
    0 30px 60px -30px rgb(0 0 0 / 0.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--xxs);
  min-height: 52px;
  padding: 0 var(--xl);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--spring), background-color var(--chrome-fade), box-shadow var(--chrome-fade);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--label-primary);
  color: var(--noir);
  box-shadow: 0 10px 40px -10px color-mix(in srgb, var(--tint) 70%, transparent);
}

.btn--primary:hover {
  box-shadow: 0 14px 50px -8px color-mix(in srgb, var(--tint) 90%, transparent);
}

.btn--secondary {
  background: var(--fill-strong);
  color: var(--label-primary);
}

.btn--secondary:hover {
  background: rgb(255 255 255 / 0.14);
}

.btn--small {
  min-height: 40px;
  padding: 0 var(--md);
  font-size: 15px;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 var(--xs);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--tint)) 16%, transparent);
  color: var(--c, var(--tint));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--neutral {
  background: var(--fill);
  color: var(--label-secondary);
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--xs) 0;
  transition: background-color var(--chrome-fade), box-shadow var(--chrome-fade);
}

.site-header.is-scrolled {
  background: rgb(7 4 9 / 0.6);
  box-shadow: inset 0 -1px 0 var(--separator);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--xs);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--xxs);
}

.nav a:not(.btn) {
  padding: var(--xxs) var(--xs);
  border-radius: 999px;
  color: var(--label-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--chrome-fade), background-color var(--chrome-fade);
}

.nav a:not(.btn):hover,
.nav a[aria-current="page"] {
  color: var(--label-primary);
  background: var(--fill);
}

@media (max-width: 720px) {
  .nav a:not(.btn) {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100svh - 64px);
  padding: 24px 0 64px;
  /* The phone's glow bleeds past its frame; keep it from widening the page. */
  overflow-x: clip;
}

.hero .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--xxl);
  text-align: center;
}

/* One line at every width: the headline runs about 14.6× its font size, so 5.8vw still fits a
   320px phone inside the 20px margins. */
.hero h1 {
  font-size: clamp(18px, 5.8vw, 44px);
  white-space: nowrap;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--tint), color-mix(in srgb, var(--tint) 55%, white));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--xs);
  margin-top: var(--xxl);
}

/* An iPhone frame around a real simulator capture of Home. */
.phone {
  position: relative;
  /* Fits the whole phone under the header on a short laptop screen. */
  width: max(260px, min(340px, 78vw, calc((100svh - 260px) / 2.17)));
  padding: 11px;
  border-radius: 58px;
  background: linear-gradient(150deg, #3a3140, #120d16 45%, #2a2230);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.14),
    0 40px 80px -30px rgb(0 0 0 / 0.8);
  animation: phone-float 8s ease-in-out infinite;
}

.phone::before {
  content: "";
  position: absolute;
  inset: -30% -50%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--tint) 35%, transparent),
    color-mix(in srgb, var(--tint) 10%, transparent) 60%,
    transparent
  );
  pointer-events: none;
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 47px;
}

@keyframes phone-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.link {
  color: var(--tint);
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: var(--xl) 0;
  box-shadow: inset 0 1px 0 var(--separator);
  color: var(--label-tertiary);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--md) var(--xl);
}

.site-footer .brand {
  font-size: 17px;
  color: var(--label-primary);
}

.site-footer .brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-footer__links {
  display: flex;
  gap: var(--xl);
  margin-left: auto;
}

.site-footer a {
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--label-primary);
}

.site-footer__legal {
  width: 100%;
  font-size: 13px;
}

@media (max-width: 560px) {
  .site-footer__links {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- Inner pages (legal) ---------- */

.page-head {
  padding: 72px 0 var(--xxxl);
}

.page-head h1 {
  font-size: clamp(40px, 6vw, 72px);
}

.page-head .lede {
  max-width: 44ch;
  margin-top: var(--lg);
}

.page-body {
  padding: 0 0 120px;
}

.prose {
  max-width: 760px;
  padding: var(--xxxl);
}

.prose .updated {
  color: var(--label-tertiary);
  font-size: 15px;
}

.prose h2 {
  margin: var(--xxxl) 0 var(--xs);
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.prose h3 {
  margin: var(--xl) 0 var(--xxs);
  font-size: 18px;
}

.prose p,
.prose li {
  color: var(--label-secondary);
}

.prose p + p {
  margin-top: var(--xs);
}

.prose ul {
  margin: var(--xs) 0;
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: var(--xxxs);
}

.prose li::marker {
  color: var(--tint);
}

.prose a {
  color: var(--tint);
}

@media (max-width: 720px) {
  .prose {
    padding: var(--xl);
  }
}

/* A short page still keeps its footer at the bottom. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

main {
  flex: 1;
}

/* ---------- Reduced motion ---------- */

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

  *,
  *::before,
  *::after {
    animation: none !important;
  }
}
