:root {
  --bg: #ffffff;
  --paper: #f9f8f1;
  --ink: #12141d;
  --ink-soft: #2e2e27;
  --muted: #6b6a60;
  --line: #2e2e27;
  --accent: #0b3721;
  --accent-ink: #ffffff;
  --radius: 20px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font: 400 clamp(1rem, 0.95rem + 0.3vw, 1.125rem)/1.65 "Manrope", system-ui, sans-serif;
}
h1, h2 { color: var(--ink); font-family: "Gotu", Georgia, serif; font-weight: 400; line-height: 1.25; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 20px 16px;
}
.brand { font-family: "Gotu", Georgia, serif; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { text-decoration: none; font-weight: 600; }
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }

.plate { margin: 0; }
.plate img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }

.btn {
  display: inline-block; padding: 0.55em 1.2em; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Story pages */
.story { max-width: 820px; margin: 0 auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0; }
.pager h1 { margin: 0; text-align: center; font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.25rem); }
.text {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: 20px 24px; color: var(--ink);
}
.text p { margin: 0; }
.text p + p { margin-top: 1em; }
.count { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 20px; }
@media (max-width: 520px) {
  .pager { flex-wrap: wrap; }
  .pager h1 { order: -1; flex-basis: 100%; }
  .text { padding: 16px; }
}

/* Home */
.cover a { display: block; }
.cover img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.hint { text-align: center; font-family: "Gotu", Georgia, serif; font-size: 1.2rem; color: var(--ink); margin: 20px 0 48px; }
.contents h2 { text-align: center; }
.contents ol {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px;
}
.contents a { display: block; text-decoration: none; }
.contents img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; }
.contents span { display: block; margin-top: 8px; font-size: 0.95rem; }
.contents b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.contents a:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* About */
.about { max-width: 820px; margin: 0 auto; text-align: center; }
.about h1, .about h2 { font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.25rem); margin: 40px 0 16px; }
.about .plate { margin: 24px 0; }
.cta { margin-top: 32px; }

.site-footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 24px 16px 40px; }
.site-footer a { display: inline-block; padding: 6px 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Story pages fill exactly one screen: the picture shrinks to leave room for
   the header, title, buttons and text. */
.reading { height: 100vh; height: 100svh; display: flex; flex-direction: column; }
.reading .site-header { width: 100%; padding-top: 12px; padding-bottom: 12px; }
.reading main { flex: 1; min-height: 0; width: 100%; display: flex; padding-bottom: 16px; }
.reading .story { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reading .plate { flex: 1 1 0; min-height: 160px; display: flex; justify-content: center; align-items: flex-start; }
.reading .plate img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
/* The picture links to the next page; display: contents keeps the <img> as the sizing flex item. */
.reading .plate a { display: contents; }
.reading .pager { margin: 14px 0; }
.reading .text { padding: 14px 20px; }
.reading .count { margin: 8px 0 0; }
.reading .site-footer { display: none; }

/* Cover and About pictures never taller than the screen. */
.cover img { width: auto; max-width: 100%; max-height: calc(100svh - 160px); margin: 0 auto; }
.about .plate img { width: auto; max-width: 100%; max-height: 75svh; margin: 0 auto; }

/* Short screens (small phones, landscape): tighter spacing and text. */
@media (max-height: 700px) {
  .reading .site-header { padding-top: 8px; padding-bottom: 8px; }
  .reading .plate { min-height: 120px; }
  .reading .pager { margin: 8px 0; }
  .reading .pager h1 { font-size: 1.3rem; }
  .reading .btn { padding: 0.4em 1em; }
  .reading .text { padding: 10px 14px; font-size: 0.9rem; line-height: 1.5; }
  .reading .text p + p { margin-top: 0.6em; }
  .reading .count { display: none; }
}
