/* Fumika's tokens (src/styles/tokens.css in the app): Candlelight Night by default, Candlelight when the visitor prefers light. */
:root {
  --bg: #0a0907; --panel: #110f0b; --surface2: #1d1a14;
  --text: #e4d8c2; --soft: #a39682; --faint: #6c6253; --line: #232019;
  --accent: #d9a955; --accent-ink: #201503;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --danger: #ec8a73;
  --night: #1b2557; --violet: #5a4d95; --mauve: #a072a8; --peach: #fcae74;
  --horizon: max(33.4svh, 170px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #efede8; --panel: #fbfaf8; --surface2: #ecebe6;
    --text: #1d1d1f; --soft: #5f5f64; --faint: #8a8a8f; --line: #e0ded8;
    --accent: #a8741f; --accent-ink: #fff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --danger: #c4452c;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100svh; position: relative; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, sans-serif; -webkit-text-size-adjust: 100%;
}

.sky {
  position: absolute; inset: 0 0 auto 0; height: var(--horizon);
  background: linear-gradient(var(--night) 0 40%, var(--violet) 40% 62%, var(--mauve) 62% 82%, var(--peach) 82% 100%);
}

.stack {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px;
  width: 100%; max-width: 640px; margin: 0 auto; padding: calc(var(--horizon) - 56px) 16px 56px;
}
.logo {
  width: 112px; height: 112px; border-radius: 50%; display: block;
  box-shadow: 0 0 0 5px var(--bg), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.word {
  margin: 0; font-family: Literata, Georgia, serif; font-weight: 600; font-size: 30px;
  letter-spacing: 0.01em; line-height: 1; text-align: center;
}
.word small {
  display: block; margin-top: 8px; font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", Inter, system-ui, sans-serif;
  font-size: 13px; font-weight: 500; color: var(--soft); letter-spacing: 0.3em; text-indent: 0.3em;
}

.box {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.box-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.box-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.ver { font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; text-align: right; }

.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.row:first-child { border-top: 0; }
a.row:hover { background: var(--surface2); }
a.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ico { width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); display: grid; place-items: center; flex: none; }
.ico svg { width: 18px; height: 18px; fill: var(--accent); }
.meta { flex: 1; min-width: 0; }
.meta b { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.meta span { display: block; font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }

.state { padding: 28px 16px; text-align: center; font-size: 14px; color: var(--soft); }
.state p { margin: 0; }
.state button {
  margin-top: 14px; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--text); cursor: pointer;
}
.state button:hover { border-color: var(--accent); }
.state button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.state.error p { color: var(--text); }
.note { font-size: 13px; color: var(--soft); text-align: center; margin: 0; }
.sample {
  margin: 0; padding: 8px 16px; font-size: 12px; text-align: center; color: var(--accent-ink);
  background: var(--accent); font-weight: 600;
}

.skeleton .ico, .skeleton .line, .skeleton .pill { background: var(--line); animation: pulse 1.4s ease-in-out infinite; }
.skeleton .line { display: block; height: 10px; border-radius: 5px; }
.skeleton .line.title { width: 45%; height: 12px; margin-bottom: 8px; }
.skeleton .line.file { width: 75%; }
.skeleton .pill { width: 52px; height: 26px; border-radius: 999px; }
.skeleton .size-ph { width: 44px; }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .skeleton * { animation: none !important; } }

.box-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; }
.box-foot a, .notes a { color: var(--accent); text-underline-offset: 3px; }
.box-foot a:focus-visible, .notes a:focus-visible, .notes summary:focus-visible, .more:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* Release notes: a reading surface under the box */
.notes { width: 100%; max-width: 560px; margin-top: 22px; scroll-margin-top: 24px; }
.notes-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.notes h2 { margin: 0; font-family: Literata, Georgia, serif; font-weight: 600; font-size: 21px; line-height: 1.3; }
.when { font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }

.body { position: relative; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 0.9em; }
.body h3 {
  margin: 1.6em 0 0.6em; font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft);
}
.body h4 { margin: 1.3em 0 0.4em; font-size: 14px; font-weight: 600; color: var(--soft); }
.body h5 { margin: 1.2em 0 0.4em; font-size: 14px; font-weight: 500; color: var(--soft); }
.body ul, .body ol { margin: 0 0 1em; padding-left: 1.3em; }
.body li { margin: 0.45em 0; padding-left: 0.2em; }
.body li::marker { color: var(--faint); }
.body li > ul, .body li > ol { margin: 0.4em 0 0; }
.body strong { font-weight: 600; color: var(--text); }
.body code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88em;
  padding: 0.12em 0.4em; border-radius: 5px; background: var(--surface2);
}
.body pre { margin: 0 0 1em; padding: 12px 14px; border-radius: 10px; background: var(--surface2); overflow-x: auto; }
.body pre code { padding: 0; background: none; overflow-wrap: normal; }
.body blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 2px solid var(--line); color: var(--soft); }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.table-scroll { margin: 0 0 1em; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.body table { border-collapse: collapse; font-size: 13px; width: 100%; overflow-wrap: normal; }
.body th, .body td { padding: 8px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.body tr:first-child th { border-top: 0; }
.body th { color: var(--soft); font-weight: 600; }
.empty { margin: 0; font-size: 14px; color: var(--soft); }

.body.collapsed { max-height: var(--collapsed-height, 380px); overflow: hidden; }
.body.collapsed::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 96px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.more {
  display: block; margin: 14px auto 0; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--text); cursor: pointer;
}
.more:hover { border-color: var(--accent); }

.earlier { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 20px; }
.earlier h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.earlier details { border-bottom: 1px solid var(--line); }
.earlier summary {
  padding: 12px 0; font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  font-variant-numeric: tabular-nums;
}
.earlier summary::-webkit-details-marker { display: none; }
.earlier summary::before {
  content: ""; width: 7px; height: 7px; flex: none; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  transform: rotate(-45deg); transition: transform 0.15s;
}
.earlier details[open] > summary::before { transform: rotate(45deg); }
.earlier details > .body { padding: 2px 0 18px 17px; }
.notes .state { padding: 20px 0; }

.notes-skeleton { display: grid; gap: 12px; }
.notes-skeleton .line.heading { width: 55%; height: 18px; margin-bottom: 6px; }
.notes-skeleton .line.text { height: 11px; }
@media (prefers-reduced-motion: reduce) { .earlier summary::before { transition: none; } }
