:root {
  color-scheme: light;
  --ink: #171717;
  --soft-ink: #56534d;
  --paper: #f1eee5;
  --paper-deep: #dfd9cb;
  --line: rgba(23, 23, 23, 0.2);
  --faint-line: rgba(23, 23, 23, 0.1);
  --accent: #a83925;
  --content: min(1240px, calc(100vw - 48px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 5%, rgba(255, 255, 255, 0.8), transparent 24rem),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.015) 0 1px, transparent 1px 4px),
    var(--paper);
  font-family: Inter, Arial, sans-serif;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(rgba(0, 0, 0, 0.18) 0.55px, transparent 0.7px);
  background-size: 5px 5px;
}

a {
  color: inherit;
}

.scroll-meter {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(23, 23, 23, 0.08);
}

.scroll-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.site-header,
.site-footer {
  display: flex;
  width: var(--content);
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  position: sticky;
  z-index: 90;
  top: 0;
  height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 238, 229, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  font-size: 10px;
}

.menu-button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: 700 11px/1 Inter, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.menu-button i,
.menu-button i::before {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--ink);
  transition: transform 220ms ease;
}

.menu-button i {
  position: relative;
}

.menu-button i::before {
  position: absolute;
  top: 6px;
  content: "";
}

.menu-button[aria-expanded="true"] i {
  transform: translateY(3px) rotate(45deg);
}

.menu-button[aria-expanded="true"] i::before {
  transform: translateY(-6px) rotate(90deg);
}

.index-panel {
  position: fixed;
  z-index: 80;
  top: 76px;
  right: max(24px, calc((100vw - 1240px) / 2));
  display: grid;
  min-width: 240px;
  border: 1px solid var(--line);
  background: rgba(241, 238, 229, 0.96);
  box-shadow: 0 16px 44px rgba(27, 22, 15, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: 180ms ease;
}

.index-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.index-panel a {
  padding: 15px 18px;
  border-bottom: 1px solid var(--faint-line);
  color: var(--soft-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.index-panel a:hover {
  color: var(--accent);
  background: #e8e2d5;
}

main,
.site-footer {
  width: var(--content);
  margin-inline: auto;
}

.grid-frame {
  position: relative;
  border: 1px solid var(--line);
}

.cross {
  position: absolute;
  z-index: 2;
  width: 17px;
  height: 17px;
}

.cross::before,
.cross::after {
  position: absolute;
  background: var(--ink);
  content: "";
}

.cross::before {
  top: 8px;
  left: 0;
  width: 17px;
  height: 1px;
}

.cross::after {
  top: 0;
  left: 8px;
  width: 1px;
  height: 17px;
}

.cross-tl { top: -9px; left: -9px; }
.cross-tr { top: -9px; right: -9px; }
.cross-bl { bottom: -9px; left: -9px; }
.cross-br { right: -9px; bottom: -9px; }

.hero {
  display: grid;
  min-height: calc(100vh - 116px);
  margin: 40px 0 132px;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 18px clamp(24px, 3vw, 40px);
  padding: 22px;
}

.hero-meta {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.hero-meta p,
.site-footer span {
  margin: 0;
  color: var(--soft-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy {
  align-self: center;
  max-width: 270px;
  padding: 36px 0 36px clamp(0px, 2vw, 24px);
}

.kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1,
h2,
blockquote {
  margin: 0;
  font-family: "Noto Serif SC", Georgia, serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(32px, 4.4vw, 62px);
  letter-spacing: -0.08em;
  line-height: 0.9;
}

h1 span {
  display: block;
  padding-left: 0.7em;
  color: var(--accent);
  font-family: Caveat, cursive;
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: -0.04em;
  transform: rotate(-4deg);
}

.hero-dek {
  max-width: 260px;
  margin: 28px 0 0;
  color: var(--soft-ink);
  font-family: "Noto Serif SC", serif;
  font-size: 12px;
  line-height: 1.85;
}

.flipbook-shell {
  align-self: center;
  min-width: 0;
  margin: 12px 0;
}

.flipbook {
  position: relative;
  display: grid;
  min-height: min(70vh, 720px);
  padding: 18px 18px 54px;
  place-items: center;
  outline: 0;
  perspective: 2000px;
}

.flipbook:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.flipbook-book {
  position: relative;
  display: flex;
  width: min(100%, 1040px);
  aspect-ratio: 10 / 8.25;
  filter: drop-shadow(10px 16px 11px rgba(34, 28, 18, 0.22));
  transform-style: preserve-3d;
}

.flipbook-half {
  position: relative;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
}

.flipbook-static,
.flipbook-turn,
.flipbook-face {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.flipbook-static,
.flipbook-face {
  overflow: hidden;
  border: 1px solid rgba(52, 42, 28, 0.22);
  background: #f3eddf;
}

.flipbook-left .flipbook-static,
.flipbook-left .flipbook-face {
  border-radius: 14px 2px 2px 14px;
}

.flipbook-right .flipbook-static,
.flipbook-right .flipbook-face {
  border-radius: 2px 14px 14px 2px;
}

.flipbook-static::after,
.flipbook-face::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.flipbook-left .flipbook-static::after,
.flipbook-left .flipbook-face::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04), transparent 22%, rgba(0, 0, 0, 0.1));
}

.flipbook-right .flipbook-static::after,
.flipbook-right .flipbook-face::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.13), transparent 22%, rgba(255, 255, 255, 0.08));
}

.flipbook-page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.28) sepia(0.18) contrast(0.92);
}

