:root {
  --mist: #eef3f4;
  --ink: #1e2540;
  --ink-soft: #6b7490;
  --sea: #2f7f8a;
  --tower: #f05a28;
  --lamp: #f2b85b;
  --night: #141b33;
  --night-soft: #232c4a;
  --album-ink: #f4f1ea;
  --slip: #f6f9fa;

  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --figure: "Bodoni Moda", "Didot", "Hiragino Mincho ProN", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;

  --sheet-w: min(100vw, 430px);
  --gutter: 26px;
  --rail: 22px;

  --fs-cover: calc(var(--sheet-w) * 0.34);
  --fs-year: calc(var(--sheet-w) * 0.4);
  --fs-h1: 27px;
  --fs-h2: 19px;
  --fs-place: 20px;
  --fs-time: 21px;
  --fs-body: 15px;
  --fs-note: 13.5px;
  --fs-small: 11.5px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--gothic);
  font-size: var(--fs-body);
  line-height: 1.8;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.mincho {
  font-family: var(--mincho);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

/* 日本語の折り返しを文節で切る。未対応のブラウザは既定の禁則のまま。 */
.cover__headline,
.stop__note,
.kit__note,
.frame__caption,
.letter__body p,
.map-section__lead {
  word-break: auto-phrase;
}

.figure {
  font-family: var(--figure);
  font-style: italic;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.01em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 一本の線。ページ全体に1枚だけ敷き、JS が d を組み立てる。 */
.thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
}

.thread path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}

/* 線の終端。塔の輪郭を両脚から立ち上げて頂点で閉じる。 */
.tower-line {
  fill: none;
  stroke: var(--tower);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .thread path,
  .tower-line {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* メディアの浮き上がり */
.rise {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 400ms ease-out,
    transform 400ms ease-out;
}

.rise.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 会話の紙片。しおりの「待ち合わせ」とアルバムの「前と後」で共通。吹き出しの形にはしない。 */
.slips {
  list-style: none;
  margin: 0;
  /* 左は「一本の線」が通る幅を空ける。紙片は不透明なので、重なると線が切れて見える。 */
  padding: 0 0 0 20px;
  display: grid;
  gap: var(--sp-2);
}

.slip {
  position: relative;
  width: 86%;
  padding: 10px 44px 10px 12px;
  border-radius: 6px;
  background: var(--slip);
  color: var(--ink);
}

.slip--her {
  margin-left: auto;
}

.slip__who {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--mincho);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.slip__text {
  margin: 0;
  font-family: var(--mincho);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  word-break: auto-phrase;
}

.slip__time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-soft);
}

/* その場で撮った1枚を入れる枠 */
.capture {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
}

.capture__open {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
}

.capture__shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture__hint {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--gothic);
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.capture__redo {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.capture__note {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  margin: 0;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--tower);
  background: rgba(238, 243, 244, 0.9);
}
