:root {
  --ink: #20231f;
  --muted: #666d63;
  --line: #d8ded2;
  --paper: #fffdf6;
  --soft: #eef5f7;
  --green: #566d58;
  --green-dark: #334536;
  --blue: #496c86;
  --clay: #a66d58;
  --gold: #d3ad62;
  --sun: #f6c02d;
  --sky: #456bd4;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

body.is-locked {
  overflow: hidden;
}

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

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(250, 248, 241, 0.9);
  border-bottom: 1px solid rgba(216, 222, 210, 0.78);
  backdrop-filter: blur(16px);
}

.entry-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(246, 192, 45, 0.2), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(69, 107, 212, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(69, 107, 212, 0.1), rgba(246, 192, 45, 0.14)),
    var(--paper);
}

.entry-gate[hidden] {
  display: none;
}

.gate-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 34px 28px 26px;
  border: 2px solid rgba(32, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 70px rgba(32, 35, 31, 0.14);
}

.gate-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(86, 109, 88, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.gate-doodle {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 14px;
  border: 3px solid var(--sun);
  border-radius: 50%;
  background: #fff8d9;
  color: var(--green-dark);
  font-weight: 900;
  transform: rotate(-6deg);
  box-shadow: 7px 7px 0 rgba(69, 107, 212, 0.16);
}

.gate-panel h2 {
  margin: 8px 0 10px;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(28px, 7vw, 34px);
  line-height: 1.25;
}

.gate-intro {
  margin: 0 0 20px;
  color: var(--muted);
}

.gate-form {
  display: grid;
  gap: 12px;
}

.gate-form label {
  color: var(--muted);
  font-weight: 700;
}

.gate-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.gate-form input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(69, 107, 212, 0.16);
}

.gate-error {
  min-height: 24px;
  margin: 0;
  color: #9d342e;
  font-weight: 700;
}

.gate-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: var(--paper);
  font-size: 13px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.site-nav a:hover {
  color: var(--green-dark);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  overflow: hidden;
  padding: 120px clamp(20px, 6vw, 88px) 68px;
  background:
    linear-gradient(180deg, rgba(69, 107, 212, 0.08), rgba(246, 192, 45, 0.09)),
    var(--paper);
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: #e9eef0;
  border-top: 1px solid rgba(32, 35, 31, 0.08);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  color: var(--ink);
}

