/* Pocket guide for iPhone: one work per screen, scroll snapping, black and white with one red accent. */
:root {
  --paper: #ffffff; --ink: #111111; --muted: #5c5c5c; --red: #d0021b; --hair: #d9d9d9; --tint: #f2f2f2;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #111111; --ink: #f2f2f2; --muted: #a8a8a8; --red: #ff5c50; --hair: #333333; --tint: #1c1c1c; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { scroll-snap-type: y proximity; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
h1, h2, p, figure, ol { margin: 0; }
.guide { max-width: 30rem; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left)); }

.intro { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding-block: max(1.5rem, env(safe-area-inset-top)) 2rem; scroll-snap-align: start; }
.crumbs { font-size: 0.85rem; }
.crumbs a { display: inline-block; padding-block: 0.6rem; }
.kick { font-size: 0.82rem; font-weight: 700; border-top: 2px solid var(--ink); padding-top: 0.5rem; }
h1 { font-size: clamp(3rem, 16vw, 4.5rem); font-weight: 700; line-height: 0.92; letter-spacing: -0.04em; }
h1 span { color: var(--red); }
.lede { font-size: 1.2rem; line-height: 1.35; }
.tip { font-size: 0.85rem; color: var(--muted); }
.toc summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.toc ol { padding-left: 1.4rem; }
.toc li { padding-block: 0.35rem; }
.toc a { display: inline-block; padding-block: 0.3rem; }

.work { display: flex; flex-direction: column; gap: 1rem; padding-block: 1.5rem; border-top: 2px solid var(--ink); }
.stage { position: relative; }
.work figure { background: var(--tint); }
.work img { display: block; width: 100%; height: min(52svh, 30rem); -webkit-user-drag: none; user-select: none; }
.fit-contain img { object-fit: contain; }
.fit-cover img { object-fit: cover; }
.haiku { font-size: clamp(1.6rem, 7.4vw, 2.2rem); font-weight: 700; line-height: 1.22; letter-spacing: -0.02em; padding-bottom: 1rem; }
.start { display: inline-flex; align-items: center; min-height: 44px; padding: 0.6rem 1.2rem; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; }
.controls, .again-row, .show > .visually-hidden { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Slideshow (with script): the lines fill the stage first, then the picture takes their place. */
.js html, html.js { scroll-snap-type: none; }
.js .show { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); }
.js .work { border-top: 0; padding-block: 0.5rem 0; gap: 0.75rem; }
.js .work[hidden] { display: none; }
.js .stage { height: min(56svh, 32rem); background: var(--tint); overflow: hidden; touch-action: pan-y; }
.js .stage .haiku { position: absolute; inset: 0; display: flex; align-items: center; padding: 1.5rem; background: var(--paper); border: 2px solid var(--ink); }
.js .stage figure { position: absolute; inset: 0; }
.js .stage img { height: 100%; }
.js .work.is-lines figure { opacity: 0; }
.js .work.is-picture .haiku { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .stage .haiku, .js .stage figure { transition: opacity 0.8s ease; }
}
.js .controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; margin-top: 0.9rem; }
.js .controls button, .js .again { font: 700 1rem var(--font); min-height: 44px; min-width: 44px; padding: 0.6rem 1.1rem; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; cursor: pointer; }
.js .controls button:disabled { opacity: 0.35; cursor: default; }
.js .counter { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.js .again-row { display: block; text-align: center; margin-top: 0.5rem; }
.js .again { border: 0; text-decoration: underline; text-underline-offset: 0.2em; font-weight: 400; font-size: 0.9rem; }
.label { border-top: 1px solid var(--hair); padding-top: 0.5rem; }
.no { font-size: 0.8rem; font-weight: 700; color: var(--red); }
.label h2 { font-size: 1rem; line-height: 1.35; font-weight: 400; margin-top: 0.2rem; }
.label h2 span { display: block; }
.label .artist { font-weight: 700; }
.label .title { font-style: italic; }
.note { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }
.end { padding-block: 3rem calc(3rem + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); font-size: 0.85rem; color: var(--muted); display: grid; gap: 1rem; }
.end a { color: var(--ink); display: inline-block; padding-block: 0.6rem; }
/* Keep a whole slide within one iPhone screen. */
.js .stage { height: min(46svh, 28rem); }
.js .stage .haiku { font-size: clamp(1.4rem, 6.4vw, 2rem); }
.js .label { padding-top: 0.35rem; }
.js .label h2 { font-size: 0.95rem; }
.js .label h2 span { display: inline; }
.js .label h2 .title::before, .js .label h2 .year::before { content: " · "; font-style: normal; }
.js .note { font-size: 0.75rem; }
.js .controls { margin-top: 0.6rem; }
.js .again-row { margin-top: 0.25rem; }

/* No frames: no boxes, rules or grey grounds around the lines and pictures.
   Buttons are solid instead of outlined, so they still read as buttons. */
.kick, .work, .js .show, .label, .end { border-top: 0; }
.work figure, .js .stage { background: none; }
.js .stage .haiku { border: 0; padding: 0.5rem 0; }
.js .controls button { background: var(--ink); color: var(--paper); border: 0; }
.js .controls button:disabled { background: var(--ink); color: var(--paper); opacity: 0.3; }
.start { border: 0; }

/* While switching works there is no fade: the new picture stays invisible until its lines have been shown. */
.js .cut .stage .haiku, .js .cut .stage figure { transition: none !important; }

/* Watertight: the picture is invisible unless the reveal has explicitly happened. */
.js .stage figure { opacity: 0; visibility: hidden; }
.js .work.is-picture .stage figure { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: no-preference) {
  .js .stage figure { transition: opacity 0.8s ease, visibility 0s; }
  .js .work.is-lines .stage figure, .js .cut .stage figure { transition: none; }
}
