/*
 * Template "Jam Pasir" (Save the Date) — counting down the time, mobile-first.
 * --inv-primary    deep ink (navy / green / maroon / espresso): first screen and the clock section
 * --inv-accent     champagne gold / bronze: brass, sand, fine lines
 * --inv-background ivory: the date section and the closing
 * --inv-text       text on ivory
 * Sizes inside the column use container units (cqw), so desktop keeps the phone-width poster.
 */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --jp-ink: var(--inv-primary);
    --jp-ink-deep: color-mix(in srgb, var(--inv-primary) 78%, #000);
    --jp-ink-soft: color-mix(in srgb, var(--inv-primary) 86%, #fff);
    --jp-gold: var(--inv-accent);
    --jp-gold-light: color-mix(in srgb, var(--inv-accent) 62%, #fff);
    --jp-gold-pale: color-mix(in srgb, var(--inv-accent) 30%, #fff);
    --jp-gold-deep: color-mix(in srgb, var(--inv-accent) 56%, #000);
    --jp-ivory: var(--inv-background);
    --jp-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --jp-caps: 'Cinzel', Georgia, serif;
    --jp-script: 'Pinyon Script', 'Cormorant Garamond', cursive;
}

html { background: var(--jp-ink-deep); }

body.jp-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(60rem 40rem at 50% 0%, color-mix(in srgb, var(--inv-primary) 70%, var(--inv-accent) 6%) 0%, transparent 70%),
        var(--jp-ink-deep);
    color: var(--inv-text);
    font-family: var(--jp-serif);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.jp-preview {
    position: sticky; top: 0; z-index: 60; padding: .5rem 1rem; text-align: center;
    background: #fff4d6; color: #6b4e00; font-family: system-ui, sans-serif; font-size: .8125rem;
}

.jp-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.jp {
    position: relative;
    max-width: 30rem; margin: 0 auto;
    container-type: inline-size;
    background: var(--jp-ivory);
}

/* gradient stops of the drawings (classes, so they follow the colour variant) */
.jp-stop-dark { stop-color: color-mix(in srgb, var(--inv-accent) 50%, #000); }
.jp-stop-mid { stop-color: var(--inv-accent); }
.jp-stop-light { stop-color: color-mix(in srgb, var(--inv-accent) 45%, #fff); }
.jp-stop-sand-top { stop-color: color-mix(in srgb, var(--inv-accent) 70%, #fff); }
.jp-stop-sand-bottom { stop-color: color-mix(in srgb, var(--inv-accent) 82%, #000); }
.jp-stop-face-in { stop-color: color-mix(in srgb, var(--inv-primary) 88%, #fff); }
.jp-stop-face-out { stop-color: var(--jp-ink-deep); }
.jp-grain { fill: color-mix(in srgb, var(--inv-accent) 45%, #000); opacity: .5; }

/* small caps label with fine rules on both sides */
.jp-label {
    display: flex; align-items: center; justify-content: center; gap: .8rem;
    margin: 0; font-family: var(--jp-caps); font-size: .7rem; font-weight: 500;
    letter-spacing: .32em; text-transform: uppercase; color: var(--jp-gold-deep);
}
.jp-label--light { color: var(--jp-gold-light); }
.jp-label__rule { flex: 0 0 2.2rem; height: 1px; background: currentColor; opacity: .7; }

.jp-amp { font-family: var(--jp-serif); font-style: italic; font-size: .55em; color: var(--jp-gold); margin: 0 .08em; }

/* ---------- first screen ---------- */
.jp-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100svh; padding: 1.6rem 1.25rem 1.9rem;
    background:
        radial-gradient(70% 45% at 50% 40%, color-mix(in srgb, var(--inv-accent) 22%, transparent) 0%, transparent 70%),
        linear-gradient(180deg, var(--jp-ink-soft) 0%, var(--jp-ink) 45%, var(--jp-ink-deep) 100%);
    color: #fff; text-align: center;
}
/* the couple photo, faint, behind everything: the room the hourglass stands in */
.jp-hero__bg { position: absolute; inset: 0; z-index: -2; }
.jp-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; opacity: .2; filter: saturate(.7); }
.jp-hero__bg::after {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(70% 45% at 50% 40%, color-mix(in srgb, var(--inv-accent) 20%, transparent) 0%, transparent 72%),
        linear-gradient(180deg, color-mix(in srgb, var(--inv-primary) 70%, transparent) 0%, color-mix(in srgb, var(--inv-primary) 82%, transparent) 50%, var(--jp-ink-deep) 100%);
}
/* fine double gold frame with notched corners */
.jp-hero__frame {
    position: absolute; inset: .7rem; z-index: -1; pointer-events: none;
    border: 1px solid color-mix(in srgb, var(--inv-accent) 55%, transparent);
    box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px color-mix(in srgb, var(--inv-accent) 22%, transparent);
}
.jp-hero__frame::before, .jp-hero__frame::after {
    content: ''; position: absolute; left: 50%; width: .5rem; height: .5rem;
    background: var(--jp-gold); transform: translateX(-50%) rotate(45deg);
}
.jp-hero__frame::before { top: -.28rem; }
.jp-hero__frame::after { bottom: -.28rem; }

.jp-kicker {
    display: flex; align-items: center; gap: .85rem; margin: 0 0 .9rem;
    font-family: var(--jp-caps); font-size: .74rem; font-weight: 500; letter-spacing: .38em; text-transform: uppercase;
    color: var(--jp-gold-light);
}
.jp-kicker > span:not(.jp-kicker__rule) { margin-right: -.38em; }
.jp-kicker__rule { width: 1.8rem; height: 1px; background: currentColor; opacity: .75; }

/* the hourglass */
.jp-glass {
    display: block; flex: none;
    height: min(62svh, 150cqw); width: auto; aspect-ratio: 300 / 482;
    overflow: visible;
    filter: drop-shadow(0 18px 28px rgb(0 0 0 / .45));
}
.jp-glass__tint { fill: color-mix(in srgb, var(--inv-primary) 70%, #fff 6%); }
.jp-stop-glass-in { stop-color: color-mix(in srgb, var(--inv-primary) 80%, #fff); }
.jp-stop-glass-out { stop-color: color-mix(in srgb, var(--inv-primary) 85%, #000); }
.jp-glass__days { font-family: var(--jp-caps); font-size: 40px; font-weight: 500; fill: var(--jp-gold-light); }
.jp-glass__days-label { font-family: var(--jp-caps); font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; fill: var(--jp-gold-pale); }
.jp-hero--empty .jp-glass__tint:not(.jp-glass__tint--low) { fill: color-mix(in srgb, var(--inv-primary) 80%, #fff); }
.jp-glass__line { fill: none; stroke: var(--jp-gold-light); stroke-width: 1.5; }
.jp-glass__shine { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .22; }
.jp-glass__stream { stroke: var(--jp-gold-light); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 2 5; }
.jp-glass__initials { font-family: var(--jp-caps); font-size: 34px; letter-spacing: .06em; fill: var(--jp-gold-light); }
.jp-glass__pile, .jp-glass__cone { transform-box: fill-box; }

.jp-names {
    margin: 1rem 0 0; font-family: var(--jp-script); font-weight: 400;
    font-size: clamp(2.5rem, 13.5cqw, 3.4rem); line-height: 1.05; color: #fff;
    text-shadow: 0 2px 18px rgb(0 0 0 / .35);
    overflow-wrap: anywhere;
}
.jp-names .jp-amp { font-size: .62em; color: var(--jp-gold-light); }

.jp-herodate { margin-top: .55rem; }
.jp-herodate p { margin: 0; }
.jp-herodate__roman {
    font-family: var(--jp-caps); font-size: clamp(1.05rem, 5.2cqw, 1.3rem); font-weight: 500;
    letter-spacing: .14em; color: var(--jp-gold-light);
}
.jp-herodate__roman i { font-style: normal; margin: 0 .45em; color: var(--jp-gold); }
.jp-herodate__text {
    margin-top: .15rem !important; font-size: .98rem; font-style: italic; color: rgb(255 255 255 / .86);
}

.jp-guest {
    margin: 1rem 0 0; padding: .55rem 1.3rem .6rem; max-width: 22rem;
    border-top: 1px solid color-mix(in srgb, var(--inv-accent) 55%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--inv-accent) 55%, transparent);
}
.jp-guest__label {
    display: block; font-family: var(--jp-caps); font-size: .62rem; letter-spacing: .3em; text-transform: uppercase;
    color: var(--jp-gold-light);
}
.jp-guest__name { display: block; margin-top: .1rem; font-size: 1.12rem; font-weight: 600; line-height: 1.3; color: #fff; }

/* shorter screens: the hourglass gives way first, the names and the date stay */
.jp-hero--guest .jp-glass { height: min(56svh, 150cqw); }
@media (max-height: 700px) {
    .jp-hero { padding-top: 1.2rem; padding-bottom: 1.4rem; }
    .jp-glass { height: min(51svh, 150cqw); }
    .jp-hero--guest .jp-glass { height: min(46svh, 150cqw); }
    .jp-kicker { margin-bottom: .6rem; }
    .jp-names { margin-top: .7rem; font-size: clamp(2.2rem, 12cqw, 3rem); }
    .jp-guest { margin-top: .7rem; padding-top: .4rem; padding-bottom: .45rem; }
}
@media (max-height: 590px) {
    .jp-glass { height: 47svh; }
    .jp-hero--guest .jp-glass { height: 41svh; }
    .jp-herodate__text { font-size: .9rem; }
    .jp-guest__name { font-size: 1rem; }
}

/* ---------- the date (ivory) ---------- */
.jp-event {
    position: relative; overflow: hidden; isolation: isolate;
    padding: 4.2rem 1.5rem 4.4rem;
    background:
        radial-gradient(80% 50% at 50% 0%, color-mix(in srgb, var(--inv-accent) 16%, transparent) 0%, transparent 70%),
        var(--jp-ivory);
    color: var(--inv-text); text-align: center;
}
/* a large clock dial, faint, leaning in from the right */
.jp-event__dial {
    position: absolute; z-index: -1; width: 30rem; height: 30rem; right: -15rem; top: 1.5rem;
    color: var(--jp-gold-deep); opacity: .1;
}
.jp-triptych {
    display: grid; grid-template-columns: 1fr 1fr 1.35fr; align-items: end;
    margin: 2rem 0 0;
}
.jp-triptych__col { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 0 .35rem; }
.jp-triptych__col + .jp-triptych__col { border-left: 1px solid color-mix(in srgb, var(--inv-accent) 60%, transparent); }
.jp-triptych__roman {
    font-family: var(--jp-caps); font-weight: 500; line-height: 1; color: var(--jp-ink);
    font-size: clamp(1.9rem, 10cqw, 2.6rem); letter-spacing: .02em;
}
.jp-triptych__roman--m { font-size: clamp(1.5rem, 7.4cqw, 2rem); }
.jp-triptych__roman--s { font-size: clamp(1.2rem, 5.9cqw, 1.6rem); }
.jp-triptych__word {
    font-family: var(--jp-caps); font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--jp-gold-deep);
}
.jp-event__full { margin: 1.4rem 0 0; font-size: 1.2rem; font-style: italic; color: var(--inv-text); }

.jp-city { margin: 2.2rem auto 0; }
.jp-city__label { display: block; font-family: var(--jp-caps); font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: var(--jp-gold-deep); }
.jp-city__name {
    margin: .2rem 0 0; font-family: var(--jp-serif); font-weight: 500; font-size: clamp(2rem, 10cqw, 2.6rem);
    line-height: 1.1; color: var(--jp-ink); overflow-wrap: anywhere;
}
/* a gold wash behind the city name */
.jp-city__name {
    display: inline; padding: 0 .3em;
    background: linear-gradient(transparent 62%, color-mix(in srgb, var(--inv-accent) 30%, transparent) 62%);
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.jp-note {
    position: relative; margin: 2.4rem auto 0; max-width: 22rem; padding: 1.4rem 1.5rem;
    background: color-mix(in srgb, var(--jp-ivory) 70%, #fff);
    box-shadow: 0 14px 30px -22px color-mix(in srgb, var(--inv-primary) 70%, transparent);
}
.jp-note p { margin: 0; font-size: 1.12rem; font-style: italic; line-height: 1.55; color: var(--inv-text); }
.jp-note__corner { position: absolute; width: 1.6rem; height: 1.6rem; border: 1px solid var(--jp-gold); }
.jp-note__corner--tl { top: -.4rem; left: -.4rem; border-right: 0; border-bottom: 0; }
.jp-note__corner--br { bottom: -.4rem; right: -.4rem; border-left: 0; border-top: 0; }

/* ---------- the countdown in the clock face (ink) ---------- */
.jp-countdown {
    position: relative; isolation: isolate;
    padding: 4rem 1.25rem 4.2rem;
    background:
        radial-gradient(80% 50% at 50% 60%, color-mix(in srgb, var(--inv-accent) 14%, transparent) 0%, transparent 70%),
        linear-gradient(180deg, var(--jp-ink) 0%, var(--jp-ink-deep) 100%);
    color: #fff; text-align: center;
}
.jp-countdown::before {
    content: ''; position: absolute; left: 1.25rem; right: 1.25rem; top: 1.4rem; height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--inv-accent) 65%, transparent), transparent);
}
.jp-countdown__title {
    margin: .9rem auto 0; max-width: 18rem; font-family: var(--jp-serif); font-weight: 500;
    font-size: clamp(1.7rem, 8cqw, 2.1rem); line-height: 1.15; color: #fff;
}
.jp-countdown__title em { display: block; font-style: italic; color: var(--jp-gold-light); }

.jp-clock { position: relative; width: min(88cqw, 23rem); margin: 2.2rem auto 0; }
.jp-clock__face { position: absolute; top: 0; left: 0; width: 100%; height: auto; aspect-ratio: 1; overflow: visible; }
.jp-clock__dial { color: var(--jp-gold-light); }
.jp-clock__dot { fill: var(--jp-gold-light); filter: drop-shadow(0 0 4px var(--jp-gold)); }
.jp-clock__orbit { transform-origin: 0 0; }

.jp-clock .inv-countdown {
    position: relative; aspect-ratio: 1; width: 100%;
    display: grid; grid-template-columns: repeat(3, auto); justify-content: center; align-content: center;
    column-gap: .55rem; row-gap: .35rem; padding-top: .6rem;
}
.jp-clock .inv-countdown__item {
    min-width: 0; padding: 0 .35rem; background: none; border-radius: 0; color: #fff;
}
.jp-clock .inv-countdown__item:first-child {
    grid-column: 1 / -1; padding-bottom: .55rem; margin: 0 auto .1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--inv-accent) 55%, transparent);
}
.jp-clock .inv-countdown__item:not(:first-child) + .inv-countdown__item { border-left: 1px solid color-mix(in srgb, var(--inv-accent) 45%, transparent); }
.jp-clock .inv-countdown__value {
    font-family: var(--jp-caps); font-weight: 500; font-size: clamp(1.25rem, 6.2cqw, 1.6rem); line-height: 1.05; color: #fff;
    font-variant-numeric: lining-nums tabular-nums;
}
.jp-clock .inv-countdown__item:first-child .inv-countdown__value {
    font-size: clamp(3.2rem, 17cqw, 4.4rem); line-height: .95; color: var(--jp-gold-light);
}
.jp-clock .inv-countdown__label {
    margin-top: .2rem; font-family: var(--jp-caps); font-size: .58rem; letter-spacing: .22em; text-transform: uppercase;
    color: var(--jp-gold-pale); opacity: 1;
}
.jp-clock .inv-countdown__done { position: relative; margin: 0; padding: 38% 18% 0; aspect-ratio: 1; font-style: italic; font-size: 1.1rem; }
.jp-clock .inv-countdown__actions { margin-top: 2rem; gap: .6rem; }
.jp-clock .inv-button {
    border-radius: 0; padding: .7rem 1.1rem; font-family: var(--jp-caps); font-size: .64rem; letter-spacing: .16em;
    text-transform: uppercase; text-decoration: none;
}
.jp-clock .inv-button--outline {
    background: transparent; color: var(--jp-gold-light);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 70%, transparent);
}
.jp-clock .inv-countdown__actions .inv-button:first-child {
    background: var(--jp-gold); color: var(--jp-ink-deep); box-shadow: none;
}

/* ---------- closing (ivory over a faint photo) ---------- */
.jp-closing {
    position: relative; isolation: isolate; overflow: hidden;
    padding: 3.6rem 1.5rem 3.2rem;
    background:
        radial-gradient(70% 40% at 50% 22%, color-mix(in srgb, var(--inv-accent) 22%, transparent) 0%, transparent 70%),
        var(--jp-ivory);
    color: var(--inv-text); text-align: center;
}
.jp-closing__bg { position: absolute; inset: 0 0 auto; height: 70%; z-index: -1; }
.jp-closing__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; opacity: .26; filter: sepia(.25) saturate(.8); }
.jp-closing__bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--jp-ivory) 55%, transparent) 0%, color-mix(in srgb, var(--jp-ivory) 40%, transparent) 40%, var(--jp-ivory) 100%);
}
.jp-heart { display: block; width: 11rem; height: auto; margin: 0 auto; overflow: visible; filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--inv-accent) 35%, transparent)); }
.jp-heart__neck { fill: color-mix(in srgb, var(--inv-primary) 12%, transparent); stroke: var(--jp-gold-deep); stroke-width: 1.2; }
.jp-heart__stream { stroke: var(--jp-gold); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 2 4.5; }
.jp-heart__edge { fill: none; stroke: color-mix(in srgb, var(--inv-accent) 40%, #fff); stroke-width: 1.2; stroke-dasharray: 1.5 3; opacity: .8; }
.jp-heart__grain { fill: color-mix(in srgb, var(--inv-accent) 55%, #000); opacity: .45; }
.jp-heart__grain--light { fill: color-mix(in srgb, var(--inv-accent) 35%, #fff); opacity: .8; }
.jp-heart__bed { fill: color-mix(in srgb, var(--inv-accent) 55%, transparent); filter: blur(3px); }
.jp-heart__loose { fill: color-mix(in srgb, var(--inv-accent) 80%, #000); opacity: .7; }
.jp-closing__text { margin: 1.6rem auto 0; max-width: 21rem; font-size: 1.22rem; font-style: italic; line-height: 1.55; }
.jp-closing__names { margin: .9rem 0 0; font-family: var(--jp-script); font-size: clamp(2.3rem, 12cqw, 3rem); line-height: 1.1; color: var(--jp-ink); overflow-wrap: anywhere; }
.jp-closing__names .jp-amp { color: var(--jp-gold-deep); }
.jp-closing__date {
    display: flex; align-items: center; justify-content: center; gap: .8rem; margin: .8rem 0 0;
    font-family: var(--jp-caps); font-size: .78rem; letter-spacing: .24em; color: var(--jp-gold-deep);
}

/* platform credit: a slim line on the closing ivory, as wide as the column */
.inv-branding { max-width: 30rem; margin: 0 auto; color: var(--jp-gold-deep); }

/* ---------- motion (only with html.inv-anim; "reduce motion" turns it all off) ---------- */
@keyframes jp-photo-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes jp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jp-pile { from { transform: scaleY(.55); } to { transform: none; } }
@keyframes jp-cone { from { transform: scaleY(1.6); } to { transform: none; } }
@keyframes jp-trickle { to { stroke-dashoffset: -14; } }
@keyframes jp-orbit { to { transform: rotate(360deg); } }
@keyframes jp-draw { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

html.inv-anim .jp-glass__photo { transform-box: fill-box; transform-origin: 50% 40%; animation: jp-photo-in 1.8s cubic-bezier(.2, .7, .2, 1) both; }
html.inv-anim .jp-glass__brass { animation: jp-fade 1.2s ease .1s both; }
html.inv-anim .jp-glass__line { stroke-dasharray: 1600; animation: jp-draw 2.2s cubic-bezier(.45, 0, .2, 1) both; }
html.inv-anim .jp-glass__pile { transform-origin: 50% 100%; animation: jp-pile 2.4s cubic-bezier(.3, .6, .3, 1) both; }
html.inv-anim .jp-glass__cone { transform-origin: 50% 100%; animation: jp-cone 2.4s cubic-bezier(.3, .6, .3, 1) both; }
/* the sand keeps trickling, slowly and quietly */
html.inv-anim .jp-glass__stream { animation: jp-trickle 1.4s linear infinite; }
html.inv-anim .jp-clock__orbit { animation: jp-orbit 60s linear infinite; }
html.inv-anim .jp-heart__stream { animation: jp-trickle 1.6s linear infinite; }

/* ---------- wider screens: the poster stays a phone-width column ---------- */
@media (min-width: 600px) {
    .jp { box-shadow: 0 0 60px -10px rgb(0 0 0 / .45); }
    .jp-hero { min-height: min(100svh, 62rem); }
}
