:root {
  --bg: #fff9f2;
  --surface: #fffdf9;
  --surface-soft: #fdf2e8;
  --text: #2f2930;
  --muted: #675d68;
  --peach: #f8c9a7;
  --lavender: #d9d0f0;
  --border: #ecdccc;
  --focus: #8c6dff;
  --shadow: 0 10px 30px rgba(47, 41, 48, 0.08);
  --radius: 18px;
  --space: clamp(1rem, 2.8vw, 1.5rem);
  --content-width: 66ch;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(248, 201, 167, 0.35), transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(217, 208, 240, 0.35), transparent 30%),
    var(--bg);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: clamp(0.99rem, 0.2vw + 0.96rem, 1.05rem);
  line-height: 1.68;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.prelude-open {
  overflow: hidden;
}

body.prelude-open .site-header,
body.prelude-open main,
body.prelude-open .lightbox {
  visibility: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(rgba(47, 41, 48, 0.1) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  z-index: -1;
}

.prelude {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 12% 15%, rgba(248, 201, 167, 0.32), transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(217, 208, 240, 0.34), transparent 36%),
    rgba(255, 249, 242, 0.93);
}

body:not(.prelude-open) .prelude {
  display: none;
}

.prelude-card {
  width: min(470px, 94%);
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(250, 241, 233, 0.92));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(44, 35, 48, 0.1);
  padding: 1.4rem;
}

.prelude-card h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 4.8vw, 1.8rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.prelude-text {
  color: #5f5561;
  margin-bottom: 0.8rem;
  font-size: 0.96rem;
}

.prelude-form {
  display: grid;
  gap: 0.65rem;
}

.prelude-submit {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0.7rem 1rem;
  color: #332a36;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(145deg, #ffd8ba, #f3e3ff);
}

h1,
h2 {
  font-family: "Newsreader", Georgia, serif;
  letter-spacing: 0.005em;
  line-height: 1.16;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(1.95rem, 6vw, 3.1rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.4rem, 5vw, 2.05rem);
  font-weight: 700;
}

p {
  margin: 0 0 0.85rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.skip-link:focus {
  left: 0.5rem;
  z-index: 1200;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(255, 249, 242, 0.85);
  border-bottom: 1px solid rgba(236, 220, 204, 0.8);
  z-index: 900;
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: rgba(236, 220, 204, 0.4);
  overflow: hidden;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #f2b88f, #d5c8ff);
}

.header-inner {
  width: min(1040px, 92%);
  margin: 0 auto;
  padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 0 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.project-title {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.audio-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-toggle[aria-pressed="true"] {
  background: #f7f0ff;
}

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

.section {
  padding: clamp(2.4rem, 8vw, 4.5rem) 0;
}

.container {
  width: min(1040px, 92%);
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: calc(100dvh - 64px);
  display: grid;
  place-items: center;
  overflow: clip;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.65;
  pointer-events: none;
}

.hero-glow-a {
  width: clamp(180px, 44vw, 320px);
  height: clamp(180px, 44vw, 320px);
  top: 12%;
  right: -8%;
  background: rgba(248, 201, 167, 0.58);
}

.hero-glow-b {
  width: clamp(140px, 30vw, 260px);
  height: clamp(140px, 30vw, 260px);
  left: -8%;
  bottom: 15%;
  background: rgba(217, 208, 240, 0.62);
}

.hero-card {
  position: relative;
  z-index: 2;
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.95), rgba(253, 242, 232, 0.85));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(1.3rem, 4vw, 2rem);
  max-width: 56rem;
}

.eyebrow {
  font-size: 0.88rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.subtext {
  font-size: clamp(1rem, 3.4vw, 1.15rem);
  color: #4f464f;
  max-width: 36ch;
}

.jump-link {
  display: inline-block;
  margin-top: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px dashed var(--muted);
}

.section-note {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  overflow-x: auto;
  gap: 0.9rem;
  scroll-snap-type: x mandatory;
  padding: 0 4vw 0.6rem;
  margin: 0 -4vw;
  scroll-padding-inline: 4vw;
  -webkit-overflow-scrolling: touch;
  perspective: 900px;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.gallery-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
  min-height: 44px;
  scroll-snap-align: start;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(47, 41, 48, 0.12);
}

.gallery-item img {
  width: 100%;
  height: clamp(280px, 72vw, 420px);
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
  background: linear-gradient(145deg, #fff6ed, #f8efff);
  transition: transform 0.6s ease;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 4vw, 1.5rem);
}

.card p {
  max-width: var(--content-width);
}

.section-card {
  will-change: transform, opacity;
}

.surprise-btn {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffd8ba, #f3e3ff);
  color: #2e2530;
  font-weight: 700;
  min-height: 46px;
  padding: 0.78rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(76, 59, 84, 0.18);
  transition: transform 0.18s ease;
  will-change: transform;
}

.surprise-btn:hover,
.surprise-btn:focus-visible {
  transform: translateY(-2px);
}

.hidden-note {
  min-height: 1.3em;
  color: #57455f;
  margin-top: 0.9rem;
}

.cat-layer {
  position: relative;
  min-height: 2.2rem;
}

.cat-float {
  position: absolute;
  left: 50%;
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(66, 52, 72, 0.25));
  opacity: 0;
  transform: translateX(-50%);
  will-change: transform, opacity;
}

.lightbox {
  width: min(94vw, 760px);
  border: 0;
  padding: 0.75rem;
  border-radius: 16px;
  background: #fff;
}

.lightbox::backdrop {
  background: rgba(20, 13, 24, 0.72);
}

.lightbox img {
  width: 100%;
  max-height: 80dvh;
  display: block;
  border-radius: 12px;
  object-fit: contain;
}

.lightbox-close {
  margin: 0 0 0.55rem auto;
  display: block;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  min-height: 42px;
  padding: 0.48rem 0.72rem;
  cursor: pointer;
}

.confetti-piece {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0.98;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1100;
}

.confetti-spark {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1099;
  opacity: 0.95;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 700px) {
  .header-inner {
    padding: 0.8rem 0;
  }

  .gallery {
    grid-auto-flow: unset;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .gallery-item img {
    height: 360px;
  }

  .hero-glow-a {
    right: 3%;
  }

  .hero-glow-b {
    left: 2%;
  }
}

@media (max-width: 699px) {
  .hero-card {
    border-radius: 16px;
    padding: 1.15rem 1rem;
  }

  .eyebrow {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
  }

  h1 {
    line-height: 1.1;
  }

  .section {
    padding: 2.1rem 0;
  }

  .card {
    padding: 1rem 0.95rem;
  }

  .hidden-note {
    margin-top: 0.7rem;
    font-size: 0.95rem;
  }
}

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