/* ============================================================
   Rise — marketing site design system
   Faithful to the app: warm cream + flat colors + Liquid Glass.
   Zero gradients, ever. Grain everywhere, gently.
   ============================================================ */

:root {
  /* From Rise/DesignSystem/Theme.swift (Dawn, light) */
  --bg: #f2ecdf;             /* rgb(242,236,224) */
  --bg-deep: #eae2d0;
  --card: #faf6ec;
  --ink: #1a1c1f;            /* rgb(26,28,31) */
  --ink-70: rgba(26, 28, 31, 0.72);
  --ink-50: rgba(26, 28, 31, 0.52);
  --ink-12: rgba(26, 28, 31, 0.12);
  --accent: #9cc4e4;         /* pastel sky blue */
  --accent-soft: #c6ddf0;
  --flame: #f09a4e;
  --sun: #f8ce72;
  --ok: #58b368;

  --glass: rgba(252, 249, 241, 0.55);
  --glass-strong: rgba(252, 249, 241, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --blur: saturate(170%) blur(22px);

  --shadow-soft: 0 24px 60px -28px rgba(26, 28, 31, 0.25);
  --shadow-card: 0 14px 40px -18px rgba(26, 28, 31, 0.18);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  --r-sm: 18px;
  --r-md: 28px;
  --r-lg: 40px;

  --font-display: ui-rounded, "Nunito", -apple-system, "SF Pro Rounded",
    system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, system-ui, sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
}

/* Grain over everything, like the app (grainOpacity ≈ 0.05) */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

::selection {
  background: var(--accent);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Type ---------- */
h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.9rem, 7.2vw, 5.2rem);
}

h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.2;
}

p {
  color: var(--ink-70);
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 34em;
}

/* Flat rounded highlight — echoes the app's selected-weekday pill */
.hl {
  background: var(--accent);
  border-radius: 0.35em;
  padding: 0 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------- Layout ---------- */
.wrap {
  width: min(1140px, calc(100% - 48px));
  margin-inline: auto;
}

section {
  position: relative;
  padding: clamp(72px, 10vw, 128px) 0;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head p {
  margin: 16px auto 0;
  max-width: 36em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-70);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 20px;
}

/* Flat decorative discs (no gradients — flat like the icon's sun) */
.orb {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.orb--sun {
  background: var(--sun);
}

.orb--sky {
  background: var(--accent);
}

.orb--flame {
  background: var(--flame);
}

/* App streak flame, recolored to the in-app orange via mask */
.flame {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: var(--flame);
  -webkit-mask: url("/assets/icon-flame.png") center / contain no-repeat;
  mask: url("/assets/icon-flame.png") center / contain no-repeat;
}

.flame--lg {
  width: 34px;
  height: 34px;
}

/* ---------- Glass primitives ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), var(--shadow-inset);
  border-radius: var(--r-md);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset);
  transition: box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  white-space: nowrap;
}

.nav .btn {
  padding: 10px 18px;
  font-size: 0.92rem;
}

.nav.scrolled {
  background: var(--glass-strong);
  box-shadow: var(--shadow-card), var(--shadow-inset);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  margin-right: 6px;
}

.nav__brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.nav__links {
  display: flex;
  gap: 2px;
}

.nav__links a {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink-70);
  padding: 8px 13px;
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.nav__links a:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.nav__lang {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink-70);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--ink-12);
  transition: background 0.25s var(--ease);
}

.nav__lang:hover {
  background: rgba(255, 255, 255, 0.55);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.btn--ink {
  background: var(--ink);
  color: #fffdf7;
  box-shadow: var(--shadow-card);
}

.btn--ink:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn--glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset);
  color: var(--ink);
}

.btn--glass:hover {
  background: var(--glass-strong);
  transform: translateY(-2px);
}

/* App Store badge-style button (coming soon) */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: #fffdf7;
  border-radius: 18px;
  padding: 12px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.store-badge svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.store-badge span {
  display: block;
  text-align: left;
  line-height: 1.15;
}

.store-badge .small {
  font-size: 0.72rem;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

.store-badge .big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.18rem;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(130px, 16vh, 190px);
  overflow: clip;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__copy > p {
  margin: 22px 0 34px;
}

.hero__cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--ink-50);
}

.hero__stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.hero .orb--sun {
  width: clamp(300px, 34vw, 460px);
  height: clamp(300px, 34vw, 460px);
  top: 4%;
  right: -4%;
}

.hero .orb--sky {
  width: 130px;
  height: 130px;
  bottom: 6%;
  left: 2%;
  opacity: 0.85;
}

/* ---------- Phone ---------- */
.phone {
  position: relative;
  z-index: 1;
  width: min(330px, 74vw);
  border-radius: 58px;
  background: #101114;
  padding: 11px;
  box-shadow: 0 60px 100px -40px rgba(26, 28, 31, 0.45),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

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

.phone--float {
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0.4deg);
  }
  50% {
    transform: translateY(-14px) rotate(-0.6deg);
  }
}

