/* mytickrs.com — one stylesheet for every page. Colors follow the app's theme
   (tickrs-public packages/ui/src/theme.tsx): change both together. */

:root {
  --bg: #f6f6f4;
  --bg-tint: #edeeea;
  --surface: #ffffff;
  --ink: #1b1b1a;
  --ink-muted: #5b5d58;
  --line: #dcddd8;
  --primary: #17855a;
  --primary-ink: #ffffff;
  --primary-soft: #e3f2ea;
  --gain: #1d7a46;
  --loss: #b3261e;
  --code-bg: #ececea;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06);
  --radius: 12px;
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}

/* Dark: the system theme, unless the visitor picked light with the header toggle (site.js), or
   picked dark. Keep the two copies of the dark colors the same. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --bg-tint: #1b1c1b;
    --surface: #1f201f;
    --ink: #ececea;
    --ink-muted: #a9aba5;
    --line: #333532;
    --primary: #34c28a;
    --primary-ink: #0c1f16;
    --primary-soft: #16301f;
    --gain: #5cc98a;
    --loss: #f2877e;
    --code-bg: #2a2b29;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.3);
  }
}

:root[data-theme="dark"] {
  --bg: #141414;
  --bg-tint: #1b1c1b;
  --surface: #1f201f;
  --ink: #ececea;
  --ink-muted: #a9aba5;
  --line: #333532;
  --primary: #34c28a;
  --primary-ink: #0c1f16;
  --primary-soft: #16301f;
  --gain: #5cc98a;
  --loss: #f2877e;
  --code-bg: #2a2b29;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.3);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Per-language system fonts, as in the app: nothing is downloaded. */
:lang(ja) { --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif; }
:lang(ko) { --font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
:lang(zh-CN) { --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
:lang(zh-TW) { --font: system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  overflow-wrap: break-word;
}

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

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

code, kbd { font-family: var(--mono); font-size: 0.9em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

.muted { color: var(--ink-muted); }
.small { font-size: 0.875rem; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand svg { width: 28px; height: 28px; }
.brand .ink { stroke: var(--ink); }
.brand .line { stroke: var(--primary); }
.brand .dot { fill: var(--primary); }
.nav { display: none; gap: 20px; margin-left: 12px; }
.nav a { color: var(--ink-muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }
.header-cta { margin-left: auto; }

/* Light/dark toggle: shows the moon in light, the sun in dark. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; margin-left: -8px; padding: 0; border-radius: 10px;
  background: var(--surface); color: var(--ink-muted); border: 1px solid var(--line); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-muted); }
.theme-toggle[hidden] { display: none; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
@media (min-width: 860px) { .nav { display: flex; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 10px;
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-muted); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; }
.cta { display: flex; flex-direction: column; gap: 4px; }
.cta .note { font-size: 0.8rem; color: var(--ink-muted); text-align: center; }

/* Sections */
section { padding: 64px 0; }
@media (min-width: 720px) { section { padding: 88px 0; } }
.tinted { background: var(--bg-tint); }
.eyebrow { color: var(--primary); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.lead { font-size: 1.15rem; color: var(--ink-muted); max-width: 40em; }
.section-head { max-width: 46em; margin-bottom: 40px; }

/* Hero */
.hero { padding: 56px 0 32px; }
@media (min-width: 720px) { .hero { padding: 88px 0 48px; } }
.hero h1 { max-width: 15em; }
.hero .lead { margin-bottom: 28px; }
.desktop-link { margin: 18px 0 0; }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin: 20px 0 0; font-size: 0.875rem; color: var(--ink-muted); }
.trust li::before { content: "✓ "; color: var(--primary); font-weight: 700; }
.phone-note { display: none; font-size: 0.85rem; color: var(--ink-muted); margin: 12px 0 0; }
@media (max-width: 719px) { .phone-note { display: block; } }

.shot {
  margin: 48px 0 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface);
}
.shot .chrome { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.shot .chrome span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shot picture, .shot img, .shot video { width: 100%; }
.shot.clip { margin: 0; }
.shot.clip video { background: #121212; }
.shot figcaption { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); }

/* Proof strip */
.proof { padding: 32px 0; border-block: 1px solid var(--line); }
.proof ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.proof strong { display: block; font-size: 1.15rem; }
.proof span { color: var(--ink-muted); font-size: 0.9rem; }

/* Two-column feature rows. Grid children may shrink below their content (long commands scroll). */
.split > *, .editions > *, .columns > *, .cta-group > * { min-width: 0; }
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } .split.flip > :first-child { order: 2; } }

.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--primary); border-bottom: 2.5px solid var(--primary); transform: rotate(-45deg);
}

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.25em; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 20px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700;
}
.steps strong { display: block; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}

/* Diagrams */
.diagram { width: 100%; }
.diagram text { font-family: var(--font); fill: var(--ink); }
.diagram .muted { fill: var(--ink-muted); }
.diagram .gain { fill: var(--gain); }
.diagram .box { fill: var(--surface); stroke: var(--line); }
.diagram .accent { fill: var(--primary-soft); stroke: var(--primary); }
.diagram .arrow { stroke: var(--ink-muted); fill: none; stroke-width: 1.5; }
.diagram .arrowhead { fill: var(--ink-muted); }

/* Edition cards */
.editions { display: grid; gap: 24px; }
@media (min-width: 900px) { .editions { grid-template-columns: 1fr 1fr; } }
.edition { display: flex; flex-direction: column; }
.edition h3 { font-size: 1.4rem; margin-bottom: 4px; }
.edition dl { margin: 16px 0 24px; display: grid; grid-template-columns: 8.5em 1fr; gap: 10px 16px; }
.edition dt { color: var(--ink-muted); font-size: 0.9rem; }
.edition dd { margin: 0; }
.edition .actions { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 480px) { .edition dl { grid-template-columns: 1fr; gap: 2px; } .edition dd { margin-bottom: 10px; } }

/* Install command */
.install { display: flex; gap: 8px; align-items: stretch; }
.install code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  background: var(--code-bg); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem;
  user-select: all;
}
.copy { flex-shrink: 0; }
.desktop-only { display: none; }
.no-desktop { display: block; }
html.has-desktop .desktop-only { display: block; }
html.has-desktop .no-desktop { display: none; }

/* Privacy columns */
.columns { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.columns h3 { margin-bottom: 8px; }

/* FAQ */
.faq > * { max-width: 52em; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative;
  font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; color: var(--ink-muted); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 16px; color: var(--ink-muted); }
.faq h2.group { margin-top: 48px; font-size: 1.35rem; }

/* Final call to action */
.final { text-align: center; }
.final .cta-group { justify-content: center; }
.final .lead { margin: 0 auto 28px; }

/* Prose pages (download, security) */
.prose { max-width: 46em; }
.prose h2 { margin-top: 48px; font-size: 1.6rem; }
.prose h3 { margin-top: 28px; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li { margin-bottom: 6px; }
.page-head { padding: 56px 0 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; font-size: 0.9rem; color: var(--ink-muted); }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 32px; }
.site-footer h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .legal { border-top: 1px solid var(--line); padding-top: 20px; }
.site-footer .legal p { margin-bottom: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
