:root {
  --bg-0: #f5eee4;
  --bg-1: #ece0d0;
  --paper: #fbf5ec;
  --paper-2: #f5ecdf;
  --ink: #251f19;
  --ink-soft: rgba(37, 31, 25, 0.75);
  --line: rgba(72, 55, 44, 0.18);
  --accent: #7d4d2f;
  --accent-strong: #5f3824;
  --hero-ink: #fff3e6;
  --hero-ink-soft: rgba(255, 243, 230, 0.84);
  --panel: rgba(251, 245, 236, 0.72);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-xl: 0 28px 70px rgba(22, 16, 12, 0.16);
  --shadow-lg: 0 20px 44px rgba(28, 21, 16, 0.12);
  --content-w: min(1160px, calc(100% - 36px));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(173, 137, 107, 0.18), transparent 26%),
    radial-gradient(circle at 100% 12%, rgba(206, 185, 162, 0.18), transparent 22%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  font-family: "Noto Serif SC", serif;
  line-height: 1.78;
}

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

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

p {
  line-height: 2.02;
}

.page-shell {
  min-height: 100svh;
}

.container {
  width: var(--content-w);
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: var(--content-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px;
  border: 1px solid rgba(255, 248, 240, 0.28);
  border-radius: 999px;
  background: rgba(30, 21, 16, 0.26);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
}

.brand img {
  width: 143px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(255, 247, 235, 0.86);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fffaf0;
  background: rgba(255, 248, 240, 0.14);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 247, 235, 0.24);
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.08);
  color: #fff8ef;
  font-size: 18px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.title-display,
.section-title,
.book-title {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 20px;
  border: 1px solid transparent;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
  font-size: 14px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: #f9efe0;
  color: #2f241c;
}

.btn-ghost {
  border-color: rgba(255, 247, 236, 0.38);
  background: rgba(255, 247, 236, 0.08);
  color: #fff6ea;
}

.btn-soft {
  border-color: var(--line);
  background: var(--paper);
  color: var(--accent-strong);
}

.section-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
}

/* Home */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.55fr);
  gap: 34px;
  align-items: end;
  padding: 112px min(52px, 4vw) 46px;
  overflow: hidden;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  background:
    linear-gradient(90deg, rgba(23, 16, 12, 0.68), rgba(23, 16, 12, 0.24)),
    url("../images/back.jpg") center/cover no-repeat;
}

.hero-overlay {
  background:
    radial-gradient(circle at 80% 30%, rgba(236, 208, 178, 0.25), transparent 20%),
    linear-gradient(180deg, rgba(25, 17, 12, 0.24), rgba(25, 17, 12, 0.6));
}

.hero-main,
.hero-note {
  position: relative;
  z-index: 1;
}

.hero-main {
  color: var(--hero-ink);
  max-width: 730px;
  padding-bottom: 36px;
}

.hero-main .eyebrow {
  color: rgba(255, 243, 226, 0.78);
}

.title-display {
  font-size: clamp(3.4rem, 8vw, 6.7rem);
  max-width: 7ch;
}

