/* Light only. Warm stone neutrals, the system sans the app itself uses, and
   the app's own screen as the page's main image. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --fg: #1c1917;
  --muted: #6b635d;        /* 5.9:1 on --bg */
  --line: #e7e5e4;
  --soft: #f3f1ee;
  --ink: #111111;
  --focus: #2563eb;
  --radius: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans", Helvetica, Arial, sans-serif;
  --serif: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif; /* the wordmark's face */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  interpolate-size: allow-keywords; /* lets <details> animate where supported */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip;
  background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Nav */
.nav, .foot { width: min(1080px, 100% - 40px); margin-inline: auto; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.nav-brand { display: inline-flex; align-items: center; }
.nav-brand img { height: 28px; width: auto; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 14px; text-decoration: none; }
.nav-links a:hover { color: var(--fg); }

main { flex: 1; }
section { width: min(1080px, 100% - 40px); margin-inline: auto; }

/* Hero */
.hero { position: relative; padding: clamp(40px, 8vh, 88px) 0 0; }
.hero::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 0;
  width: min(900px, 100vw); aspect-ratio: 1.6; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgb(28 25 23 / 0.06), rgb(28 25 23 / 0));
  pointer-events: none;
}
.hero-copy { text-align: center; }
.hero-icon { width: 128px; height: 128px; margin: 0 auto 10px; } /* the SVG carries its own shadow and grid margin */
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.03em; }
.hero h1 { margin: 0; font-size: clamp(44px, 8vw, 72px); line-height: 1.05; }
.hero-lede { margin: 12px 0 0; font-size: clamp(18px, 2.6vw, 21px); color: var(--muted); }
.hero-lede a { color: var(--fg); font-weight: 500; }

