/* ============================================================
   Hall of Us — stylesheet
   A small gallery-hall of your memories together.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Jost:wght@300;400;500&display=swap");

:root {
  /* --- Color tokens --- */
  --bg: #fbf5f2; /* soft blush ivory */
  --bg-alt: #f6e9e4; /* pale peach, section alternation */
  --paper: #fffdfb; /* card / plaque surface */
  --ink: #4a2e33; /* warm deep mauve-brown, primary text */
  --ink-soft: #8b6b70; /* muted mauve, secondary text */
  --rose: #c6828c; /* dusty rose, primary accent */
  --rose-deep: #a85d68; /* deeper rose, hover / emphasis */
  --gold: #c9a66b; /* soft muted gold, fine lines */
  --leaf: #92a57c; /* muted sage green, for tulip stems/leaves */
  --line: #e4d1cc; /* hairline borders */

  /* --- Type tokens --- */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, sans-serif;

  --measure: 62ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

/* ---------------- Opening loader ---------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: loader-hide 0.6s ease forwards;
  animation-delay: 1.15s;
}

.loader.is-done {
  display: none;
}

.loader__mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.7rem;
  color: var(--ink);
  opacity: 0;
  letter-spacing: 0.02em;
  animation: loader-mark-in 0.9s ease forwards;
  animation-delay: 0.15s;
}

@keyframes loader-mark-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loader-hide {
  0% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader {
    display: none;
  }
}

/* ---------------- Ambient petals ---------------- */

.petals {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -8%;
  border-radius: 0 50% 50% 50%;
  transform: rotate(45deg);
  animation: petal-fall linear infinite;
}

@keyframes petal-fall {
  0% {
    transform: translate(0, -10vh) rotate(45deg);
    opacity: 0;
  }
  8% {
    opacity: var(--petal-opacity, 0.28);
  }
  92% {
    opacity: var(--petal-opacity, 0.28);
  }
  100% {
    transform: translate(var(--drift, 40px), 110vh) rotate(405deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .petals {
    display: none;
  }
}

/* ---------------- Nav ---------------- */

.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem clamp(1.25rem, 5vw, 4rem);
}

.site-nav__mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.site-nav__links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-nav__links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 0.2rem;
}

.site-nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--rose);
  transition: right 0.35s ease;
}

.site-nav__links a:hover::after,
.site-nav__links a:focus-visible::after,
.site-nav__links a[aria-current="page"]::after {
  right: 0;
}

.site-nav__links a[aria-current="page"] {
  color: var(--ink);
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  z-index: 2;
  min-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 4rem;
  opacity: 0;
  transform: translateY(10px);
  animation: hero-settle 1.1s ease-out forwards;
  animation-delay: 0.1s;
}

@keyframes hero-settle {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--rose-deep);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 6rem);
  margin: 0;
  line-height: 1;
}

.hero__rule {
  width: 64px;
  height: 1px;
  background: var(--gold);
  margin: 1.75rem 0 1.5rem;
}

.hero__subtitle {
  max-width: 36ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 2.25rem;
}

.hero__cta {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--rose);
  padding-bottom: 0.15rem;
  transition:
    color 0.25s ease,
    border-color 0.25s ease;
}

.hero__cta:hover {
  color: var(--rose-deep);
  border-color: var(--rose-deep);
}

/* ---------------- Cute lily illustration ---------------- */

.lily-garden {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: clamp(2rem, 6vw, 3.5rem);
  opacity: 0;
  animation: lilies-rise 1s ease-out forwards;
  animation-delay: 0.5s;
}

@keyframes lilies-rise {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.lily-garden .cute-lily:nth-child(1) {
  transform: scale(0.6) translateY(10%);
}
.lily-garden .cute-lily:nth-child(2) {
  transform: scale(0.88);
  margin: 0 -8px;
  z-index: 1;
}
.lily-garden .cute-lily:nth-child(3) {
  transform: scale(0.66) scaleX(-1) translateY(8%);
  --petal: var(--gold);
  --petal-shade: #b3874a;
}

.cute-lily {
  --petal: var(--rose);
  --petal-shade: var(--rose-deep);
  position: relative;
  width: 130px;
  height: 200px;
  flex: 0 0 auto;
}

.cute-lily .stem {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 5px;
  height: 116px;
  background: var(--leaf);
  border-radius: 6px;
  transform: translateY(-50%);
}

.cute-lily .leaf {
  position: absolute;
  width: 12px;
  height: 46px;
  background: var(--leaf);
  border-radius: 90% 90% 0 0;
  bottom: 30px;
}

.cute-lily .leaf.left {
  left: 60px;
  transform: rotate(-35deg);
  top: 45px;
  transform-origin: bottom center;
}
.cute-lily .leaf.right {
  right: 55px;
  transform: rotate(35deg);
  top: 60px;
  transform-origin: bottom center;
}

/* six tepals fanned out in a star, alternating tone for depth */
.cute-lily .petal {
  position: absolute;
  bottom: 116px;
  left: 50%;
  width: 20px;
  height: 66px;
  background: var(--petal);
  border-radius: 0 100% 0 100%;
  transform-origin: bottom center;
}

.cute-lily .petal.p1 {
  transform: translateX(-50%) rotate(-64deg);
  background: var(--petal-shade);
  z-index: 1;
}
.cute-lily .petal.p2 {
  transform: translateX(-50%) rotate(-34deg);
  z-index: 2;
}
.cute-lily .petal.p3 {
  transform: translateX(-50%) rotate(-6deg);
  background: var(--petal-shade);
  z-index: 3;
}
.cute-lily .petal.p4 {
  transform: translateX(-50%) rotate(6deg) scaleX(-1);
  background: var(--petal-shade);
  z-index: 3;
}
.cute-lily .petal.p5 {
  transform: translateX(-50%) rotate(34deg) scaleX(-1);
  z-index: 2;
}
.cute-lily .petal.p6 {
  transform: translateX(-50%) rotate(64deg) scaleX(-1);
  background: var(--petal-shade);
  z-index: 1;
}

.cute-lily .stamen {
  position: absolute;
  bottom: 148px;
  left: 50%;
  width: 2px;
  height: 26px;
  background: var(--gold);
  transform-origin: bottom center;
}

.cute-lily .stamen::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -1.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--petal-shade);
}