.hero-main p {
  max-width: 38rem;
  color: var(--hero-ink-soft);
  margin-top: 22px;
  margin-bottom: 0;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-note {
  margin-left: auto;
  margin-bottom: 8px;
  max-width: 320px;
  border-radius: 28px;
  border: 1px solid rgba(255, 248, 237, 0.2);
  background: rgba(25, 17, 13, 0.3);
  color: rgba(255, 243, 227, 0.86);
  padding: 24px;
  box-shadow: var(--shadow-xl);
}

.hero-note .eyebrow {
  margin-bottom: 10px;
  color: rgba(255, 243, 227, 0.74);
}

.hero-note p {
  margin: 0;
}

.summary-rail {
  width: var(--content-w);
  margin: -44px auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.summary-rail article {
  padding: 24px;
}

.summary-rail h3 {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 1.7rem;
  color: var(--accent);
}

.summary-rail p {
  margin: 0;
  color: var(--ink-soft);
}

.home-sections {
  width: var(--content-w);
  margin: 0 auto;
  padding: 84px 0 82px;
  display: grid;
  gap: 24px;
}

.feature {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.feature-gallery {
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
}

.feature-book {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1fr);
  align-items: center;
}

.section-title {
  font-size: clamp(2.1rem, 4vw, 3.8rem);
}

.feature p {
  color: var(--ink-soft);
  margin: 14px 0 0;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--accent-strong);
  font-weight: 600;
}

.link-arrow::after {
  content: "→";
}

.photo-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-strip figure {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.photo-strip figure:nth-child(2) {
  transform: translateY(18px);
}

.photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover {
  width: min(380px, 100%);
  margin: 0 auto;
  min-height: 420px;
  border-radius: 14px 22px 22px 14px;
  border: 1px solid rgba(90, 58, 39, 0.2);
  background:
    linear-gradient(180deg, rgba(126, 82, 51, 0.12), transparent 36%),
    linear-gradient(135deg, #f6e7d2, #ebd5b8);
  box-shadow: var(--shadow-lg);
  padding: 30px;
}

.book-cover .eyebrow {
  color: rgba(96, 59, 37, 0.72);
  margin-bottom: 72px;
}

.book-cover h3 {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  color: var(--accent-strong);
}

.book-cover p {
  margin: 14px 0 0;
  color: rgba(55, 37, 25, 0.78);
}

.portrait-wrap {
  width: var(--content-w);
  margin: 0 auto;
  padding-bottom: 88px;
}

.portrait-head {
  margin-bottom: 18px;
}

.portrait-head .eyebrow {
  color: var(--accent);
}

.portrait-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.portrait-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
}

.portrait-card img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  border-radius: 16px;
}

.portrait-card h3 {
  margin: 6px 0 10px;
  font-size: 2rem;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
}

.portrait-card p {
  margin: 0;
  color: var(--ink-soft);
}

.site-footer {
  width: var(--content-w);
  margin: 0 auto;
  padding: 0 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
  color: rgba(37, 31, 25, 0.62);
}

/* Sub pages */
.subpage {
  padding-top: 82px;
}

.sub-hero {
  position: relative;
  margin: 0 auto;
  width: var(--content-w);
  min-height: 340px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 34px;
  color: var(--hero-ink);
  background-color: #241b15;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.sub-hero::after {
  content: "";
  position: absolute;
  inset: 0;
}

.sub-hero::after {
  background:
    linear-gradient(95deg, rgba(28, 20, 15, 0.72), rgba(28, 20, 15, 0.22)),
    linear-gradient(180deg, rgba(20, 14, 11, 0.12), rgba(20, 14, 11, 0.58));
}

.sub-hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.sub-hero-content .eyebrow {
  color: rgba(255, 243, 226, 0.76);
}

.sub-hero-content h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  line-height: 1.04;
}

.sub-hero-content p {
  margin: 14px 0 0;
  color: rgba(255, 243, 226, 0.86);
}

.sub-main {
  width: var(--content-w);
  margin: 22px auto 84px;
}

/* Gallery */
.gallery-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--paper);
  color: rgba(39, 32, 25, 0.78);
  cursor: pointer;
  font-family: inherit;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: rgba(95, 56, 36, 0.38);
  background: #f0e1ce;
  color: var(--accent-strong);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-item {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #d9c8b4;
  box-shadow: var(--shadow-lg);
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 320ms ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-meta {
  padding: 10px 12px;
  background: rgba(250, 245, 236, 0.96);
}

.gallery-meta h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}

.gallery-meta p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(19, 13, 10, 0.92);
  padding: 30px;
  display: none;
}

.lightbox.open {
  display: grid;
}

.lightbox-inner {
  margin: auto;
  max-width: min(1100px, 100%);
  width: 100%;
  display: grid;
  gap: 16px;
}

.lightbox-frame {
  width: 100%;
  min-height: 52vh;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(247, 237, 225, 0.08);
}

.lightbox-frame img {
  width: auto;
  max-width: 100%;
  max-height: 72vh;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: rgba(255, 244, 231, 0.92);
}

.lightbox-actions {
  display: flex;
  gap: 8px;
}

.lightbox-btn {
  border: 1px solid rgba(255, 244, 231, 0.32);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 244, 231, 0.08);
  color: rgba(255, 244, 231, 0.92);
  cursor: pointer;
}

/* Book */
.book-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.toc {
  padding: 18px;
  position: sticky;
  top: 88px;
}