.flipbook-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(23, 23, 23, 0.42);
  background: #ece4d4;
  font-family: Caveat, cursive;
  font-size: 24px;
}

.flipbook-turn {
  z-index: 5;
  display: none;
  will-change: transform;
}

.flipbook-turn-forward {
  transform-origin: left center;
}

.flipbook-turn-backward {
  transform-origin: right center;
}

.flipbook-face {
  backface-visibility: hidden;
}

.flipbook-face-back {
  transform: rotateY(180deg) translateZ(0.1px);
}

.flipbook-turn.flipping {
  display: block;
}

.flipbook-turn-forward.flipping {
  animation: flip-forward 700ms cubic-bezier(0.44, 0, 0.56, 1) forwards;
}

.flipbook-turn-backward.flipping {
  animation: flip-backward 700ms cubic-bezier(0.44, 0, 0.56, 1) forwards;
}

.flipbook-shadow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 48%, rgba(32, 24, 14, 0.26));
  opacity: 0;
  pointer-events: none;
  animation: page-shadow 700ms cubic-bezier(0.44, 0, 0.56, 1);
}

.flipbook-button {
  position: absolute;
  z-index: 10;
  top: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(23, 23, 23, 0.2);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(241, 238, 229, 0.9);
  box-shadow: 0 4px 12px rgba(34, 28, 18, 0.14);
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.flipbook-button:hover {
  transform: translateY(-50%) scale(1.08);
}

.flipbook-button:disabled {
  opacity: 0;
  pointer-events: none;
}

.flipbook-prev { left: 0; }
.flipbook-next { right: 0; }

.flipbook-indicator,
.flipbook-help {
  color: var(--soft-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.flipbook-indicator {
  position: absolute;
  bottom: 16px;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.flipbook-help {
  margin: 0;
  opacity: 0.72;
}

@keyframes flip-forward {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-180deg); }
}

@keyframes flip-backward {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}

@keyframes page-shadow {
  0%, 100% { opacity: 0; }
  42%, 62% { opacity: 1; }
}

.scroll-cue {
  display: flex;
  grid-column: 1 / -1;
  gap: 14px;
  align-items: center;
  width: max-content;
  color: var(--soft-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.scroll-cue i {
  display: block;
  width: 76px;
  height: 1px;
  background: var(--ink);
}

.section-shell {
  margin-bottom: 150px;
}

.section-header,
.compact-header {
  display: grid;
  grid-template-columns: 64px 1fr minmax(240px, 0.4fr);
  gap: 24px;
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
}

.compact-header {
  grid-template-columns: 64px 1fr;
}

.section-number {
  margin: 0;
  color: var(--accent);
  font-family: Caveat, cursive;
  font-size: 28px;
}

h2 {
  font-size: clamp(32px, 4.5vw, 62px);
  letter-spacing: -0.08em;
  line-height: 1.15;
}

.section-note {
  margin: 2px 0 0;
  color: var(--soft-ink);
  font-family: "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.9;
}

.feature-strip {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  margin-top: 12px;
}

figure {
  margin: 0;
}

.feature-image {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  background: var(--paper-deep);
}

.feature-image img,
.tile img,
.terrain-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.38) sepia(0.2) contrast(0.9);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), filter 700ms ease;
}

.feature-image:hover img,
.tile:hover img,
.terrain-card:hover img {
  filter: grayscale(0.1) sepia(0.08) contrast(0.98);
  transform: scale(1.035);
}

figcaption {
  color: var(--soft-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feature-image figcaption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  color: #eee8dc;
  background: rgba(20, 18, 15, 0.72);
}

.feature-copy {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: end;
  padding: 34px;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--faint-line) 1px, transparent 1px) 0 0 / 100% 32px,
    rgba(255, 255, 255, 0.24);
}

.handwritten {
  margin: 0 0 30px;
  color: var(--accent);
  font-family: Caveat, cursive;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
  transform: rotate(-5deg);
}

.feature-copy p:last-child {
  margin: 0;
  color: var(--soft-ink);
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  line-height: 2;
}

.masonry {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 110px;
  gap: 16px;
}

.tile {
  position: relative;
  grid-column: span 4;
  grid-row: span 3;
  overflow: hidden;
  background: var(--paper-deep);
}

.tile.tall {
  grid-row: span 6;
}

.tile.wide {
  grid-column: span 8;
}

