/* MiseDeck site styles.
 *
 * One shared stylesheet for the landing page and the changelog. The
 * PageMask site copies its token block into every page; two pages do not
 * justify a copy-paste palette that can drift — the tokens below are the
 * app's own (docs/design/visual-language.md), which are in turn derived
 * from mise.jdx.dev's warm parchment / charcoal family.
 */

/* Self-hosted faces — the same files the app ships (OFL 1.1). */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/cormorant-garamond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light dark;

  /* The app's own palette (docs/design/visual-language.md). */
  --bg: #fdf8f3;
  --surface: #f8f0e2;
  --chrome: #f5ede3;
  --chrome-2: #f0e6da;
  --text: #2a1f1a;
  --dim: #5a4d42;
  --quiet: #7d7068;
  --accent: #8b2252;
  --accent-strong: #721a43;
  --accent-soft: #8b225214;
  --ok: #6b7f4e;
  --warn: #9a7245;
  --danger: #c44536;
  --line: rgba(42, 31, 26, 0.16);
  --line-strong: rgba(42, 31, 26, 0.34);
  --shadow: 0 18px 48px -24px rgba(42, 31, 26, 0.42);

  --font-display: "Cormorant Garamond", "Songti SC", "SimSun", Georgia, serif;
  --font-ui: "Space Grotesk", "PingFang SC", "Microsoft YaHei", system-ui,
    -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius: 8px;
  --radius-card: 12px;
  --measure: 1080px;
  --motion: 150ms;
  --ease: cubic-bezier(0.2, 0, 0.38, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141010;
    --surface: #221c1a;
    --chrome: #1c1614;
    --chrome-2: #1f1816;
    --text: #ede6df;
    --dim: #c9bfb5;
    --quiet: #9e9288;
    --accent: #c75b7a;
    --accent-strong: #d98bac;
    --accent-soft: #c75b7a1f;
    --ok: #8fa86e;
    --warn: #c5975b;
    --danger: #c44536;
    --line: rgba(237, 230, 223, 0.16);
    --line-strong: rgba(237, 230, 223, 0.34);
    --shadow: 0 18px 48px -24px rgba(0, 0, 0, 0.7);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="zh-CN"] body {
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

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

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--chrome-2);
  border-radius: 4px;
  padding: 1px 5px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--quiet);
}

html[lang="zh-CN"] .eyebrow {
  letter-spacing: normal;
  text-transform: none;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ------------------------------------------------------- bilingual switch */
html:not(.lang-en) body [lang="en"] {
  display: none;
}

html.lang-en body [lang="zh-CN"] {
  display: none;
}

/* A release body that carries only one language: the missing half is
   rendered with the other language's text and one of these classes, so
   it shows in the language that lacks it and stays hidden in the one
   that already has it (the generator's `rel-fallback-*`). */
html:not(.lang-en) body .rel-fallback-en {
  display: none;
}

html.lang-en body .rel-fallback-zh {
  display: none;
}

/* The fallback half carries the `lang` of its own text, so a screen
   reader reads it in the language it is written in — the language
   rules above would then hide it. The class decides which language
   mode shows it; these two rules have the last word. */
html.lang-en body .rel-fallback-en {
  display: block;
}

html:not(.lang-en) body .rel-fallback-zh {
  display: block;
}

/* ---------------------------------------------------------------- layout */
.container {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 72px;
}

.section.band {
  background: var(--chrome);
}

.section-head {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.2;
  margin: 10px 0 0;
}

.section-head p {
  color: var(--dim);
  margin: 12px 0 0;
}

/* ---------------------------------------------------------------- header */
.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-head .inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.site-nav {
  display: flex;
  gap: 4px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}

.site-nav a {
  color: var(--dim);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.head-right {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ver-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}

.ver-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang-group button {
  font: inherit;
  font-size: 13px;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}

.lang-group button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------------ hero */
.hero {
  padding-block: 88px 72px;
  background:
    radial-gradient(
      620px circle at 50% -12%,
      var(--accent-soft),
      transparent 70%
    ),
    linear-gradient(180deg, var(--chrome) 0%, var(--bg) 88%);
  text-align: center;
}

.hero img.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
}

.hero .slogan {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--dim);
  margin: 12px 0 0;
}

.hero .lede {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--dim);
}

.hero .cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero .trust {
  margin: 26px auto 0;
  max-width: 640px;
  font-size: 13px;
  color: var(--quiet);
}

.facts {
  display: flex;
  gap: 10px 28px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--quiet);
}

.facts span::before {
  content: "·";
  margin-inline-end: 10px;
  color: var(--line-strong);
}

.facts span:first-child::before {
  content: none;
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease),
    border-color var(--motion) var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------- terminal */
.terminal {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--chrome);
  box-shadow: var(--shadow);
}

.terminal-bar {
  padding: 10px 16px;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
  display: flex;
  align-items: center;
  gap: 10px;
}

html[lang="zh-CN"] .terminal-bar {
  letter-spacing: normal;
  text-transform: none;
}

.terminal-bar::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.terminal-lines {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  overflow-x: auto;
}

.terminal-lines .prompt {
  color: var(--accent);
}

