/*
  Lunaly site styles, shared by every page (home, /baixar, /privacidade, 404).
  Colors, type, spacing and radii mirror the app's dark "Meia-noite" theme in app/src/ui/theme/tokens.ts:
  change a value there first, then here. One periwinkle accent for actions; gold belongs to the Moon (the mark).
  The mark is landing/atual/mark.svg, drawn by landing/scripts/build-site-assets.py.
*/

@font-face { font-family: "EB Garamond"; src: url(/fonts/eb-garamond-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens (tokens.ts › dark) ---------- */
:root {
  color-scheme: dark;
  --bg: #0A0F1E;
  --surface: #131A2C;
  --fill: #1E2640;
  --thumb: #2E3858;
  --text: #EEF0F6;
  --text-2: #C4C9D8;
  --muted: #939AB2;
  --line: rgba(238, 240, 246, 0.09);
  --tick: rgba(238, 240, 246, 0.18);
  --primary: #A9B6F0;
  --primary-hover: #BCC6F4;
  --primary-soft: rgba(169, 182, 240, 0.16);
  --on-primary: #0A0F1E;
  --gold: #D9B76E;
  --danger: #F2B3A1;

  --display: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* radius: control 14, chip 20, card 22, pill */
  --r-control: 14px;
  --r-chip: 20px;
  --r-card: 22px;
  --r-pill: 999px;

  /* 4px grid; page rhythm */
  --gutter: 16px;
  --content: 1120px;
  --section: 80px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --section: 128px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 500; text-wrap: balance; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--primary-soft); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -80px; z-index: 10;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Text roles ---------- */
.t-hero { font-size: clamp(2.5rem, 1.55rem + 4.2vw, 4.5rem); line-height: 1.06; letter-spacing: -0.015em; }
.t-title { font-size: clamp(2rem, 1.45rem + 2.2vw, 3rem); line-height: 1.1; letter-spacing: -0.01em; }
.t-title2 { font-size: 1.5rem; line-height: 1.2; }
.t-title3 { font-size: 1.3125rem; line-height: 1.25; }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--text-2); }
@media (min-width: 1024px) { .lede { font-size: 1.1875rem; } }
.kicker { font: 500 0.9375rem/1.4 var(--sans); color: var(--primary); }
.body-2 { color: var(--text-2); }
.footnote { font-size: 0.875rem; line-height: 1.55; color: var(--muted); }

/* ---------- Mark and wordmark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 500 1.5rem/1 var(--display); letter-spacing: 0.01em; }
.brand:hover { color: var(--text); }
.mark { width: 30px; height: 30px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary);
  font: 600 1rem/1.2 var(--sans); text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: default; }
.btn:disabled { opacity: 0.75; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }
.btn-quiet { background: var(--fill); color: var(--text); }
.btn-quiet:hover { background: var(--thumb); color: var(--text); }

/* ---------- Cards and badges ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 24px; }
@media (min-width: 1024px) { .card { padding: 28px; } }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--primary-soft); color: var(--primary);
  font: 500 0.75rem/1.3 var(--sans); vertical-align: middle;
}
.icon { width: 24px; height: 24px; flex: none; color: var(--primary); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Phone: a neutral frame around a real screenshot ---------- */
.phone {
  --w: 280px;
  width: var(--w);
  flex: none;
  padding: calc(var(--w) * 0.026);
  border-radius: calc(var(--w) * 0.14);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--thumb), 0 32px 64px -24px rgba(0, 0, 0, 0.7);
}
.phone img {
  width: 100%;
  aspect-ratio: 1080 / 2400;
  border-radius: calc(var(--w) * 0.114);
  background: var(--bg);
}

/* ---------- Invite form (home: hero and closing) ---------- */
.invite { max-width: 520px; }
.invite-label { display: block; margin-bottom: 10px; font: 600 1rem/1.4 var(--sans); color: var(--text); }
.invite-row { display: grid; gap: 8px; }
@media (min-width: 480px) { .invite-row { grid-template-columns: minmax(0, 1fr) auto; } }
.input {
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--fill); color: var(--text);
  font: 400 1rem/1.2 var(--sans);
  transition: border-color 0.2s var(--ease);
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover { border-color: var(--tick); }
.input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; border-radius: var(--r-control); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.consent {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start;
  margin-top: 14px; font-size: 0.875rem; line-height: 1.5; color: var(--text-2); cursor: pointer;
}
.consent input {
  appearance: none; -webkit-appearance: none;
  display: grid; place-content: center;
  width: 20px; height: 20px; margin: 1px 0 0;
  border: 1.5px solid var(--tick); border-radius: 6px; background: var(--fill);
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s;
}
.consent input::before {
  content: ""; width: 10px; height: 5px; margin-top: -2px;
  border-left: 2px solid var(--on-primary); border-bottom: 2px solid var(--on-primary);
  transform: rotate(-45deg) scale(0); transition: transform 0.15s var(--ease);
}
.consent input:hover { border-color: var(--muted); }
.consent input:checked { background: var(--primary); border-color: var(--primary); }
.consent input:checked::before { transform: rotate(-45deg) scale(1); }
@media (forced-colors: active) { .consent input { appearance: auto; -webkit-appearance: auto; } .consent input::before { content: none; } }
.consent input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.invite-error { font-size: 0.9375rem; line-height: 1.5; color: var(--danger); }
.invite-error:not(:empty) { margin-top: 12px; }
.invite-note { margin-top: 16px; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.invite-done { padding: 20px 22px; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--primary-soft); }
.invite-done:focus { outline: none; }
.invite-done:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.invite-done strong { display: block; margin-bottom: 4px; font: 500 1.3125rem/1.25 var(--display); }
.invite-done p { color: var(--text-2); }

