/* Rize marketing: base tokens, reset, chrome (nav, buttons, footer).
   Section layouts live in sections.css, motion in motion.css. */

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

:root {
  /* Palette shared with the app */
  --linen: #F5F0E8;
  --linen-dark: #EDE6D6;
  --mist: #E4ECE7;
  --sage: #8A9E8C;
  --sage-light: #C4D4C6;
  --sage-dark: #5C7260;
  --sage-brand: #7BA99A;
  --teal: #4A8C8A;
  --teal-light: #7ABAB8;
  --teal-dark: #2E6664;
  --dusk: #1F4645;
  --charcoal: #2C2C2A;
  --ink: #1E1E1C;
  --muted: #6B6B68;
  --soft: #9A9A96;
  --white: #FDFAF5;

  --font-display: 'Cormorant Garamond', 'Cormorant Garamond Fallback', Georgia, serif;
  --font-body: 'DM Sans', 'DM Sans Fallback', system-ui, sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-breath: cubic-bezier(0.45, 0.05, 0.55, 0.95);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --reveal: 1.1s;
  --breath: 7s;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 1120px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { width: 100%; overflow-x: clip; }

body {
  font-family: var(--font-body);
  background: var(--linen);
  color: var(--charcoal);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(122, 186, 184, 0.35); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Paper grain over the whole page. Very quiet. */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* Layout helpers */
.wrap { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2 * var(--gutter), 720px); margin-inline: auto; }
.center { text-align: center; }

/* Type */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.25rem;
}
.dark .eyebrow { color: var(--teal-light); }

.headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--charcoal);
  text-wrap: balance;
}
.headline em { font-style: italic; color: var(--teal); }
.dark .headline { color: var(--linen); }
.dark .headline em { color: var(--teal-light); }

.lede {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--muted);
  max-width: 34em;
}
.dark .lede { color: rgba(245, 240, 232, 0.68); }

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem var(--gutter);
  transition: padding 0.6s var(--ease-out), background 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}
.nav.is-scrolled {
  padding: 0.85rem var(--gutter);
  background: rgba(245, 240, 232, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(138, 158, 140, 0.18);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--sage-brand);
  text-decoration: none;
  line-height: 1;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}
.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -6px;
  height: 1px;
  background: var(--teal);
  transition: right 0.5s var(--ease-out);
}
.nav-links a:not(.nav-cta):hover { color: var(--charcoal); }
.nav-links a:not(.nav-cta):hover::after { right: 0; }
.nav-cta {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--white);
  background: var(--teal);
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  transition: background 0.3s, transform 0.3s var(--ease-out);
}
.nav-cta:hover { background: var(--teal-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 12px; right: 12px;
  height: 1.5px;
  background: var(--charcoal);
  transition: transform 0.5s var(--ease-out), opacity 0.3s;
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.9rem;
  border-radius: 100px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), background 0.4s, border-color 0.4s, color 0.4s, box-shadow 0.5s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: 0.1s; }

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 8px 24px -10px rgba(46, 102, 100, 0.55);
}
.btn-primary:hover { background: var(--teal-dark); box-shadow: 0 14px 30px -10px rgba(46, 102, 100, 0.6); }
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
}
.btn-primary:hover::after { opacity: 1; }

.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border-color: rgba(44, 44, 42, 0.22);
  font-weight: 400;
}
.btn-ghost:hover { border-color: var(--charcoal); }
.dark .btn-ghost { color: var(--linen); border-color: rgba(245, 240, 232, 0.28); }
.dark .btn-ghost:hover { border-color: var(--linen); }

.btn-light {
  background: var(--linen);
  color: var(--dusk);
}
.btn-light:hover { background: var(--white); }

/* Store badges */
.store-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--charcoal);
  color: var(--white);
  padding: 0.6rem 1.15rem 0.6rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.5s var(--ease-out), background 0.4s;
}
.store-badge:hover { transform: translateY(-2px); background: var(--ink); }
.store-badge svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.store-badge-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge-sub { font-size: 0.62rem; opacity: 0.65; font-weight: 300; letter-spacing: 0.04em; }
.store-badge-name { font-size: 0.86rem; font-weight: 500; }
.dark .store-badge {
  background: rgba(245, 240, 232, 0.08);
  border: 1px solid rgba(245, 240, 232, 0.18);
  color: var(--linen);
}
.dark .store-badge:hover { background: rgba(245, 240, 232, 0.14); }

/* Footer */
.footer {
  background: var(--ink);
  color: var(--linen);
  padding: 4rem var(--gutter) 2.5rem;
  position: relative;
  overflow: hidden;
}
.footer-inner {
  width: min(100%, var(--measure));
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2.5rem;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--sage-brand);
  line-height: 1;
}
.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 300;
  color: rgba(245, 240, 232, 0.55);
  margin-top: 0.9rem;
}
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 2rem; }
.footer-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.6);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--linen); }
.footer-bottom {
  width: min(100%, var(--measure));
  margin: 3.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 240, 232, 0.1);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(245, 240, 232, 0.35);
}
.footer-horizon {
  position: absolute;
  left: 50%;
  bottom: -55vw;
  width: 140vw;
  height: 140vw;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 0%, rgba(74, 140, 138, 0.22), transparent 40%);
  pointer-events: none;
}

/* Responsive chrome */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(245, 240, 232, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out);
    z-index: -1;
  }
  .nav.is-open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 1rem; letter-spacing: 0.14em; }
  .nav-links li { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
  .nav.is-open .nav-links li { opacity: 1; transform: none; }
  .nav.is-open .nav-links li:nth-child(2) { transition-delay: 0.05s; }
  .nav.is-open .nav-links li:nth-child(3) { transition-delay: 0.1s; }
  .nav.is-open .nav-links li:nth-child(4) { transition-delay: 0.15s; }
  .nav.is-open .nav-links li:nth-child(5) { transition-delay: 0.2s; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 1.25rem 1.75rem; }
}
