/* Waystone website — tokens mirror the app's design system (SPEC §12). System fonts only:
   no external requests, so the site loads the same everywhere (including mainland China). */

:root {
  --ivory: #f7f4ec;
  --ivory-deep: #efe9dc;
  --surface: #ffffff;
  --ink: #1e2a23;
  --muted: #5f6e64;
  --forest: #2f5a46;
  --forest-deep: #244637;
  --on-forest: #ffffff;
  --sage: #9cb7a3;
  --sage-soft: #e3ece4;
  --amber: #c98d2c;
  --amber-soft: #f6e8cf;
  --line: #dce3dc;
  --shadow: 0 1px 2px rgba(30, 42, 35, 0.04), 0 8px 24px rgba(30, 42, 35, 0.06);
  --shadow-lift: 0 2px 6px rgba(30, 42, 35, 0.06), 0 24px 60px rgba(30, 42, 35, 0.14);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  --radius: 20px;
  --radius-lg: 28px;
  --gutter: 20px;
  --max: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ivory: #111613;
    --ivory-deep: #0c100e;
    --surface: #1a211d;
    --ink: #eceeea;
    --muted: #9fada4;
    --forest: #8dbfa3;
    --forest-deep: #a6d0b8;
    --on-forest: #0f1712;
    --sage: #5e7c69;
    --sage-soft: #1f2a24;
    --amber: #e3b160;
    --amber-soft: #3a2f1c;
    --line: #2b352f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--forest);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--forest-deep);
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

/* Chinese reads better in the system sans at heavier weight. */
html[lang^="zh"] h1,
html[lang^="zh"] h2,
html[lang^="zh"] h3 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.01em;
  /* Break Chinese headings at punctuation, not in the middle of a word. */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ivory) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(30, 42, 35, 0.18);
}

.brand .brand-cn {
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover {
  background: var(--sage-soft);
}

.nav a[aria-current="page"] {
  background: var(--sage-soft);
  color: var(--forest);
}

.nav .lang-switch {
  border: 1px solid var(--line);
  margin-left: 6px;
}

@media (max-width: 760px) {
  .nav .nav-section {
    display: none;
  }
  .brand .brand-cn {
    display: none;
  }
}

/* ---------- Buttons & pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--forest);
  color: var(--on-forest);
}

.btn-primary:hover {
  background: var(--forest-deep);
  color: var(--on-forest);
}

.btn-soft {
  background: var(--sage-soft);
  color: var(--forest);
}

.btn-soft:hover {
  color: var(--forest-deep);
}

.btn:active {
  transform: translateY(1px);
}

.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--ivory);
  font-weight: 600;
  font-size: 15px;
}

.store-pill small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  opacity: 0.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
  background: var(--sage-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

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

.hero {
  position: relative;
  padding: 56px 0 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 640px;
  height: 640px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sage) 35%, transparent), transparent);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
}

.hero h1 {
  font-size: clamp(40px, 5.6vw, 66px);
  margin: 18px 0 20px;
}

.hero .lead {
  font-size: clamp(18px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 34em;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.hero .meta {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 560px;
}

.hero-visual .phone {
  width: min(300px, 78vw);
}

.hero-visual .phone.back {
  position: absolute;
  width: min(250px, 62vw);
  right: 2%;
  top: 70px;
  transform: rotate(5deg);
  opacity: 0.96;
}

.hero-visual .phone.front {
  position: relative;
  transform: translateX(-18%) rotate(-3deg);
  z-index: 1;
}

@media (max-width: 900px) {
  .hero {
    padding-top: 36px;
  }
  .hero .container {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-visual {
    min-height: 0;
  }
  .hero-visual .phone.back {
    display: none;
  }
  .hero-visual .phone.front {
    transform: none;
  }
}

/* ---------- Phone frame ---------- */

.phone {
  border-radius: 46px;
  padding: 9px;
  background: linear-gradient(145deg, #2a302c, #141815);
  box-shadow: var(--shadow-lift);
}

.phone img {
  width: 100%;
  border-radius: 38px;
  background: var(--ivory);
}

/* ---------- Sections ---------- */

.section {
  padding: 88px 0;
}

.section-tight {
  padding: 64px 0;
}

.section-alt {
  background: var(--ivory-deep);
}

.section-head {
  max-width: 680px;
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  margin-bottom: 14px;
}

.section-head p {
  color: var(--muted);
  font-size: 18px;
}

/* How it works — styled like the app's route rail */

.route {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: stop;
}

.route li {
  position: relative;
  padding: 24px 22px 26px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.route .marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.route .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--on-forest);
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.route li:nth-child(3) .dot {
  background: var(--amber);
  box-shadow: 0 0 0 6px var(--amber-soft);
}

.route li:nth-child(4) .dot {
  background: var(--sage-soft);
  color: var(--forest);
}

.route .rail {
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--sage) 0 6px, transparent 6px 12px);
}