.eyebrow,
.section-kicker,
.note-date {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.section h2 {
  margin: 10px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(42px, 7vw, 88px);
}

.hero-copy {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(32, 35, 31, 0.18);
  border-radius: 8px;
  font-weight: 700;
}

.button.primary {
  background: var(--green-dark);
  color: var(--white);
}

.button.quiet {
  background: rgba(255, 255, 255, 0.58);
  color: var(--green-dark);
}

.hero-art {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: center;
  width: min(100%, 520px);
  margin: 0;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(32, 35, 31, 0.12);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(32, 35, 31, 0.16);
}

.section {
  padding: 76px clamp(20px, 6vw, 88px);
  scroll-margin-top: 96px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.section h2 {
  max-width: 760px;
  font-size: clamp(30px, 4vw, 52px);
}

.intro > p,
.about-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-note {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
}

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

.note-card {
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.note-card h3,
.timeline h3 {
  margin: 12px 0 8px;
  line-height: 1.3;
  font-size: 21px;
}

.note-card p:last-child,
.timeline p,
.anniversary-card p:last-child,
.archive-list p,
.family-card p {
  margin: 0;
  color: var(--muted);
}

.album-band {
  background: #f7f1e8;
  border-block: 1px solid var(--line);
}

.album-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
}

.album-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 20px;
}

.album-filter {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid rgba(32, 35, 31, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--green-dark);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.album-filter.is-active {
  background: var(--green-dark);
  color: var(--paper);
}

.feature-photo {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 10px solid var(--white);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 48px rgba(32, 35, 31, 0.12);
}

.feature-photo img {
  display: block;
  width: 100%;
  height: 440px;
  object-fit: cover;
}

.feature-photo figcaption,
.photo-tile figcaption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  max-width: calc(100% - 28px);
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.feature-copy {
  display: grid;
  align-content: center;
  min-height: 320px;
  padding: 28px;
  border: 1px solid rgba(32, 35, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.feature-copy h3 {
  margin: 10px 0 12px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
}

.feature-copy p:last-child {
  margin: 0;
  color: var(--muted);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  gap: 14px;
}

.photo-tile {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
  border: 8px solid var(--white);
  box-shadow: 0 14px 34px rgba(32, 35, 31, 0.1);
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile.tall {
  grid-row: span 2;
}

.photo-tile.wide {
  grid-column: span 2;
}

.photo-tile.is-hidden {
  display: none;
}

.anniversary-section {
  background: var(--paper);
}

.anniversary-grid,
.family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.anniversary-card,
.family-card {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.anniversary-card.highlight {
  background:
    linear-gradient(145deg, rgba(246, 192, 45, 0.18), rgba(255, 255, 255, 0.76)),
    var(--white);
  border-color: rgba(211, 173, 98, 0.48);
}

.countdown-text {
  display: inline-flex;
  width: fit-content;
  margin: 2px 0 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(69, 107, 212, 0.1);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.anniversary-card.is-lunar .countdown-text {
  background: rgba(246, 192, 45, 0.18);
  color: #735a22;
}

.anniversary-card h3,
.archive-list h3,
.family-card h3 {
  margin: 12px 0 8px;
  line-height: 1.25;
  font-size: 22px;
}

.diary-section {
  background: var(--soft);
  border-block: 1px solid var(--line);
}

.archive-list {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.archive-list article {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
  border: 1px solid rgba(32, 35, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.archive-list time {
  color: var(--green);
  font-weight: 800;
}

.archive-list h3 {
  margin-top: 0;
}

.diary-template {
  max-width: 980px;
  margin-top: 18px;
  padding: 24px;
  border: 1px solid rgba(32, 35, 31, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(246, 192, 45, 0.16), rgba(255, 255, 255, 0.66)),
    var(--white);
}

.diary-template h3 {
  margin: 10px 0 16px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

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

.template-grid p {
  min-height: 118px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(32, 35, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.template-grid strong,
.template-grid span {
  display: block;
}

.template-grid strong {
  margin-bottom: 8px;
  color: var(--green-dark);
}

.template-grid span {
  color: var(--muted);
}

.family-section {
  background: #fbf6ec;
}

.family-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.member-photo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0 0 8px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(246, 192, 45, 0.14), rgba(69, 107, 212, 0.08)),
    var(--paper);
  border: 1px solid rgba(32, 35, 31, 0.08);
}

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

.member-photo.is-wide {
  aspect-ratio: 4 / 3;
}

.family-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--paper);
  font-weight: 900;
  box-shadow: 7px 7px 0 rgba(69, 107, 212, 0.13);
}

.timeline-section {
  background: var(--paper);
}

.timeline {
  display: grid;
  gap: 0;
  max-width: 920px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.timeline li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.timeline time {
  color: var(--green);
  font-weight: 800;
}

.about {
  background: var(--green-dark);
  color: var(--paper);
}

.about .section-kicker {
  color: #e7c879;
}

.about-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 24px;
}

.about-panel p {
  color: rgba(250, 248, 241, 0.82);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(20px, 6vw, 88px);
  border-top: 1px solid rgba(216, 222, 210, 0.65);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 88vh;
    padding-top: 150px;
  }

  .hero-art {
    width: min(100%, 430px);
    justify-self: start;
  }

  .intro,
  .note-grid,
  .anniversary-grid,
  .family-grid,
  .template-grid,
  .about-panel {
    grid-template-columns: 1fr;
  }

  .album-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 160px;
  }

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

  .feature-photo img {
    height: 340px;
  }
}

@media (max-width: 560px) {
  .site-nav {
    gap: 18px;
    justify-content: flex-start;
  }

  .hero {
    min-height: 86vh;
    padding-bottom: 42px;
  }

  .hero-art {
    width: min(100%, 360px);
  }

  .hero-actions,
  .site-footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section {
    padding-block: 58px;
    scroll-margin-top: 122px;
  }

  .section-heading {
    display: block;
  }

  .album-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .photo-tile,
  .photo-tile.tall,
  .photo-tile.wide {
    grid-column: auto;
    grid-row: auto;
  }

  .photo-tile img {
    height: auto;
  }

  .archive-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