.terminal-lines .cmd {
  color: var(--text);
}

.terminal-lines .ok {
  color: var(--ok);
}

.terminal-lines .warn {
  color: var(--warn);
}

.terminal-lines .dim {
  color: var(--quiet);
}

/* --------------------------------------------------------------- feature */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 22px 20px;
}

.card .cmd {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}

.card p {
  color: var(--dim);
  font-size: 14px;
  margin: 0;
}

.card .more {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
}

.card[data-accent="env"] .cmd {
  color: var(--warn);
}

.card[data-accent="tasks"] .cmd {
  color: var(--ok);
}

.card[data-accent="plugins"] .cmd {
  color: var(--danger);
}

/* ------------------------------------------------------------ screenshot */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.shot {
  margin: 0;
}

.shot-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
  /* The screenshots are light; pinning the scheme keeps a dark page from
     showing a black gutter around a light frame. */
  color-scheme: light;
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  font-size: 14px;
  color: var(--dim);
  padding: 10px 2px 0;
}

.shot figcaption .name {
  color: var(--text);
  font-weight: 600;
}

/* The shot frame is a button (it opens the lightbox): keep the frame's
   look and reset the button chrome around it. */
button.shot-frame {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
}

/* Nine shots in a two-column grid: the trailing odd one spans both
   columns so the grid never ends on a hole. */
.shot-grid .shot:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* The lightbox: one native dialog reused by every frame. The 1920 px webp
   is the same file the grid shows, so "full size" costs nothing extra. */
#shot-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(96vw, 1600px);
  max-height: 96vh;
}

#shot-lightbox:modal {
  overscroll-behavior: contain;
}

#shot-lightbox::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(20, 16, 16, 0.66);
}

#shot-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(96vh - 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

/* Opaque caption strip (#321): --dim directly on the dark backdrop
   computes to 1.29:1 in light theme — the strip gives both the caption
   and its .name their token background back. */
#shot-lightbox #lightbox-cap {
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 10px 14px 12px;
  font-size: 14px;
  color: var(--dim);
}

#shot-lightbox #lightbox-cap .name {
  color: var(--text);
  font-weight: 600;
}

#shot-lightbox form {
  position: absolute;
  top: 10px;
  right: 10px;
}

#shot-lightbox form button {
  appearance: none;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* --------------------------------------------------------------- install */
.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.install-grid .card h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.install-grid .card .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--quiet);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.install-grid .card p {
  font-size: 14px;
}

.file-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--chrome-2);
  border-radius: 4px;
  padding: 6px 8px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.note {
  border-inline-start: 3px solid var(--warn);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  color: var(--dim);
  font-size: 14px;
}

.note strong {
  color: var(--text);
}

.note code {
  display: block;
  background: var(--chrome-2);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 8px 0 0;
  overflow-x: auto;
}

/* ------------------------------------------------------------------- faq */
.faq {
  max-width: 760px;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}

.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "→";
  color: var(--accent);
  font-family: var(--font-mono);
}

.faq details[open] summary::after {
  content: "←";
}

.faq p {
  color: var(--dim);
  margin: 0 0 16px;
}

/* ---------------------------------------------------------------- footer */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--chrome);
  padding-block: 28px;
  color: var(--quiet);
  font-size: 14px;
}

.site-foot .inner {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  align-items: center;
}

.site-foot .spacer {
  margin-inline-start: auto;
}

.site-foot a {
  color: var(--dim);
}

.site-foot a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------ changelog */
.rel {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.rel:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.rel-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.rel-ver {
  color: var(--accent);
}

/* The pre-release badge: the same pill as the install cards' `.tag`,
   with the accent border that marks it as a state rather than a word. */
.rel-tag {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 8px;
  white-space: nowrap;
}

.rel-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--quiet);
}

.rel h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 6px;
}

.rel ul {
  margin: 0;
  padding-inline-start: 20px;
  color: var(--dim);
  font-size: 15px;
}

.rel li {
  margin-bottom: 4px;
}

.rel li code {
  font-size: 0.88em;
}

/* A fenced code block from a release note: the code is literal text, so
   it keeps its own lines and scrolls sideways instead of wrapping. */
.rel pre {
  background: var(--chrome-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin: 12px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}

.rel pre code {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: 1em;
  white-space: pre;
}

.rel-note {
  font-size: 13px;
  color: var(--quiet);
  margin: 10px 0 0;
}

/* A line of a historical release that names an install channel that no
   longer exists (the Homebrew tap of v1.0.0-beta.2). */
.rel-dead {
  color: var(--quiet);
  font-size: 14px;
  border-inline-start: 2px solid var(--warn);
  padding-inline-start: 10px;
  margin: 10px 0;
}

.page-head {
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 24px;
  margin-bottom: 8px;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  margin: 10px 0 0;
}

.page-meta {
  color: var(--quiet);
  font-size: 14px;
  margin: 8px 0 0;
}

.back-link {
  font-size: 14px;
  color: var(--dim);
}

.back-link:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .grid,
  .install-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .section {
    padding-block: 52px;
  }

  .grid,
  .install-grid,
  .shot-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-block: 60px 52px;
  }

  .head-right {
    margin-inline-start: 0;
  }
}

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