/*
 * mandarling.app: one stylesheet for every page. No web fonts, no scripts and no third-party
 * requests, to match what the privacy policy says. Colors follow the app (cream page, white
 * cards, orange for actions); the text and link colors are all at least 4.5:1 on their
 * backgrounds, in both themes.
 */
:root {
  --bg: #fff8f4;
  --surface: #ffffff;
  --text: #231a16;
  --muted: #5f514a;
  --accent: #bd4007;
  --on-accent: #ffffff;
  --brand: #d9541e;
  --soft: #ffe9df;
  --line: #ecd9d0;
  --shadow: 0 24px 48px -20px rgba(120, 45, 10, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1110;
    --surface: #271d1a;
    --text: #f1dfd9;
    --muted: #cdb9b1;
    --accent: #ff8a5b;
    --on-accent: #3a0b00;
    --soft: #33231e;
    --line: #4a3b36;
    --shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
main:focus { outline: none; } /* where the skip link lands; not a control */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hanzi { font-size: 1.08em; }

/* Header */
.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -0.3px; }
.brand svg { width: 40px; height: 40px; flex: none; }
.nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 16px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 2px; }
.nav a:hover { color: var(--accent); }

/* Hero */
.hero-bar { background: var(--soft); padding-top: 28px; }
.hero { background: linear-gradient(180deg, var(--soft) 0%, var(--bg) 100%); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: center; padding-top: 24px; padding-bottom: 8px; }
h1 { font-size: clamp(36px, 5.6vw, 58px); line-height: 1.04; letter-spacing: -1.2px; margin: 0 0 18px; font-weight: 800; }
.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); margin: 0 0 26px; max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 20px; }
.soon { display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 13px 24px; font-weight: 700; }
.ghost { font-weight: 600; }
.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 15px; }
.trust li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 6px; }
.hero-phones { display: flex; justify-content: center; align-items: flex-end; padding-top: 12px; max-height: 640px; overflow: hidden; }

/* Phones: a screenshot in a bezel, cropped to a phone's proportions from the top */
.phone { margin: 0; border: 7px solid #1b1311; border-bottom: none; border-radius: 30px 30px 0 0; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); width: 230px; flex: none; }
.phone img { display: block; width: 100%; aspect-ratio: 9 / 17; object-fit: cover; object-position: top; }
.hero-phones .phone:nth-child(1) { width: 158px; margin-right: -26px; transform: translateY(46px); }
.hero-phones .phone:nth-child(2) { width: 236px; z-index: 1; }
.hero-phones .phone:nth-child(3) { width: 158px; margin-left: -26px; transform: translateY(46px); }

/* Sections */
section { padding: 64px 0; }
section.tint { background: var(--soft); }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.8px; margin: 0 0 12px; font-weight: 800; }
.sub { color: var(--muted); margin: 0 0 34px; max-width: 60ch; font-size: 19px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; margin-bottom: 10px; }
.steps h3, .cards h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.25; }
.steps p, .cards p { margin: 0; color: var(--muted); font-size: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }

/* Screens gallery */
/* A list a keyboard can focus, and scroll with the arrow keys */
.gallery { display: flex; gap: 22px; overflow-x: auto; margin: 0; list-style: none; padding: 8px max(20px, calc((100vw - 1080px) / 2 + 20px)) 26px; -webkit-overflow-scrolling: touch; }
/* Snapping helps a thumb; for arrow keys and a mouse wheel it fights every step, so it is for touch screens only */
@media (pointer: coarse) { .gallery { scroll-snap-type: x proximity; } }
.gallery:focus-visible { outline-offset: -3px; }
.gallery li { flex: none; scroll-snap-align: center; width: 250px; }
.gallery figure { margin: 0; }
.gallery .phone { width: 250px; border-bottom: 7px solid #1b1311; border-radius: 30px; }
.gallery figcaption { margin-top: 12px; text-align: center; font-weight: 700; font-size: 16px; }
.gallery figcaption span { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 820px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
.plan.pick { border: 2px solid var(--accent); }
.plan h3 { margin: 0 0 4px; font-size: 22px; }
.price { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin: 0 0 14px; }
.price small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { padding: 5px 0 5px 28px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.note { max-width: 820px; margin: 22px 0 0; padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 14px 14px 0; font-size: 16px; }
.note strong { display: block; margin-bottom: 2px; }
.fine { color: var(--muted); font-size: 15px; margin: 14px 0 0; }

/* FAQ */
.faq { max-width: 820px; }
details { border-bottom: 1px solid var(--line); padding: 4px 0; }
summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 26px; line-height: 1; color: var(--accent); }
details[open] summary::after { content: "–"; }
details p { margin: 0 0 16px; color: var(--muted); }

/* Text pages: privacy, terms, support */
.doc { max-width: 720px; margin: 0 auto; padding: 24px 20px 72px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 6px; }
.doc h2 { font-size: 22px; letter-spacing: -0.3px; color: var(--accent); margin: 34px 0 6px; }
.doc p, .doc li { margin: 0 0 12px; }
.doc ul { padding-left: 22px; margin: 0 0 12px; }
.updated { color: var(--muted); margin: 0 0 20px; }
.callout { background: var(--soft); border-radius: 16px; padding: 16px 18px; margin: 18px 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 15px; }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 12px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
footer p { margin: 0 0 8px; max-width: 80ch; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-phones { max-height: 460px; order: 2; }
  .steps, .cards { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
}
@media (max-width: 520px) {
  .nav { display: none; }
  .hero-phones .phone:nth-child(1), .hero-phones .phone:nth-child(3) { display: none; }
  .hero-phones .phone:nth-child(2) { width: 230px; }
  .top { padding-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Windows high contrast and similar: keep what looks like a button, and the bezels, visible */
@media (forced-colors: active) {
  .soon { border: 2px solid ButtonText; }
  .phone { border-color: CanvasText; }
  .plan.pick { border-color: Highlight; }
}

/* The Play button shows once the app is live (<body data-play="live">); until then, "coming soon". */
body[data-play="soon"] .when-live,
body[data-play="live"] .when-soon { display: none; }