/* ---------- Header and footer ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { display: none; color: var(--text-2); font: 500 0.9375rem/1 var(--sans); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--text); }
@media (min-width: 900px) { .site-nav a:not(.btn) { display: inline; } }

.site-footer { margin-top: var(--section); border-top: 1px solid var(--line); padding-block: 40px 48px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.footer-tag { margin-top: 12px; color: var(--text-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 0.9375rem; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-legal { display: grid; gap: 8px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.footer-legal a { color: var(--text-2); }
@media (min-width: 800px) { .footer-legal { grid-template-columns: minmax(0, 1fr) auto; gap: 24px; } }

/* ---------- Home: hero ---------- */
.hero { display: grid; gap: 56px; align-items: center; padding-block: 24px 0; }
.hero .t-hero { margin-bottom: 20px; }
.hero .lede { max-width: 33em; }
.hero .invite { margin-top: 32px; }
.hero-art { display: grid; justify-items: center; }
.hero-art .phone { grid-area: 1 / 1; --w: min(76vw, 292px); }
.hero-art .phone.back { display: none; }
@media (min-width: 600px) {
  .hero-art .phone.front { transform: translateX(-16%); }
  .hero-art .phone.back { display: block; --w: 264px; transform: translate(34%, -7%); }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 32px; padding-top: 56px; }
  .hero-art .phone.front { --w: 264px; transform: translate(-18%, 4%); }
  .hero-art .phone.back { --w: 240px; transform: translate(30%, -5%); }
}
@media (min-width: 1200px) {
  .hero-art .phone.front { --w: 300px; }
  .hero-art .phone.back { --w: 276px; }
}

/* ---------- Home: feature sections ---------- */
.section { padding-top: var(--section); }
.section-head { max-width: 640px; }
.section-head .t-title { margin-top: 10px; }
.section-head .lede { margin-top: 16px; }

.feature { display: grid; gap: 48px; align-items: center; }
.feature-copy { max-width: 540px; }
.feature-copy .t-title { margin-top: 10px; }
.feature-copy .lede { margin-top: 16px; }
.feature-art { display: flex; justify-content: center; gap: 14px; }
.feature-art .phone { --w: min(76vw, 292px); }
.feature-art.pair .phone { --w: min(calc((100vw - 2 * var(--gutter) - 14px) / 2), 264px); }
.feature-art.pair .phone + .phone { margin-top: 40px; }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
  .feature.flip .feature-art { order: -1; }
  .feature-art .phone { --w: 300px; }
  .feature-art.pair { gap: 20px; }
  .feature-art.pair .phone { --w: min(calc((50vw - var(--gutter) - 52px) / 2), 264px); }
}

/* A list of short facts, each with a title and a line. */
.points { margin-top: 28px; border-bottom: 1px solid var(--line); }
.points li { padding-block: 14px; border-top: 1px solid var(--line); }
.points strong { display: block; font-weight: 600; color: var(--text); }
.points span { color: var(--text-2); }

/* "Como você chega" chips and the ritual steps, drawn like the app's Hoje. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips li { padding: 8px 14px; border-radius: var(--r-chip); background: var(--fill); font: 500 0.875rem/1.3 var(--sans); }
.steps { margin-top: 24px; padding: 4px 20px; border-radius: var(--r-card); background: var(--surface); }
.steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding-block: 14px; }
.steps li + li { border-top: 1px solid var(--line); }
.steps .ring { width: 20px; height: 20px; margin-top: 2px; border: 1.5px solid var(--tick); border-radius: 50%; }
.steps strong { display: block; font-weight: 500; }
.steps span { display: block; font-size: 0.875rem; line-height: 1.45; color: var(--text-2); }
.steps small { font-size: 0.875rem; color: var(--muted); white-space: nowrap; }

/* ---------- Home: practices and journeys ---------- */
.practices { display: grid; gap: 12px; margin-top: 32px; }
@media (min-width: 560px) { .practices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.practice { display: grid; gap: 10px; align-content: start; }
.practice-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.practice h3 { margin-top: 6px; }
.practice p { color: var(--text-2); }

.journeys { display: grid; gap: 12px; margin-top: 20px; }
@media (min-width: 900px) { .journeys { grid-template-columns: repeat(2, minmax(0, 1fr)); } .journey.main { grid-column: 1 / -1; } }
.journey p { margin-top: 8px; color: var(--text-2); }
.journey.main { display: grid; gap: 24px; }
@media (min-width: 900px) { .journey.main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; } }
.nights { display: grid; gap: 0; counter-reset: night; }
.nights li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; padding-block: 9px; counter-increment: night; }
.nights li + li { border-top: 1px solid var(--line); }
.nights li::before { content: counter(night); font: 500 1.125rem/1 var(--display); color: var(--muted); font-variant-numeric: lining-nums; }
.journeys-label { margin-top: 56px; }
.journeys-lead { margin-top: 8px; }

