:root {
  --ink: #090b12;
  --paper: #f8f2e6;
  --gold: #d3af67;
  --gold-bright: #f0d397;
  --muted: #9c9ba4;
  --line: rgba(222, 194, 136, 0.22);
}

* { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; color: var(--paper); background: var(--ink); font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input, textarea { font: inherit; touch-action: manipulation; }
button { color: inherit; }

.experience {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 18%, rgba(52, 39, 77, 0.34), transparent 30%),
    radial-gradient(circle at 78% 65%, rgba(34, 64, 68, 0.22), transparent 32%),
    linear-gradient(125deg, #0c0b14 0%, #080b10 52%, #0d1014 100%);
}

.grain { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .24; background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.14) 0 1px, transparent 1.2px), radial-gradient(circle at 70% 65%, rgba(255,255,255,.1) 0 1px, transparent 1.2px); background-size: 47px 43px, 61px 57px; mix-blend-mode: soft-light; }
.aurora { position: absolute; z-index: -2; border-radius: 999px; filter: blur(60px); opacity: .22; animation: breathe 8s ease-in-out infinite alternate; }
.aurora-one { width: 38vw; height: 38vw; left: -15vw; top: 24%; background: #745d8e; }
.aurora-two { width: 32vw; height: 32vw; right: -12vw; bottom: -8vw; background: #3e796e; animation-delay: -3s; }
.orbit { position: absolute; z-index: -1; border: 1px solid rgba(210, 175, 103, .08); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 34vw; height: 34vw; left: 5%; top: 20%; }
.orbit-two { width: 18vw; height: 18vw; right: 6%; top: 9%; box-shadow: 0 0 80px rgba(215, 180, 110, .03) inset; }

.topbar { height: 78px; padding: 0 clamp(24px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); letter-spacing: .16em; }
.brand { display: flex; align-items: center; gap: 13px; font-size: 10px; color: rgba(255,255,255,.62); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(220,188,125,.58); color: var(--gold-bright); font: italic 16px Georgia, serif; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.edition { display: flex; align-items: center; gap: 10px; font-size: 9px; color: rgba(255,255,255,.42); }
.edition span { width: 5px; height: 5px; border-radius: 50%; background: #d5b575; box-shadow: 0 0 12px #e5c88d; }

.stage { min-height: calc(100svh - 126px); padding: 5vh clamp(24px, 6vw, 92px) 4vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); gap: clamp(48px, 8vw, 132px); align-items: center; max-width: 1540px; margin: 0 auto; }
.hero-copy { text-align: center; display: flex; align-items: center; flex-direction: column; min-width: 0; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.eyebrow { margin: 0 0 3vh; display: flex; align-items: center; gap: 12px; color: rgba(238,219,184,.42); font: 9px/1 Georgia, serif; letter-spacing: .26em; }
.eyebrow i { width: 28px; height: 1px; background: var(--line); }
.eyebrow span { color: rgba(238,211,153,.7); }

.portrait { width: clamp(148px, 17vw, 210px); aspect-ratio: 1; padding: 0; position: relative; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.portrait-frame { position: absolute; inset: 13%; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #24232a, #14151b); border: 1px solid rgba(238,211,151,.58); box-shadow: 0 24px 60px rgba(0,0,0,.46), 0 0 0 7px rgba(210,170,95,.055); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.88) contrast(1.03); }
.portrait-shine { position: absolute; inset: 0; background: linear-gradient(128deg, rgba(255,255,255,.16), transparent 30% 70%, rgba(222,187,120,.12)); pointer-events: none; }
.monogram { color: #d7bb82; font: italic 60px/1 Georgia, serif; text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.portrait-orbit { position: absolute; border: 1px solid rgba(213,178,105,.28); border-radius: 50%; inset: 4%; animation: slow-spin 20s linear infinite; }
.portrait-orbit::before, .portrait-orbit::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #e6c987; box-shadow: 0 0 12px #dfbb71; }
.portrait-orbit::before { top: 13%; left: 13%; }
.portrait-orbit::after { right: 3%; bottom: 28%; }
.portrait-orbit-b { inset: 0; opacity: .45; animation-direction: reverse; animation-duration: 28s; border-style: dotted; }
.portrait-label { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); padding: 5px 10px; border: 1px solid var(--line); border-radius: 100px; background: #101116; color: rgba(255,255,255,.48); font: 8px/1 system-ui, sans-serif; letter-spacing: .14em; white-space: nowrap; opacity: 0; transition: .25s; }
.portrait:hover .portrait-label, .portrait:focus-visible .portrait-label { opacity: 1; bottom: -10px; }

.title-wrap { margin-top: clamp(24px, 3vh, 40px); }
.for-you { margin: 0 0 1px; color: var(--gold); font: italic 17px/1 Georgia, serif; letter-spacing: .1em; }
h1 { margin: 0; max-width: 760px; color: #fbf5ea; font-family: "Songti SC", "STSong", "SimSun", Georgia, serif; font-size: clamp(46px, 6.2vw, 90px); font-weight: 400; line-height: 1.08; letter-spacing: .06em; text-shadow: 0 8px 40px rgba(0,0,0,.4); overflow-wrap: anywhere; }
.birthday-line { margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 17px; color: var(--gold-bright); font-size: clamp(11px, 1vw, 14px); letter-spacing: .6em; text-indent: .6em; }
.birthday-line span { width: clamp(30px, 5vw, 62px); height: 1px; background: linear-gradient(90deg, transparent, rgba(220,184,111,.6)); }
.birthday-line span:last-child { transform: rotate(180deg); }
.wish-preview { max-width: 640px; margin: 2.8vh auto 0; color: rgba(245,239,228,.62); font: 15px/2.05 "Songti SC", STSong, serif; letter-spacing: .08em; }
.signature { margin: 2.3vh 0 0; color: rgba(218,186,122,.38); font: 8px/1 Georgia, serif; letter-spacing: .25em; }
.signature b { margin: 0 10px; color: rgba(255,255,255,.32); }

.customizer { padding: clamp(28px, 4vh, 42px); border: 1px solid rgba(236,213,169,.14); background: linear-gradient(145deg, rgba(28,28,35,.68), rgba(13,15,19,.56)); box-shadow: 0 32px 90px rgba(0,0,0,.32); backdrop-filter: blur(20px); position: relative; }
.customizer::before, .customizer::after { content: ""; position: absolute; width: 12px; height: 12px; border-color: rgba(221,184,111,.55); }
.customizer::before { left: -1px; top: -1px; border-left: 1px solid; border-top: 1px solid; }
.customizer::after { right: -1px; bottom: -1px; border-right: 1px solid; border-bottom: 1px solid; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.panel-heading > div { display: flex; gap: 14px; align-items: flex-start; }
.panel-heading p { margin: 0; color: rgba(255,255,255,.47); font: 12px/1.6 "Songti SC", serif; letter-spacing: .08em; }
.panel-heading strong { color: #eee6d9; font-size: 20px; font-weight: 400; letter-spacing: .05em; }
.step { color: var(--gold); font: italic 11px Georgia, serif; border-bottom: 1px solid var(--gold); padding-bottom: 4px; }
.diamond { color: rgba(224,191,127,.56); font-size: 27px; }
.field-label { display: block; margin: 19px 0 9px; color: rgba(255,255,255,.36); font-size: 9px; letter-spacing: .16em; }
.name-field { position: relative; border-bottom: 1px solid rgba(222,198,154,.28); }
.name-field:focus-within { border-color: var(--gold); }
.name-field input { width: 100%; border: 0; outline: 0; background: transparent; padding: 10px 48px 12px 0; color: #fff9ee; font: 22px/1.4 "Songti SC", serif; letter-spacing: .08em; }
.name-field input::placeholder { color: rgba(255,255,255,.18); }
.name-field span { position: absolute; right: 0; bottom: 16px; color: rgba(255,255,255,.2); font: 8px/1 system-ui; }
.upload { width: 100%; padding: 13px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; text-align: left; border: 1px dashed rgba(222,190,130,.26); background: rgba(255,255,255,.018); cursor: pointer; transition: .25s; }
.upload:hover { border-color: rgba(234,202,140,.6); background: rgba(230,198,134,.05); }
.upload-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(221,188,123,.3); border-radius: 50%; color: var(--gold); font-size: 18px; font-weight: 200; }
.upload b { display: block; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 400; letter-spacing: .08em; }
.upload small { color: rgba(255,255,255,.25); font-size: 7px; letter-spacing: .14em; }
.arrow { color: rgba(220,188,126,.54); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
textarea { width: 100%; resize: none; border: 1px solid rgba(222,198,154,.18); outline: 0; padding: 12px 13px; background: rgba(0,0,0,.12); color: rgba(255,250,241,.68); font: 12px/1.75 "Songti SC", serif; letter-spacing: .05em; }
textarea:focus { border-color: rgba(219,181,108,.62); }
.enter-button { margin-top: 22px; width: 100%; height: 50px; padding: 0 19px; border: 1px solid #d4b570; background: linear-gradient(100deg, #c9a55f, #e1c786 45%, #c49e57); color: #15130f; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 13px; letter-spacing: .12em; box-shadow: 0 10px 30px rgba(199,157,78,.12); transition: transform .25s, box-shadow .25s; }
.enter-button:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(199,157,78,.22); }
.enter-button:disabled { cursor: wait; opacity: .58; transform: none; }
.enter-button i { font-size: 18px; font-style: normal; }
.share-status { min-height: 16px; margin: 9px 0 0; color: #e4ba82; font-size: 10px; line-height: 1.5; text-align: center; letter-spacing: .05em; }
.share-result { margin-top: 13px; padding: 16px; border: 1px solid rgba(219,184,116,.24); background: rgba(213,172,94,.055); }
.share-result[hidden] { display: none; }
.share-kicker { color: var(--gold-bright); font: 9px/1 Georgia, serif; letter-spacing: .14em; }
.share-result p { margin: 7px 0 12px; color: rgba(255,255,255,.45); font-size: 10px; }
.share-url-display { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid rgba(231,197,127,.42); background: rgba(4,5,8,.38); color: #f1d18f; text-decoration: none; }
.share-url-display span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.share-url-display b { flex: 0 0 auto; color: var(--gold-bright); font-size: 15px; font-weight: 400; }
.share-actions { margin-top: 13px; display: flex; gap: 9px; }
.share-actions a, .share-actions button { flex: 1; border: 1px solid rgba(222,188,121,.28); padding: 9px 10px; background: transparent; color: rgba(255,255,255,.66); text-align: center; text-decoration: none; cursor: pointer; font-size: 9px; letter-spacing: .08em; }
.share-actions a:hover, .share-actions button:hover { border-color: rgba(235,202,137,.64); color: var(--gold-bright); }
.share-actions .copy-primary { border-color: rgba(218,179,104,.55); background: rgba(211,170,91,.12); color: var(--gold-bright); }
.privacy { margin: 12px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: rgba(255,255,255,.24); font-size: 8px; letter-spacing: .08em; }
.privacy span { width: 3px; height: 3px; background: #7ea58f; border-radius: 50%; }

.ceremony-controls { position: fixed; z-index: 8; right: 38px; bottom: 34px; display: flex; gap: 10px; opacity: 0; transform: translateY(20px); pointer-events: none; transition: .5s .7s; }
.again-button, .edit-button { border: 1px solid rgba(218,185,120,.34); padding: 12px 17px; background: rgba(12,13,18,.72); backdrop-filter: blur(12px); cursor: pointer; font-size: 10px; letter-spacing: .1em; }
.again-button span { color: var(--gold); margin-left: 8px; }
.edit-button { color: rgba(255,255,255,.42); }
.fireworks-canvas { position: fixed; z-index: 7; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; contain: strict; }
footer { position: absolute; bottom: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center; justify-content: center; gap: 14px; border-top: 1px solid rgba(255,255,255,.05); color: rgba(255,255,255,.2); }
footer p { font: 8px/1 Georgia, serif; letter-spacing: .22em; }
footer span { color: rgba(211,175,103,.38); font-size: 8px; }

.ceremony .customizer { opacity: 0; transform: translateX(50px); pointer-events: none; }
.customizer { transition: opacity .65s, transform .65s; }
.ceremony .stage { grid-template-columns: 1fr; }
.ceremony .hero-copy { transform: none; }
.ceremony .portrait { width: clamp(180px, 20vw, 250px); transition: width .8s; }
.ceremony h1 { font-size: clamp(62px, 8vw, 118px); transition: font-size .8s; }
.ceremony .ceremony-controls { opacity: 1; transform: translateY(0); pointer-events: auto; }

@keyframes breathe { to { transform: translate3d(5%, -4%, 0) scale(1.12); opacity: .32; } }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes burst { 0% { opacity: 0; transform: scale(.2); } 15% { opacity: 1; } 60% { opacity: .9; } 100% { opacity: 0; transform: translate3d(var(--drift), 130px, 0) scale(.1); } }

@media (max-width: 900px) {
  .experience { min-height: 100dvh; overflow-x: clip; overflow-y: visible; }
  .topbar { padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
  .stage { min-height: auto; grid-template-columns: minmax(0, 1fr); gap: 44px; padding: 46px max(20px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .hero-copy { width: 100%; }
  .customizer { width: min(100%, 520px); margin: 0 auto; padding: 32px 28px; }
  .name-field input, textarea { font-size: 16px; }
  .upload, .enter-button { min-height: 52px; }
  .share-actions { flex-wrap: wrap; }
  .share-actions .copy-primary { flex-basis: 100%; min-height: 42px; }
  .share-actions a, .share-actions button { min-height: 40px; display: grid; place-items: center; }
  .ceremony .customizer { display: none; }
  .ceremony .stage { min-height: calc(100dvh - 64px); padding: 20px max(18px, env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: center; }
  .ceremony .hero-copy { min-height: 0; width: 100%; transform: none; justify-content: center; }
  .ceremony .eyebrow { margin-bottom: 18px; }
  .ceremony .portrait { width: min(42vw, 176px); }
  .ceremony .title-wrap { margin-top: 18px; }
  .ceremony h1 { max-width: 100%; font-size: clamp(46px, 13vw, 72px); line-height: 1; letter-spacing: .035em; }
  .ceremony .birthday-line { margin-top: 12px; }
  .ceremony .wish-preview { max-width: 520px; margin-top: 18px; padding-inline: 4px; font-size: 12.5px; line-height: 1.8; }
  .ceremony .signature { margin-top: 14px; }
  .ceremony-controls { right: max(16px, env(safe-area-inset-right)); left: max(16px, env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); width: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); transform: translateY(20px); }
  .ceremony .ceremony-controls { transform: translateY(0); }
  .again-button, .edit-button { min-height: 44px; padding: 10px 12px; white-space: nowrap; }
  .ceremony .aurora { animation: none; filter: blur(42px); }
  .ceremony .grain { opacity: .15; mix-blend-mode: normal; }
  .ceremony .again-button, .ceremony .edit-button { backdrop-filter: none; }
  footer { position: relative; }
  .ceremony footer { display: none; }
}

@media (max-width: 540px) {
  .topbar { height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0; }
  .brand { font-size: 8px; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; }
  .edition { display: none; }
  .stage { gap: 38px; padding: 34px 16px calc(82px + env(safe-area-inset-bottom)); }
  .portrait { width: min(43vw, 158px); }
  .title-wrap { margin-top: 20px; }
  .for-you { font-size: 14px; }
  h1 { font-size: clamp(40px, 13vw, 56px); line-height: 1.06; letter-spacing: .035em; }
  .eyebrow { margin-bottom: 22px; gap: 7px; font-size: 7px; letter-spacing: .15em; }
  .eyebrow i { width: 16px; }
  .birthday-line { gap: 8px; letter-spacing: .36em; text-indent: .36em; }
  .birthday-line span { width: 22px; }
  .wish-preview { margin-top: 20px; padding-inline: 4px; font-size: 12.5px; line-height: 1.85; }
  .customizer { padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); }
  .panel-heading { margin-bottom: 24px; }
  .panel-heading strong { font-size: 18px; }
  .name-field input { font-size: 18px; }
  textarea { min-height: 124px; }
  .share-result { padding: 14px; }
  .share-url-display { min-height: 46px; }
  .ceremony .stage { min-height: calc(100dvh - 58px - env(safe-area-inset-top)); padding-top: 12px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .ceremony .eyebrow { margin-bottom: 12px; }
  .ceremony .portrait { width: min(43vw, 158px); }
  .ceremony .title-wrap { margin-top: 14px; }
  .ceremony .for-you { font-size: 13px; }
  .ceremony h1 { font-size: clamp(38px, 14vw, 60px); line-height: 1; }
  .ceremony .birthday-line { gap: 6px; font-size: 10px; letter-spacing: .28em; text-indent: .28em; }
  .ceremony .wish-preview { margin-top: 14px; max-width: 350px; font-size: 11.5px; line-height: 1.7; letter-spacing: .05em; }
  .ceremony .signature { margin-top: 11px; font-size: 7px; }
  .ceremony-controls { gap: 8px; }
  .again-button, .edit-button { min-width: 0; padding-inline: 8px; font-size: 9px; text-align: center; }
  .orbit-two { display: none; }
  footer p { letter-spacing: .1em; }
}

@media (max-width: 380px), (max-height: 700px) and (max-width: 540px) {
  .ceremony .eyebrow { display: none; }
  .ceremony .portrait { width: min(39vw, 138px); }
  .ceremony .title-wrap { margin-top: 10px; }
  .ceremony h1 { font-size: clamp(34px, 13vw, 50px); }
  .ceremony .wish-preview { margin-top: 11px; font-size: 10.5px; line-height: 1.6; }
  .ceremony .signature { margin-top: 8px; }
}

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