@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
  --background: #fafaf8;
  --surface: #FFFFFF;
  --text: #1C1C1C;
  --muted: #77736D;
  --accent: #A69A8A;
  --border: #E7E5E0;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--sans);
  line-height: 1.7;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .19em;
}
h1, h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.12;
}
h1 { font-size: clamp(3rem, 8vw, 6.7rem); }
h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h1 em, h2 em { font-weight: 400; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 3.3rem;
  padding: .85rem 1.2rem;
  border: 1px solid var(--text);
  border-radius: 0;
  font-size: .82rem;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.button:hover { transform: translateY(-2px); }
.button-dark { color: #fff; background: var(--text); width: 100%; }
.button-dark:hover { background: #393939; }
.button-outline { color: var(--text); background: transparent; }
.button-outline:hover { color: #fff; background: var(--text); }

.gate-screen, .welcome-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  text-align: center;
}
.gate-card { width: min(100%, 28rem); animation: rise-in .8s both; }
.gate-card h1 { margin-bottom: 1.3rem; }
.gate-copy { margin: 0 0 2rem; color: var(--muted); font-size: .94rem; }
#passwordForm { display: grid; gap: .75rem; }
#sitePassword {
  width: 100%;
  min-height: 3.3rem;
  padding: .8rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
  outline-offset: 3px;
}
#sitePassword:focus { outline: 1px solid var(--accent); }
.error-message { color: #8C3030; font-size: .82rem; margin: .2rem 0 0; }
.gate-footnote { margin: 3rem 0 0; color: var(--muted); font-size: .62rem; letter-spacing: .17em; }
.welcome-screen { animation: fade-in .7s both; }
.welcome-screen h2 { animation: rise-in .8s .2s both; }

.site-content { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1.1rem, 5vw, 4.5rem); animation: fade-in .8s both; }
.site-header { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--border); font-size: .65rem; letter-spacing: .14em; }
.header-mark { font-weight: 600; }
.header-note { color: var(--muted); letter-spacing: .04em; }
.hero { max-width: 760px; margin: clamp(4rem, 11vw, 8rem) auto 3rem; text-align: center; }
.hero-subtitle { max-width: 32rem; margin: 1.5rem auto 0; color: var(--muted); font-size: clamp(.9rem, 2vw, 1.05rem); }
.memory-section { position: relative; width: min(100%, 850px); margin: 0 auto; padding: 0 0 5rem; }
.main-photo { margin: 0; width: 100%; }
.main-photo img { display: block; width: 100%; height: auto; border: 1px solid var(--border); }
.main-photo figcaption, .childhood-photo figcaption { margin-top: .6rem; color: var(--muted); font-size: .58rem; letter-spacing: .15em; }
.childhood-photo {
  position: absolute;
  z-index: 2;
  right: -1.5rem;
  bottom: 1.1rem;
  width: clamp(145px, 27%, 235px);
  margin: 0;
  padding: .55rem .55rem .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 35px rgb(0 0 0 / 12%);
  transform: rotate(3deg);
}
.childhood-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: saturate(.78) contrast(.96); }
.childhood-photo figcaption { font-size: .48rem; letter-spacing: .08em; }
.message-section { max-width: 600px; margin: 2rem auto 7rem; text-align: center; }
.message-section h2 { margin-bottom: 1.8rem; }
.message-section > p:not(.eyebrow):not(.signature) { color: var(--muted); font-size: .95rem; }
.signature { margin: 2rem 0; font-family: var(--serif); font-size: 1.3rem; font-style: italic; }
.signature span { color: var(--accent); }
.site-footer { display: flex; justify-content: space-between; padding: 1.3rem 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .62rem; letter-spacing: .15em; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
  padding: 1rem; background: rgb(20 20 20 / 58%); backdrop-filter: blur(5px);
  animation: fade-in .2s both;
}
.letter-modal {
  position: relative; width: min(100%, 620px); max-height: 88svh; overflow: auto;
  padding: clamp(2rem, 6vw, 4rem); background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 24px 80px rgb(0 0 0 / 18%);
  animation: rise-in .35s both;
}
.letter-modal h2 { margin-bottom: 1.5rem; }
.modal-close { position: absolute; top: .75rem; right: 1rem; border: 0; background: transparent; font-size: 2rem; line-height: 1; color: var(--muted); }
.letter-copy { color: var(--muted); font-size: .94rem; }
.letter-copy .signature { color: var(--text); }
body.modal-open { overflow: hidden; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .site-header { font-size: .58rem; }
  .hero { margin-top: 4rem; }
  .memory-section { padding-bottom: 4.5rem; }
  .childhood-photo { right: -.25rem; bottom: .5rem; width: 36%; }
  .main-photo figcaption { max-width: 55%; }
  .message-section { margin-bottom: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
