:root {
  --blue: #3f93ee;
  --blue-deep: #1769c8;
  --yellow: #eff34d;
  --ink: #182233;
  --muted: #667085;
  --paper: #fffdf4;
  --warm: #f6efe0;
  --line: rgba(24, 34, 51, 0.14);
  --shadow: 0 24px 70px rgba(24, 34, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(63, 147, 238, 0.12), rgba(255, 253, 244, 0) 36rem),
    var(--paper);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

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

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.18;
  background-image:
    radial-gradient(rgba(24, 34, 51, 0.16) 0.8px, transparent 0.8px),
    radial-gradient(rgba(255, 255, 255, 0.5) 0.8px, transparent 0.8px);
  background-position:
    0 0,
    6px 6px;
  background-size: 12px 12px;
  mix-blend-mode: multiply;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(24, 34, 51, 0.08);
  background: rgba(255, 253, 244, 0.84);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: grid;
  gap: 1px;
  font-weight: 900;
}

.wordmark span {
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
}

.wordmark small,
.section-kicker,
.poster-card figcaption,
footer {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: 0.95rem;
  font-weight: 700;
}

main {
  position: relative;
  z-index: 2;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 560px);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(44px, 7vw, 86px) clamp(18px, 6vw, 80px) 48px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 18px;
  font-weight: 900;
  color: var(--blue-deep);
}

h1,
h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(3.3rem, 10vw, 9.4rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 1.02;
}

.lede {
  max-width: 640px;
  margin: 26px 0 0;
  color: #3d4b60;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.75;
}

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

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 999px;
  min-height: 46px;
  padding: 0 20px;
  text-align: center;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(24, 34, 51, 0.12);
}

.button.primary {
  border-color: var(--yellow);
  background: var(--yellow);
}

.button.ghost {
  background: rgba(255, 253, 244, 0.55);
}

.button.danger {
  border-color: rgba(198, 45, 45, 0.3);
  color: #b62929;
}

.poster-card {
  position: relative;
  z-index: 2;
  margin: 0;
  border: 1px solid rgba(24, 34, 51, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.poster-card img {
  aspect-ratio: 1200 / 1800;
  object-fit: cover;
}

.poster-card figcaption {
  padding: 12px 14px 14px;
}

.intro,
.islanders,
.letter-section,
.blessing-section,
.gallery,
.founders {
  padding: clamp(58px, 9vw, 110px) clamp(18px, 6vw, 80px);
  border-top: 1px solid var(--line);
}

.intro,
.gallery,
.founders {
  background: var(--paper);
}

.intro,
.founders {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.8fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: start;
}

.intro p,
.founders p,
.letter-columns p,
.blessing-copy p,
.gallery-heading p,
.admin-help,
.modal-card p {
  margin: 0;
  color: #3f4d60;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.9;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--blue-deep);
}

.islanders {
  position: relative;
  min-height: clamp(520px, 78vh, 760px);
  background: #f7f2e9;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.islanders-heading {
  position: relative;
  z-index: 3;
  max-width: 1080px;
  margin: 0 auto 34px;
}

.islanders-heading p {
  margin: 16px 0 0;
  color: #3f4d60;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.9;
}

.name-cloud {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 12px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.name-cloud span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #111827;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: var(--name-size, 1.7rem);
  line-height: 1.08;
  transition:
    color 1400ms ease,
    transform 1400ms ease;
}

.name-cloud span.highlight {
  color: var(--blue-deep);
  transform: scale(1.055);
}

.name-cloud span:nth-child(4n + 1) {
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.name-cloud small {
  color: rgba(24, 34, 51, 0.58);
  font-size: 0.38em;
  font-weight: 700;
}

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

.letter-section h2 {
  max-width: 980px;
}

.letter-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 5vw, 68px);
  max-width: 1080px;
  margin-top: 34px;
}

.blessing-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vw, 28px);
  background: var(--warm);
  text-align: center;
  padding: clamp(40px, 6vw, 70px) clamp(18px, 6vw, 80px);
}

.blessing-copy {
  max-width: 480px;
}

.blessing-copy h2 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.blessing-form,
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.form-row input {
  flex: 1;
  min-width: 0;
}

.form-row .button {
  min-height: 48px;
  padding: 0 24px;
  white-space: nowrap;
}

.blessing-form textarea,
.gate-form textarea {
  resize: none;
}

.blessing-form input,
.blessing-form textarea,
.gate-form input,
.gate-form textarea {
  border: 1px solid rgba(24, 34, 51, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  line-height: 1.5;
  outline: none;
  width: 100%;
}

.blessing-form input:focus,
.blessing-form textarea:focus,
.gate-form input:focus,
.gate-form textarea:focus {
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 3px rgba(63, 147, 238, 0.14);
}

.form-note {
  min-height: 24px;
  margin: 0;
  color: var(--blue-deep);
  font-weight: 800;
}

.gallery-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: clamp(8px, 1.4vw, 18px);
  align-items: stretch;
  animation: wall-drift 32s ease-in-out infinite alternate;
  will-change: transform;
}

.photo-tile {
  position: relative;
  grid-column: span 3;
  min-height: 180px;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #e9edf3;
  box-shadow: 0 12px 34px rgba(24, 34, 51, 0.09);
  transform: rotate(var(--tilt, 0deg));
  animation: photo-breathe 8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  cursor: zoom-in;
}

.photo-tile.large {
  grid-column: span 5;
  grid-row: span 2;
  min-height: 380px;
}

.photo-tile.wide {
  grid-column: span 6;
  min-height: 230px;
}