.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.toc h2 {
  margin: 0;
  font-size: 1.5rem;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.toc-group {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(92, 64, 46, 0.25);
}

.toc-group-title {
  margin-bottom: 8px;
  font-size: 0.86rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.toc-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}

.toc-item strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
}

.toc-item span {
  font-size: 0.82rem;
}

.toc-item.active,
.toc-item:hover {
  border-color: rgba(95, 56, 36, 0.24);
  background: #f3e6d6;
  color: var(--accent-strong);
}

.book-main {
  padding: 20px;
  overflow: hidden;
}

.book-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.book-topbar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.book-actions {
  display: flex;
  gap: 8px;
}

.book-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
}

.book-stage {
  perspective: 1500px;
}

.book-page {
  min-height: 68vh;
  border-radius: 18px;
  border: 1px solid rgba(94, 68, 50, 0.24);
  background:
    linear-gradient(90deg, rgba(115, 83, 61, 0.08) 0, rgba(115, 83, 61, 0.02) 40px, transparent 100%),
    linear-gradient(180deg, #fbf5ec, #f2e7d8);
  padding: clamp(20px, 4vw, 46px);
  box-shadow: var(--shadow-lg);
  transform-origin: left center;
}

.book-page.is-flipping {
  animation: turn 460ms ease;
}

@keyframes turn {
  0% { transform: rotateY(0deg); opacity: 1; }
  45% { transform: rotateY(-11deg); opacity: 0.85; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.book-page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
  border-bottom: 1px dashed rgba(96, 68, 49, 0.28);
  padding-bottom: 14px;
}

.book-page-head p {
  margin: 0;
  color: var(--ink-soft);
}

.book-title {
  font-size: clamp(2.2rem, 4.5vw, 4rem);
}

.book-sub {
  margin: 8px 0 0;
  color: rgba(52, 39, 31, 0.76);
}

.book-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
}

.book-body p {
  margin: 0 0 12px;
  color: rgba(40, 31, 24, 0.86);
}

.book-figure {
  border-radius: 14px;
  overflow: hidden;
  background: #d9c7b2;
  align-self: start;
}

.book-figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.book-figure figcaption {
  margin: 0;
  padding: 8px 10px;
  background: rgba(251, 245, 236, 0.95);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* About */
.bio-grid {
  display: grid;
  gap: 20px;
}

.bio-card {
  padding: 20px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.bio-card img {
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.bio-card h2 {
  margin: 0;
  font-size: 2.2rem;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
}

.bio-card .meta {
  margin: 4px 0 14px;
  color: var(--accent);
}

.bio-card p {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.timeline {
  margin-top: 16px;
  border-left: 1px dashed rgba(95, 56, 36, 0.32);
  padding-left: 14px;
  display: grid;
  gap: 10px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.timeline-item p {
  margin: 0;
  color: var(--ink-soft);
}

.closing-note {
  margin-top: 16px;
  padding: 18px;
}

.closing-note p {
  margin: 0;
  color: var(--ink-soft);
}

/* reveal animation */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-reveal].show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1080px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 126px;
  }

  .hero-note {
    margin-left: 0;
    max-width: 430px;
  }

  .summary-rail {
    margin-top: 20px;
    grid-template-columns: 1fr;
  }

  .feature-gallery,
  .feature-book,
  .portrait-grid,
  .book-layout,
  .book-body,
  .bio-card {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 760px) {
  :root {
    --content-w: min(1160px, calc(100% - 22px));
  }

  .site-header {
    top: 8px;
    border-radius: 20px;
    align-items: stretch;
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
  }

  .brand {
    padding: 6px 8px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .site-nav {
    width: 100%;
    display: none;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 245, 232, 0.24);
  }

  .site-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav a {
    text-align: center;
  }

  .hero {
    padding: 124px 16px 28px;
  }

  .title-display {
    max-width: none;
    font-size: clamp(2.8rem, 13vw, 4.2rem);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .photo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-strip figure:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }

  .sub-hero {
    min-height: 270px;
    padding: 22px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-frame img {
    max-height: 56vh;
  }

  .book-page {
    min-height: auto;
  }

  .site-footer {
    flex-direction: column;
    gap: 4px;
  }
}
