/* P1 polish (2026-10-27). Scoped to html[data-polish]; ?polish=0 restores the previous FX v3 look, ?fx=v2 the original.
   Local fonts only (CSP font-src 'self'). Card art and the approved result frame are untouched. */
@font-face{font-family:'P1 Mincho';src:url(../assets/fonts/hero/ShipporiMincho-SemiBold.woff) format('woff');font-weight:400 700;font-display:swap}
@font-face{font-family:'P1 Zen';src:url(../assets/fonts/hero/ZenOldMincho-SemiBold.woff) format('woff');font-weight:400 700;font-display:swap}
@font-face{font-family:'P1 Cormorant';src:url(../assets/fonts/hero/CormorantGaramond-VF.woff) format('woff');font-weight:300 700;font-display:swap}
html[data-polish]{--p1-serif:'P1 Mincho','P1 Zen','Noto Serif CJK JP','Yu Mincho','Hiragino Mincho ProN',serif;--p1-latin:'P1 Cormorant','P1 Mincho',serif;--p1-gold:#d9bf86;--p1-gold-hi:#f3e2b8;--p1-gold-lo:#8d7648;--p1-ink:#efe6d2;--p1-mute:#a39478;--p1-ease:cubic-bezier(.2,.7,.2,1)}
html[data-polish] body{font-family:var(--p1-serif);background:radial-gradient(130% 70% at 50% 0%,#1d150b 0%,#0a0805 50%,#030302 100%) fixed;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
/* soften grain/vignette a touch: depth, not dirt */
html[data-polish][data-fx=v3] body::before{opacity:.04}
html[data-polish][data-fx=v3] body::after{background:radial-gradient(ellipse at 50% 42%,transparent 58%,#000000b3 100%)}

/* ---------- ambient gold dust (canvas, non-interactive) ---------- */
.p1-dust{position:fixed;inset:0;width:100%;height:100%;z-index:28;pointer-events:none;opacity:0;transition:opacity 1.6s ease}
.p1-dust[data-on="1"]{opacity:1}

/* ---------- TOP PAGE ---------- */
html[data-polish] .entry-stage{background:linear-gradient(180deg,#020202 0,#050403 55%,#0a0704 100%)}
html[data-polish] .entry-art img{transform-origin:50% 38%;animation:p1-art-in 2.4s var(--p1-ease) both,p1-art-drift 28s ease-in-out 2.4s infinite alternate;will-change:transform}
html[data-polish] .entry-art::after{background:linear-gradient(to bottom,transparent 76%,#050403d9 93%,#070504 100%)}
@keyframes p1-art-in{from{opacity:0;transform:scale(1.08)}to{opacity:1;transform:scale(1)}}
@keyframes p1-art-drift{from{transform:scale(1)}to{transform:scale(1.045) translateY(-.8%)}}
html[data-polish] .fortune-form{position:relative;padding-inline:8cqw}
/* staggered, unhurried entrance */
html[data-polish] .intro-cue,html[data-polish] .fortune-form>*{animation:p1-rise 1.1s var(--p1-ease) both}
html[data-polish] .intro-cue{animation-delay:.9s}
html[data-polish] .fortune-form>:nth-child(1){animation-delay:1.1s}
html[data-polish] .fortune-form>:nth-child(2){animation-delay:1.25s}
html[data-polish] .fortune-form>:nth-child(3){animation-delay:1.4s}
html[data-polish] .fortune-form>:nth-child(4){animation-delay:1.5s}
html[data-polish] .fortune-form>:nth-child(5){animation-delay:1.6s}
html[data-polish] .fortune-form>:nth-child(6){animation-delay:1.7s}
html[data-polish] .fortune-form>:nth-child(n+7){animation-delay:1.8s}
@keyframes p1-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
/* cue: hairline + falling light */
html[data-polish] .intro-cue{flex-direction:column;align-items:center;margin:-10px 0 4px}
html[data-polish] .intro-cue-button{font:600 13.5px/1.8 var(--p1-serif)!important;letter-spacing:.38em!important;color:var(--p1-gold-hi)!important;padding:8px 0 8px .38em!important;border:0!important;text-shadow:0 0 18px #c9a96255;background:transparent!important}
html[data-polish] .intro-cue-button::after{content:''!important;display:block;width:1px;height:30px;margin:10px auto 0;background:linear-gradient(to bottom,#e7cf98,transparent);transform-origin:top;animation:p1-fall 2.6s var(--p1-ease) 2.2s infinite}
@keyframes p1-fall{0%{transform:scaleY(0);opacity:0}30%{opacity:1}70%{transform:scaleY(1);opacity:1}100%{transform:scaleY(1);opacity:0}}
/* notice: centered prose between ornamental rules */
html[data-polish] .fortune-form .integration-notice{font:400 13px/2.15 var(--p1-serif);letter-spacing:.14em;color:#d3c4a2;border:0;background:none;padding:26px 0 22px;margin:0 0 6px;position:relative}
html[data-polish] .fortune-form .integration-notice::before{content:'';display:block;width:100%;height:9px;margin:0 auto 20px;background:linear-gradient(90deg,transparent,#a88f5a 30%,#a88f5a 46%,transparent 46%,transparent 54%,#a88f5a 54%,#a88f5a 70%,transparent) center/100% 1px no-repeat;position:relative}
html[data-polish] .fortune-form .integration-notice::after{content:'';position:absolute;left:50%;top:26px;width:7px;height:7px;margin-left:-3.5px;border:1px solid #cdb27a;transform:rotate(45deg);background:#0b0805}
html[data-polish] .form-row{margin:0 0 20px}
html[data-polish] .form-row label{font:600 11.5px/1.6 var(--p1-serif);letter-spacing:.36em;color:#b9a06a;margin:0 0 9px;padding-left:2px}
html[data-polish] .fortune-form input[type=text],html[data-polish] #birth-date{height:56px;min-height:56px;padding:0 16px;border:1px solid #3a2f1c;border-bottom:1px solid #8d7648;border-radius:2px;background:linear-gradient(180deg,#17120a,#0d0a06);box-shadow:inset 0 1px 0 #ffffff0a,inset 0 -18px 28px #00000040;color:var(--p1-ink);font-family:var(--p1-serif);font-size:18px;letter-spacing:.1em;transition:border-color .5s,box-shadow .5s,background .5s}
html[data-polish] #birth-date{font-family:var(--p1-latin);font-weight:500;font-size:23px;letter-spacing:.14em;font-variant-numeric:lining-nums;padding-inline:16px}
html[data-polish] .date-wrap:not(.has-value) input:not(:focus){color:transparent}
html[data-polish] .date-placeholder{font-family:var(--p1-latin);font-size:23px;letter-spacing:.14em;left:16px;color:#6f6451}
html[data-polish] input::placeholder{color:#6f6451;letter-spacing:.12em}
html[data-polish] .fortune-form input:focus{outline:0;border-color:#c9ad73;border-bottom-color:#f0d89c;box-shadow:inset 0 1px 0 #ffffff12,0 0 0 1px #e9d29a40,0 8px 30px -8px #c9a96240;background:linear-gradient(180deg,#1d1710,#0f0b07)}
/* flash note + toggles */
html[data-polish] .flash-note{font:400 11px/1.9 var(--p1-serif);letter-spacing:.12em;color:#8f846c;text-align:center;margin:6px 0 4px}
html[data-polish] .skip-option{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:14px;min-height:50px;margin:0;padding:0 2px;font:500 13.5px/1.4 var(--p1-serif);letter-spacing:.16em;color:#d3c6a6;border-top:1px solid #2a2216}
html[data-polish] .skip-option+.skip-option{border-bottom:1px solid #2a2216}
html[data-polish] .skip-option input{appearance:none;-webkit-appearance:none;flex:none;position:relative;width:42px;height:24px;margin:0;border-radius:12px;border:1px solid #6b5a38;background:#0b0805;accent-color:auto;cursor:pointer;transition:background .45s,border-color .45s,box-shadow .45s}
html[data-polish] .skip-option input::before{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#8d7d5c;transition:transform .45s var(--p1-ease),background .45s,box-shadow .45s}
html[data-polish] .skip-option input:checked{background:linear-gradient(180deg,#4a3a1b,#2b2110);border-color:#cdb27a;box-shadow:0 0 14px -2px #c9a96255}
html[data-polish] .skip-option input:checked::before{transform:translateX(18px);background:linear-gradient(180deg,#fff0c8,#d8b972);box-shadow:0 0 8px #e9d29a88}
html[data-polish] .skip-option input:focus-visible{outline:2px solid #fff1ce;outline-offset:3px}
/* main button */
html[data-polish] .fortune-form .primary-button{position:relative;overflow:hidden;height:62px;margin-top:26px;border:1px solid #b99b5e;border-radius:2px;background:linear-gradient(180deg,#3b2d15 0%,#1c140a 100%);color:var(--p1-gold-hi);font:600 18px/1 var(--p1-serif);letter-spacing:.5em;padding-left:.5em;box-shadow:inset 0 0 0 3px #120d06,inset 0 0 0 4px #b99b5e55,0 14px 36px -14px #000,0 0 32px -10px #c9a96244;text-shadow:0 0 14px #e9c97a66;transition:box-shadow .5s,color .5s,transform .3s}
html[data-polish] .fortune-form .primary-button::before{content:'';position:absolute;top:0;bottom:0;left:-40%;width:30%;background:linear-gradient(100deg,transparent,#fff1c855,transparent);transform:skewX(-18deg);animation:p1-shine 7s ease-in-out 3s infinite}
@keyframes p1-shine{0%,70%{left:-40%}100%{left:130%}}
html[data-polish] .fortune-form .primary-button:hover{color:#fff;box-shadow:inset 0 0 0 3px #120d06,inset 0 0 0 4px #e8cc8a,0 14px 36px -14px #000,0 0 40px -6px #c9a96266}
html[data-polish] .fortune-form .primary-button:active{transform:scale(.992)}
html[data-polish] .profile-memory-tools{justify-content:center;margin-top:10px}
html[data-polish] .profile-memory-tools button{font:400 11.5px/1.6 var(--p1-serif);letter-spacing:.2em;color:#8f846c;text-decoration:underline;text-decoration-color:#8f846c55;text-underline-offset:5px}
html[data-polish] .form-error{font-family:var(--p1-serif);letter-spacing:.06em;text-align:center}
html[data-polish] .review-footer{background:none;font:400 11px/2.1 var(--p1-serif);letter-spacing:.14em;color:#756b58;padding:30px 8cqw 44px;border-top:0;position:relative}
html[data-polish] .review-footer::before{content:'';display:block;width:42px;height:1px;margin:0 auto 24px;background:#6b5a38}

/* ---------- INTRO (the 7s clip) ---------- */
html[data-polish] .presentation-stage{background:#000}
html[data-polish] .presentation-stage::after{inset:0;border:0;outline:0;background:linear-gradient(to bottom,#000000d9 0,transparent 16%,transparent 46%,#000000a8 74%,#000000f5 100%)}
html[data-polish] .presentation-stage[data-mode=result]::after{display:none}
html[data-polish] .presentation-stage video{filter:contrast(1.08) saturate(.9) sepia(.1) brightness(.96)}
html[data-polish] .p1-progress{position:fixed;left:0;right:0;top:0;height:2px;z-index:31;pointer-events:none;background:#ffffff0d;opacity:0;transition:opacity .8s}
html[data-polish] .p1-progress::before{content:'';position:absolute;inset:0;transform-origin:0 50%;transform:scaleX(var(--p1-p,0));background:linear-gradient(90deg,#8d7648,#f3e2b8);box-shadow:0 0 12px #e9c97a}
body[data-integration-state=playing] .p1-progress{opacity:1}
/* ritual lines */
html[data-polish] .intro-ritual{top:61%!important;max-width:92%;font:600 17px/1.9 var(--p1-serif)!important;letter-spacing:.46em!important;padding:6px 0 6px .46em!important;color:var(--p1-gold-hi)!important;text-shadow:0 0 22px #000,0 0 4px #000,0 0 34px #d9a95377!important;filter:blur(7px);transition:opacity 1s ease,filter 1.1s ease,letter-spacing 1.8s var(--p1-ease)!important}
html[data-polish] .intro-ritual[data-on="1"]{filter:blur(0);letter-spacing:.56em!important}
html[data-polish] .intro-ritual::before,html[data-polish] .intro-ritual::after{width:44%;margin:10px auto;transform:scaleX(0);transition:transform 1.4s var(--p1-ease)}
html[data-polish] .intro-ritual[data-on="1"]::before,html[data-polish] .intro-ritual[data-on="1"]::after{transform:scaleX(1)}
/* controls: no heavy panel, a quiet caption + three discreet links */
html[data-polish] .motion-controls{display:flex!important;flex-wrap:wrap;justify-content:center;align-items:center;gap:0 22px;background:none!important;padding:0 18px calc(14px + env(safe-area-inset-bottom))!important;font-family:var(--p1-serif)}
html[data-polish] .motion-controls>p{width:100%;text-align:center;margin:0}
html[data-polish] .motion-controls #motion-status{font:500 11px/2 var(--p1-serif);letter-spacing:.4em;color:var(--p1-gold);text-shadow:0 0 12px #000}
html[data-polish] .motion-controls .flash-note{font:400 10px/1.8 var(--p1-serif);letter-spacing:.12em;color:#8a7f69;margin:0 0 6px}
html[data-polish] .motion-controls .secondary-button,html[data-polish] .motion-controls .text-button{width:auto;min-height:44px;margin:0;padding:6px 2px;border:0;background:none;border-radius:0;font:500 12px/1.6 var(--p1-serif);letter-spacing:.24em;color:#b6a47a;text-decoration:none;position:relative}
html[data-polish] .motion-controls .secondary-button::after,html[data-polish] .motion-controls .text-button::after{content:'';position:absolute;left:2px;right:2px;bottom:8px;height:1px;background:#b6a47a66}
html[data-polish] .motion-controls .secondary-button:hover,html[data-polish] .motion-controls .text-button:hover{color:#fff1ce;background:none}
html[data-polish] .motion-controls .primary-button{width:100%;max-width:320px;margin:6px 0 8px;min-height:50px;border-radius:2px;border:1px solid #b99b5e;background:linear-gradient(180deg,#3b2d15,#1c140a);font:600 15px/1 var(--p1-serif);letter-spacing:.3em}
html[data-polish] .motion-controls .intro-mute{display:inline-flex;align-items:center}

/* ---------- REVEAL: the card rises out of warm light ---------- */
html[data-polish] #motion-white{background:radial-gradient(circle at 50% 44%,#fff6df 0%,#f1d392 26%,#9a7432 58%,#0a0703 100%)!important}
/* halo + slow rays over the card while it settles (screen blend = light, not a layer of paint) */
html[data-polish] .presentation-stage[data-fx-reveal]::before{content:'';position:absolute;inset:-10% -30%;z-index:4;pointer-events:none;opacity:var(--fx-h,0);mix-blend-mode:screen;background:radial-gradient(circle at 50% 38%,#ffe9b8dd 0,#f0c97866 22%,transparent 58%),conic-gradient(from calc(var(--fx-r,0)*1deg) at 50% 38%,transparent 0 6%,#ffe2a044 8% 10%,transparent 12% 20%,#ffe2a033 22% 23%,transparent 25% 38%,#ffe2a044 40% 42%,transparent 44% 60%,#ffe2a033 62% 63.5%,transparent 66% 80%,#ffe2a044 82% 84%,transparent 86%);-webkit-mask-image:radial-gradient(circle at 50% 38%,#000 0,#000 30%,transparent 70%);mask-image:radial-gradient(circle at 50% 38%,#000 0,#000 30%,transparent 70%)}

/* the controls step aside while the card is revealed */
html[data-polish] .motion-controls{transition:opacity .9s ease}
html[data-polish] body[data-p1-reveal] .motion-controls{opacity:0;pointer-events:none}
html[data-polish] body[data-p1-reveal] .p1-progress{opacity:0}
html[data-polish] .motion-controls[hidden]{display:none!important}
html[data-polish] .date-wrap:not(.has-value) input:not(:focus)::-webkit-datetime-edit,html[data-polish] .date-wrap:not(.has-value) input:not(:focus)::-webkit-datetime-edit-fields-wrapper{opacity:0}
html[data-polish] .date-wrap:not(.has-value) input:not(:focus)::-webkit-calendar-picker-indicator{opacity:.5}
html[data-polish] .presentation-stage::after{transition:opacity 1.4s ease .2s}
html[data-polish] body[data-p1-reveal] .presentation-stage::after{opacity:0}
