/* ==========================================================
   PondPhuwin | A Sky Full of Us
   Day sky (Pond, sun) and night sky (Phuwin, moon)
   ========================================================== */

:root {
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Figtree', system-ui, sans-serif;

    --bg: #fff8f2;
    --bg-alt: #fbf1f7;
    --surface: #ffffff;
    --surface-soft: #ffffffb3;
    --ink: #3d2f45;
    --muted: #7d6b78;
    --rose: #d9739a;
    --rose-soft: #f7c6d6;
    --sky: #bfe0f5;
    --lavender: #d9c8f2;
    --sun: #ffd9a0;
    --line: #f0dfe6;
    --shadow: 0 20px 60px #a883a026;
    --shadow-sm: 0 8px 24px #a883a01f;

    --hero-bg:
        radial-gradient(ellipse at 12% 18%, #fbd7e4 0, transparent 40%),
        radial-gradient(ellipse at 88% 22%, #d4ebfa 0, transparent 42%),
        linear-gradient(160deg, #fffaf4, #fff3f7 55%, #eff7ff);
    --orb: radial-gradient(circle at 35% 35%, #fff4d6, #ffd9a0 55%, #ffc4a8);
    --star-opacity: 0;

    --radius: 22px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="night"] {
    --bg: #17122a;
    --bg-alt: #1e1836;
    --surface: #251e3d;
    --surface-soft: #251e3dcc;
    --ink: #f6ecf8;
    --muted: #b9a9cb;
    --rose: #f29bbd;
    --rose-soft: #5b3a63;
    --sky: #2c3a63;
    --lavender: #4a3a78;
    --sun: #cdd6ff;
    --line: #3a2f58;
    --shadow: 0 20px 60px #00000055;
    --shadow-sm: 0 8px 24px #00000040;

    --hero-bg:
        radial-gradient(ellipse at 12% 20%, #3b2459 0, transparent 42%),
        radial-gradient(ellipse at 88% 18%, #1f3762 0, transparent 44%),
        linear-gradient(160deg, #17122a, #1d1636 60%, #141b38);
    --orb: radial-gradient(circle at 35% 35%, #ffffff, #e6e9ff 50%, #b9c3f5);
    --star-opacity: 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background .6s ease, color .6s ease;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
    outline: 3px solid var(--rose);
    outline-offset: 3px;
    border-radius: 8px;
}

.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 100;
    background: var(--ink);
    color: var(--bg);
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Background layers ---------- */

.stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: var(--star-opacity);
    transition: opacity 1s ease;
    background-image:
        radial-gradient(1.5px 1.5px at 8% 12%, #fff, transparent),
        radial-gradient(1px 1px at 22% 38%, #fff, transparent),
        radial-gradient(2px 2px at 36% 8%, #ffe9f4, transparent),
        radial-gradient(1px 1px at 48% 62%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 61% 22%, #dfe8ff, transparent),
        radial-gradient(1px 1px at 72% 74%, #fff, transparent),
        radial-gradient(2px 2px at 84% 40%, #ffe9f4, transparent),
        radial-gradient(1px 1px at 93% 86%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 15% 80%, #dfe8ff, transparent),
        radial-gradient(1px 1px at 55% 92%, #fff, transparent);
    animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { filter: brightness(.7); }
    to   { filter: brightness(1.3); }
}

#sky {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 60;
}

.sky-object {
    position: absolute;
    bottom: -70px;
    opacity: 0;
    user-select: none;
    filter: drop-shadow(0 3px 7px #b9a5c555);
    animation: floatUp var(--duration, 7s) ease-out forwards;
}

@keyframes floatUp {
    0%   { transform: translate(0, 0) rotate(0) scale(.5); opacity: 0; }
    12%  { opacity: 1; }
    50%  { transform: translate(var(--drift, 20px), -55vh) rotate(50deg) scale(1); }
    75%  { opacity: .95; }
    100% { transform: translate(calc(var(--drift, 20px) * -1), -115vh) rotate(110deg) scale(1.2); opacity: 0; }
}

#trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 70;
    overflow: hidden;
}

.trail-dot {
    position: absolute;
    font-size: 14px;
    color: var(--rose);
    animation: trailFade .9s ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes trailFade {
    to { opacity: 0; transform: translate(-50%, calc(-50% + 22px)) scale(.3) rotate(80deg); }
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 76px;
    padding: 0 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, box-shadow .3s, background .6s;
}

.site-header.is-scrolled {
    border-color: var(--line);
    box-shadow: 0 8px 30px #a883a014;
}

.logo {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -.5px;
}
.logo span { color: var(--rose); font-style: italic; }

.nav-links { display: flex; gap: 6px; }

.nav-links a {
    position: relative;
    padding: 8px 14px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: color .25s, background .25s;
}
.nav-links a:hover,
.nav-links a.is-active {
    color: var(--ink);
    background: var(--surface-soft);
}
.nav-links a.is-active { box-shadow: inset 0 0 0 1px var(--line); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Day/night switch */
.theme-toggle {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 30px;
}
.theme-toggle__track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 62px;
    height: 32px;
    padding: 0 9px;
    border-radius: 30px;
    background: linear-gradient(135deg, #fbd3e1, #cfe8f8);
    border: 1px solid #ffffff99;
    font-size: 13px;
    transition: background .5s;
}
html[data-theme="night"] .theme-toggle__track {
    background: linear-gradient(135deg, #3b2a63, #1f2e5c);
    border-color: #4a3a78;
}
.theme-toggle__icon { position: relative; z-index: 1; color: #8a6a7c; }
html[data-theme="night"] .theme-toggle__icon { color: #c8bde6; }
.theme-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 8px #8a6a7c40;
    transition: transform .45s var(--ease), background .4s;
}
html[data-theme="night"] .theme-toggle__thumb {
    transform: translateX(30px);
    background: #f3eeff;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .3s var(--ease), opacity .2s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Shared bits ---------- */

main, .site-footer { position: relative; z-index: 1; }

.pill {
    display: inline-block;
    padding: 7px 16px;
    margin-bottom: 26px;
    border-radius: 30px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--rose);
    font-size: 13px;
    font-weight: 600;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 40px;
    padding: 15px 26px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px #d8a9bf55; }
.btn:active { transform: translateY(0) scale(.97); }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-secondary {
    background: var(--surface-soft);
    color: var(--ink);
    border: 1px solid var(--line);
}

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

.section-heading { text-align: center; margin-bottom: 52px; }

.section-title {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.4vw, 54px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -1px;
    max-width: 16ch;
    margin: 0 auto;
}

.section-description {
    color: var(--muted);
    font-size: 16px;
    max-width: 46ch;
    margin: 18px auto 0;
}

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

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: calc(100vh - 76px);
    min-height: calc(100svh - 76px);
    padding: 70px 8% 110px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 60px;
    background: var(--hero-bg);
    transition: background .8s ease;
}

.hero-orb {
    position: absolute;
    z-index: -1;
    top: 8%;
    right: 6%;
    width: clamp(220px, 32vw, 440px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--orb);
    box-shadow: 0 0 120px 40px #ffd9a055;
    opacity: .85;
    animation: orbBreath 9s ease-in-out infinite alternate;
    transition: background .8s ease, box-shadow .8s ease;
}
html[data-theme="night"] .hero-orb { box-shadow: 0 0 120px 30px #b9c3f533; }

@keyframes orbBreath {
    from { transform: scale(1) translateY(0); }
    to   { transform: scale(1.06) translateY(10px); }
}

.hero-cloud {
    position: absolute;
    z-index: -1;
    color: #ffffffcc;
    pointer-events: none;
    animation: cloudDrift 18s ease-in-out infinite alternate;
}
html[data-theme="night"] .hero-cloud { color: #ffffff1c; }
.hero-cloud--one { bottom: 6%; left: 3%; font-size: 120px; }
.hero-cloud--two { top: 14%; left: 42%; font-size: 70px; animation-duration: 24s; animation-direction: alternate-reverse; }

@keyframes cloudDrift {
    from { transform: translateX(-16px); }
    to   { transform: translateX(26px); }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(46px, 6.4vw, 88px);
    line-height: 1.04;
    font-weight: 400;
    letter-spacing: -2.5px;
}
.hero h1 .line { display: block; }
.hero h1 .line--italic {
    font-style: italic;
    background: linear-gradient(100deg, var(--rose), #9d86e0 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: .08em;
}

.hero-description {
    max-width: 44ch;
    color: var(--muted);
    font-size: 17px;
    margin: 26px 0 34px;
}

.hero-stats {
    display: flex;
    gap: 34px;
    list-style: none;
    margin-top: 46px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    max-width: 480px;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 400;
    line-height: 1.1;
}
.hero-stats span { color: var(--muted); font-size: 13px; }

/* Orchestrated entrance, once */
.pill, .hero h1 .line, .hero-description, .hero .button-row, .hero-stats, .hero-visual {
    animation: enter .9s var(--ease) both;
}
.pill { animation-delay: .05s; }
.hero h1 .line:nth-child(1) { animation-delay: .15s; }
.hero h1 .line:nth-child(2) { animation-delay: .3s; }
.hero-description { animation-delay: .45s; }
.hero .button-row { animation-delay: .55s; }
.hero-stats { animation-delay: .65s; }
.hero-visual { animation-delay: .35s; }

@keyframes enter {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Photo frame */
.hero-visual {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: auto;
}

.photo-frame,
.memory-card__photo,
.lightbox__photo {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--rose-soft), var(--sky));
}

.photo-frame::after,
.memory-card__photo::after,
.lightbox__photo::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 80px;
    color: #ffffffcc;
    z-index: 0;
}
.photo-frame img,
.memory-card__photo img,
.lightbox__photo img { position: relative; z-index: 1; }
.has-image::after { display: none; }
.no-photo img { display: none; }

.photo-frame {
    padding: 12px;
    border-radius: 999px 999px 30px 30px;
    background: var(--surface-soft);
    border: 1px solid #ffffff55;
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}
.photo-frame::after { inset: 12px; border-radius: 999px 999px 20px 20px; background: linear-gradient(135deg, var(--rose-soft), var(--sky)); font-size: 110px; }
.photo-frame img {
    width: 100%;
    height: 470px;
    object-fit: cover;
    border-radius: 999px 999px 20px 20px;
}

.chip {
    position: absolute;
    padding: 9px 16px;
    border-radius: 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 600;
    animation: bob 5s ease-in-out infinite alternate;
}
.chip--pond   { top: 8%;  right: -22px; }
.chip--phuwin { top: 38%; left: -34px; animation-delay: -2.5s; }

@keyframes bob {
    from { transform: translateY(-6px) rotate(-2deg); }
    to   { transform: translateY(8px) rotate(2deg); }
}

.floating-note {
    position: absolute;
    bottom: 34px;
    right: -26px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 16px 22px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    transform: rotate(-4deg);
}
.floating-note small { color: var(--muted); font-size: 12px; }
.floating-note p { font-family: var(--font-display); font-size: 19px; margin-top: 2px; }

/* ---------- Ribbon ---------- */

.ribbon {
    overflow: hidden;
    background: var(--ink);
    color: var(--bg);
    padding: 15px 0;
    transform: rotate(-1deg) scale(1.02);
    margin: -20px 0 0;
    position: relative;
    z-index: 2;
}
.ribbon__track {
    display: flex;
    width: max-content;
    gap: 46px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    animation: marquee 34s linear infinite;
}
.ribbon__track span { white-space: nowrap; }

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

/* ---------- Wishes ---------- */

.wish-section {
    padding: 120px 8% 110px;
    background: var(--bg-alt);
    transition: background .6s;
}

.wish-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 36px;
    max-width: 1100px;
    margin: auto;
    align-items: stretch;
}

.wish-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
}
.wish-form label { display: block; font-weight: 600; margin-bottom: 10px; }

.wish-form textarea {
    width: 100%;
    resize: none;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--bg);
    line-height: 1.6;
    transition: border-color .25s, box-shadow .25s;
}
.wish-form textarea::placeholder { color: var(--muted); opacity: .7; }
.wish-form textarea:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rose) 22%, transparent);
}

.wish-form__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 20px;
    font-size: 13px;
    color: var(--muted);
}
.wish-form__error { color: #d0506f; font-weight: 600; }

.wish-button {
    border: 1px solid #ffffff80;
    border-radius: 50px;
    padding: 15px 28px;
    background: linear-gradient(135deg, #f0a9c4, #c9b4ee);
    color: #3b2c45;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 12px 30px #d7a9c555;
    transition: transform .25s var(--ease), box-shadow .25s;
}
.wish-button:hover { transform: scale(1.05); box-shadow: 0 16px 38px #d7a9c577; }
.wish-button:active { transform: scale(.96); }

.wish-counter { margin-top: 24px; color: var(--muted); font-size: 14px; }
.wish-counter strong { color: var(--ink); }

.wish-message {
    min-height: 30px;
    margin-top: 10px;
    color: var(--rose);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
}

/* Wish sky */
.wish-sky {
    position: relative;
    min-height: 380px;
    border-radius: var(--radius);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 15%, #5b3f8c88, transparent 45%),
        radial-gradient(circle at 85% 80%, #2c4a8a88, transparent 50%),
        linear-gradient(180deg, #241a45, #3a2a63 60%, #6b4a86);
    box-shadow: var(--shadow);
}

.wish-sky__empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
    color: #e8dcf5;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
}

.wish-sky__clear {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 3;
    padding: 7px 14px;
    border-radius: 30px;
    border: 1px solid #ffffff44;
    background: #ffffff1c;
    color: #f4eaff;
    font-size: 12px;
    transition: background .2s;
}
.wish-sky__clear:hover { background: #ffffff33; }

.wish-star {
    position: absolute;
    z-index: 1;
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    color: #ffe9a8;
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 0 8px #ffe9a8aa);
    transform: translate(-50%, -50%);
    animation: starIn .7s var(--ease) both, starPulse 3s ease-in-out infinite alternate;
    animation-delay: 0s, var(--delay, 0s);
}
.wish-star:hover, .wish-star:focus-visible, .wish-star.is-open { z-index: 4; }

.wish-star__text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: max-content;
    max-width: 210px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #fffaf4;
    color: #3d2f45;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 10px 28px #00000040;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.wish-star:hover .wish-star__text,
.wish-star:focus-visible .wish-star__text,
.wish-star.is-open .wish-star__text {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes starIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(-90deg); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}
@keyframes starPulse {
    from { filter: drop-shadow(0 0 4px #ffe9a888); }
    to   { filter: drop-shadow(0 0 12px #ffe9a8); }
}

/* ---------- Memories ---------- */

.memories { padding: 120px 8%; }

.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: auto;
}

.memory-card {
    transform: rotate(calc(var(--tilt, 0) * 1deg));
    transition: transform .4s var(--ease);
}
.memory-card:hover,
.memory-card:focus-within { transform: rotate(0) translateY(-8px); }

.memory-card__open {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 12px 8px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .3s;
}
.memory-card:hover .memory-card__open { box-shadow: var(--shadow); }

.memory-card__photo {
    display: block;
    height: 300px;
    border-radius: 14px;
}
.memory-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease);
}
.memory-card:hover .memory-card__photo img { transform: scale(1.06); }

.memory-card__body { display: block; padding: 18px 8px 12px; }
.memory-card__body h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 23px;
    letter-spacing: -.3px;
}
.memory-card__body p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.memory-card.reveal { opacity: 0; translate: 0 36px; }
.memory-card.reveal.is-visible {
    opacity: 1;
    translate: 0 0;
    transition: opacity .8s var(--ease), translate .8s var(--ease), transform .4s var(--ease);
}
.memory-card.reveal:nth-child(2).is-visible { transition-delay: .12s, .12s, 0s; }
.memory-card.reveal:nth-child(3).is-visible { transition-delay: .24s, .24s, 0s; }

/* Lightbox */
.lightbox {
    margin: auto;
    width: min(92vw, 560px);
    border: none;
    border-radius: 26px;
    padding: 14px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 40px 100px #00000066;
    overflow: visible;
}
.lightbox::backdrop {
    background: #1d1230b3;
    backdrop-filter: blur(6px);
}
.lightbox[open] { animation: pop .45s var(--ease); }

@keyframes pop {
    from { opacity: 0; transform: scale(.92) translateY(20px); }
    to   { opacity: 1; transform: none; }
}

.lightbox__photo { border-radius: 18px; min-height: 280px; }
.lightbox__photo img {
    width: 100%;
    max-height: 66vh;
    object-fit: cover;
    border-radius: 18px;
}
.lightbox__caption { padding: 18px 10px 8px; }
.lightbox__caption h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.lightbox__caption p { color: var(--muted); margin-top: 4px; }

.lightbox__close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: 22px;
    line-height: 1;
}

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

.letter-section {
    padding: 120px 8% 130px;
    background: var(--bg-alt);
    transition: background .6s;
}

.envelope-wrap {
    max-width: 640px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.envelope {
    position: relative;
    display: block;
    width: min(100%, 520px);
    height: 300px;
    margin-top: 20px;
    border: none;
    background: none;
    text-align: center;
    transition: margin .6s var(--ease), height .6s var(--ease);
}

.envelope__back,
.envelope__front,
.envelope__flap { position: absolute; left: 0; width: 100%; }

.envelope__back {
    top: 0; height: 100%;
    background: #f1c5d6;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
html[data-theme="night"] .envelope__back { background: #6d4a84; }

.envelope__front {
    bottom: 0; height: 100%;
    z-index: 3;
    border-radius: 10px;
    background:
        linear-gradient(to top right, #f8d6e3 49.5%, transparent 50%) left / 50% 100% no-repeat,
        linear-gradient(to top left,  #f8d6e3 49.5%, transparent 50%) right / 50% 100% no-repeat;
    pointer-events: none;
}
html[data-theme="night"] .envelope__front {
    background:
        linear-gradient(to top right, #7d5896 49.5%, transparent 50%) left / 50% 100% no-repeat,
        linear-gradient(to top left,  #7d5896 49.5%, transparent 50%) right / 50% 100% no-repeat;
}

.envelope__flap {
    top: 0; height: 58%;
    z-index: 4;
    background: #eeb4ca;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top;
    transition: transform .7s var(--ease), z-index 0s .35s;
}
html[data-theme="night"] .envelope__flap { background: #8b6aa6; }

.envelope__seal {
    position: absolute;
    top: 46%; left: 50%;
    z-index: 5;
    transform: translate(-50%, -50%);
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #d9739a;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 10px #b9507755;
    transition: opacity .3s;
}

.envelope__hint {
    position: absolute;
    bottom: -38px; left: 0; right: 0;
    color: var(--muted);
    font-size: 14px;
}

.envelope__paper {
    position: absolute;
    left: 5%; bottom: 8%;
    width: 90%;
    height: 82%;
    z-index: 2;
    background: #fffdf9;
    color: #5b4a58;
    border-radius: 8px;
    box-shadow: 0 6px 20px #a883a025;
    overflow: hidden;
    transition: transform .8s var(--ease) .25s, height .8s var(--ease) .25s;
}
.envelope__paper-inner { display: block; padding: 30px 32px; }
.envelope__flower { display: block; color: #e2a4bb; font-size: 34px; margin-bottom: 12px; }
.envelope__text {
    display: block;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 14px;
}

/* open state */
.envelope[aria-expanded="true"] { margin-top: 250px; }
.envelope[aria-expanded="true"] .envelope__flap { transform: rotateX(180deg); z-index: 1; }
.envelope[aria-expanded="true"] .envelope__seal { opacity: 0; }
.envelope[aria-expanded="true"] .envelope__paper {
    height: 440px;
    transform: translateY(-66px);
    z-index: 2;
    overflow: visible;
}
.envelope[aria-expanded="true"] .envelope__hint { opacity: 0; }

.surprise { margin-top: 70px; text-align: center; }

.surprise-button {
    border: 1px solid var(--rose-soft);
    border-radius: 40px;
    padding: 14px 26px;
    background: var(--surface);
    color: var(--rose);
    font-weight: 600;
    font-size: 14px;
    transition: transform .25s var(--ease), box-shadow .25s;
}
.surprise-button:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.surprise-message {
    margin-top: 26px;
    padding: 26px 28px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    line-height: 1.85;
    max-width: 52ch;
}
.surprise-message:not([hidden]) { animation: enter .7s var(--ease); }

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

.site-footer {
    padding: 70px 20px 60px;
    text-align: center;
    background: var(--bg);
    transition: background .6s;
}
.footer-heart { color: var(--rose); font-size: 26px; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.site-footer h2 { font-family: var(--font-display); font-size: 28px; font-weight: 400; margin: 10px 0 14px; }
.site-footer p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.footer-credit { margin-top: 10px; }
.back-to-top {
    display: inline-block;
    margin-top: 24px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid var(--line);
    transition: background .25s;
}
.back-to-top:hover { background: var(--surface); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; text-align: center; gap: 70px; padding-top: 50px; }
    .hero-description { margin-left: auto; margin-right: auto; }
    .button-row, .hero-stats { justify-content: center; }
    .hero-stats { margin-left: auto; margin-right: auto; }
    .hero-orb { top: 3%; right: -10%; }
    .wish-layout { grid-template-columns: 1fr; }
    .memory-grid { grid-template-columns: 1fr; max-width: 420px; }
}

@media (max-width: 800px) {
    .site-header { height: 68px; padding: 0 6%; }
    .menu-toggle { display: flex; }

    .nav-links {
        position: absolute;
        top: 68px; left: 0; right: 0;
        flex-direction: column;
        padding: 14px 6% 24px;
        gap: 4px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 20px 30px #a883a014;
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: transform .3s var(--ease), opacity .25s, visibility .25s;
    }
    .nav-links.open { transform: none; opacity: 1; visibility: visible; }
    .nav-links a { padding: 14px 16px; font-size: 16px; }

    .hero { padding: 40px 7% 90px; }
    .photo-frame img { height: 380px; }
    .hero-visual { max-width: 340px; }
    .chip--pond { right: -10px; }
    .chip--phuwin { left: -12px; }
    .floating-note { right: -8px; }
    .hero-stats { gap: 22px; }

    .wish-section, .memories, .letter-section { padding: 80px 7%; }
    .wish-form { padding: 24px; }
    .wish-sky { min-height: 320px; }

    .envelope { height: 240px; margin-top: 20px; }
    .envelope__paper-inner { padding: 20px 20px; }
    .envelope__text { font-size: 15px; }
    .envelope[aria-expanded="true"] { margin-top: 250px; }
    .envelope[aria-expanded="true"] .envelope__paper { height: 410px; transform: translateY(-50px); }
}

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