/* Floating streak chip over the hero phone */
.float-card {
  position: absolute;
  z-index: 2;
  left: max(-10px, 2vw);
  bottom: 14%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 24px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), var(--shadow-inset);
  animation: float 7s 1.2s ease-in-out infinite;
}

.float-card .flame--lg {
  flex: none;
}

.float-card strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  display: block;
  line-height: 1;
}

.float-card small {
  color: var(--ink-50);
  font-size: 0.8rem;
}

/* ---------- Missions ---------- */
.missions {
  overflow: clip;
}

.missions .orb--sky {
  width: 380px;
  height: 380px;
  top: 10%;
  left: -160px;
  opacity: 0.55;
}

.missions .orb--flame {
  width: 190px;
  height: 190px;
  bottom: 4%;
  right: -60px;
  opacity: 0.4;
}

.mission-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.mission {
  padding: 30px 26px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.mission:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft), var(--shadow-inset);
}

.mission img {
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
}

.mission h3 {
  margin-bottom: 8px;
}

.mission p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.steps {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 44px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px 11px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

.step b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fffdf7;
  font-size: 0.85rem;
}

/* ---------- Game / streaks ---------- */
.game {
  background: var(--bg-deep);
  overflow: clip;
}

.game .wrap {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

.game__stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

.game .orb--flame {
  width: clamp(260px, 26vw, 360px);
  height: clamp(260px, 26vw, 360px);
  bottom: 2%;
  left: -6%;
  opacity: 0.75;
}

.week-card {
  position: absolute;
  z-index: 2;
  right: max(-14px, 1vw);
  bottom: 12%;
  padding: 16px 20px;
  border-radius: 24px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), var(--shadow-inset);
  animation: float 8s 0.6s ease-in-out infinite;
}

.week-card table {
  border-collapse: collapse;
}

.week-card td {
  text-align: center;
  padding: 2px 7px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
}

.week-card .dow td {
  color: var(--ink-50);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.week-card .today {
  background: var(--accent);
  border-radius: 999px;
}

.week-card .flame {
  display: block;
  margin: 3px auto 0;
}

.game__copy h2 {
  margin-bottom: 18px;
}

.game__copy > p {
  margin-bottom: 30px;
}

.perks {
  list-style: none;
  display: grid;
  gap: 14px;
}

.perks li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--r-sm);
}

.perks .emoji {
  font-size: 1.5rem;
  line-height: 1.3;
  flex: none;
}

.perks b {
  font-family: var(--font-display);
  font-weight: 800;
  display: block;
}

.perks span {
  color: var(--ink-70);
  font-size: 0.95rem;
}

/* ---------- Screens row ---------- */
.screens {
  overflow: clip;
}

.shots {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
}

.shots img {
  width: min(300px, 78vw);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.shots a:nth-child(1) img {
  transform: rotate(-2.2deg);
}

.shots a:nth-child(3) img {
  transform: rotate(2.2deg);
}

.shots a:hover img {
  transform: rotate(0) translateY(-8px);
  box-shadow: var(--shadow-soft);
}

/* ---------- Privacy ---------- */
.privacy {
  overflow: clip;
}

.privacy .orb--sky {
  width: 300px;
  height: 300px;
  top: 44px;
  right: -90px;
  opacity: 0.55;
}

.privacy__panel {
  position: relative;
  z-index: 1;
  border-radius: var(--r-lg);
  padding: clamp(36px, 5vw, 64px);
}

.privacy__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 36px 0 30px;
}