/* ---------- Home: widgets and appearance ---------- */
.duo { display: grid; gap: 12px; margin-top: 32px; }
@media (min-width: 900px) { .duo { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.media-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; padding: 0; }
.media-card .card-copy { padding: 24px 24px 0; }
@media (min-width: 1024px) { .media-card .card-copy { padding: 28px 28px 0; } }
.media-card .card-copy p { margin-top: 8px; color: var(--text-2); }
.media-card .card-media { display: flex; justify-content: center; align-items: flex-end; padding: 28px 24px 0; }
.widget-shot { width: 100%; max-width: 460px; border-radius: var(--r-card) var(--r-card) 0 0; }
.media-card .phone { --w: min(64vw, 236px); }
/* The light-theme phone shows its top part only; the card's bottom edge cuts it. */
.media-card .crop { position: relative; overflow: hidden; align-items: flex-start; height: 320px; }
@media (min-width: 900px) {
  .media-card .crop { height: auto; min-height: 300px; }
  .crop .phone { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); }
}

/* ---------- Home: care, privacy ---------- */
.grid-2 { display: grid; gap: 12px; margin-top: 32px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-2 .card h3 { margin-bottom: 8px; }
.grid-2 .card p { color: var(--text-2); }
.grid-2 .card p + p { margin-top: 10px; }

/* ---------- Home: Plus ---------- */
.plans { display: grid; gap: 12px; margin-top: 32px; }
@media (min-width: 860px) { .plans { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.plan { display: grid; gap: 20px; align-content: start; }
.plan.free { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.plan.plus { box-shadow: inset 0 0 0 1px var(--primary-soft); }
.plan-name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-price { font: 500 2rem/1.1 var(--display); font-variant-numeric: lining-nums; }
.plan-price small { font: 400 0.9375rem/1.4 var(--sans); color: var(--text-2); }
.prices { display: grid; gap: 8px; }
.prices li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 14px 16px; border-radius: var(--r-control); background: var(--fill); }
.prices b { font-weight: 600; }
.prices span { color: var(--text-2); font-size: 0.9375rem; }
.prices .plan-price { font-size: 1.5rem; }
.ticks li { position: relative; padding-left: 28px; color: var(--text-2); }
.ticks li + li { margin-top: 10px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 12px; height: 7px; border-left: 1.5px solid var(--primary); border-bottom: 1.5px solid var(--primary); transform: rotate(-45deg); }
.ticks strong { color: var(--text); font-weight: 600; }

/* ---------- Home: questions ---------- */
.faq { margin-top: 24px; border-bottom: 1px solid var(--line); max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 18px; cursor: pointer; list-style: none;
  font: 500 1.0625rem/1.4 var(--sans);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { padding-bottom: 20px; color: var(--text-2); max-width: 640px; }

/* ---------- Home: closing invite ---------- */
.closing { text-align: center; }
.closing .card { padding: 48px 20px; }
@media (min-width: 720px) { .closing .card { padding: 64px 40px; } }
.closing .mark { width: 52px; height: 52px; margin: 0 auto 20px; }
.closing .lede { max-width: 32em; margin: 16px auto 0; }
.closing .invite { margin: 32px auto 0; text-align: left; }

/* ---------- Simple pages: /baixar, 404, /privacidade ---------- */
.simple { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.simple main { flex: 1 0 auto; }
.simple .site-footer { margin-top: 0; }
.center { display: grid; place-items: center; padding-block: 48px 72px; text-align: center; }
.center-box { max-width: 400px; }
.center-box .mark { width: 64px; height: 64px; margin: 0 auto 24px; }
.center-box .lede { margin-top: 12px; }
.stores { display: grid; gap: 12px; margin-top: 32px; }
.stores .btn[aria-disabled="true"] { background: var(--fill); color: var(--text-2); pointer-events: none; }
.stores .soon { font-weight: 400; color: var(--muted); }
.center-box .footnote { margin-top: 20px; }

.doc { max-width: 720px; padding-block: 32px 24px; }
.doc .t-title { margin-bottom: 8px; }
.doc section { padding-top: 32px; }
.doc h2 { font: 600 1.0625rem/1.4 var(--sans); margin-bottom: 8px; }
.doc p { color: var(--text-2); }
.doc a { overflow-wrap: anywhere; }

/* ---------- Motion: sections rise into view once. Off when the reader prefers less motion. ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