.route li:last-child .rail {
  display: none;
}

.route h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.route p {
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 1080px) {
  .route {
    grid-template-columns: repeat(2, 1fr);
  }
  .route .rail {
    display: none;
  }
}

@media (max-width: 600px) {
  .route {
    grid-template-columns: 1fr;
  }
}

/* Showcase */

.showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.showcase figure {
  margin: 0;
}

.showcase .phone {
  width: min(280px, 100%);
  margin: 0 auto 22px;
}

.showcase figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  max-width: 300px;
  margin: 0 auto;
}

.showcase figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 4px;
}

@media (max-width: 900px) {
  .showcase {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px var(--gutter) 24px;
    margin: 0 calc(var(--gutter) * -1);
    scrollbar-width: none;
  }
  .showcase::-webkit-scrollbar {
    display: none;
  }
  .showcase figure {
    flex: 0 0 min(78%, 300px);
    scroll-snap-align: center;
  }
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  padding: 26px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.feature .icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--sage-soft);
  color: var(--forest);
  margin-bottom: 16px;
}

.feature .icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 650;
  margin-bottom: 8px;
  letter-spacing: 0;
}

.feature p {
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* Companion */

.companion {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}

.pebble-stage {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.85;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--amber) 16%, transparent), transparent 60%),
    var(--sage-soft);
}

.pebble-stage svg {
  width: 52%;
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(30, 42, 35, 0.18));
  animation: breathe 5.2s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pebble-stage svg {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

.quotes {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.quotes li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quotes .mood {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--forest);
  background: var(--sage-soft);
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 3px;
  white-space: nowrap;
}

.quotes q {
  quotes: none;
  color: var(--ink);
}

.companion .note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 900px) {
  .companion {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pebble-stage {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
  }
}

/* Privacy band */

.privacy-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  padding: 44px;
  border-radius: var(--radius-lg);
  background: var(--forest);
  color: var(--on-forest);
}

.privacy-band h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  margin-bottom: 14px;
}

.privacy-band p {
  opacity: 0.85;
}

.privacy-band a {
  color: var(--on-forest);
  font-weight: 600;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.checklist li {
  position: relative;
  padding-left: 32px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--on-forest) 18%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23d49a3a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 20px no-repeat;
}

@media (max-width: 900px) {
  .privacy-band {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 24px;
  }
}

/* FAQ */

.faq {
  max-width: 820px;
  display: grid;
  gap: 12px;
}

.faq details {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 4px 22px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  padding: 16px 28px 16px 0;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--forest);
  border-bottom: 2px solid var(--forest);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details p {
  color: var(--muted);
  padding-bottom: 18px;
}

/* CTA band */

.cta {
  text-align: center;
  padding: 72px 0 96px;
}

.cta h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  margin-bottom: 14px;
}

.cta p {
  color: var(--muted);
  margin-bottom: 28px;
}

.cta .actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Document pages (privacy, terms, support) ---------- */

.doc {
  padding: 56px 0 88px;
}

.doc .container {
  max-width: 780px;
}

.doc h1 {
  font-size: clamp(34px, 4.4vw, 48px);
  margin-bottom: 10px;
}

.doc .updated {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
}

.doc .summary {
  background: var(--sage-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 40px;
}

.doc .summary h2 {
  font-size: 20px;
  margin: 0 0 10px;
}

.doc .summary ul {
  margin: 0;
  padding-left: 20px;
}

.doc h2 {
  font-size: 26px;
  margin: 44px 0 14px;
}

.doc h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 650;
  margin: 26px 0 8px;
  letter-spacing: 0;
}

.doc p,
.doc li {
  color: var(--ink);
}

.doc p + p {
  margin-top: 12px;
}

.doc ul {
  padding-left: 22px;
  margin: 10px 0;
}

.doc li + li {
  margin-top: 6px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.doc th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 28px 0 8px;
}

.contact-card p {
  color: var(--muted);
}

.contact-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  font-size: 15px;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
}

.site-footer .brand {
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--forest);
}

/* ---------- 404 ---------- */

.not-found {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 0;
}

.not-found svg {
  width: 120px;
  margin: 0 auto 20px;
}

.not-found h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

.not-found p {
  color: var(--muted);
  margin-bottom: 24px;
}

.section-head.flush {
  margin-bottom: 0;
}

.privacy-band .more {
  margin-top: 16px;
}

.site-footer .rights {
  margin-top: 10px;
}

/* Chinese hero title: keep "中断了也能重新上路。" on one line on phones. */
html[lang^="zh"] .hero h1 {
  font-size: clamp(31px, 5.2vw, 60px);
}