.privacy__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-inset);
}

.privacy__item img {
  width: 26px;
  height: 26px;
  margin-top: 2px;
  flex: none;
}

.privacy__item b {
  font-family: var(--font-display);
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}

.privacy__item span {
  color: var(--ink-70);
  font-size: 0.93rem;
  line-height: 1.5;
}

.privacy__more {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 2px;
  transition: border-color 0.25s var(--ease);
}

.privacy__more:hover {
  border-color: var(--flame);
}

/* ---------- Get / final CTA ---------- */
.get {
  overflow: clip;
}

.get .orb--sun {
  width: clamp(340px, 40vw, 560px);
  height: clamp(340px, 40vw, 560px);
  bottom: -32%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.9;
}

.get__panel {
  position: relative;
  z-index: 1;
  text-align: center;
  border-radius: var(--r-lg);
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 64px);
}

.get__panel .lead {
  margin: 18px auto 36px;
}

.get__panel img.appicon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin: 0 auto 26px;
  box-shadow: var(--shadow-card);
}

/* ---------- Footer ---------- */
footer {
  padding: 56px 0 40px;
  border-top: 1px solid rgba(26, 28, 31, 0.08);
  margin-top: 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
}

.foot-brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.foot-tag {
  margin-top: 10px;
  color: var(--ink-50);
  font-size: 0.9rem;
  max-width: 30ch;
}

.foot-col h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.foot-col ul {
  list-style: none;
}

.foot-col li {
  margin-bottom: 10px;
}

footer a {
  color: var(--ink-70);
  font-size: 0.9rem;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--ink);
}

.foot-bottom {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid rgba(26, 28, 31, 0.08);
  color: var(--ink-50);
  font-size: 0.84rem;
  text-align: center;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ---------- Legal / document pages (quiet, plain format) ---------- */
.legal {
  padding-top: clamp(120px, 15vh, 160px);
  padding-bottom: 40px;
}

.legal .wrap {
  max-width: 680px;
}

.legal h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin-bottom: 10px;
}

.legal .updated {
  color: var(--ink-50);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

.doc section {
  padding: 0;
  margin-bottom: 40px;
}

.doc h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.doc h3 {
  font-size: 1rem;
  margin: 20px 0 6px;
}

.doc p {
  margin-bottom: 12px;
  font-size: 0.97rem;
  line-height: 1.75;
}

.doc ul,
.doc ol {
  margin: 0 0 12px 22px;
  color: var(--ink-70);
  font-size: 0.97rem;
  line-height: 1.75;
}

.doc li {
  margin-bottom: 8px;
}

.doc strong {
  color: var(--ink);
}

.doc a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.doc a:hover {
  text-decoration-color: var(--ink);
}

/* ---------- Reveal on scroll (armed only when JS + IO exist) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .mission-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero .wrap,
  .game .wrap {
    grid-template-columns: 1fr;
  }

  .hero__copy {
    text-align: center;
  }

  .hero__cta {
    justify-content: center;
  }

  .game__stage {
    order: 2;
  }

  .game__copy {
    text-align: center;
  }

  .perks li {
    text-align: left;
  }

  .shots {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .nav {
    top: 10px;
    gap: 4px;
    padding: 6px 7px 6px 11px;
  }

  .nav__brand {
    font-size: 1.02rem;
    gap: 7px;
    margin-right: 4px;
  }

  .nav__brand img {
    width: 26px;
    height: 26px;
  }

  .nav__lang {
    font-size: 0.8rem;
    padding: 8px 11px;
  }

  .nav .btn {
    padding: 9px 14px;
    font-size: 0.88rem;
  }

  .nav__links {
    display: none;
  }

  .privacy__grid {
    grid-template-columns: 1fr;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .float-card {
    left: 0;
  }

  .week-card {
    right: 0;
  }
}

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

  .phone--float,
  .float-card,
  .week-card {
    animation: none;
  }

  .reveal,
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