/* The app window */
.window {
  margin: clamp(40px, 7vh, 64px) auto 0; max-width: 1080px;
  border-radius: 12px; overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 1px rgb(28 25 23 / 0.08), 0 30px 60px -20px rgb(28 25 23 / 0.28), 0 18px 36px -18px rgb(28 25 23 / 0.2);
}
.window-bar {
  position: relative; display: flex; align-items: center; height: 38px; padding: 0 14px;
  background: linear-gradient(#f6f5f3, #eeece9); border-bottom: 1px solid #e2dfdb;
}
.dots { display: inline-flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.12); }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.window-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 13px; color: #57534e; white-space: nowrap; }
.window-shot { width: 100%; height: auto; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .window { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 50ms; }
  .hero-copy > :nth-child(3) { animation-delay: 100ms; }
  .hero-copy > :nth-child(4) { animation-delay: 150ms; }
  .window { animation-delay: 220ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* Buttons and the hero call to action */
.download { margin-top: 30px; min-height: 96px; }
.dl-primary { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 15rem; padding: 12px 26px; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 8px 20px -8px rgb(0 0 0 / 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #262322; transform: translateY(-1px); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 12px 24px -8px rgb(0 0 0 / 0.4); }
.btn:active { transform: none; }
.btn small { font-weight: 400; font-size: 12.5px; color: rgb(255 255 255 / 0.72); }
.btn-big { min-height: 60px; }
.btn.is-loading { background: var(--line); box-shadow: none; color: transparent; pointer-events: none; }
.dl-meta { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.dl-meta a { color: var(--muted); }
.dl-meta a:hover { color: var(--fg); }

/* Built on Peitho */
.peitho {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 48px; align-items: center;
  margin-top: clamp(80px, 14vh, 136px); padding: 44px 48px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 1px 2px rgb(28 25 23 / 0.04), 0 20px 40px -28px rgb(28 25 23 / 0.18);
}
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.peitho h2 { margin: 4px 0 0; font-size: 44px; line-height: 1.1; }
.peitho-tagline { margin: 14px 0 0; font-size: 19px; line-height: 1.5; }
.peitho-link { display: inline-flex; gap: 6px; margin-top: 18px; font-size: 15px; font-weight: 500; text-decoration: none; }
.peitho-link span { transition: transform 0.15s ease; }
.peitho-link:hover span { transform: translateX(3px); }

.peitho-visual { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr); align-items: center; gap: 14px; }
.md {
  margin: 0; padding: 14px 16px 16px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #44403c; white-space: pre-wrap; overflow: hidden;
}
.md b { color: var(--fg); }
.md-file { display: block; margin-bottom: 8px; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.arrow { font-size: 22px; color: var(--muted); }
.slide {
  aspect-ratio: 16 / 9; padding: 7% 8%; border-radius: 8px; background: #fbfaf8; overflow: hidden;
  box-shadow: 0 0 0 1px rgb(28 25 23 / 0.08), 0 14px 28px -14px rgb(28 25 23 / 0.35);
  container-type: inline-size;
}
.slide-title { margin: 0 0 7cqi; font-size: 9.5cqi; line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; }
.slide-title::after { content: ""; display: block; width: 12cqi; height: 1.1cqi; margin-top: 3.5cqi; background: var(--fg); border-radius: 1cqi; }
.slide ul { margin: 0; padding-left: 1.1em; font-size: 5.6cqi; line-height: 1.5; color: #44403c; }

/* Download: one accordion entry per platform */
.downloads { width: min(640px, 100% - 40px); margin-top: clamp(72px, 12vh, 120px); margin-bottom: clamp(72px, 12vh, 120px); }
.downloads h2 { margin: 0 0 18px; font-size: 34px; text-align: center; }
.acc { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-item summary {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none;
  font-weight: 600; user-select: none;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after {
  content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform 0.2s ease;
}
.acc-item[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.acc-item summary:hover { background: #fcfbfa; }
.acc-item summary:focus-visible { outline-offset: -2px; border-radius: 0; }
.acc-name { flex: 1; }
.acc-count { font-weight: 400; font-size: 13px; color: var(--muted); }
.acc-item::details-content { block-size: 0; overflow: clip; transition: block-size 0.25s ease, content-visibility 0.25s allow-discrete; }
.acc-item[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) { .acc-item::details-content { transition: none; } }
.acc-item ul { list-style: none; margin: 0; padding: 0 20px 12px; }
.acc-item li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--soft); }
.acc-item li a { display: flex; flex-direction: column; min-width: 0; text-decoration: none; }
.acc-item li a:hover .acc-file { text-decoration: underline; }
.acc-file { font-size: 14px; font-weight: 500; word-break: break-all; }
.acc-kind { font-size: 12.5px; color: var(--muted); }
.dl-size { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acc.is-loading .acc-item { height: 57px; background: linear-gradient(90deg, var(--surface), var(--soft), var(--surface)); }
.acc-empty { margin: 0; padding: 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.acc-empty a { color: var(--fg); }

@media (prefers-reduced-motion: no-preference) {
  .btn.is-loading, .acc.is-loading .acc-item { animation: pulse 1.2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.55; } }
}

/* Footer */
.foot { padding: 24px 0 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.foot a { color: var(--muted); }

/* 404 */
.notfound { text-align: center; padding: 96px 20px; }
.notfound h1 { margin: 0; font-size: 44px; }
.notfound p { color: var(--muted); }

@media (max-width: 860px) {
  .peitho { grid-template-columns: 1fr; gap: 32px; padding: 32px 24px; }
  .peitho-copy { text-align: center; }
  .peitho-visual { max-width: 520px; margin-inline: auto; width: 100%; text-align: left; }
}
@media (max-width: 560px) {
  .btn { min-width: 100%; }
  .window { border-radius: 10px; }
  .window-bar { height: 28px; padding: 0 10px; }
  .dots { gap: 6px; } .dots i { width: 9px; height: 9px; }
  .window-title { font-size: 11px; }
  .peitho-visual { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); justify-self: center; }
  .peitho h2 { font-size: 36px; }
  .peitho-tagline { font-size: 17px; }
}
