:root {
  --paper: #f2ede3;
  --paper-deep: #e7dece;
  --ink: #25221e;
  --muted: #756e64;
  --line: rgba(58, 48, 39, .18);
  --brown: #5a4635;
  --brown-dark: #33271f;
  --gold: #a27b41;
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(55, 44, 34, .14);
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  --sans: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.8; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .16; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); z-index: 20; mix-blend-mode: multiply; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -100px; z-index: 999; background: var(--ink); color: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.topbar { height: 76px; padding: 0 clamp(1rem, 4vw, 4.5rem); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; background: rgba(242, 237, 227, .88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; }
.brand-mark, .footer-mark { width: 42px; height: 42px; border: 1px solid var(--brown); border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.35rem; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-family: var(--serif); letter-spacing: .08em; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: .18rem; }
nav { display: flex; align-items: center; gap: clamp(.8rem, 2.2vw, 2rem); }
nav a { text-decoration: none; font-size: .92rem; color: var(--muted); position: relative; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -.45rem; height: 1px; background: var(--gold); transition: right .25s; }
nav a:hover::after, nav a:focus-visible::after { right: 0; }
.menu-button { display: none; border: 1px solid var(--line); background: transparent; padding: .45rem .8rem; border-radius: 999px; }
.hero { min-height: calc(100vh - 76px); position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .7fr); align-items: center; gap: clamp(2rem, 7vw, 8rem); padding: clamp(4rem, 8vw, 8rem) clamp(1.2rem, 8vw, 9rem); background: radial-gradient(circle at 80% 20%, rgba(162,123,65,.16), transparent 33%), linear-gradient(125deg, #f5f1e9 0%, #e9e0d1 100%); }
.hero::after { content: "王笃新"; position: absolute; right: -1vw; bottom: -7vw; font-family: var(--serif); font-size: clamp(8rem, 21vw, 22rem); letter-spacing: .08em; color: rgba(69, 53, 40, .035); white-space: nowrap; pointer-events: none; }
.hero-grain { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 49.9%, rgba(76,55,39,.08) 50%, transparent 50.1%); opacity: .45; }
.hero-copy, .hero-photo { position: relative; z-index: 2; }
.eyebrow { margin: 0 0 .8rem; color: var(--gold); text-transform: uppercase; letter-spacing: .2em; font-size: .78rem; font-weight: 700; }
.hero h1 { font-family: var(--serif); font-size: clamp(4.5rem, 11vw, 9.5rem); letter-spacing: .1em; font-weight: 500; line-height: 1; margin: 0 0 1rem; }
.life-dates { color: var(--muted); letter-spacing: .16em; font-family: var(--serif); margin: 0 0 2rem; }
.mobile-break { display: none; }
.hero blockquote { margin: 0; max-width: 730px; padding-left: 1.5rem; border-left: 2px solid var(--gold); font-family: var(--serif); font-size: clamp(1.08rem, 1.7vw, 1.42rem); line-height: 2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.1rem; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .7rem 1.45rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--brown); color: var(--white); box-shadow: 0 10px 30px rgba(70,50,34,.18); }
.button.ghost { border-color: rgba(57,45,34,.32); background: rgba(255,255,255,.25); }
.button.dark { color: var(--white); border-color: rgba(255,255,255,.45); flex: 0 0 auto; }
.hero-photo { width: min(100%, 430px); justify-self: center; transform: rotate(1.2deg); }
.hero-photo::before { content: ""; position: absolute; inset: 17px -18px -18px 18px; border: 1px solid rgba(92,70,51,.38); z-index: -1; }
.hero-photo img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 25%; filter: saturate(.7) sepia(.08); box-shadow: var(--shadow); }
.hero-photo figcaption { text-align: center; color: var(--muted); font-family: var(--serif); letter-spacing: .2em; margin-top: 1.6rem; }
.scroll-cue { position: absolute; left: 50%; bottom: 1.3rem; transform: translateX(-50%); font-size: .7rem; letter-spacing: .35em; text-decoration: none; color: var(--muted); writing-mode: vertical-rl; z-index: 3; }
.section { padding: clamp(5rem, 10vw, 9rem) clamp(1.2rem, 8vw, 9rem); }
.section-heading { max-width: 860px; margin: 0 auto clamp(2.5rem, 5vw, 5rem); text-align: center; }
.section-heading h2, .family-copy h2, .source-card h2 { font-family: var(--serif); font-weight: 500; line-height: 1.45; font-size: clamp(2rem, 4vw, 3.7rem); margin: 0; }
.intro { background: var(--white); }
.intro-grid { max-width: 1180px; margin: auto; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .65fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.prose-card { font-family: var(--serif); font-size: 1.08rem; }
.prose-card p { margin: 0 0 1.4rem; text-indent: 2em; }
.facts { border-top: 1px solid var(--ink); }
.facts div { padding: 1rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 66px 1fr; gap: .8rem; }
.facts span { color: var(--muted); font-size: .85rem; }
.facts strong { font-weight: 500; }
.timeline-section { background: #ece4d6; }
.timeline { max-width: 920px; padding: 0; margin: auto; list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 135px; top: .5rem; bottom: .5rem; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 3.2rem; position: relative; padding: 0 0 2.7rem; }
.timeline li::before { content: ""; position: absolute; left: 130px; top: .45rem; width: 11px; height: 11px; border: 2px solid var(--gold); border-radius: 50%; background: #ece4d6; }
.timeline .time { color: var(--gold); text-align: right; font-size: .86rem; letter-spacing: .04em; }
.timeline h3 { margin: -.2rem 0 .45rem; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.timeline p { margin: 0; color: #5f584f; }
.voices-section { background: var(--brown-dark); color: var(--white); }
.voices-section .section-heading .eyebrow { color: #d5b27b; }
.media-grid { max-width: 1120px; margin: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.media-card { border: 1px solid rgba(255,255,255,.17); background: rgba(255,255,255,.06); padding: clamp(1.3rem, 3vw, 2.3rem); border-radius: 3px; }
.media-label { color: #d5b27b; letter-spacing: .14em; font-size: .78rem; }
.media-card h3 { font-family: var(--serif); font-size: 1.55rem; margin: .55rem 0 .5rem; }
.media-card p { color: rgba(255,255,255,.72); margin: 0 0 1.4rem; }
audio { width: 100%; }
video { width: 100%; background: #111; max-height: 620px; }
.gallery-section { background: var(--paper); }
.gallery { max-width: 1220px; margin: auto; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 260px; gap: 1rem; }
.photo { position: relative; padding: 0; border: 0; overflow: hidden; background: #ddd; cursor: zoom-in; }
.photo.wide { grid-column: span 2; }
.photo.tall { grid-row: span 2; }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72); transition: transform .6s, filter .6s; }
.photo:hover img, .photo:focus-visible img { transform: scale(1.04); filter: saturate(.95); }
.photo span { position: absolute; inset: auto 0 0; padding: 3rem 1rem 1rem; color: white; text-align: left; background: linear-gradient(transparent, rgba(22,18,15,.75)); font-size: .85rem; letter-spacing: .08em; }
.more-photos { max-width: 1220px; margin: 1.4rem auto 0; border-top: 1px solid var(--line); }
.more-photos summary { cursor: pointer; text-align: center; padding: 1.3rem; color: var(--muted); }
.mini-gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; }
.mini-gallery img { width: 100%; height: 220px; object-fit: cover; }
.words-section { background: var(--white); }
.quote-grid { max-width: 1120px; margin: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.quote-grid blockquote { margin: 0; background: var(--white); padding: clamp(1.5rem, 4vw, 3rem); min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; }
.quote-grid p { font-family: var(--serif); font-size: clamp(1.12rem, 2vw, 1.45rem); line-height: 1.8; margin: 0 0 1.5rem; }
.quote-grid cite { font-style: normal; font-size: .8rem; color: var(--muted); }
.family-section { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; background: #dfd3c1; }
.family-photo img { width: 100%; max-height: 720px; object-fit: cover; box-shadow: var(--shadow); }
.family-copy p:not(.eyebrow):not(.candle-count) { color: #5e554c; }
.candle-button { border: 0; background: var(--brown); color: white; border-radius: 999px; padding: .8rem 1.2rem; cursor: pointer; margin-top: 1rem; }
.candle-count { color: var(--gold); min-height: 1.8em; }
.guestbook-section { background: var(--paper); }
.guestbook-grid { max-width: 1080px; margin: auto; display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; }
.message-form { background: var(--white); padding: 1.5rem; border: 1px solid var(--line); }
.message-form label { display: block; margin-bottom: 1rem; color: var(--muted); font-size: .86rem; }
.message-form input, .message-form textarea { display: block; width: 100%; margin-top: .45rem; border: 1px solid var(--line); background: #faf7f0; padding: .8rem; color: var(--ink); border-radius: 2px; }
.message-form small { display: block; color: var(--muted); margin-top: 1rem; }
.messages { display: grid; gap: 1rem; align-content: start; }
.message { background: rgba(255,255,255,.6); border-left: 2px solid var(--gold); padding: 1.25rem 1.4rem; }
.message.featured { background: var(--brown-dark); color: var(--white); }
.message p { margin: 0; font-family: var(--serif); }
.message footer { margin-top: .8rem; color: var(--muted); font-size: .78rem; }
.message.featured footer { color: rgba(255,255,255,.62); }
.source-section { background: var(--brown); color: var(--white); }
.source-card { max-width: 1120px; margin: auto; display: flex; justify-content: space-between; gap: 3rem; align-items: center; }
.source-card h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.source-card p:not(.eyebrow) { color: rgba(255,255,255,.74); max-width: 780px; }
.footer { text-align: center; padding: 4rem 1rem; background: #241d18; color: rgba(255,255,255,.7); }
.footer-mark { margin: 0 auto 1rem; border-color: rgba(255,255,255,.38); color: white; }
.footer-note { font-size: .78rem; color: rgba(255,255,255,.42); }
.lightbox { width: min(94vw, 1100px); max-height: 92vh; padding: 0; border: 0; background: #181513; color: white; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.lightbox::backdrop { background: rgba(16,13,11,.88); backdrop-filter: blur(5px); }
.lightbox img { max-width: 100%; max-height: 82vh; margin: auto; object-fit: contain; }
.lightbox p { margin: 0; padding: 1rem; text-align: center; color: rgba(255,255,255,.72); }
.lightbox-close { position: absolute; right: .65rem; top: .45rem; z-index: 2; border: 0; width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.55); color: white; font-size: 1.8rem; cursor: pointer; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .75s ease, transform .75s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } .photo img, .button { transition: none; } }
@media (max-width: 900px) {
  .menu-button { display: block; }
  nav { display: none; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 1rem 1.2rem; background: rgba(242,237,227,.98); border-bottom: 1px solid var(--line); }
  nav.open { display: flex; }
  nav a { padding: .55rem; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-photo { width: min(80vw, 390px); }
  .hero h1 { text-align: center; }
  .hero .eyebrow, .life-dates { text-align: center; }
  .hero blockquote { font-size: 1.06rem; }
  .hero-actions { justify-content: center; }
  .scroll-cue { display: none; }
  .intro-grid, .family-section, .guestbook-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 230px; }
  .mini-gallery { grid-template-columns: repeat(3, 1fr); }
  .source-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .topbar { height: 66px; }
  nav { top: 66px; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .hero { padding: 3.5rem 1.1rem 4rem; }
  .hero h1 { font-size: 4.1rem; }
  .mobile-break { display: block; }
  .life-dates { line-height: 2; }
  .section { padding: 4.7rem 1.1rem; }
  .timeline::before { left: 8px; }
  .timeline li { grid-template-columns: 1fr; gap: .45rem; padding-left: 2rem; }
  .timeline li::before { left: 2px; }
  .timeline .time { text-align: left; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; gap: .55rem; }
  .photo.wide { grid-column: span 2; }
  .photo.tall { grid-row: span 2; }
  .mini-gallery { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .mini-gallery img { height: 180px; }
  .quote-grid { grid-template-columns: 1fr; }
  .quote-grid blockquote { min-height: 0; }
}
