/* The Celestial product page. Brand tokens and nav/footer come from site.css. */

@property --x { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --y { syntax: '<percentage>'; inherits: true; initial-value: 49%; }
@property --r { syntax: '<length>'; inherits: true; initial-value: 2000px; }

/* ================= Scroll story ================= */
.story { position: relative; }

.stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 4vw;
    max-width: 1280px;
    margin: 0 auto;
    padding: 60px 5vw 0;
    overflow: hidden;
}

.panels { position: relative; min-height: 360px; z-index: 2; }

.panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.panel.on { opacity: 1; transform: none; pointer-events: auto; }

.panel h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.95;
    background: linear-gradient(180deg, #fff, #9a9a9f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 22px;
}

.panel h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 18px; }
.panel p { color: #b9b9be; font-size: 1.1rem; line-height: 1.55; max-width: 38ch; }
.panel .lede { font-size: clamp(1.15rem, 2vw, 1.4rem); color: #d4d4d8; }
.panel .time { color: #fff; font-variant-numeric: tabular-nums; }
.panel .fine { margin-top: 18px; font-size: 0.8rem; color: var(--muted); }

.scroll-hint {
    margin-top: 48px;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.scroll-hint::before {
    content: "";
    width: 1px;
    height: 34px;
    background: linear-gradient(var(--gold), transparent);
    animation: drip 2.2s ease-in-out infinite;
    transform-origin: top;
}

@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.stone-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 0 24px var(--glow, transparent); flex: none; }
.count { color: var(--gold); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; }

.facts { display: flex; gap: 28px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.facts div { font-size: 0.95rem; color: #fff; }
.facts span { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 4px; }

.dial-wrap { position: relative; display: flex; justify-content: center; align-items: center; }

.orbit-field {
    position: absolute;
    width: 150%;
    aspect-ratio: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 0;
}

.orbit-field ellipse { fill: none; stroke: rgba(197, 160, 89, 0.22); stroke-width: 1; }
.orbit-field .planet { fill: #f3dfb0; filter: drop-shadow(0 0 6px rgba(243, 223, 176, 0.9)); }

.glow {
    position: absolute;
    width: 90%;
    aspect-ratio: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accent-glow), transparent 62%);
    pointer-events: none;
}

.dial { position: relative; z-index: 1; width: min(80vh, 100%); aspect-ratio: 1; transform-origin: 49.66% 48.83%; will-change: transform; }

.face, .hero { position: absolute; inset: 0; will-change: transform, opacity; transform-origin: 49.66% 48.83%; }
.face img, .face svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.face img {
    -webkit-mask-image: radial-gradient(circle at 49.7% 48.8%, #000 45%, transparent 70%);
    mask-image: radial-gradient(circle at 49.7% 48.8%, #000 45%, transparent 70%);
}

.hero img {
    position: absolute;
    inset: -6% 0;
    width: 100%;
    height: 112%;
    object-fit: contain;
    filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.8));
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%);
}

.spot {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at var(--x) var(--y), transparent 0 var(--r), rgba(3, 6, 14, 0.62) calc(var(--r) + 30px));
    transition: --x 0.6s cubic-bezier(.6,0,.2,1), --y 0.6s cubic-bezier(.6,0,.2,1), --r 0.6s cubic-bezier(.6,0,.2,1);
}

.hands { transition: opacity 0.5s ease; }
.hands.dim { opacity: 0.1; }
.orbit { fill: none; stroke: var(--gold); stroke-width: 1.6; filter: drop-shadow(0 0 3px rgba(197,160,89,.95)); }
.marker { opacity: 0; transition: opacity 0.35s ease; }
.marker.on { opacity: 1; }
.marker circle.ring { fill: none; stroke: var(--gold); stroke-width: 1.8; }
.marker circle.pulse { fill: none; stroke: var(--gold); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.hit { fill: transparent; cursor: pointer; }
.hit:focus-visible { outline: none; stroke: #fff; stroke-width: 2; }

/* ================= Shared section rhythm ================= */
.block { padding: 140px 0; position: relative; }
.fine-print { margin-top: 28px; font-size: 0.82rem; color: var(--muted); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ================= Details ================= */
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 56px; }
.detail { transition-delay: calc(var(--i, 0) * 90ms); }
.detail-img {
    aspect-ratio: 4 / 5;
    border-radius: 22px;
    background-image: url("/assets/celestial/dial-live-1800.webp");
    background-repeat: no-repeat;
    border: 1px solid var(--line);
    margin-bottom: 18px;
    transition: background-size 1.2s cubic-bezier(.2,.7,.2,1);
}
.detail:hover .detail-img { filter: brightness(1.1); }
.detail h3 { font-size: 1.15rem; margin-bottom: 6px; }
.detail p { color: #a1a1a6; font-size: 0.95rem; line-height: 1.5; }

/* ================= Movements ================= */
.caliber-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 56px; align-items: start; }

.caliber {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 40px;
}

#caliber-automatic { box-shadow: inset 0 1px 0 rgba(197,160,89,0.35); }
#caliber-quartz { box-shadow: inset 0 1px 0 rgba(120,160,230,0.35); }

.caliber-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.caliber-type { color: var(--gold); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.75rem; font-weight: 600; margin-bottom: 8px; }
#caliber-quartz .caliber-type { color: #8daecf; }
.caliber h3 { font-size: 2rem; letter-spacing: -0.02em; }
.caliber-price { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.caliber > p { color: #a1a1a6; line-height: 1.6; margin-top: 26px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-val { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat-val small { font-size: 0.4em; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }

details summary { cursor: pointer; list-style: none; color: #fff; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; justify-content: space-between; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; font-weight: 400; transition: transform 0.3s; }
details[open] summary::after { transform: rotate(45deg); }
.caliber details { margin-top: 26px; }

.spec-list { margin-top: 14px; }
.spec-list div { display: grid; grid-template-columns: 40% 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.92rem; }
.spec-list dt { color: var(--muted); }
.spec-list dd { color: #e8e8ed; }

/* ================= Finishes ================= */
.finish-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 6vw; align-items: center; }

/* The configuration images are transparent cut-outs: float them over a soft glow */
.finish-visual { position: relative; aspect-ratio: 3 / 4; }

.finish-visual::before {
    content: "";
    position: absolute;
    inset: 12% 8% 20%;
    background: radial-gradient(closest-side, var(--accent-glow), transparent);
    filter: blur(24px);
}

.finish-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.6s ease;
    filter: drop-shadow(0 34px 50px rgba(0, 0, 0, 0.75));
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.finish-img.on { opacity: 1; }

.finish-controls fieldset { border: 0; margin-top: 34px; }
.finish-controls legend { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 14px; }
.finish-name { margin: 34px 0 22px; font-size: 1.2rem; color: #fff; }

/* ================= Specifications ================= */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 56px; }
.figure { border-top: 1px solid var(--line); padding-top: 22px; }
.figure-val { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.figure-val small { font-size: 0.35em; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.figure-label { color: var(--muted); margin-top: 10px; font-size: 0.9rem; }

.profile { margin: 70px auto 10px; max-width: 760px; }
.profile svg { width: 100%; display: block; }
.profile figcaption { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 10px; }

.spec-groups { margin-top: 60px; column-count: 2; column-gap: 48px; }
.spec-group { border-top: 1px solid var(--line); padding: 22px 0; break-inside: avoid; }
.spec-group summary { font-size: 1.15rem; }

/* ================= Reassurance ================= */
.assure { padding-top: 60px; }
.assure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.assure-item { border: 1px solid var(--line); border-radius: 24px; padding: 32px; background: rgba(255,255,255,0.02); }
.assure-val { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
.assure-item p { color: #a1a1a6; line-height: 1.55; font-size: 0.95rem; }
.assure-item a { display: inline-block; margin-top: 16px; color: var(--gold); text-decoration: none; font-size: 0.9rem; }
.assure-item a:hover { text-decoration: underline; }

.guide-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-top: 24px;
    padding: 30px 32px;
    border-radius: 24px;
    text-decoration: none;
    background: linear-gradient(120deg, rgba(11,28,56,0.9), rgba(11,28,56,0.35));
    border: 1px solid rgba(120,160,230,0.25);
    color: #c9d6ea;
    line-height: 1.6;
    transition: border-color 0.3s;
}
.guide-link strong { color: #fff; font-size: 1.15rem; }
.guide-link:hover { border-color: var(--gold); }
.guide-arrow { font-size: 1.6rem; color: var(--gold); }

/* ================= Outro ================= */
.outro { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; gap: 22px; }
.outro h2 { font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: -0.035em; }
.outro p { color: var(--muted); font-size: 1.15rem; }

/* ================= Tablets and phones ================= */
@media (max-width: 1000px) {
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .caliber-grid, .finish-layout, .assure-grid { grid-template-columns: 1fr; }
    .spec-groups { column-count: 1; }
    .figures { grid-template-columns: repeat(2, 1fr); }
    .finish-visual { max-width: 520px; margin: 0 auto; width: 100%; }
}

@media (max-width: 820px) {
    .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; gap: 4px; padding: 68px 16px 0; }
    .dial-wrap { order: -1; }
    .dial { width: min(92vw, 50vh); }
    .panels { min-height: 280px; }
    .panel { justify-content: flex-start; }
    .panel h1 { font-size: 3.4rem; margin-bottom: 12px; }
    .panel h2 { font-size: 1.9rem; margin-bottom: 10px; }
    .panel p { font-size: 1rem; }
    .scroll-hint { margin-top: 22px; }
    .facts { gap: 20px; margin-top: 16px; padding-top: 12px; }
    .block { padding: 90px 0; }
    .caliber { padding: 28px 22px; }
    .caliber h3, .caliber-price { font-size: 1.6rem; }
    .guide-link { padding: 24px; }
}

@media (max-width: 480px) {
    .detail-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .detail p { font-size: 0.85rem; }
}
