/* "Light up your house". The home page card holds six animated night scenes, one per look. Tapping one irises
   open into a full-screen story: the same scene fills the screen and the questions come one at a time. */

/* Entry tiles on the home page */
.ent-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
@media (min-width: 560px) { .ent-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ent-tile { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #0A1A31; color: #FFFFFF; font: inherit; text-align: left; isolation: isolate; transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.25), box-shadow 0.3s ease; }
.ent-tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ent-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); pointer-events: none; transition: box-shadow 0.3s ease; }
.ent-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px rgba(3, 8, 20, 0.7); }
.ent-tile:hover::after { box-shadow: inset 0 0 0 2px var(--gold); }
.ent-tile:active { transform: scale(0.97); }
.ent-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ent-cap { position: absolute; left: 7px; bottom: 7px; z-index: 1; max-width: calc(100% - 14px); padding: 0.3rem 0.6rem; border-radius: 9px; background: rgba(3, 9, 21, 0.66); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); font-weight: 700; font-size: 0.84rem; line-height: 1.2; pointer-events: none; }
.ent-cap small { display: block; font-weight: 500; font-size: 0.72rem; opacity: 0.85; }
.ent-resume { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem 0.9rem; margin-top: 0.85rem; padding: 0.75rem 0.85rem; border-radius: 12px; background: #FFF8E4; box-shadow: inset 0 0 0 1.5px var(--gold); font-size: 0.93rem; }
.ent-resume b { font-variant-numeric: tabular-nums; }
.ent-resume .btn { min-height: 44px; flex: 1 1 auto; font-size: 0.95rem; }

/* The story */
.jy { position: fixed; inset: 0; z-index: 100; background: #030915; color: var(--ink); overflow: hidden; --panel-w: 440px; --panel-gap: clamp(24px, 3.5vw, 56px); }
.jy[hidden] { display: none !important; }
.jy.opening { animation: jy-iris 0.9s cubic-bezier(0.7, 0, 0.2, 1) both; }
.jy.closing { animation: jy-iris-out 0.62s cubic-bezier(0.6, 0, 0.4, 1) both; }
@keyframes jy-iris { from { clip-path: circle(0px at var(--ox, 50%) var(--oy, 60%)); } to { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 60%)); } }
@keyframes jy-iris-out { from { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 60%)); } to { clip-path: circle(0px at var(--ox, 50%) var(--oy, 60%)); } }
html.jy-open, html.jy-open body { overflow: hidden; }

.jy-stage { position: absolute; inset: 0; }
.jy-scene, .jy-photo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.jy-photo { opacity: 0; pointer-events: none; transition: opacity 0.7s ease; touch-action: manipulation; cursor: crosshair; }
.jy.photo-mode .jy-photo { opacity: 1; pointer-events: auto; }
.jy-stage::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 130px; background: linear-gradient(180deg, rgba(2, 6, 15, 0.6), rgba(2, 6, 15, 0)); pointer-events: none; }