.tile figcaption,
.terrain-card figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 12px;
  color: #eee8dc;
  background: linear-gradient(transparent, rgba(17, 16, 14, 0.78));
}

.note-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  border: 1px solid var(--line);
  background: #e5ded0;
}

.note-card blockquote {
  color: var(--accent);
  font-family: Caveat, cursive;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.98;
  transform: rotate(-3deg);
}

.note-card figcaption {
  position: static;
  padding: 0;
  color: var(--soft-ink);
  background: none;
}

.comparison {
  position: relative;
  height: min(62vw, 620px);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #d1cabb;
}

.comparison-image,
.comparison-before img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-image {
  filter: sepia(0.12) contrast(0.95);
}

.comparison-before {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 52%;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.7);
}

.comparison-before img {
  width: var(--comparison-width, 100vw);
  max-width: none;
  filter: grayscale(1) contrast(0.78) brightness(1.18);
}

.comparison-handle {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 52%;
  width: 48px;
  cursor: ew-resize;
  transform: translateX(-50%);
}

.comparison-handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transform: translate(-50%, -50%);
}

.comparison-handle span::before,
.comparison-handle span::after {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  content: "";
}

.comparison-handle span::before {
  left: 9px;
  transform: translateY(-50%) rotate(-45deg);
}

.comparison-handle span::after {
  right: 9px;
  transform: translateY(-50%) rotate(135deg);
}

.comparison-label {
  position: absolute;
  z-index: 4;
  top: 16px;
  margin: 0;
  padding: 8px 10px;
  color: #eee8dc;
  background: rgba(20, 18, 15, 0.76);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.before-label { left: 16px; }
.after-label { right: 16px; }

.terrain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 310px;
  gap: 16px;
}

.terrain-card {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
}

.terrain-large {
  grid-row: span 2;
}

.terrain-wide {
  grid-column: span 2;
}

.terrain-card figcaption {
  display: flex;
  justify-content: space-between;
}

.closing {
  margin: 0 0 70px;
  padding: clamp(40px, 8vw, 100px);
  text-align: center;
}

.closing h2 {
  font-size: clamp(48px, 8vw, 104px);
}

.closing em {
  color: var(--accent);
  font-family: Caveat, cursive;
  font-weight: 500;
}

.closing p:not(.kicker) {
  margin: 28px auto;
  color: var(--soft-ink);
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
}

.closing a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.closing a span {
  font-size: 20px;
}

.site-footer {
  height: 74px;
  border-top: 1px solid var(--line);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 840px) {
  :root {
    --content: min(100% - 28px, 700px);
  }

  .site-header {
    height: 64px;
  }

  .index-panel {
    top: 64px;
    right: 14px;
  }

  .hero {
    min-height: auto;
    margin-top: 28px;
    margin-bottom: 96px;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 44px 4px 22px;
  }

  .hero-dek {
    margin-top: 28px;
  }

  .flipbook-shell {
    margin: 0;
  }

  .flipbook {
    min-height: 390px;
  }

  .section-shell {
    margin-bottom: 96px;
  }

  .section-header {
    grid-template-columns: 44px 1fr;
  }

  .section-note {
    grid-column: 2;
  }

  .compact-header {
    grid-template-columns: 44px 1fr;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .feature-image {
    min-height: 440px;
  }

  .feature-copy {
    min-height: 300px;
  }

  .masonry {
    grid-auto-rows: 84px;
    gap: 10px;
  }

  .tile,
  .tile.wide {
    grid-column: span 6;
  }

  .tile.tall {
    grid-column: span 6;
  }

  .terrain-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 230px;
    gap: 10px;
  }
}

@media (max-width: 540px) {
  .site-header {
    padding-left: 48px;
  }

  .brand-mark {
    display: none;
  }

  h1 {
    font-size: 54px;
  }

  .hero {
    padding: 14px;
  }

  .hero-meta {
    display: grid;
    gap: 8px;
  }

  .flipbook {
    min-height: 270px;
    padding: 12px 0 42px;
  }

  .flipbook-button {
    top: auto;
    bottom: 0;
    width: 34px;
    height: 34px;
    transform: none;
  }

  .flipbook-button:hover {
    transform: scale(1.06);
  }

  .flipbook-prev { left: calc(50% - 52px); }
  .flipbook-next { right: calc(50% - 52px); }

  .flipbook-indicator {
    bottom: 11px;
    display: none;
  }

  .section-header,
  .compact-header {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .section-note {
    grid-column: 1;
  }

  .feature-image {
    min-height: 360px;
  }

  .masonry {
    display: block;
  }

  .tile {
    min-height: 340px;
    margin-bottom: 10px;
  }

  .note-card {
    min-height: 230px;
  }

  .comparison {
    height: 360px;
  }

  .terrain-grid {
    display: block;
  }

  .terrain-card {
    height: 280px;
    margin-bottom: 10px;
  }

  .closing {
    padding: 54px 18px;
  }

  body .home-link {
    top: auto;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
