:root {
  --ink: #111111;
  --paper: #ffffff;
  --bg: #dddddd;
  --gray: #6b6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- persistent site chrome ---------- */
.chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 3vw, 40px) clamp(20px, 3.5vw, 48px) 0;
  z-index: 200;
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }

.logo {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: clamp(12px, 1.3vw, 16px);
  padding: 0.6em 1em;
  cursor: pointer;
}

.hamburger {
  background: var(--ink);
  border: none;
  width: clamp(40px, 4vw, 52px);
  height: clamp(28px, 2.8vw, 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 55%;
  height: 2px;
  background: var(--paper);
}

/* ---------- stage / flipbook ---------- */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(70px, 10vh, 120px) clamp(16px, 3vw, 60px) clamp(64px, 9vh, 100px);
}

.flipbook {
  width: min(92vw, 1900px);
  aspect-ratio: 3.0909;
  max-height: 100%;
  margin: 0 auto;
  transition: transform 500ms cubic-bezier(0.65, 0, 0.35, 1);
}

.flipbook .page {
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
}

.flipbook .page img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* ---------- about / conclusion text pages ---------- */
.page-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 62%;
  padding: 0 clamp(24px, 6vw, 90px);
}

.about-inner h1,
.conclusion-inner h1 {
  font-size: clamp(20px, 2.6vw, 34px);
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(12px, 1.2vw, 16px);
  line-height: 1.55;
  margin: 0 0 1em;
}

.page-inner p {
  font-size: clamp(10.5px, 0.95vw, 13px);
  line-height: 1.65;
  color: #222;
  margin: 0 0 1em;
}

.edit-note {
  color: var(--gray);
  font-style: italic;
  font-size: 10px;
  margin-top: 1.4em;
}

.conclusion-inner {
  text-align: center;
  max-width: 100%;
  align-items: center;
}

.contact { margin: 1em 0; }
.contact a {
  border-bottom: 1px solid var(--ink);
  font-size: clamp(13px, 1.3vw, 17px);
}

/* ---------- table of contents ---------- */
.toc {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 88vw);
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  z-index: 300;
  transform: translateY(-100%);
  transition: transform 550ms cubic-bezier(0.65, 0, 0.35, 1);
  padding: clamp(90px, 12vh, 140px) clamp(28px, 4vw, 56px) 40px;
}
.toc.open { transform: translateY(0); }

.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { border-top: 1px solid rgba(255,255,255,0.25); }
.toc li:last-child { border-bottom: 1px solid rgba(255,255,255,0.25); }

.toc a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 18px 4px;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: opacity 200ms ease, padding-left 200ms ease;
}
.toc a:hover { opacity: 0.6; padding-left: 12px; }

.toc-num {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
}

.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  z-index: 250;
}
.toc-overlay.open { opacity: 1; pointer-events: auto; }

/* ---------- bottom page-turn controls ---------- */
.page-nav {
  position: fixed;
  bottom: clamp(14px, 2.5vh, 28px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 150;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  padding: 8px 18px;
  border: 1px solid rgba(0,0,0,0.12);
}

.page-nav button {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
}
.page-nav button:hover { opacity: 0.55; }
.page-nav button:disabled { opacity: 0.25; cursor: default; }

.page-indicator {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gray);
  min-width: 60px;
  text-align: center;
}

@media (max-width: 720px) {
  .page-inner { max-width: 100%; padding: 0 20px; }
  .lede, .page-inner p { font-size: 11px; }
}
