:root {
  --bg: #170f09;
  --bg-2: #22160d;
  --panel: #2b1c10;
  --line: #4a3320;
  --ink: #f4e7d0;
  --ink-2: #c9b596;
  --amber: #f1b65c;
  --lav: #c3b0e2;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -80px, #3a2413 0%, var(--bg) 62%) fixed, var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }

.top { text-align: center; padding: 34px 16px 18px; }
.eyebrow {
  margin: 0; letter-spacing: .34em; font-size: 11px; color: var(--amber);
  font-family: "Hoefler Text", "Baskerville", "Times New Roman", serif;
}
h1 {
  margin: 6px 0 4px; font-size: clamp(24px, 4.6vw, 40px); font-weight: 700; letter-spacing: .04em;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
h1 span { color: var(--lav); font-family: "Hoefler Text", "Baskerville", serif; font-style: italic; margin-left: .15em; }
.lead { margin: 0 auto; max-width: 34em; color: var(--ink-2); font-size: 14px; }

main { max-width: 1240px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- viewer ---------- */
.stage {
  position: relative; width: 100%; aspect-ratio: 1230 / 692; container-type: inline-size;
  background: #0f0905; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px rgba(0, 0, 0, .8);
  touch-action: none;
}
.stage canvas, .stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage canvas { opacity: 0; transition: opacity .6s ease; cursor: grab; outline-offset: -3px; }
.stage canvas:active { cursor: grabbing; }
.stage.ready canvas { opacity: 1; }
.stage .poster { object-fit: cover; }

.loading {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(20, 12, 6, .78); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 16px 7px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden;
}
.loading i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--amber); transition: width .2s; }
.stage.ready .loading { display: none; }
.hint {
  position: absolute; left: 12px; bottom: 10px; margin: 0; padding: 3px 12px; border-radius: 999px;
  background: rgba(20, 12, 6, .62); color: var(--ink-2); font-size: 11.5px; pointer-events: none;
  transition: opacity .8s ease;
}
.hint.gone { opacity: 0; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.controls .spacer { flex: 1 1 auto; }
.fstop {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
}
.fstop input { width: 150px; accent-color: var(--amber); cursor: pointer; }
.fstop output { min-width: 5.2em; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
button {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 15px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
button:hover { border-color: #7a5a3a; }
button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #2a1808; font-weight: 700; }
button.toggle, button.toggle[aria-pressed="true"] { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 400; }
button.toggle[aria-pressed="false"] { border-color: var(--lav); color: var(--lav); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--lav); outline-offset: 2px; }

/* ---------- sections ---------- */
.block { margin-top: 54px; }
h2 {
  margin: 0 0 4px; font-size: 20px; letter-spacing: .08em;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
h2::after { content: ""; display: block; width: 44px; height: 2px; background: var(--amber); margin-top: 8px; }
.note { margin: 10px 0 14px; color: var(--ink-2); font-size: 13.5px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); aspect-ratio: 16 / 9; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery .tall img { object-position: 50% 30%; }
.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

.made ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.made li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--ink-2); }
.made b { color: var(--ink); margin-right: .3em; }

footer { border-top: 1px solid var(--line); text-align: center; color: #8f7a60; font-size: 12px; padding: 18px 16px 30px; }
footer p { margin: 0; }

@media (max-width: 760px) {
  .top { padding-top: 22px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .made ul { grid-template-columns: 1fr; }
  .controls { gap: 6px; }
  .controls .spacer { display: none; }
  .fstop { width: 100%; justify-content: space-between; }
  .fstop input { flex: 1 1 auto; width: auto; }
  button { font-size: 12.5px; padding: 6px 12px; }
  .hint { font-size: 10.5px; left: 8px; bottom: 8px; }
  .hint .more { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stage canvas, .gallery img, .hint { transition: none; }
}
