/* ScreenSketch website. Palette comes from the app: icon blue, ruler navy, marker red, ruler yellow. */

:root {
  color-scheme: light dark;
  --paper: #eef1f8;
  --sheet: #ffffff;
  --ink: #0f1430;
  --ink-2: #4c5473;
  --line: rgba(15, 20, 48, .14);
  --grid: rgba(47, 91, 234, .07);
  --blue: #2f5bea;
  --red: #ff3b30;
  --yellow: #ffc53d;
  --ruler-bg: #141a33;
  --kbd: #ffffff;
  --ruler: 0px;
  --gutter: 20px;
  --sans: system-ui, -apple-system, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

@media (min-width: 760px) {
  :root { --ruler: 20px; --gutter: 44px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0f22;
    --sheet: #141a33;
    --ink: #eef1fa;
    --ink-2: #a6aecb;
    --line: rgba(255, 255, 255, .15);
    --grid: rgba(125, 157, 255, .07);
    --blue: #7d9dff;
    --ruler-bg: #1b2247;
    --kbd: #1d2445;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--ruler) + 16px); }

body {
  margin: 0;
  padding: var(--ruler) 0 0 var(--ruler);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: var(--ruler) var(--ruler);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

h1 {
  font-size: clamp(2.75rem, 7.4vw, 6.25rem);
  font-weight: 800;
  line-height: .96;
  letter-spacing: -.045em;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.85rem);
  font-weight: 750;
  line-height: 1.07;
  letter-spacing: -.03em;
}

h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }

:lang(zh) h1 { letter-spacing: -.01em; line-height: 1.1; font-size: clamp(2.5rem, 6.6vw, 5.5rem); }
:lang(zh) h2 { letter-spacing: 0; line-height: 1.2; }

kbd {
  display: inline-block;
  font: 600 .82em/1.5 var(--sans);
  padding: 0 .5em;
  border-radius: 6px;
  background: var(--kbd);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  white-space: nowrap;
}

.pro {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
  padding: 0 .55em;
  border-radius: 999px;
  background: var(--yellow);
  color: #3a2a00;
  vertical-align: middle;
}

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.lede { color: var(--ink-2); max-width: 40rem; }

/* ---- Page rulers (built by site.js) ------------------------------- */

.pruler { display: none; }

@media (min-width: 760px) {
  .pruler {
    display: block;
    position: fixed;
    z-index: 50;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--ruler-bg);
    background-repeat: repeat-x;
    color: #fff;
    font: 600 9px/1 var(--sans);
    font-variant-numeric: tabular-nums;
  }
  .pruler-top {
    inset: 0 0 auto 0;
    height: 20px;
    background-image:
      linear-gradient(90deg, rgba(255, 255, 255, .95) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 50px 9px, 10px 4px;
    background-position: 0 100%, 0 100%;
  }
  .pruler-left {
    inset: 0 auto 0 0;
    width: 20px;
    background-repeat: repeat-y;
    background-image:
      linear-gradient(rgba(255, 255, 255, .95) 1px, transparent 1px),
      linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 9px 50px, 4px 10px;
    background-position: 100% 0, 100% 0;
  }
  .pruler-corner {
    top: 0; left: 0; width: 20px; height: 20px; z-index: 51;
    display: grid; place-items: center;
    background-image: none;
    font-weight: 700;
  }
  .pruler-num { position: absolute; opacity: .85; }
  .pruler-top .pruler-num { top: 2px; left: calc(var(--at) + 3px); }
  .pruler-left .pruler-num { left: 2px; top: calc(var(--at) + 3px); writing-mode: vertical-rl; }
  .pruler-mark {
    position: absolute;
    top: 0; left: 0;
    display: none;
    background: var(--red);
    font-weight: 700;
    border-radius: 2px;
    will-change: transform;
  }
  .pruler-mark.is-on { display: block; }
  .pruler-top .pruler-mark { margin: 4px 0 0 -14px; width: 28px; padding: 2px 0; text-align: center; }
  .pruler-left .pruler-mark { margin: -14px 0 0 4px; height: 28px; padding: 0 2px; writing-mode: vertical-rl; text-align: center; }
}

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

.top { padding-block: 1.25rem; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.top nav { display: flex; align-items: center; gap: clamp(.9rem, 2.4vw, 1.9rem); font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--ink); }
.top nav .lang { color: var(--ink); font-weight: 600; }
@media (max-width: 620px) { .top nav a:not(.lang) { display: none; } }

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

.hero { padding-block: clamp(2.5rem, 8vw, 6.5rem) clamp(2rem, 5vw, 4rem); }
[data-measure] { position: relative; }
.hero h1 { max-width: 14ch; }
:lang(zh) .hero h1 { max-width: none; }
.hero .lede { margin-top: clamp(3.3rem, 5vw, 3.8rem); font-size: clamp(1.1rem, 1.7vw, 1.35rem); line-height: 1.45; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.hero-note { margin-top: 1.1rem; font-size: .92rem; color: var(--ink-2); }

.store {
  display: inline-flex;
  flex-direction: column;
  padding: .6rem 1.25rem .7rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.2;
  text-decoration: none;
}
.store small { font-size: .74rem; font-weight: 500; opacity: .8; }
.store strong { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
a.store:hover { color: var(--paper); background: var(--blue); }

/* The headline, measured like the app measures a rectangle. */
.hm-box {
  position: absolute;
  display: none;
  border: 1.5px dashed var(--blue);
  background: rgba(47, 91, 234, .07);
  pointer-events: none;
}
.hm-box.is-on { display: block; }
.hm-label {
  position: absolute;
  top: 100%; left: 50%;
  transform: translate(-50%, 8px);
  padding: 3px 8px;
  border-radius: 5px;
  background: #26262b;
  color: #fff;
  font: 700 12px/1.3 var(--sans);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Tour ---------------------------------------------------------- */

.tour { margin-top: clamp(1rem, 3vw, 2rem); }
.tour-pin { width: min(1480px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.tour-stage { display: none; }

.chapter { max-width: 60rem; padding-block: 1.75rem; }
.chapter h2 { font-size: clamp(1.6rem, 2.6vw, 2.35rem); }
.chapter p { margin-top: .9rem; color: var(--ink-2); max-width: 34rem; }
.chapter img { width: 100%; border-radius: 12px; margin-bottom: 1.25rem; }
.chapter-keys { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.1rem 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--ink-2); }
.chapter-note { font-size: .88rem; }

.stage {
  position: relative;
  aspect-ratio: 1440 / 900;
  overflow: hidden;
  border-radius: 12px;
  background: #6f80d4;
  box-shadow: 0 0 0 1px rgba(15, 20, 48, .18), 0 34px 60px -28px rgba(20, 26, 51, .55);
}
.stage-cam { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.stage-svg { display: block; width: 100%; height: 100%; font-family: var(--sans); }
.stage-svg text { white-space: pre; }
.stage-loupe {
  position: absolute;
  width: 19.444%;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .92), 0 10px 30px rgba(0, 0, 0, .4);
  visibility: hidden;
}

/* Reduced motion: one still per chapter, in normal flow. */
.tour--static .chapter { padding-block: 2.5rem; }
.tour--static .chapter .stage { margin-bottom: 1.5rem; }

/* Scroll-driven: the stage stays put while the page scrolls underneath it. */
.tour--live { height: calc(var(--chapters, 6) * 125vh + 100vh); }
.tour--live .tour-pin {
  position: sticky;
  top: var(--ruler);
  height: calc(100vh - var(--ruler));
  height: calc(100svh - var(--ruler));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 1.25rem;
  padding-block: 1rem;
}
.tour--live .tour-stage { display: block; order: -1; }
.tour--live .stage { width: min(100%, (100svh - 20rem) * 1.6); margin-inline: auto; }
.tour--live .tour-captions { display: grid; align-content: start; }
.tour--live .chapter {
  grid-area: 1 / 1;
  padding-block: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}
.tour--live .chapter.is-active { opacity: 1; visibility: visible; transform: none; }
/* Cross-fade only once the first chapter is in place, so nothing flashes on load. */
.tour--live.is-ready .chapter { transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s; }
.tour--live.is-ready .chapter.is-active { transition-delay: 0s; }

.tour-nav { display: flex; gap: 3px; width: min(100%, (100svh - 20rem) * 1.6); margin: .9rem auto 0; }
.tour-tick {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: .6rem 0 .2rem;
  border: 0;
  border-top: 3px solid var(--line);
  background: none;
  color: var(--ink-2);
  font: 500 .8rem/1.2 var(--sans);
  text-align: left;
  cursor: pointer;
}
.tour-tick::before {
  content: "";
  position: absolute;
  top: -3px; left: 0;
  width: calc(var(--fill, 0) * 100%);
  height: 3px;
  background: var(--red);
}
.tour-tick.is-active { color: var(--ink); font-weight: 650; }
.tour-tick span { display: none; }

@media (min-width: 760px) {
  .tour-tick span { display: inline; }
}

@media (min-width: 1040px) {
  .tour--live .tour-pin {
    grid-template-columns: minmax(17rem, 23rem) minmax(0, 1fr);
    grid-template-rows: none;
    align-content: center;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 3.5rem);
  }
  .tour--live .tour-stage { order: 0; }
  .tour--live .stage, .tour-nav { width: min(100%, (100svh - 9rem) * 1.6); }
}

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

.band { padding-block: clamp(4rem, 9vw, 7.5rem); }
.band > .wrap > h2 { max-width: 26ch; }
.band > .wrap > .lede { margin-top: 1rem; }

.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 0 3rem; margin: 2.5rem 0 0; }
.keys div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.keys dt { color: var(--ink); }
.keys dd { margin: 0; white-space: nowrap; }

.plans { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
@media (min-width: 860px) { .plans { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.plan { position: relative; overflow: hidden; padding: 1.75rem; border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); }
.plan--pro { padding-top: calc(1.75rem + 14px); }
/* The yellow ruler from the app icon. */
.plan--pro::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 14px;
  background-color: var(--yellow);
  background-image:
    linear-gradient(90deg, #5a3a00 2px, transparent 2px),
    linear-gradient(90deg, #5a3a00 2px, transparent 2px);
  background-size: 48px 9px, 12px 5px;
  background-position: 11px 100%, 11px 100%;
  background-repeat: repeat-x;
}
.plan ul { margin: 1.1rem 0 0; padding: 0; list-style: none; }
.plan li { position: relative; padding: .38rem 0 .38rem 1.5rem; }
.plan li::before { content: ""; position: absolute; left: 0; top: 1.02em; width: .8rem; height: 2px; background: var(--red); }
.plan-note { margin-top: 1.25rem; font-size: .92rem; color: var(--ink-2); }

.facts { display: grid; gap: 2rem 3rem; margin-top: 2.5rem; }
@media (min-width: 860px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts p { margin-top: .5rem; color: var(--ink-2); }
.more { margin-top: 2rem; }

.faq { margin-top: 2.5rem; max-width: 46rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 1rem 2rem 1rem 0; font-weight: 650; cursor: pointer; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .85rem; font-size: 1.3rem; font-weight: 400; color: var(--ink-2); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 2rem 1.1rem 0; color: var(--ink-2); }
.contact { margin-top: 2.5rem; max-width: 46rem; }
.contact a { font-weight: 650; }

.foot { padding-block: 2.5rem 3.5rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* ---- Documents (privacy policy, 404) ------------------------------- */

.doc { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(4rem, 8vw, 6rem); }
.doc h1 { width: fit-content; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.02; letter-spacing: -.035em; }
.doc .meta { margin-top: 1rem; color: var(--ink-2); }
.doc-body { max-width: 44rem; margin-top: 2.5rem; }
.doc [data-measure] + .doc-body { margin-top: 4rem; }
.doc-body h2 { font-size: 1.4rem; letter-spacing: -.015em; margin-top: 2.5rem; }
.doc-body p, .doc-body ul { margin-top: .9rem; }
.doc-body ul { padding-left: 1.25rem; }
.doc-body li { margin-top: .4rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