.cute-lily .stamen.s1 {
  transform: translateX(-50%) rotate(-16deg);
}
.cute-lily .stamen.s2 {
  transform: translateX(-50%) rotate(0deg);
}
.cute-lily .stamen.s3 {
  transform: translateX(-50%) rotate(16deg);
}

@media (prefers-reduced-motion: reduce) {
  .lily-garden {
    opacity: 1;
    animation: none;
  }
}

.lily-accent {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.lily-accent .cute-lily {
  transform: scale(0.7);
}

/* ---------------- Gallery hall ---------------- */

.hall {
  position: relative;
  z-index: 2;
  background: var(--bg-alt);
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 6vw, 4rem)
    clamp(4rem, 10vw, 7rem);
}

.hall__heading {
  text-align: center;
  max-width: 46ch;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
}

.hall__heading h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 0.6rem;
}

.hall__heading p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.98rem;
}

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  max-width: 1160px;
  margin: 0 auto;
}

.frame {
  opacity: 0;
  transform: translateY(18px) rotate(var(--tilt, 0deg));
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.frame.is-visible {
  opacity: 1;
  transform: translateY(0) rotate(var(--tilt, 0deg));
}

.frame:nth-child(3n + 1) {
  --tilt: -1.4deg;
}
.frame:nth-child(3n + 2) {
  --tilt: 0.9deg;
}
.frame:nth-child(3n) {
  --tilt: -0.5deg;
}

.frame__photo {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.6rem;
  box-shadow: 0 18px 30px -22px rgba(74, 46, 51, 0.45);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.frame:hover .frame__photo,
.frame:focus-within .frame__photo {
  transform: rotate(calc(var(--tilt, 0deg) * -1));
  box-shadow: 0 22px 34px -20px rgba(74, 46, 51, 0.5);
}

.frame__photo-inner {
  aspect-ratio: 4 / 5;
  background: repeating-linear-gradient(
    135deg,
    var(--bg-alt),
    var(--bg-alt) 10px,
    var(--bg) 10px,
    var(--bg) 20px
  );
  border: 1px dashed var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.frame__photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame__placeholder {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 1rem;
}

.frame__plaque {
  text-align: center;
  padding-top: 0.85rem;
}

.frame__plaque-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  margin: 0 0 0.15rem;
}

.frame__plaque-date {
  display: block;
  font-size: 0.78rem;
  color: var(--rose-deep);
  margin-bottom: 0.35rem;
}

.frame__plaque-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------------- Letter page ---------------- */

.letter-wrap {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) 1.5rem clamp(5rem, 10vw, 8rem);
}

.letter-wrap__label {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--rose-deep);
  margin-bottom: 2.5rem;
}

.letter {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(2rem, 6vw, 3.5rem);
  box-shadow: 0 30px 50px -35px rgba(74, 46, 51, 0.4);
}

.letter__salutation {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.letter p {
  max-width: var(--measure);
  margin: 0 0 1.25rem;
  opacity: 0;
  transform: translateY(6px);
  animation: line-in 0.8s ease forwards;
}

.letter p:nth-of-type(1) {
  animation-delay: 0.15s;
}
.letter p:nth-of-type(2) {
  animation-delay: 0.35s;
}
.letter p:nth-of-type(3) {
  animation-delay: 0.55s;
}
.letter p:nth-of-type(4) {
  animation-delay: 0.75s;
}

@keyframes line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.letter__signoff {
  margin-top: 2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
}

.letter__edit-note {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------------- Footer ---------------- */

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.site-footer span {
  color: var(--rose);
}