.jy-top { position: absolute; z-index: 3; top: env(safe-area-inset-top, 0px); left: 0; right: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; color: #EAF1F7; }
.jy-prog { display: grid; justify-items: center; gap: 0.35rem; min-width: 0; }
.jy-strand { display: flex; gap: 9px; align-items: center; height: 18px; }
.jy-strand i { width: 11px; height: 15px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: rgba(255, 255, 255, 0.2); position: relative; transition: background-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s cubic-bezier(0.3, 1.8, 0.5, 1); }
.jy-strand i::before { content: ""; position: absolute; left: 2.5px; top: -4px; width: 6px; height: 5px; border-radius: 1px; background: rgba(255, 255, 255, 0.35); }
.jy-strand i.on { transform: scale(1.12); }
.jy-strand i.on:nth-child(6n + 1) { background: #FFC94D; box-shadow: 0 0 12px 3px rgba(255, 201, 77, 0.75); }
.jy-strand i.on:nth-child(6n + 2) { background: #F0544B; box-shadow: 0 0 12px 3px rgba(240, 84, 75, 0.7); }
.jy-strand i.on:nth-child(6n + 3) { background: #46C77E; box-shadow: 0 0 12px 3px rgba(70, 199, 126, 0.7); }
.jy-strand i.on:nth-child(6n + 4) { background: #7DBBFF; box-shadow: 0 0 12px 3px rgba(125, 187, 255, 0.7); }
.jy-strand i.on:nth-child(6n + 5) { background: #FFF1D6; box-shadow: 0 0 12px 3px rgba(255, 241, 214, 0.7); }
.jy-strand i.on:nth-child(6n + 6) { background: #FFC94D; box-shadow: 0 0 12px 3px rgba(255, 201, 77, 0.75); }
.jy-chapter { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jy-close, .jy-back { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(3, 9, 21, 0.45); color: #FFFFFF; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background-color 0.2s ease; }
.jy-close:hover, .jy-back:hover { background: rgba(3, 9, 21, 0.75); }
.jy-close { justify-self: end; }
.jy .jy-back { justify-self: start; width: auto; height: 42px; padding: 0 0.95rem 0 0.6rem; gap: 0.3rem; display: inline-flex; align-items: center; border-radius: 999px; font: 700 0.9rem/1 var(--body); background: rgba(3, 9, 21, 0.55); border-color: rgba(255, 255, 255, 0.4); }
.jy .jy-back svg { width: 18px; height: 18px; }
.jy-krow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.jy-pback { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.35rem 0.75rem 0.35rem 0.45rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: 700 0.84rem/1 var(--body); cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease; }
.jy-pback:hover { border-color: var(--pine-3); background: var(--snow); }
.jy-pback svg { width: 16px; height: 16px; }
.jy-close svg, .jy-back svg { width: 18px; height: 18px; }
.jy .jy-back[hidden] { display: inline-flex !important; visibility: hidden; }

.jy-est { position: absolute; z-index: 3; left: 50%; translate: -50% 0; top: calc(env(safe-area-inset-top, 0px) + 4.6rem); margin: 0; padding: 0.42rem 0.85rem; border-radius: 999px; background: rgba(3, 9, 21, 0.6); color: #FFFFFF; font-size: 0.86rem; font-weight: 700; white-space: nowrap; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.35); font-variant-numeric: tabular-nums; transition: opacity 0.4s ease; }
.jy-est b { color: #FFD27A; }
.jy-est.bump { animation: jy-bump 0.55s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes jy-bump { 45% { scale: 1.09; } }
.jy .jy-est[hidden] { display: block !important; opacity: 0; pointer-events: none; }

.jy-panel { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; top: calc(52svh - 22px); background: var(--paper); border-radius: 22px 22px 0 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.4rem 1.25rem calc(1.6rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -18px 50px -20px rgba(0, 0, 0, 0.6); }
.jy-panel::before { content: ""; position: absolute; left: 50%; top: 8px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line); }
@media (max-height: 640px) { .jy-panel { top: calc(46svh - 22px); } }
.jy.opening .jy-panel { animation: jy-sheet 0.9s 0.35s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes jy-sheet { from { transform: translateY(104%); } }
.jy.opening .jy-top, .jy.opening .jy-est { animation: jy-fade-in 0.7s 0.5s ease both; }
@keyframes jy-fade-in { from { opacity: 0; } }

@media (min-width: 900px) {
  .jy-top { padding: 1.1rem 1.5rem; grid-template-columns: auto minmax(0, 1fr) auto; }
  .jy-prog { justify-items: start; padding-left: 0.4rem; }
  .jy-panel { top: 96px; bottom: auto; left: auto; right: var(--panel-gap); width: var(--panel-w); max-height: calc(100vh - 128px); border-radius: 22px; padding: 1.8rem 1.75rem 1.6rem; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.75); }
  .jy-panel::before { display: none; }
  .jy.opening .jy-panel { animation-name: jy-card; }
  .jy-est { left: calc((100% - var(--panel-w) - var(--panel-gap)) / 2); top: 1.35rem; font-size: 0.95rem; }
}
@keyframes jy-card { from { opacity: 0; transform: translateX(56px); } }

/* chapter content */
.jy-ch { display: grid; gap: 0.9rem; }
.jy-ch > * { animation: jy-rise 0.6s cubic-bezier(0.2, 0.85, 0.25, 1) both; }
.jy-ch > *:nth-child(2) { animation-delay: 0.06s; }
.jy-ch > *:nth-child(3) { animation-delay: 0.12s; }
.jy-ch > *:nth-child(4) { animation-delay: 0.18s; }
.jy-ch > *:nth-child(5) { animation-delay: 0.24s; }
.jy-ch > *:nth-child(6) { animation-delay: 0.3s; }
.jy-ch > *:nth-child(n + 7) { animation-delay: 0.34s; }
.jy-ch.leaving > * { animation: jy-leave 0.24s ease both; }
@keyframes jy-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes jy-leave { to { opacity: 0; transform: translateY(-10px); } }
.jy-kicker { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cranberry); margin: 0; }
.jy-title { font: 400 clamp(1.6rem, 1.2vw + 1.25rem, 2.05rem)/1.1 var(--display); margin: 0; text-wrap: balance; }
.jy-title:focus { outline: none; }
.jy-lede { color: var(--slate); font-size: 1rem; margin: 0; }
.jy-actions { display: grid; gap: 0.6rem; margin-top: 0.2rem; }
.jy-actions .btn { width: 100%; }
.jy-actions .btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; filter: saturate(0.4); }
.jy-link { background: none; border: 0; padding: 0.35rem 0; font: 600 0.95rem/1.2 var(--body); color: var(--pine-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: center; }
.jy-fine { font-size: 0.84rem; color: var(--slate); text-align: center; margin: 0; }

.jy-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.jy-size { display: grid; gap: 0.12rem; align-content: start; text-align: left; padding: 0.7rem 0.8rem; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font: 500 0.82rem/1.3 var(--body); color: var(--slate); transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease; }
.jy-size:hover { border-color: var(--pine-3); }
.jy-size:active { transform: scale(0.97); }
.jy-size svg { height: 26px; width: auto; justify-self: start; fill: var(--pine-3); margin-bottom: 0.2rem; }
.jy-size b { font-size: 1rem; color: var(--ink); }
.jy-size em { font-style: normal; font-weight: 700; color: var(--pine-3); font-variant-numeric: tabular-nums; margin-top: 0.1rem; }
.jy-size[aria-pressed="true"] { border-color: var(--gold); background: #FFF8E4; }
.jy-size[aria-pressed="true"] svg { fill: var(--cranberry); }
.jy-exact { font-size: 0.92rem; }
.jy-exact summary { cursor: pointer; font-weight: 700; color: var(--pine-3); }
.jy-exact .jy-exact-in { display: grid; gap: 0.35rem; margin-top: 0.55rem; }
.jy-exact output { font: 400 1.35rem/1 var(--display); font-variant-numeric: tabular-nums; }
.jy-exact ol { margin: 0.2rem 0 0.3rem; padding-left: 1.15rem; color: var(--slate); display: grid; gap: 0.2rem; }
.jy-opt { font-weight: 500; color: var(--slate); }

.jy-lookrow { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.jy-lookrow .lab { font-weight: 700; font-size: 0.92rem; }
.jy-lookrow .lab small { display: block; font-weight: 500; color: var(--slate); font-size: 0.84rem; }
.jy-sws { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.jy-sw { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: #0B1A31; cursor: pointer; padding: 0; transition: border-color 0.2s ease, transform 0.2s ease; }
.jy-sw:hover { transform: translateY(-1px); }
.jy-sw[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(247, 183, 51, 0.35); }
.jy-sw i { width: 6px; height: 8px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; box-shadow: 0 0 6px 1px currentColor; }

.jy-rows { display: grid; }
.jy-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.jy-row:first-child { border-top: 0; padding-top: 0.2rem; }
.jy-row .lab { font-weight: 700; }
.jy-row .lab small { display: block; font-weight: 500; color: var(--slate); font-size: 0.84rem; }
.jy-step { display: flex; align-items: center; gap: 0.55rem; flex: none; }
.jy-step button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); font: 600 1.35rem/1 var(--body); color: var(--ink); cursor: pointer; transition: border-color 0.2s ease, transform 0.15s ease, background-color 0.2s ease; }
.jy-step button:hover { border-color: var(--pine-3); }
.jy-step button:active { transform: scale(0.9); background: #FFF8E4; }
.jy-step output { min-width: 2ch; text-align: center; font: 400 1.45rem/1 var(--display); font-variant-numeric: tabular-nums; }
.jy-row .lab small.jy-delta { color: var(--pine-3); font-weight: 700; font-variant-numeric: tabular-nums; }

.jy-whens { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.jy-when { min-height: 54px; padding: 0.55rem 0.8rem; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font: 600 0.94rem/1.2 var(--body); color: var(--ink); text-align: left; transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease; }
.jy-when:hover { border-color: var(--pine-3); }
.jy-when:active { transform: scale(0.97); }
.jy-when[aria-pressed="true"] { border-color: var(--gold); background: #FFF8E4; }

.jy-price { font: 400 clamp(2.3rem, 2.6vw + 1.7rem, 3.05rem)/1 var(--display); font-variant-numeric: tabular-nums; margin: 0; letter-spacing: -0.01em; }
.jy-price-sm { font-size: 2rem; }
.jy-recap { margin: -0.3rem 0 0; color: var(--slate); font-size: 0.95rem; }
.jy-items, .jy-pay { list-style: none; margin: 0; padding: 0; display: grid; font-size: 0.92rem; }
.jy-items li, .jy-pay li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.42rem 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.jy-items li:first-child, .jy-pay li:first-child { border-top: 0; }
.jy-items li span:first-child, .jy-pay li span:first-child { color: var(--slate); }
.jy-items li span:last-child, .jy-pay li span:last-child { text-align: right; }
.jy-incl { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.jy-incl span { font-size: 0.8rem; font-weight: 700; padding: 0.3rem 0.6rem; border-radius: 999px; background: #EAF4EE; color: var(--pine-3); }
.jy-box { border-radius: 14px; background: var(--snow); padding: 0.75rem 0.9rem; }
.jy-box h3 { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); margin: 0 0 0.3rem; }
.jy-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.jy-two .btn { min-height: 48px; padding: 0 0.6rem; font-size: 0.92rem; }

.jy-fields { display: grid; gap: 0.75rem; }
.jy-fields .btn { width: 100%; }
.jy-soft { display: grid; gap: 0.55rem; padding: 0.85rem; border-radius: 14px; background: var(--snow); }
.jy-or { display: flex; align-items: center; gap: 0.6rem; color: var(--slate); font-size: 0.82rem; font-weight: 700; margin: 0; }
.jy-or::before, .jy-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.jy-upload { position: relative; display: grid; place-items: center; gap: 0.3rem; padding: 1.3rem; border-radius: 16px; border: 2px dashed var(--line); background: var(--snow); text-align: center; cursor: pointer; font-weight: 700; transition: border-color 0.2s ease; }
.jy-upload:hover { border-color: var(--pine-3); }
.jy-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.jy-upload:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.jy-upload svg { width: 30px; height: 30px; color: var(--pine-3); }
.jy-upload small { color: var(--slate); font-weight: 500; }
.jy-tip { position: absolute; z-index: 3; left: 50%; translate: -50% 0; top: calc(env(safe-area-inset-top, 0px) + 4.6rem); margin: 0; padding: 0.45rem 0.85rem; border-radius: 999px; background: rgba(3, 9, 21, 0.78); color: #FFFFFF; font-size: 0.86rem; font-weight: 700; white-space: nowrap; pointer-events: none; transition: opacity 0.3s ease; }
.jy .jy-tip[hidden] { display: block !important; opacity: 0; }
@media (min-width: 900px) { .jy-tip { left: calc((100% - var(--panel-w) - var(--panel-gap)) / 2); top: 1.35rem; } }
.jy-note { display: flex; gap: 0.7rem; align-items: center; padding: 0.75rem; border-radius: 14px; background: var(--snow); font-size: 0.92rem; }
.jy-note .faces { display: flex; flex: none; }
.jy-note .faces img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--paper); }
.jy-note .faces img + img { margin-left: -10px; }
.jy-next { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.3rem; color: var(--slate); }

@media (prefers-reduced-motion: reduce) {
  .jy.opening, .jy.closing, .jy.opening .jy-panel, .jy.opening .jy-top, .jy.opening .jy-est { animation: none; }
  .jy-ch > *, .jy-ch.leaving > * { animation: none; }
  .ent-tile, .ent-tile:hover { transition: none; transform: none; }
}
