/* app.historyofmarket.com: plain CSS, no build step. Light and dark follow the system; 16 px side gutters at every
   width; the CSP in _headers allows this file only (no inline styles, no scripts). */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --surface: #f5f5f7;
  --accent: #0066cc;
  --button-bg: #1d1d1f;
  --button-text: #ffffff;
  --tile-gap: #ffffff;
  --up-1: #1f8f4e;
  --up-2: #3fae6c;
  --up-3: #8ccfa5;
  --down-1: #c93a3a;
  --down-2: #e06b6b;
  --down-3: #eea5a5;
  --flat: #a1a1a8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #424245;
    --surface: #1c1c1e;
    --accent: #2997ff;
    --button-bg: #f5f5f7;
    --button-text: #000000;
    --tile-gap: #000000;
    --up-1: #1d7a45;
    --up-2: #2c9a5c;
    --up-3: #24563a;
    --down-1: #b23434;
    --down-2: #8e3434;
    --down-3: #5c2a2a;
    --flat: #48484a;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  overflow-wrap: break-word;
}

body:lang(zh) {
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 720px; }

/* header */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-block: 16px;
}
.brand { color: var(--text); font-weight: 600; }
.lang { font-size: 15px; }

/* landing */
.hero { display: grid; gap: 32px; align-items: center; padding-block: 24px 48px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(34px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.02em; }
.lead { margin: 0 0 28px; font-size: clamp(19px, 2.4vw, 23px); line-height: 1.45; color: var(--muted); }
.store {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
}
.store:hover { text-decoration: none; opacity: 0.88; }
.platforms { margin: 12px 0 0; font-size: 15px; color: var(--muted); }

.map {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 3px;
  aspect-ratio: 4 / 3;
  padding: 3px;
  border-radius: 20px;
  background: var(--tile-gap);
  box-shadow: 0 0 0 1px var(--line);
}
.map span { border-radius: 4px; }
.t1 { grid-area: 1 / 1 / 5 / 6; background: var(--up-1); }
.t2 { grid-area: 1 / 6 / 4 / 9; background: var(--up-2); }
.t3 { grid-area: 1 / 9 / 4 / 11; background: var(--down-3); }
.t4 { grid-area: 1 / 11 / 3 / 13; background: var(--up-3); }
.t5 { grid-area: 3 / 11 / 4 / 13; background: var(--down-2); }
.t6 { grid-area: 4 / 6 / 6 / 8; background: var(--up-1); }
.t7 { grid-area: 4 / 8 / 6 / 11; background: var(--down-1); }
.t8 { grid-area: 4 / 11 / 6 / 13; background: var(--flat); }
.t9 { grid-area: 5 / 1 / 9 / 4; background: var(--down-2); }
.t10 { grid-area: 5 / 4 / 9 / 6; background: var(--up-2); }
.t11 { grid-area: 6 / 6 / 9 / 9; background: var(--up-3); }
.t12 { grid-area: 6 / 9 / 9 / 13; background: var(--up-1); }

.features {
  list-style: none;
  margin: 0;
  padding: 0 0 56px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.features li { padding: 20px; border-radius: 16px; background: var(--surface); }
.features h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.3; }
.features p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }

@media (min-width: 820px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 48px; padding-block: 48px 72px; }
}

/* policy, terms, support */
.doc { padding-block: 24px 56px; }
.doc h1 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.01em; }
.doc h2 { margin: 36px 0 8px; font-size: 21px; line-height: 1.3; }
.doc p, .doc li { margin: 0 0 14px; }
.doc ol, .doc ul { margin: 0 0 14px; padding-inline-start: 1.4em; }
.doc li::marker { color: var(--muted); }
.dated { color: var(--muted); font-size: 15px; }

/* footer */
.foot { padding-block: 0 48px; font-size: 15px; color: var(--muted); }
.foot::before { content: ""; display: block; margin-bottom: 24px; border-top: 1px solid var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.foot p { margin: 0 0 6px; }
.foot [aria-current="page"] { color: var(--text); }
