@font-face { font-family: "Be Vietnam Pro"; src: url("shared/fonts/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2"); font-weight: 400; unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("shared/fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("shared/fonts/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2"); font-weight: 600; unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("shared/fonts/be-vietnam-pro-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #2f241c;
  --muted: #7a6a5a;
  --line: #e2d6c4;
  --paper: #fffaf2;
  --accent: #b5452b;
  --accent-d: #8e3320;
  --page: #efe6d8;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; color: var(--ink); font: 400 15px/1.5 "Be Vietnam Pro", system-ui, sans-serif;
  background: var(--page) url("img/tex/giayxam.jpg") 0 0 / 512px; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--accent-d); }

/* ---------- header and occasions ---------- */
.top { max-width: 1160px; margin: 0 auto; padding: 18px 16px 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand b { display: block; font: italic 600 26px/1.1 "Playfair Display", serif; }
.brand small { color: var(--muted); font-size: 13px; }
.events { display: flex; gap: 8px; max-width: 1160px; margin: 0 auto; padding: 10px 16px 14px; overflow-x: auto; scrollbar-width: none; }
.events::-webkit-scrollbar { display: none; }
.ev { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); text-align: left; transition: transform 0.15s; }
.ev img { width: 36px; height: 36px; }
.ev span { display: grid; line-height: 1.2; }
.ev b { font-weight: 600; font-size: 14px; white-space: nowrap; }
.ev small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.ev.on { border-color: var(--accent); background: #fff; box-shadow: 0 3px 0 var(--accent); transform: translateY(-1px); }
.ev:hover img { transform: rotate(-6deg) scale(1.06); }
.ev img { transition: transform 0.2s; }

/* ---------- desk: card + tools ---------- */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; max-width: 1160px; margin: 0 auto; padding: 4px 16px 24px; align-items: start; }
.stage { position: sticky; top: 12px; }
.card-wrap { max-width: 560px; margin: 0 auto; border-radius: 6px; box-shadow: 0 2px 4px rgba(60, 40, 20, 0.12), 0 24px 50px rgba(60, 40, 20, 0.28); overflow: hidden; background: #ddd; }
#card { display: block; width: 100%; height: auto; touch-action: none; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.sel-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px auto 0; }
.sel-tools button { min-width: 44px; height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 600; font-size: 16px; }
.sel-tools button[data-act="front"], .sel-tools .del { font-size: 13px; }
.sel-tools .del { color: #b42318; border-color: #f0c4bd; }

.tools { display: grid; gap: 14px; }
.block { padding: 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 6px 18px rgba(80, 55, 30, 0.08); }
.block h2 { margin: 0 0 12px; font: italic 600 19px/1.2 "Playfair Display", serif; }
.templates { display: flex; gap: 10px; }
.tpl { flex: 0 1 108px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; overflow: hidden; box-shadow: 0 4px 10px rgba(60, 40, 20, 0.18); }
.tpl canvas { display: block; width: 100%; height: auto; }
.tpl.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181, 69, 43, 0.25), 0 4px 10px rgba(60, 40, 20, 0.18); }
label { display: grid; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 400 16px/1.45 "Be Vietnam Pro", sans-serif; }
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181, 69, 43, 0.15); }
.msg { position: relative; }
.link { justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--accent-d); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.font { display: grid; justify-items: center; padding: 6px 2px 5px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.font span { font-size: 26px; line-height: 1.25; }
.font small { font: 600 11px "Be Vietnam Pro", sans-serif; color: var(--muted); font-style: normal; }
.font.on { border-color: var(--accent); background: #fff5ef; }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; max-height: 260px; overflow-y: auto; }
.stickers button { padding: 4px; border: 0; border-radius: 12px; background: none; transition: transform 0.12s, background 0.12s; }
.stickers button:hover { background: #f4ebde; transform: scale(1.08) rotate(-4deg); }
.stickers img { display: block; width: 100%; height: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.btn.main { border-color: var(--accent-d); background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-d); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.fine { max-width: 1160px; margin: 0 auto; padding: 8px 16px 28px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .desk { grid-template-columns: 1fr; gap: 16px; }
  .stage { position: static; }
  .card-wrap { max-width: 460px; }
}

/* ---------- receiver: openings, card entrance, effects ---------- */
body.viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; overflow: hidden; overflow: clip; background: #1c1410; perspective: 1400px; }
.v-bg { position: absolute; inset: 0; background: #3a2a20 0 0 / 420px; }
.v-bg::before { content: ""; position: absolute; inset: 0; background: rgba(18, 10, 6, 0.6); }
.v-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 45% at 50% 45%, rgba(255, 220, 160, 0.28), transparent 70%); }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; }
.falling { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.falling img { position: absolute; top: -60px; animation: fall linear infinite; opacity: 0.85; }
@keyframes fall { to { transform: translate(var(--drift), 112vh) rotate(320deg); } }
.flash { --fc: #fff; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(circle at 50% 45%, var(--fc) 0, color-mix(in srgb, var(--fc) 80%, transparent) 25%, transparent 65%); opacity: 0; }
.flash.on { animation: flash 0.7s ease-out; }
@keyframes flash { 10% { opacity: 1; } to { opacity: 0; } }
.v-top { position: absolute; top: max(14px, env(safe-area-inset-top)); z-index: 7; height: 42px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; background: rgba(20, 12, 8, 0.45); color: #fff; font-weight: 600; backdrop-filter: blur(6px); }
.v-close { left: 14px; }
.v-music { right: 14px; width: 42px; padding: 0; font-size: 18px; }

.intro { position: absolute; inset: 0; z-index: 3; touch-action: manipulation; transition: opacity 0.5s; }
.intro.done { opacity: 0; pointer-events: none; }
.intro-layer { position: absolute; inset: 0; perspective: 900px; }
.intro-text { position: absolute; left: 16px; right: 16px; bottom: max(9vh, 40px); display: grid; gap: 6px; text-align: center; color: #fff8ec; pointer-events: none; }
.intro-text b { font: italic 600 clamp(22px, 5vw, 30px)/1.3 "Playfair Display", serif; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55); }
.intro-text small { min-height: 1.4em; font-size: 16px; font-weight: 600; animation: blink 1.6s ease-in-out infinite; }
.ia { position: absolute; transform: translate(-50%, -50%); filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.4)); user-select: none; -webkit-user-select: none; cursor: pointer; will-change: transform; }
.ia.bob { animation: bob 2.4s ease-in-out infinite; }
.ia.sway { animation: sway 3s ease-in-out infinite; transform-origin: 50% 90%; }
.ia.beat { --g: 1; animation: beat 0.9s ease-in-out infinite; }
.ia.popped { animation: popped 0.2s ease-out forwards; pointer-events: none; }
.ia.bloom { animation: bloom 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.5) both; }
.ia.lantern { top: auto !important; bottom: -120px; animation: lantern linear infinite; filter: drop-shadow(0 0 18px rgba(255, 160, 60, 0.7)); }
.ia.moon { filter: drop-shadow(0 0 40px rgba(255, 230, 150, 0.6)); animation: bob 4s ease-in-out infinite; transition: filter 0.6s; }
.ia.moon.lit { filter: drop-shadow(0 0 90px rgba(255, 240, 180, 1)) brightness(1.15); }
@keyframes bob { 50% { transform: translate(-50%, calc(-50% - 16px)) rotate(3deg); } }
@keyframes sway { 0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); } 50% { transform: translate(-50%, -50%) rotate(3deg); } }
@keyframes beat { 0%, 100% { transform: translate(-50%, -50%) scale(var(--g)); } 15% { transform: translate(-50%, -50%) scale(calc(var(--g) * 1.14)); } 30% { transform: translate(-50%, -50%) scale(var(--g)); } 45% { transform: translate(-50%, -50%) scale(calc(var(--g) * 1.1)); } }
@keyframes popped { to { transform: translate(-50%, -50%) scale(1.7); opacity: 0; } }
@keyframes bloom { from { transform: translate(-50%, -50%) scale(0) rotate(-40deg); opacity: 0; } }
@keyframes lantern { from { transform: translate(-50%, 0) rotate(-3deg); } 50% { transform: translate(calc(-50% + 18px), -60vh) rotate(3deg); } to { transform: translate(-50%, -130vh) rotate(-3deg); } }
@keyframes blink { 50% { opacity: 0.45; } }
.sleigh { position: absolute; left: 0; top: 0; display: flex; align-items: flex-end; gap: 2px; pointer-events: none; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.45)); }
.sleigh img { width: var(--s); height: var(--s); }
.sleigh img:nth-child(3) { width: calc(var(--s) * 1.25); height: calc(var(--s) * 1.25); }
.sleigh .santa { position: absolute; right: calc(var(--s) * 0.18); bottom: calc(var(--s) * 0.55); width: calc(var(--s) * 0.85); height: calc(var(--s) * 0.85); }
.count { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); color: #fff6d8; font: italic 700 clamp(120px, 34vw, 220px)/1 "Playfair Display", serif; text-shadow: 0 0 40px rgba(255, 210, 120, 0.8), 0 8px 30px rgba(0, 0, 0, 0.5); pointer-events: none; }
.scene { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 64px 16px 20px; }
.tilt { transition: transform 0.25s ease-out; transform-style: preserve-3d; }
.card3d { position: relative; width: min(88vw, calc((100vh - 170px) * 0.8), 520px); aspect-ratio: 4 / 5; transform-style: preserve-3d; cursor: pointer; will-change: transform; }
.face { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); }
.back { display: grid; place-items: center; transform: rotateY(180deg); background: #efe6d6 0 0 / 300px; }
.back img { width: 40%; height: auto; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.3)); }
.view-actions { display: flex; gap: 8px; width: min(88vw, 520px); opacity: 0; transform: translateY(16px); transition: opacity 0.5s, transform 0.5s; pointer-events: none; }
.view-actions.on { opacity: 1; transform: none; pointer-events: auto; }
.view-actions .btn { flex: 1; min-height: 46px; padding: 0 10px; font-size: 14px; }
.view-actions .btn.main { flex: 1.5; }
.view-actions .btn:not(.main) { background: rgba(255, 250, 242, 0.92); }
.music span { display: flex; gap: 8px; }
.music select { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 400 15px "Be Vietnam Pro", sans-serif; }
.mini { padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; font-size: 13px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ia, .intro-text small { animation: none !important; } }
.sig { display: grid; gap: 4px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sig span { display: flex; justify-content: space-between; align-items: center; }
#sig-pad { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }

.qr-dlg { width: min(360px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: 20px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.qr-dlg::backdrop { background: rgba(30, 20, 12, 0.55); }
.qr-dlg h2 { margin: 0 0 12px; font: italic 600 22px/1.2 "Playfair Display", serif; }
.qr-box { padding: 10px; border-radius: 14px; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-dlg .btn { width: 100%; margin-top: 12px; }
.qr-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1e7d8; font-size: 20px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 14px; background: #2f241c; color: #fff; font-weight: 600; font-size: 14px; transform: translate(-50%, 140%); opacity: 0; transition: transform 0.25s, opacity 0.25s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .envelope img, .opened { animation: none; } }

/* ---------- yes/no question (Tỏ tình, Xin lỗi) ---------- */
.ask { display: grid; gap: 10px; justify-items: center; width: min(88vw, 520px); text-align: center; color: #fff8ec; animation: askin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.ask b { font: italic 600 clamp(22px, 5.5vw, 30px)/1.25 "Playfair Display", serif; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55); }
.ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ask-btns .btn { flex: 1; min-height: 50px; font-size: 17px; }
#ask-yes { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.07); } 40% { transform: scale(1); } 60% { transform: scale(1.05); } }
#ask-no.run { position: fixed; z-index: 9; flex: none; width: auto; min-width: 110px; transition: left 0.18s ease-out, top 0.18s ease-out; }
@keyframes askin { from { opacity: 0; transform: translateY(20px) scale(0.9); } }
#ask-yes { transform-origin: center; }

/* ---------- tool tabs and the action dock ---------- */
.tools { gap: 10px; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255, 250, 242, 0.7); border: 1px solid var(--line); }
.tabs button { padding: 10px 4px; border: 0; border-radius: 12px; background: none; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(80, 55, 30, 0.15); }
.block h2.sub { margin-top: 16px; font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qr-btn { width: 100%; min-height: 46px; margin-top: 4px; font-size: 15px; }
.dock { position: sticky; bottom: 12px; z-index: 5; display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 8px; padding: 8px; border-radius: 18px; background: rgba(255, 250, 242, 0.92); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(60, 40, 20, 0.18); backdrop-filter: blur(8px); }
.dock .btn { min-height: 48px; padding: 0 8px; font-size: 15px; }
.templates { overflow-x: auto; scrollbar-width: none; }
.tpl { flex: 0 0 104px; }
@media (max-width: 900px) {
  .top { padding-top: 12px; }
  .brand img { width: 34px; height: 34px; }
  .brand b { font-size: 22px; }
  .events { padding-bottom: 10px; }
  .card-wrap { max-width: min(400px, calc(46vh * 0.8)); }
  .hint#stage-hint { font-size: 12px; margin-top: 6px; }
  .desk { padding-bottom: 96px; }
  .dock { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .stickers { max-height: none; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .fine { padding-bottom: 100px; }
}
@media (max-width: 380px) { .two { grid-template-columns: 1fr; } .tabs button { font-size: 13px; } }
/* narrow phones: long option names and date pickers must never widen the page */
.desk > * { min-width: 0; }
input, textarea, select { min-width: 0; max-width: 100%; }
.music select { width: 0; }
input[type="datetime-local"] { display: block; width: 100%; -webkit-appearance: none; appearance: none; min-height: 46px; }
.tabs button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .desk { grid-template-columns: minmax(0, 1fr); } }
.tabs { display: flex; }
.tabs button { flex: 1 1 auto; padding: 10px 8px; }
.view-actions .btn { white-space: nowrap; }
.dock .btn { white-space: nowrap; }
@media (max-width: 360px) { .dock { gap: 6px; padding: 6px; } .dock .btn { font-size: 14px; padding: 0 6px; } }
#ask-no.run { white-space: nowrap; padding: 0 16px; }

/* ---------- occasion strip arrows, desktop sizing ---------- */
.ev-row { position: relative; max-width: 1160px; margin: 0 auto; }
.events { --fl: 0px; --fr: 0px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); }
.events.fade-l { --fl: 48px; }
.events.fade-r { --fr: 48px; }
.ev-arrow { position: absolute; top: 8px; z-index: 2; width: 40px; height: 40px; border: 1.5px solid var(--line); border-radius: 50%; background: #fff; font-size: 24px; line-height: 1; color: var(--ink); box-shadow: 0 4px 12px rgba(60, 40, 20, 0.18); }
.ev-arrow.l { left: 6px; }
.ev-arrow.r { right: 6px; }
.ev-arrow:hover { background: var(--paper); }
@media (hover: none) { .ev-arrow { display: none; } }
@media (min-width: 901px) {
  .top { padding-top: 14px; }
  .events { padding: 8px 16px 12px; }
  .desk { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
  /* the whole card always fits on a laptop screen */
  .card-wrap { max-width: min(560px, calc((100vh - 190px) * 0.8)); }
  .tools { position: sticky; top: 12px; }
  .stage .hint { margin-top: 8px; }
}
@media (min-width: 901px) and (max-height: 620px) { .card-wrap { max-width: 340px; } }

/* ---------- viewer effects: light rays, bokeh, gloss and glints on the card ---------- */
.viewer { --acc: #ffd27a; }
.bokeh { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.bokeh i { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 55%, #fff) 0, color-mix(in srgb, var(--acc) 35%, transparent) 40%, transparent 70%); animation: drift linear infinite alternate; }
@keyframes drift { to { transform: translate(var(--dx), var(--dy)) scale(1.25); } }
.rays { position: absolute; z-index: 2; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; left: 50%; top: 45%; pointer-events: none; opacity: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--acc) 30%, rgba(255, 244, 214, 0.42)) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.5) 22%, transparent 55%); mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.5) 22%, transparent 55%); }
.rays.on { animation: raysin 1.4s ease-out forwards, spin 40s linear infinite; }
@keyframes raysin { 0% { opacity: 0; scale: 0.3; } 35% { opacity: 1; scale: 1.05; } 100% { opacity: 0.75; scale: 1; } }
@keyframes spin { to { rotate: 360deg; } }
.gloss { --gx: 30%; --gy: 20%; z-index: 2; overflow: hidden; pointer-events: none; box-shadow: none; transform: translateZ(1px); opacity: 0; transition: opacity 0.8s; }
.gloss.on { opacity: 1; }
.gloss::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.3), transparent 45%); mix-blend-mode: soft-light; }
.gloss .sweep { position: absolute; top: -20%; bottom: -20%; left: 0; width: 38%; background: linear-gradient(100deg, transparent 0, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.08) 70%, transparent 100%); mix-blend-mode: overlay; transform: translateX(-120%) skewX(-12deg); }
.gloss.on .sweep { animation: sweep 5.5s ease-in-out 0.3s infinite; }
@keyframes sweep { 0% { transform: translateX(-120%) skewX(-12deg); } 30%, 100% { transform: translateX(330%) skewX(-12deg); } }
.glints i { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); background: radial-gradient(circle, #fff 0, #fff 18%, rgba(255, 255, 255, 0.6) 30%, transparent 62%); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: glint ease-in-out infinite; opacity: 0; }
@keyframes glint { 0%, 70%, 100% { opacity: 0; transform: scale(0.2) rotate(0); } 82% { opacity: 1; transform: scale(1) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .bokeh, .rays, .gloss .sweep, .glints { display: none; } }
