:root {
  color-scheme: dark;
  --night: #090e10;
  --glass: rgba(25, 34, 35, .68);
  --glass-light: rgba(42, 52, 50, .46);
  --line: rgba(233, 239, 223, .11);
  --ink: #f0eee6;
  --muted: #a4aca4;
  --pine: #9ab59d;
  --red: #d6857d;
  --gold: #dbc18c;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
  background: var(--night);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(35, 67, 55, .28), transparent 38rem),
    radial-gradient(ellipse at 94% 48%, rgba(98, 57, 55, .13), transparent 26rem),
    var(--night);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { -webkit-tap-highlight-color: transparent; }

body.is-locked .site-header,
body.is-locked main,
body.is-locked .site-footer { visibility: hidden; }

.pin-gate {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(30px, env(safe-area-inset-top, 0px)) 20px max(30px, env(safe-area-inset-bottom, 0px));
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(50, 81, 62, .45), transparent 55%),
    radial-gradient(ellipse at 90% 85%, rgba(114, 66, 62, .2), transparent 38%),
    rgba(9, 14, 16, .97);
  transition: opacity .55s ease, visibility .55s ease;
}

.pin-gate.is-unlocking { visibility: hidden; opacity: 0; pointer-events: none; }
.pin-card { position: relative; width: min(100%, 360px); padding: 46px 25px 28px; overflow: hidden; border: 1px solid rgba(233, 239, 223, .13); border-radius: 25px; background: linear-gradient(145deg, rgba(35, 47, 45, .8), rgba(19, 27, 29, .9)); box-shadow: 0 25px 80px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .05); text-align: center; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.pin-decoration { position: absolute; inset: 0; pointer-events: none; }
.pin-star { position: absolute; color: var(--gold); }
.pin-star-one { top: 23px; left: 25px; font-size: 15px; }
.pin-star-two { top: 50px; right: 24px; color: var(--red); font-size: 19px; }
.pin-heart { position: absolute; top: -38px; left: 50%; display: grid; width: 76px; height: 76px; transform: translateX(-50%); place-items: end center; padding-bottom: 10px; border: 1px solid rgba(214, 133, 125, .22); border-radius: 50%; background: rgba(214, 133, 125, .08); color: #e0a09a; font-size: 16px; }
.pin-card h1 { margin: 17px 0 10px; font-family: var(--serif); font-size: clamp(36px, 10vw, 43px); font-weight: 500; line-height: 1.08; letter-spacing: -1.2px; }
.pin-card h1 em { color: #a9c5aa; font-weight: 500; }
.pin-form { margin-top: 27px; }
.pin-label { display: block; margin-bottom: 13px; color: #d7d9ce; font-size: 11px; }
.pin-input-wrap { position: relative; width: max-content; margin: 0 auto; }
.pin-digits { display: flex; gap: 9px; }
.pin-digits span { display: grid; width: 37px; height: 45px; place-items: center; border: 1px solid rgba(233, 239, 223, .16); border-radius: 10px; background: rgba(8, 14, 15, .37); transition: border-color .2s ease, background .2s ease; }
.pin-digits span::after { width: 7px; height: 7px; border-radius: 50%; background: transparent; content: ""; transition: background .2s ease, transform .2s ease; }
.pin-digits span.is-filled { border-color: rgba(154, 181, 157, .52); background: rgba(76, 105, 80, .16); }
.pin-digits span.is-filled::after { transform: scale(1); background: var(--pine); }
.pin-digits span.is-active::after { width: 2px; height: 18px; border-radius: 1px; background: var(--gold); animation: pin-caret-blink 1s step-end infinite; }
.pin-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .01; cursor: text; }
.pin-input-wrap:focus-within .pin-digits span { border-color: rgba(219, 193, 140, .48); }
.pin-error { min-height: 17px; margin: 10px 0 2px; color: #e39b94; font-size: 11px; }
.pin-submit { display: flex; width: 100%; min-height: 48px; margin-top: 3px; padding: 0 17px; align-items: center; justify-content: center; gap: 9px; border: 1px solid rgba(184, 207, 176, .27); border-radius: 13px; background: linear-gradient(135deg, rgba(101, 135, 105, .42), rgba(61, 91, 70, .5)); color: #f0eee6; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.pin-submit:hover { transform: translateY(-1px); background: linear-gradient(135deg, rgba(117, 153, 120, .52), rgba(72, 106, 80, .6)); }
.pin-submit span { color: var(--gold); font-size: 17px; }
.pin-card.is-invalid { animation: pin-shake .32s ease; }

.page-glow {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 900px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(53, 78, 61, .22), transparent 45%),
    radial-gradient(ellipse at 10% 12%, rgba(113, 70, 65, .12), transparent 34%);
}

.string-lights {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  display: flex;
  width: min(390px, 100%);
  height: 19px;
  justify-content: space-around;
  padding: 0 14px;
  transform: translateX(-50%);
  border-top: 1px solid rgba(215, 210, 189, .2);
  border-radius: 0 0 50% 50%;
  pointer-events: none;
}

.string-lights span {
  width: 6px;
  height: 9px;
  margin-top: 1px;
  border-radius: 5px;
  background: #e3b66b;
  box-shadow: 0 0 12px 3px rgba(227, 182, 107, .37);
  animation: twinkle 2.8s ease-in-out infinite alternate;
}

.string-lights span:nth-child(3n + 1) { background: #d6857d; box-shadow: 0 0 12px 3px rgba(214, 133, 125, .32); animation-delay: .6s; }
.string-lights span:nth-child(3n + 2) { background: #8daf91; box-shadow: 0 0 12px 3px rgba(141, 175, 145, .32); animation-delay: 1.2s; }

.site-header {
  display: flex;
  width: min(100% - 36px, 398px);
  height: calc(76px + env(safe-area-inset-top, 0px));
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(233, 239, 223, .08);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-tree { position: relative; display: flex; width: 29px; height: 36px; align-items: center; flex-direction: column; justify-content: flex-end; }
.tree-star { position: absolute; top: -3px; z-index: 1; color: var(--gold); font-size: 15px; }
.tree-layer { display: block; height: 0; border-right: 11px solid transparent; border-bottom: 14px solid #6f9576; border-left: 11px solid transparent; }
.tree-layer-one { border-right-width: 8px; border-bottom-width: 10px; border-left-width: 8px; }
.tree-layer-two { margin-top: -3px; border-right-width: 12px; border-bottom-width: 12px; border-left-width: 12px; }
.tree-layer-three { margin-top: -3px; border-right-width: 16px; border-bottom-width: 14px; border-left-width: 16px; }
.tree-trunk { width: 5px; height: 5px; background: #aa8465; }
.brand-name { color: #eeeae0; font-size: 12px; font-weight: 600; line-height: 1.1; letter-spacing: -.2px; }
.brand-name em { color: #e0a09a; font-family: var(--serif); font-size: 17px; font-weight: 500; }

.section-shell { width: min(100% - 36px, 398px); margin-right: auto; margin-left: auto; }

.hero {
  position: relative;
  display: flex;
  min-height: 590px;
  padding: 42px 4px 40px;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.hero-copy { position: relative; z-index: 1; }
.eyebrow, .section-kicker { margin: 0; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: 1.65px; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 8px; }
.eyebrow-star { color: #d6857d; font-size: 15px; }
.hero h1 { margin: 17px 0 12px; font-family: var(--serif); font-size: clamp(43px, 12vw, 53px); font-weight: 500; line-height: 1.04; letter-spacing: -1.9px; }
.hero h1 span { color: #a9c5aa; font-style: italic; }
.hero-message { max-width: 300px; margin: 0 auto; color: var(--muted); font-size: 12px; line-height: 1.75; }
.hero-sparkle { position: absolute; color: var(--gold); }
.sparkle-one { top: 3px; right: 3%; font-size: 15px; }
.sparkle-two { right: 1%; bottom: -27px; color: var(--red); font-size: 20px; }

.hero-art { position: relative; display: grid; width: 100%; min-height: 315px; margin-top: 15px; place-items: center; }
.orbit { position: absolute; width: 315px; height: 315px; border: 1px solid rgba(219, 193, 140, .15); border-radius: 50%; }
.orbit-two { width: 278px; height: 278px; border-color: rgba(154, 181, 157, .13); }
.portrait-card { position: relative; z-index: 1; width: min(280px, 76vw); padding: 11px; transform: rotate(2deg); border: 1px solid rgba(234, 237, 218, .18); border-radius: 19px; background: rgba(32, 43, 42, .62); box-shadow: 0 20px 55px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .06); -webkit-backdrop-filter: blur(18px) saturate(135%); backdrop-filter: blur(18px) saturate(135%); animation: portrait-float 6s ease-in-out infinite; }
.portrait-topline { display: flex; height: 16px; justify-content: flex-end; color: var(--red); font-size: 11px; }
.couple-avatar { overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid rgba(233, 239, 223, .1); border-radius: 11px; background: rgba(71, 103, 78, .24); }
.hero-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.portrait-tape { display: none; }
.hero-star { position: absolute; z-index: 1; color: var(--gold); }
.star-a { top: 17%; left: 9%; font-size: 19px; }
.star-b { top: 25%; right: 7%; color: var(--red); font-size: 23px; }
.star-c { right: 12%; bottom: 8%; color: var(--pine); font-size: 15px; }
.floating-gift { position: absolute; z-index: 2; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(233, 239, 223, .12); border-radius: 14px; background: rgba(36, 47, 45, .68); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 18px; }
.gift-one { right: 7%; bottom: 11%; transform: rotate(9deg); }
.gift-two { top: 11%; right: 13%; width: 34px; height: 34px; transform: rotate(-10deg); font-size: 15px; }
.scroll-hint { position: absolute; right: 50%; bottom: 8px; display: flex; width: 22px; height: 30px; align-items: center; justify-content: center; transform: translateX(50%); }
.scroll-hint span { width: 17px; height: 25px; border: 1px solid rgba(212, 219, 200, .38); border-radius: 12px; }
.scroll-hint span::after { display: block; width: 2px; height: 5px; margin: 5px auto; border-radius: 2px; background: var(--gold); content: ""; animation: scroll-tick 1.5s ease infinite; }

.memories { width: 100%; max-width: 430px; padding-top: 36px; overflow: hidden; }
.section-heading { display: flex; width: calc(100% - 36px); margin: 0 auto 22px; align-items: end; justify-content: space-between; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: -1px; }
.section-heading h2 span { color: var(--red); }
.memory-window { position: relative; width: 100%; height: 390px; overflow: hidden; background: transparent; }
.memory-belt { display: flex; width: max-content; height: 100%; gap: 0; }
.memory-belt.is-ready { animation: drift-horizontal 42s linear infinite; }
.memory-set { display: flex; height: 100%; flex: 0 0 auto; align-items: flex-start; gap: 12px; padding: 0 6px; }
.memory-column { display: flex; width: 174px; height: max-content; flex: 0 0 174px; align-self: flex-start; flex-direction: column; gap: 12px; }
.memory-belt.is-ready .column-up { animation: drift-up 20s linear infinite; }
.memory-belt.is-ready .column-down { animation: drift-down 24s linear infinite; }
.memory-belt.is-ready .column-third { animation-duration: 23s; }
.memory-belt.is-ready .column-fourth { animation-duration: 21s; }
.memory-card { display: block; min-height: 238px; flex: 0 0 238px; overflow: hidden; border: 1px solid rgba(235, 239, 224, .15); border-radius: 18px; background: rgba(35, 45, 43, .63); box-shadow: 0 9px 24px rgba(0, 0, 0, .23); }
.memory-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.memory-card[data-photo="casal-07.jpg"] img { transform: scale(1.12); }

.letter-experience { display: flex; padding-top: 78px; align-items: center; flex-direction: column; }
.letter-experience > .section-kicker { margin-bottom: 21px; text-align: center; }
.envelope-button { display: flex; width: 100%; min-height: 222px; padding: 15px 0; align-items: center; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(35, 47, 45, .75), rgba(23, 31, 33, .84)); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); transition: border-color .25s ease, background .25s ease; }
.envelope-button:active { background: rgba(43, 57, 51, .9); }
.envelope { position: relative; display: block; width: 148px; height: 99px; perspective: 700px; filter: drop-shadow(0 13px 18px rgba(0, 0, 0, .3)); }
.envelope-back { position: absolute; inset: 0; z-index: 1; border: 1px solid rgba(235, 239, 224, .3); border-radius: 7px; background: linear-gradient(145deg, #788b72, #4a6658); }
.envelope-paper { position: absolute; z-index: 2; right: 12px; bottom: 4px; left: 12px; height: 80px; border-radius: 5px; background: #f3ead8; box-shadow: 0 1px 5px rgba(0, 0, 0, .15); transition: transform .75s cubic-bezier(.2, .8, .2, 1) .18s; }
.envelope-paper::before { position: absolute; top: 18px; right: 14px; left: 14px; height: 1px; background: rgba(102, 91, 71, .18); box-shadow: 0 10px rgba(102, 91, 71, .13), 0 20px rgba(102, 91, 71, .11); content: ""; }
.envelope-front { position: absolute; inset: 0; z-index: 3; overflow: hidden; border-radius: 7px; }
.envelope-front::before, .envelope-front::after { position: absolute; inset: 0; content: ""; }
.envelope-front::before { background: linear-gradient(145deg, transparent 49.5%, rgba(221, 231, 212, .56) 50%) left / 50.1% 100% no-repeat, linear-gradient(215deg, transparent 49.5%, rgba(207, 220, 199, .43) 50%) right / 50.1% 100% no-repeat; }
.envelope-front::after { background: linear-gradient(35deg, transparent 49.5%, rgba(193, 207, 183, .8) 50%) left bottom / 50.1% 100% no-repeat, linear-gradient(-35deg, transparent 49.5%, rgba(203, 216, 193, .86) 50%) right bottom / 50.1% 100% no-repeat; }
.envelope-flap { position: absolute; top: 0; left: 0; z-index: 4; width: 0; height: 0; transform-origin: 50% 0; border-top: 56px solid #8da185; border-right: 74px solid transparent; border-left: 74px solid transparent; transition: transform .55s cubic-bezier(.2, .8, .2, 1), z-index 0s .28s; }
.envelope-seal { position: absolute; top: 47px; left: 50%; z-index: 5; display: grid; width: 25px; height: 25px; transform: translateX(-50%); place-items: center; border: 1px solid rgba(244, 215, 183, .48); border-radius: 50%; background: #b86562; color: #ffe8d6; font-size: 12px; transition: opacity .2s ease, transform .25s ease; }
.envelope-instruction { margin-top: 17px; color: #c4c6b8; font-size: 11px; letter-spacing: .2px; }
.envelope-button:hover .envelope { animation: envelope-nudge 1.4s ease-in-out infinite; }
.letter-experience.is-open .envelope-flap { z-index: 0; transform: rotateX(180deg); }
.letter-experience.is-open .envelope-paper { transform: translateY(-56px); }
.letter-experience.is-open .envelope-seal { transform: translate(-50%, 14px) scale(.8); opacity: 0; }
.letter-experience.is-open .envelope-button { border-color: rgba(186, 212, 181, .28); }
.letter-experience.is-open .envelope-instruction { color: #9fb99f; }

.letter-paper { position: relative; width: 100%; max-height: 0; margin-top: 0; padding: 0 22px; transform: translateY(20px) scale(.98); overflow: hidden; border: 1px solid transparent; border-radius: 8px 20px 17px 19px; background: #f1e8d7; color: #34372d; box-shadow: 0 20px 55px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: max-height .7s ease, opacity .45s ease, transform .55s ease, margin .45s ease, padding .45s ease; }
.letter-experience.is-open .letter-paper { max-height: 1500px; margin-top: 22px; padding: 23px 22px 19px; transform: translateY(0) scale(1); border-color: rgba(248, 239, 219, .32); opacity: 1; pointer-events: auto; }
.paper-heading { display: flex; justify-content: space-between; color: #8d7964; font-size: 8px; font-weight: 700; letter-spacing: 1.3px; }
.paper-heading span:last-child { color: #b36862; font-size: 14px; }
.letter-message { margin-top: 20px; color: #463f36; font-family: var(--hand); font-size: clamp(22px, 6vw, 26px); line-height: 1.3; }
.letter-message p { margin: 0 0 16px; white-space: pre-wrap; }
.letter-message p:first-child { margin-bottom: 11px; }
.letter-message p:last-child { margin: 24px 0 0; text-align: right; }

.site-footer { width: min(100% - 36px, 398px); margin: clamp(42px, 12vw, 72px) auto 0; padding: 26px 16px calc(30px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(233, 239, 223, .11); color: #929b91; font-size: 10px; text-align: center; }
.site-footer p { margin: 0; line-height: 1.75; overflow-wrap: anywhere; }
.site-footer p:not(:last-child) { color: var(--ink); }
.site-footer p + p { margin-top: 12px; }

@keyframes twinkle { from { opacity: .58; transform: translateY(0); } to { opacity: 1; transform: translateY(2px); } }
@keyframes pin-caret-blink { 50% { opacity: 0; } }
@keyframes portrait-float { 0%, 100% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(-7px) rotate(0deg); } }
@keyframes scroll-tick { 0%, 100% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(7px); opacity: .25; } }
@keyframes drift-horizontal { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes drift-up { from { transform: translateY(0); } to { transform: translateY(var(--column-loop-end)); } }
@keyframes drift-down { from { transform: translateY(var(--column-loop-end)); } to { transform: translateY(0); } }
@keyframes envelope-nudge { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-1deg); } }
@keyframes pin-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

@media (min-width: 500px) {
  .section-shell { width: min(100% - 44px, 398px); }
  .hero { min-height: 670px; padding-top: 63px; }
  .memories { width: min(100% - 44px, 430px); }
  .section-heading { width: 100%; }
  .memory-window { width: calc(100% + 44px); margin-left: -22px; }
}

@media (max-width: 360px) {
  .pin-card { padding-right: 18px; padding-left: 18px; }
  .pin-digits { gap: 7px; }
  .pin-digits span { width: 35px; }
  .section-shell { width: calc(100% - 30px); }
  .site-header, .site-footer { width: calc(100% - 30px); }
  .hero { min-height: 570px; padding-top: 34px; }
  .hero h1 { font-size: 44px; }
  .hero-art { min-height: 280px; }
  .orbit { width: 270px; height: 270px; }
  .orbit-two { width: 236px; height: 236px; }
  .portrait-card { width: min(250px, 78vw); }
  .memories { width: 100%; }
  .memory-window { height: 316px; }
  .memory-column { width: 146px; flex-basis: 146px; }
  .memory-card { min-height: 200px; flex-basis: 200px; }
  .memory-set { gap: 10px; }
  .section-heading { width: calc(100% - 30px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .memory-belt.is-ready, .memory-belt.is-ready .memory-column { animation: none; }
}