.photo-tile.tall {
  grid-column: span 3;
  grid-row: span 2;
  min-height: 390px;
}

.photo-tile.small {
  grid-column: span 2;
  min-height: 150px;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition:
    transform 520ms ease,
    filter 520ms ease;
}

.photo-tile:hover img {
  transform: scale(1.045);
  filter: saturate(1.05) contrast(1.04);
}

@keyframes photo-breathe {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes wall-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  35% {
    transform: translate3d(-10px, 8px, 0);
  }
  70% {
    transform: translate3d(9px, -6px, 0);
  }
  100% {
    transform: translate3d(-6px, -10px, 0);
  }
}

.marquee-wall {
  position: relative;
  z-index: 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 0 48px;
  margin-top: 8px;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll var(--duration, 40s) linear infinite;
  will-change: transform;
}

.marquee-track.reverse {
  animation-direction: reverse;
}

.marquee-item {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  margin-right: 28px;
  padding: 8px 16px;
  border: 1px solid rgba(24, 34, 51, 0.1);
  border-radius: 999px;
  color: rgba(24, 34, 51, 0.72);
  background: rgba(255, 253, 244, 0.78);
  box-shadow: 0 8px 24px rgba(24, 34, 51, 0.08);
  opacity: 0.82;
  font-size: 14px;
  max-width: min(480px, 78vw);
}

.marquee-item span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  word-break: break-word;
  min-width: 0;
}

.marquee-item strong {
  color: var(--blue-deep);
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(520px, 100vw);
  height: 100vh;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: rgba(255, 253, 244, 0.96);
  box-shadow: -24px 0 70px rgba(24, 34, 51, 0.16);
  transform: translateX(104%);
  transition: transform 220ms ease;
}

.admin-panel.open {
  transform: translateX(0);
}

.admin-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.admin-header h2 {
  font-size: 2.2rem;
}

.icon-button {
  min-width: 44px;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
}

.admin-list {
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 18px 0;
  overflow: auto;
  max-height: calc(100vh - 280px);
}

.admin-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.admin-item p {
  margin: 0;
  line-height: 1.6;
}

.admin-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.status {
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-item-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(24, 34, 51, 0.34);
  backdrop-filter: blur(12px);
}

.modal.open {
  display: grid;
}

.modal-card {
  width: min(560px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(24, 34, 51, 0.12);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 3.8rem);
}

.gate-form {
  margin-top: 22px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: clamp(18px, 4vw, 46px);
  background: rgba(12, 16, 24, 0.76);
  backdrop-filter: blur(18px);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  width: auto;
  max-width: min(94vw, 1280px);
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
  object-fit: contain;
}

.lightbox-caption {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 61;
  max-width: min(520px, 80vw);
  margin: 0;
  padding: 10px 16px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(12, 16, 24, 0.62);
  backdrop-filter: blur(12px);
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}

@media (max-width: 560px) {
  .lightbox-caption {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 0.82rem;
    padding: 8px 12px;
  }
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  border-color: rgba(255, 255, 255, 0.65);
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border-color: rgba(255, 255, 255, 0.55);
  color: white;
  background: rgba(255, 255, 255, 0.12);
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  transition: background 200ms ease, transform 200ms ease;
}

.lightbox-nav img {
  width: 22px;
  height: 22px;
  filter: invert(1);
  pointer-events: none;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

@media (max-width: 560px) {
  .lightbox-nav {
    min-width: 40px;
    min-height: 40px;
  }

  .lightbox-nav img {
    width: 18px;
    height: 18px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}

footer {
  position: relative;
  z-index: 2;
  padding: 26px clamp(18px, 6vw, 80px) 42px;
  border-top: 1px solid var(--line);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

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

.burst-dot {
  position: fixed;
  z-index: 50;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  pointer-events: none;
  animation: burst 720ms ease-out forwards;
}

@keyframes burst {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.25);
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: start;
    gap: 14px;
  }

  nav {
    gap: 12px;
    font-size: 0.9rem;
  }

  .hero,
  .intro,
  .letter-columns,
  .founders {
    grid-template-columns: 1fr;
  }

  .photo-wall {
    grid-template-columns: repeat(6, 1fr);
  }

  .photo-tile,
  .photo-tile.small {
    grid-column: span 3;
  }

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

  .hero {
    min-height: auto;
  }

  .poster-card {
    max-width: 520px;
    justify-self: center;
  }
}

@media (max-width: 560px) {
  .site-header {
    position: sticky;
    min-height: auto;
    align-items: center;
    padding: 12px 16px;
  }

  nav {
    gap: 10px;
    font-size: 0.82rem;
    overflow-x: auto;
    max-width: calc(100vw - 164px);
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 5.4rem);
  }

  .hero {
    padding-top: 34px;
  }

  .lede {
    font-size: 1rem;
  }

  .hero-actions,
  .admin-actions {
    display: flex;
    gap: 10px;
  }

  .button {
    min-height: 44px;
    padding: 0 16px;
  }

  .photo-wall {
    grid-template-columns: repeat(2, 1fr);
    animation-duration: 24s;
  }

  .islanders {
    min-height: auto;
  }

  .marquee-track {
    animation-duration: 56s;
  }

  .marquee-item {
    max-width: min(68vw, 320px);
    padding: 7px 11px;
    font-size: 0.86rem;
  }

  .photo-tile,
  .photo-tile.small,
  .photo-tile.large,
  .photo-tile.wide,
  .photo-tile.tall {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 190px;
    transform: none;
  }

}

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