/* ViPi site. Light: paper and seal red. Dark: lacquer, eggshell and gold. */
:root {
  --paper: #fbfaf8;
  --sheet: #ffffff;
  --ink: #241a1b;
  --muted: #6c5f5d;
  --faint: #978985;
  --rule: #e9e2dd;
  --red: #c8102e;
  --red-text: #b30d28;
  --on-red: #ffffff;
  --gold: #f5b82e;
  --gold-text: #8a5b00;
  --cap: #ffffff;
  --cap-edge: #d9cfca;
  --cap-text: #3b2f2e;
  --shadow: 0 1px 0 rgba(90, 30, 30, .04), 0 30px 60px -30px rgba(120, 25, 30, .28);
  --wide: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #1c1011;
  --sheet: #271718;
  --ink: #f3e9e0;
  --muted: #c0aea7;
  --faint: #8f7c77;
  --rule: #3c2728;
  --red: #d61c33;
  --red-text: #ff7d70;
  --on-red: #ffffff;
  --gold: #f5c04a;
  --gold-text: #f5c04a;
  --cap: #33201f;
  --cap-edge: #0f0607;
  --cap-text: #eadbd2;
  --shadow: 0 0 0 1px #3c2728, 0 30px 70px -30px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1011;
    --sheet: #271718;
    --ink: #f3e9e0;
    --muted: #c0aea7;
    --faint: #8f7c77;
    --rule: #3c2728;
    --red: #d61c33;
    --red-text: #ff7d70;
    --on-red: #ffffff;
    --gold: #f5c04a;
    --gold-text: #f5c04a;
    --cap: #33201f;
    --cap-edge: #0f0607;
    --cap-text: #eadbd2;
    --shadow: 0 0 0 1px #3c2728, 0 30px 70px -30px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .for-light { display: none; }
  :root:not([data-theme="light"]) .for-dark { display: block; }
}
.for-dark { display: none; }
:root[data-theme="dark"] .for-light { display: none; }
:root[data-theme="dark"] .for-dark { display: block; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.6 "Be Vietnam Pro", -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[lang|="zh"] { font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Be Vietnam Pro", sans-serif; }
[lang="zh-Hant"] { font-family: "PingFang TC", "Noto Sans CJK TC", "PingFang SC", sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--red-text); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; color: var(--ink); }
p { margin: 0; }
em { font-style: normal; font-weight: 700; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 .38em;
  border-radius: 6px;
  background: var(--cap);
  box-shadow: 0 0 0 1px var(--cap-edge), 0 2px 0 var(--cap-edge);
  color: var(--cap-text);
  font-family: inherit;
  font-size: .82em;
  font-weight: 600;
  line-height: 1.65;
  text-align: center;
  white-space: nowrap;
  vertical-align: .08em;
}

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; }
.top nav { display: flex; gap: 24px; margin-left: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 16px; font-weight: 500; }
.top nav a:hover { color: var(--ink); }
.theme {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.theme:hover { border-color: var(--muted); }

/* Hero */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 80px) var(--gutter) clamp(64px, 8vw, 112px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
h1 {
  font-size: clamp(42px, 5.6vw, 72px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -.028em;
  max-width: 11em;
}
.lede { margin-top: 28px; max-width: 30em; font-size: 20px; line-height: 1.55; color: var(--muted); }
.lede kbd { font-size: .78em; }
.cta { margin-top: 36px; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px;
  border-radius: 12px;
  background: var(--red); color: var(--on-red);
  font-weight: 700; font-size: 18px; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 24px -12px var(--red);
}
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.fine { margin-top: 14px; font-size: 15px; color: var(--faint); max-width: 30em; }

/* Demo */
.demo {
  position: relative;
  background: var(--sheet);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 14px 18px;
}
.demo-bar { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 12px; border-bottom: 1px solid var(--rule); }
.demo-title { font-size: 14px; font-weight: 600; color: var(--faint); }
.modes { display: flex; gap: 6px; }
.modes button {
  min-width: 38px; height: 26px; padding: 0 8px;
  border: 1px solid var(--rule); border-radius: 6px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 800; line-height: 1; letter-spacing: .02em;
  cursor: pointer;
}
.modes button[lang="zh"] { font-size: 14px; font-weight: 600; font-family: "PingFang SC", "Noto Sans CJK SC", sans-serif; }
.modes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.demo-field {
  position: relative;
  min-height: 196px;
  padding: 24px 12px 12px;
  cursor: text;
}
.demo-text {
  font-size: clamp(28px, 3.1vw, 40px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.caret {
  display: inline-block;
  width: 2px; height: 1.1em;
  margin-left: 1px;
  vertical-align: -.16em;
  background: var(--red);
}
.demo.focused .caret { animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; resize: none; border: 0; padding: 0;
  font-size: 16px; caret-color: transparent; color: transparent; background: transparent;
  cursor: text;
}
.demo.focused { box-shadow: var(--shadow), 0 0 0 2px var(--red); }
.cands {
  position: absolute;
  z-index: 2;
  margin: 0; padding: 6px 10px 8px;
  list-style: none;
  background: var(--sheet);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--rule), 0 14px 30px -10px rgba(40, 10, 10, .35);
  white-space: nowrap;
  pointer-events: none;
}
.cands .py { display: block; font: 500 14px/1.4 "Be Vietnam Pro", sans-serif; color: var(--faint); padding: 0 2px 4px; }
.cands li { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 9px 3px 7px; border-radius: 7px; font-size: 22px; line-height: 1.3; color: var(--ink); }
.cands li small { font: 500 13px/1 "Be Vietnam Pro", sans-serif; color: var(--faint); }
.cands li.on { background: var(--red); color: #fff; }
.cands li.on small { color: rgba(255, 255, 255, .8); }
.tape {
  display: flex; justify-content: flex-end; gap: 5px;
  height: 36px; padding: 0 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
  mask-image: linear-gradient(to right, transparent, #000 30%);
}
.tape kbd { flex: none; align-self: center; font-size: 14px; line-height: 26px; min-width: 26px; animation: press .18s ease-out; }
.tape kbd.combo { color: var(--on-red); background: var(--red); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
@keyframes press { from { transform: translateY(3px); opacity: .3; } }
.demo-hint { margin-top: 10px; padding: 0 8px; font-size: 15px; color: var(--faint); }
.demo-hint kbd { font-size: .78em; }

/* Bands */
.band {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  border-top: 1px solid var(--rule);
}
.band-head { align-self: start; position: sticky; top: 32px; }
h2 { font-size: clamp(30px, 3.3vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -.022em; max-width: 13em; }
.band-head > p { margin-top: 18px; color: var(--muted); max-width: 26em; }
.band-head kbd { font-size: .78em; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 700; }

.specimen { margin: 0; }
.specimen > div {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) minmax(0, 3fr);
  gap: 8px 28px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.specimen > div:first-child { padding-top: 0; }
.specimen dt { margin: 0; }
.specimen dd { margin: 0; }
kbd.typed { font-size: 17px; font-weight: 500; padding: .1em .6em; letter-spacing: .01em; }
.out { display: block; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.out[lang="zh"] { font-weight: 600; }
.note { display: block; margin-top: 4px; font-size: 16px; color: var(--muted); }
.note kbd { font-size: 13px; }

.facts { margin: 28px 0 0; padding-left: 1.1em; color: var(--muted); }
.facts li { padding-left: .3em; margin: 8px 0; }
.facts li::marker { color: var(--red); }
.band-head .facts { margin-top: 22px; font-size: 17px; }

.cand-shot { margin: 32px 0 0; max-width: 289px; }
.cand-shot img { border-radius: 10px; box-shadow: 0 0 0 1px var(--rule); }
.keys { margin-top: 28px; color: var(--muted); font-size: 16px; line-height: 2; }
.keys kbd { font-size: 13px; }
.trio { margin-top: 44px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.trio > div { padding-top: 16px; border-top: 2px solid var(--gold); }
.trio p { margin-top: 8px; font-size: 16px; color: var(--muted); }
.trio kbd { font-size: 13px; }
.pairs { word-spacing: .3em; color: var(--ink); }

/* Shortcut */
.chord { display: flex; align-items: center; gap: 18px; }
.chord > span { font-size: 32px; color: var(--faint); }
kbd.cap {
  display: grid; place-items: center; align-content: center;
  width: clamp(104px, 12vw, 136px); aspect-ratio: 1;
  border-radius: 20px;
  font-size: clamp(44px, 5vw, 60px); line-height: 1; font-weight: 500;
  box-shadow: 0 0 0 1px var(--cap-edge), 0 6px 0 var(--cap-edge), 0 18px 30px -18px rgba(60, 10, 10, .5);
}
kbd.cap small { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--faint); letter-spacing: .01em; }
.rotation { margin-top: 44px; }
.rotation p { font-size: 20px; color: var(--muted); }
.rotation p + p { margin-top: 6px; }
.rotation strong { color: var(--ink); }
.mru { margin: 26px 0 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 14px; }
.mru li { display: flex; align-items: center; gap: 14px; }
.mru li + li::before { content: "⇄"; color: var(--faint); font-size: 22px; }
.badge {
  display: inline-grid; place-items: center;
  min-width: 52px; height: 36px; padding: 0 10px;
  border-radius: 8px;
  background: var(--ink); color: var(--paper);
  font-weight: 800; font-size: 16px;
}
.badge[lang="zh"] { font-weight: 600; font-size: 19px; }
.mru li:first-child .badge { background: var(--red); color: var(--on-red); }

/* Secure Input */
.monitor { max-width: 560px; border-radius: 12px; background: var(--sheet); box-shadow: var(--shadow); overflow: hidden; }
.monitor-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--rule); font-size: 14px; font-weight: 600; color: var(--muted); }
.lock { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--red); color: #fff; }
.monitor-body { padding: 20px 22px 22px; font-size: 16px; color: var(--muted); }
.monitor-state { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.monitor-since { font-size: 14px; color: var(--faint); margin-top: 2px; }
.monitor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.monitor-actions span { padding: 4px 12px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--cap); box-shadow: 0 0 0 1px var(--cap-edge), 0 1px 0 var(--cap-edge); }
.after { margin-top: 24px; color: var(--muted); max-width: 34em; }

/* Settings */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; }
.tabs button {
  padding: 8px 14px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.2;
  cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.shot { margin: 0; max-width: 562px; }
.shot img { border-radius: 12px; }

/* Promise */
.vows { margin: 0; padding: 0; list-style: none; }
.vows li { padding: 20px 0; border-bottom: 1px solid var(--rule); font-size: 20px; color: var(--muted); }
.vows li:first-child { padding-top: 0; }
.vows strong { color: var(--ink); font-weight: 700; }

/* Steps */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 26px 64px; font-size: 20px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -.12em;
  font-size: 40px; line-height: 1; font-weight: 800; color: var(--red-text);
}
.steps kbd { font-size: .8em; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 18px 0;
  font-size: 19px; font-weight: 600;
  cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 26px; line-height: 1; font-weight: 400; color: var(--faint); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 36em; }
.faq kbd { font-size: .8em; }

/* Footer */
.foot {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 48px var(--gutter) 64px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) auto;
  gap: 32px 48px;
  font-size: 15px;
  color: var(--faint);
}
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-brand p { color: var(--muted); }
.credits { max-width: 40em; }
.foot a { color: var(--muted); }
.foot-links { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .band { grid-template-columns: minmax(0, 1fr); }
  .band-head { position: static; }
  .foot { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  .top { gap: 16px; }
  .top nav { display: none; }
  .theme { margin-left: auto; }
  .specimen > div { grid-template-columns: 1fr; }
  .lede, .rotation p, .vows li, .steps li { font-size: 18px; }
  .demo-field { min-height: 200px; }
  .steps li { padding-left: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
