@font-face { font-family: 'Be Vietnam Pro'; src: url('assets/fonts/BeVietnamPro-Regular.ttf?v=24'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('assets/fonts/BeVietnamPro-Medium.ttf?v=24'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('assets/fonts/BeVietnamPro-SemiBold.ttf?v=24'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('assets/fonts/BeVietnamPro-Bold.ttf?v=24'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('assets/fonts/BeVietnamPro-ExtraBold.ttf?v=24'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('assets/fonts/PlayfairDisplay-VariableFont_wght.ttf?v=24'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('assets/fonts/PlayfairDisplay-Italic-VariableFont_wght.ttf?v=24'); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --ink: #16231c;
  --ink-2: #22352a;
  --ink-3: #2c4436;
  --paper: #ffffff;
  --sage: #eef3ec;
  --sun-2: #fff4c4;
  --orange: #ff7949;
  --orange-ink: #c2410c;
  --muted: #4a5a50;
  --on-dark: #f4f1e8;
  --on-dark-2: #c9d3c8;
  --give: #fff1dc;
  --sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; max-width: 100%; overflow: hidden; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--on-dark);
  height: 100dvh;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 72px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'lnum' 1;
  transition: background-color .4s linear, color .4s linear;
}
body.light { background: var(--sage); color: var(--ink); }
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
strong { font-weight: 700; }
button, a { -webkit-tap-highlight-color: transparent; }

header, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--ink-2);
  transition: background-color .4s linear, color .4s linear;
}
body.light header, body.light footer { background: var(--sage); color: var(--ink); }

.brand {
  font-weight: 800;
  font-size: 22px;
  text-decoration: none;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.brand span { font-weight: 500; font-size: 14px; color: var(--on-dark-2); letter-spacing: 0; }
body.light .brand span { color: var(--muted); }
.top-actions { display: flex; gap: 8px; }
.chip-btn {
  font: 500 14px/1 var(--sans);
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  padding: 8px 16px;
  cursor: pointer;
}
.chip-btn { border-radius: 4px; }

.slide-info { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.slide-info b { font-weight: 700; }
.slide-info span { color: var(--on-dark-2); }
body.light .slide-info span { color: var(--muted); }
.dots { display: flex; gap: 8px; align-items: center; }
.dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #ffffff40;
  transition: width .3s var(--ease), background-color .3s linear;
}
.dots button.active { width: 28px; background: var(--orange); }
body.light .dots button { background: #16231c30; }
body.light .dots button.active { background: var(--ink); }
.arrows { display: flex; gap: 8px; }
.arrows button {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 20px;
  transition: background-color .3s var(--ease), color .3s var(--ease), opacity .3s linear;
}
.arrows button:disabled { opacity: .3; cursor: default; }
.arrows button:not(:disabled):hover { background: var(--orange); color: var(--ink); }

main { position: relative; min-height: 0; overflow: hidden; }
.pane {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #68806c transparent;
  background: var(--ink);
  color: var(--on-dark);
  opacity: 1;
  transition: opacity .4s linear;
}
.pane[data-tone='light'] { background: var(--sage); color: var(--ink); }

.display { font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.lead { font-size: 20px; line-height: 1.6; }
.body { font-size: 17px; line-height: 1.65; }
.cap { font-size: 14px; line-height: 1.5; color: var(--muted); }
.num { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; line-height: .9; font-variant-numeric: lining-nums; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 700 17px/1 var(--sans);
  text-decoration: none;
  border-radius: 4px;
  padding: 0 24px;
  height: 56px;
  border: 0;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; display: block; }
.btn-primary, .btn-primary:visited { background: var(--ink); color: #fff; }
.btn-primary:hover, .btn-primary.is-hover { background: var(--orange-ink); color: #fff; transform: translateY(-2px); }
.btn-warm, .btn-warm:visited { background: var(--orange-ink); color: #fff; }
.btn-warm:hover, .btn-warm.is-hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.btn:focus-visible, .btn.is-focus { outline: 3px solid var(--orange); outline-offset: 4px; }
.where { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 12px; }
.where svg { width: 16px; height: 16px; display: block; flex: none; }

.img-slide {
  max-width: 1360px;
  margin: auto;
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 64px;
  padding: 40px;
  align-items: center;
}
.img-slide .copy { max-width: 560px; min-width: 0; }
.img-slide h1 { font-size: clamp(36px, 3.9vw, 58px); color: var(--on-dark); }
.s3 h1 { font-size: clamp(34px, 3.4vw, 48px); }
.s3 .copy { max-width: 620px; }
.img-slide h1 em { font-style: normal; color: var(--orange); }
.img-slide .lead { color: var(--on-dark); margin-top: 32px; max-width: 520px; }
.img-slide .body { color: var(--on-dark-2); margin-top: 16px; max-width: 540px; }
.img-slide .body strong { color: var(--on-dark); font-weight: 600; }
.sign-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  max-width: 520px;
  border-top: 2px solid #ffffff1f;
}
.sign-row .who { font-family: var(--serif); font-style: italic; font-size: 28px; color: var(--on-dark); }
.sign-row .cap { color: var(--on-dark-2); }
.pull {
  margin-top: 32px;
  max-width: 520px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.45;
  color: var(--on-dark);
  padding-left: 20px;
  border-left: 4px solid var(--orange);
}
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.facts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--on-dark);
  background: var(--ink-3);
  border-radius: 4px;
  padding: 8px 12px;
}
.facts svg { width: 18px; height: 18px; color: var(--orange); display: block; flex: none; }
.note { color: var(--on-dark-2); margin-top: 24px; max-width: 520px; }
.s6fig .lead,
.s6fig .body {
  margin: 20px 0 0;
  max-width: 480px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--on-dark);
}
.s6fig .num {
  font-size: clamp(36px, 3.2vw, 52px);
  color: var(--orange);
  line-height: 1.05;
  letter-spacing: -.03em;
}
.s6fig .lead .num,
.s6fig .body .num { display: block; margin: 4px 0 6px; }
.s6fig .stats {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 16px;
  max-width: 520px;
}
.s6fig .stats li {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  margin: 0;
}
.s6fig .stats .num { white-space: nowrap; }
.s6fig .stats .lbl {
  font-size: 16px;
  line-height: 1.4;
  color: var(--on-dark-2);
}
.mat {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--ink-2);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-origin: content-box;
  background-clip: content-box;
  border-radius: 6px;
  padding: 32px;
  height: calc(100dvh - 224px);
  max-height: 720px;
  min-width: 0;
  min-height: 0;
}
.zoom-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  color: inherit;
}
.zoom-hit img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
}

.s5 { min-height: 100%; max-width: 1440px; margin: auto; }
.s5 h1 { font-size: clamp(40px, 4.6vw, 66px); color: var(--ink); }
.s5b .letter h2 {
  font-size: clamp(26px, 2.9vw, 40px);
  line-height: 1.18;
  color: var(--ink);
}
.s5 .lead, .s5 .body { color: var(--ink); }
.s5b {
  background: var(--sage);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 56px;
  padding: 40px;
  align-items: center;
  min-height: 100%;
}
.s5b .letter { background: #fff; border-radius: 8px; padding: 44px 52px; min-width: 0; }
.pledge {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pledge li {
  margin: 0;
  white-space: nowrap;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--orange-ink);
  background: var(--sun-2);
  border-radius: 4px;
  padding: 10px 12px;
}
.only {
  margin: 16px 0 0;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.s5b .letter .body { margin-top: 16px; max-width: 620px; }
.s5b .sig { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; }
.s5b .sig .who { font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1; color: var(--ink); }
.s5b .stamps { display: flex; gap: 12px; }
.s5b .stamp { background: var(--sun-2); border-radius: 6px; padding: 12px 16px; min-width: 152px; }
.s5b .stamp .num { font-size: 44px; color: var(--orange-ink); }
.s5b .stamp p { font-size: 14px; line-height: 1.4; margin-top: 4px; color: var(--ink); }
.s5b .collage { position: relative; height: 540px; min-width: 0; }
.s5b .pol { position: absolute; background: #fff; padding: 12px; border-radius: 4px; width: 270px; }
.s5b .pol img { display: block; width: 100%; height: 190px; max-width: none; object-fit: cover; border-radius: 2px; }
.s5b .pol figcaption { font-size: 14px; line-height: 1.4; color: var(--ink); margin-top: 8px; }
.s5b .p1 { left: 0; top: 0; z-index: 1; transform: rotate(-3deg); }
.s5b .p2 { right: 0; top: 130px; z-index: 3; transform: rotate(2.5deg); }
.s5b .p3 { left: 80px; top: 300px; z-index: 2; transform: rotate(-1deg); }

.s8 { min-height: 100%; }
.s8 h1 { font-size: clamp(40px, 4.6vw, 66px); }
.s8 h2 { font-size: 32px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.h2i { display: flex; align-items: center; gap: 16px; }
.hi {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.hi svg { width: 24px; height: 24px; display: block; }
.s8b .take .hi { background: var(--ink); color: #fff; }
.s8b .give .hi { background: var(--orange-ink); color: #fff; }
.s8b {
  padding: 36px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100%;
}
.s8b .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.s8b .head h1 { color: var(--on-dark); }
.s8b .head p { font-size: 18px; line-height: 1.5; color: var(--on-dark-2); max-width: 380px; text-align: right; }
.s8b .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; flex: 1; min-height: 0; }
.s8b .card {
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 44% 1fr;
  background: var(--on-dark);
  color: var(--ink);
  min-height: 0;
}
.s8b .give { background: var(--give); }
.s8b .card .pic { position: relative; background: var(--ink-3); overflow: hidden; min-width: 0; min-height: 0; }
.s8b .card .pic img.cover { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.s8b .card .pic .fan {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 340px;
  transform: translate(-50%, -50%);
  animation: none;
}
.fan img {
  position: absolute;
  width: 170px;
  max-width: none;
  border-radius: 4px;
  background: #fff;
  border: 6px solid #fff;
}
.fan .f1 { left: 0; top: 30px; transform: rotate(-8deg); }
.fan .f2 { left: 46px; top: 0; transform: rotate(-1deg); z-index: 2; }
.fan .f3 { left: 90px; top: 34px; transform: rotate(7deg); }
.s8b .card .txt { padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.s8b .card h2 { margin-top: 12px; }
.s8b .card .body { margin-top: 12px; }
.s8b .card .btn { margin-top: 24px; align-self: flex-start; }
.s8b .take .side-tag { color: #2d6a43; }
.s8b .foot { color: var(--on-dark-2); font-size: 14px; line-height: 1.5; }

dialog {
  color: var(--on-dark);
  background: var(--ink-2);
  border: 2px solid var(--ink-3);
  border-radius: 8px;
  padding: 0;
  max-width: calc(100vw - 32px);
}
dialog::backdrop { background: #16231cb8; }
#menu { width: 640px; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}
.dialog-head h2 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.dialog-head button { font-size: 28px; width: 40px; height: 40px; }
.dialog-head > div { display: flex; align-items: center; gap: 16px; }
.dialog-head a { font-size: 16px; font-weight: 700; text-decoration: none; }
#menu-items { padding: 0 16px 16px; }
#menu-items button {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 16px;
  font-size: 18px;
  line-height: 1.4;
  border-radius: 4px;
}
#menu-items button.active { color: var(--orange); }
#menu-items button:hover { background: var(--ink-3); }
#viewer { width: min(1100px, calc(100vw - 32px)); height: min(94dvh, 900px); }
#viewer[open] { display: flex; flex-direction: column; }
#viewer .dialog-head { font-size: 16px; align-items: center; }
#viewer-name { flex: 1; min-width: 0; line-height: 1.35; }
#viewer .dialog-head > div { flex: none; }
#download { white-space: nowrap; }
.image-scroll { flex: 1; overflow: auto; background: var(--sage); padding: 20px; min-height: 0; }
.image-scroll img { width: 100%; height: auto; display: block; margin: auto; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise1 {
  from { opacity: 0; transform: translateY(16px) rotate(-3deg); }
  to { opacity: 1; transform: rotate(-3deg); }
}
@keyframes rise2 {
  from { opacity: 0; transform: translateY(16px) rotate(2.5deg); }
  to { opacity: 1; transform: rotate(2.5deg); }
}
@keyframes rise3 {
  from { opacity: 0; transform: translateY(16px) rotate(-1deg); }
  to { opacity: 1; transform: rotate(-1deg); }
}
@keyframes fan1 {
  from { opacity: 0; transform: translateY(16px) rotate(-8deg); }
  to { opacity: 1; transform: rotate(-8deg); }
}
@keyframes fan2 {
  from { opacity: 0; transform: translateY(16px) rotate(-1deg); }
  to { opacity: 1; transform: rotate(-1deg); }
}
@keyframes fan3 {
  from { opacity: 0; transform: translateY(16px) rotate(7deg); }
  to { opacity: 1; transform: rotate(7deg); }
}
.pane h1,
.pane .lead,
.pane .body,
.pane .mat,
.pane .stamp,
.pane .card,
.pane .facts span,
.pane .sign-row,
.pane .pull,
.pane .head p,
.pane .foot,
.pane .letter,
.pane .note,
.pane .pledge,
.pane .only,
.pane .stats {
  animation: rise .6s var(--ease) both;
}
.pane h1 { animation-delay: .05s; }
.pane .lead, .pane .head p { animation-delay: .12s; }
.pane .body { animation-delay: .18s; }
.pane .facts span, .pane .stamp { animation-delay: .24s; }
.pane .sign-row, .pane .pull, .pane .foot, .pane .note { animation-delay: .3s; }
.pane .mat, .pane .letter { animation-delay: .08s; }
.pane .card:nth-child(2) { animation-delay: .16s; }
.s5b .pol.p1 { animation: rise1 .6s var(--ease) both; }
.s5b .pol.p2 { animation: rise2 .6s var(--ease) .16s both; }
.s5b .pol.p3 { animation: rise3 .6s var(--ease) .24s both; }
.fan .f1 { animation: fan1 .6s var(--ease) both; }
.fan .f2 { animation: fan2 .6s var(--ease) .16s both; }
.fan .f3 { animation: fan3 .6s var(--ease) .24s both; }
header > *, footer > *, .dots button { animation: rise .5s var(--ease) both; }
footer > * { animation-delay: .15s; }

@media (max-width: 950px) and (min-width: 651px) {
  .img-slide { grid-template-columns: 1fr; gap: 40px; padding: 40px; }
  .img-slide .copy { max-width: 640px; }
  .img-slide h1, .s3 h1 { font-size: 44px; }
  .mat { height: auto; max-height: none; }
  .zoom-hit { height: auto; }
  .zoom-hit img { max-height: 640px; }
  .s5b { grid-template-columns: 1fr; gap: 40px; }
  .s5 h1, .s5b h1 { font-size: 44px; }
  .s5b .collage { height: 560px; max-width: 600px; margin: 0 auto; width: 100%; }
  .s8b .head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .s8b .head p { text-align: left; }
  .s8b .pair { grid-template-columns: 1fr; }
  .s8b .card { min-height: 360px; }
  .s8 h1, .s8b h1 { font-size: 44px; }
}

@media (max-width: 650px) {
  body { grid-template-rows: 64px minmax(0, 1fr) 64px; }
  header, footer { padding: 0 16px; }
  .brand span, .slide-info span, .chip-btn + .chip-btn { display: none; }
  .dots { gap: 4px; }
  .dots button { width: 8px; height: 8px; }
  .dots button.active { width: 16px; }
  .arrows button { width: 40px; height: 40px; }
  .lead { font-size: 18px; }
  .btn { width: 100%; justify-content: center; }
  .img-slide { grid-template-columns: 1fr; gap: 32px; padding: 32px 20px 40px; align-items: start; }
  .img-slide h1 { font-size: 34px; }
  .img-slide .lead { margin-top: 20px; }
  .mat { height: auto; max-height: none; padding: 16px; }
  .zoom-hit { height: auto; }
  .zoom-hit img { max-height: none; width: 100%; height: auto; }
  .pull { font-size: 20px; }
  .s5 h1, .s5b h1, .s8 h1, .s8b h1 { font-size: 28px; }
  .s3 h1 { font-size: 28px; }
  .s5b { grid-template-columns: 1fr; padding: 20px 16px 40px; gap: 40px; }
  .s5b .letter { padding: 28px 24px; }
  .s5b .sig { flex-direction: column; align-items: flex-start; }
  .s5b .stamps { width: 100%; flex-direction: column; }
  .s5b .stamp { flex: none; width: 100%; min-width: 0; }
  .s5b .stamp .num { font-size: 32px; line-height: 1; }
  .s5b .collage { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: none; }
  .s5b .pol {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: auto;
    transform: none;
    padding: 8px;
  }
  .s5b .pol img { height: 132px; }
  .s5b .p3 { grid-column: 1 / -1; }
  .s5b .p3 img { height: 180px; }
  .s5b .p1, .s5b .p2, .s5b .p3 { animation-name: rise; }
  .s8 h2 { font-size: 28px; }
  .hi { width: 40px; height: 40px; }
  .hi svg { width: 20px; height: 20px; }
  .s8b { padding: 24px 16px 32px; }
  .s8b .head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .s8b .head p { text-align: left; }
  .s8b .pair { grid-template-columns: 1fr; gap: 16px; }
  .s8b .take,
  .s8b .give { grid-template-columns: 1fr; grid-template-rows: 220px auto; min-height: 0; }
  .only { font-size: 16px; letter-spacing: .04em; }
  .s8b .card .txt { padding: 24px; }
  .s8b .card .btn { align-self: stretch; }
  .s8b .card .pic .fan { width: 240px; height: 240px; }
  .dialog-head { padding: 16px; }
  #menu-items { padding: 0 8px 16px; }
  #viewer { width: 100vw; max-width: 100vw; height: 100dvh; }
  .image-scroll { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
