/* Rimba Kabut: a misty forest walked into, one page at a time. The fixed .rb-stage holds the painted
   layers; rimba.js sets the camera (--rb-p, --rb-f, --rb-fb, --rb-pan) and each page's distance
   (--rb-l, --rb-la), and the rules below turn them into transform/opacity only. Entrance and scene
   states live under .rb-motion, which only rimba.js sets, so the page is complete without JS and
   with prefers-reduced-motion: reduce. Inside the reading column, sizes follow the column
   (container units), so wide screens get the phone layout beside a forest panel. */
@font-face { font-family: "Lora"; src: url("/frontend/assets/fonts/lora-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/frontend/assets/fonts/lora-italic-latin.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Hurricane"; src: url("/frontend/assets/fonts/hurricane-latin.woff2") format("woff2"); font-display: swap; }

:root[data-theme="rimba"] {
    --bg: #f4f3ec; --surface: #fbfaf5; --ink: #3b2f25; --muted: #5e5446; --accent: #66513e; --accent-ink: #fff;
    --line: #d9d6c8; --hero-ink: #3b2f25; --radius: 1.25rem;
    --heading: "Lora", Georgia, serif; --body: "Lora", Georgia, serif; --script: "Hurricane", "Brush Script MT", cursive;
    --rb-sky: #dfe5d6; --rb-sky-mid: #eaeee3; --rb-tree-far: #bcc5b0; --rb-tree-mid: #96a388; --rb-leaf: #9baa8b; --rb-moss: #56664a;
    --rb-stem: #7c8e6c; --rb-bark: #6f5a45; --rb-gold: #b48e48; --rb-gold-ink: #8a6a2c; --rb-fog: 255, 255, 255; --rb-card: rgba(251, 250, 245, .9); --rb-bird: rgba(58, 66, 52, .7); --rb-halo: 244, 243, 236; --rb-mist: 250, 250, 245;
    --rb-out: cubic-bezier(.16, 1, .3, 1); --rb-dolly-ease: cubic-bezier(.65, 0, .35, 1);
}
:root[data-theme="rimba"][data-scheme="dark"] {
    color-scheme: dark;
    --bg: #111712; --surface: #1a221b; --ink: #ece8dc; --muted: #bdb6a4; --accent: #d2b47a; --accent-ink: #1a1610; --line: #2f3b30; --hero-ink: #ece8dc;
    --rb-sky: #0d1510; --rb-sky-mid: #142019; --rb-tree-far: #22302a; --rb-tree-mid: #1a261f; --rb-leaf: #4a604e; --rb-moss: #2f4033;
    --rb-stem: #5d725f; --rb-bark: #5a4835; --rb-gold: #c9a866; --rb-gold-ink: #c9a866; --rb-fog: 170, 190, 180; --rb-card: rgba(24, 32, 26, .9); --rb-bird: rgba(200, 210, 190, .5); --rb-halo: 12, 18, 14; --rb-mist: 12, 18, 14;
}

[data-theme="rimba"] body { font-size: 1rem; line-height: 1.65; overflow-x: clip; }
/* One page per screen: the scroll settles on a page when it ends near one, long pages scroll freely. */
html[data-theme="rimba"] { scroll-snap-type: y proximity; }

/* Guest-only invitations (restricted.blade.php): once the guest's link has loaded the sections, the
   "Undangan pribadi" placeholder would sit as an empty screen under the forest; it steps aside. */
[data-restricted="true"] .restricted:has(~ #invitation-root:not([hidden])) { display: none; }

/* ---------- Stage ---------- */
/* Entrance offsets and the arch flying past must never widen the page. */
.rb { position: relative; isolation: isolate; overflow-x: hidden; overflow-x: clip; }
.rb-stage { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--rb-sky); }
.rb-dolly { position: absolute; inset: 0; transform-origin: 40% 60%; transition: transform 1.6s var(--rb-dolly-ease); }
.rb-layer { position: absolute; left: 0; width: 100%; top: 0; height: 100%; will-change: transform; }
.rb-sky { background: linear-gradient(180deg, var(--rb-sky) 0%, var(--rb-sky-mid) 48%, var(--bg) 100%); }
/* Painted layers (img/). The far forest is the backdrop; at night it is swapped, never both loaded. */
.rb-far { height: 112%; background: url("img/bg-forest.webp") center 30% / cover no-repeat;
    transform: translate3d(calc(var(--rb-pan, 0) * 2%), calc(var(--rb-p, 0) * -5vh), 0) scale(calc(1.06 + var(--rb-p, 0) * .08)); }
/* Walking between pages: the near trunks swell past the camera while the next ones step up from the mist. */
.rb-mid { height: 118%; background: url("img/trees-near.webp") center bottom / cover no-repeat; transform-origin: 50% 55%; }
.rb-mid-pass { opacity: calc(.9 - var(--rb-f, 0) * .9); transform: translate3d(calc(var(--rb-pan, 0) * -2%), 0, 0) scale(calc(1 + var(--rb-f, 0) * .9)); }
/* Janur stage 8: the first 1% of a page change stays fully transparent. At rest rimba.js reports a hair above 0,
   which painted an invisible copy of the trees and counted as the cover's largest paint once the script ran. */
.rb-mid-next { opacity: calc(clamp(0, (var(--rb-f, 0) - .01) / .99, 1) * .9); transform: translate3d(calc(var(--rb-pan, 0) * -2%), 0, 0) scale(calc(.8 + var(--rb-f, 0) * .2)); }
/* Between pages the mist thickens, so one scene hands over to the next. */
.rb-stage::after { content: ""; position: absolute; inset: 0; background: rgba(var(--rb-mist), .62); pointer-events: none;
    opacity: max(calc(var(--rb-read, 1) * .6), calc(var(--rb-fb, 0) * .7)); }
.rb-fog { left: -20%; top: 0; width: 140%; height: 110%;
    background: url("img/fog.webp") 8% 70% / 70% auto no-repeat, url("img/fog.webp") 92% 92% / 80% auto no-repeat,
        radial-gradient(60% 16% at 50% 100%, rgba(var(--rb-fog), .9), transparent 70%);
    opacity: calc(.7 + var(--rb-fb, 0) * .3); animation: rb-drift 16s ease-in-out infinite alternate; }
.rb-hero-ground { position: absolute; left: 0; right: 0; bottom: -1px; height: min(26svh, 15rem); pointer-events: none;
    background: url("img/ground.webp") center bottom / auto 72% repeat-x; }
.rb-bush { position: absolute; bottom: -6%; width: min(52cqi, 24rem); aspect-ratio: 728 / 492; background: url("img/bush.webp") center / contain no-repeat; }
.rb-bush-left { left: -14%; }
.rb-bush-right { right: -16%; transform: scaleX(-1); }
:root[data-scheme="dark"] .rb-far { background-image: url("img/bg-night.webp"); background-position: center bottom; }
:root[data-scheme="dark"] :is(.rb-mid, .rb-hero-ground, .rb-bush) { filter: brightness(.42) saturate(.7); }
:root[data-scheme="dark"] .rb-fog { opacity: .22; }
:root[data-scheme="dark"] :is(.rb-arch, .rb-portal-frame, .rb-opening-sprig) { filter: brightness(.78); }
@keyframes rb-drift { to { transform: translate3d(-4%, -1%, 0); } }
@keyframes rb-sway { 50% { transform: rotate(-3deg); } }
@keyframes rb-spin { to { transform: rotate(1turn); } }
@keyframes rb-bob { 50% { transform: translate3d(0, 6px, 0); } }
@keyframes rb-fly { from { transform: translate3d(-12%, 0, 0); } 50% { transform: translate3d(48%, -26px, 0); } to { transform: translate3d(112%, 10px, 0); } }
@keyframes rb-flap { to { transform: scaleY(-.55); } }
/* A small flock crossing the sky (drawn here, after the reference's Lottie birds). */
.rb-birds { position: absolute; inset: 0 0 auto; height: 40%; pointer-events: none; }
.rb-flight { position: absolute; left: 0; top: var(--y); width: 100%; animation: rb-fly 30s linear infinite; animation-delay: calc(var(--d) * -1); }
.rb-bird { display: block; width: calc(30px * var(--s)); height: auto; overflow: visible; fill: var(--rb-bird); }
.rb-wing { transform-box: fill-box; animation: rb-flap .45s ease-in-out infinite alternate; }
.rb-wing-l { transform-origin: 100% 85%; }
.rb-wing-r { transform-origin: 0 85%; animation-delay: -.05s; }
/* Before "Buka Undangan" the camera sits close in; it pulls back as the cover lifts. */
body.is-locked .rb-dolly { transform: scale(1.3) translate3d(-3%, 5%, 0); }

/* ---------- Type and atoms ---------- */
.rb-main { position: relative; outline: none; container: rb / inline-size; }
/* The cover's mist is see-through to the forest; the content waits until it lifts. */
.rb-main { transition: opacity .9s ease .45s; }
body.is-locked .rb-main { opacity: 0; }
.rb-kicker { font: italic 400 .95rem/1.4 var(--body); letter-spacing: .03em; color: var(--accent); margin: 0 0 .35rem; }
.rb-title { font: 400 clamp(3.25rem, 13cqi, 4.5rem)/.95 var(--script); color: var(--accent); text-align: center; margin: 0 0 1.25rem; text-wrap: balance; }
.rb-title-sm { font: 600 1.15rem/1.4 var(--body); }
.rb-lead { font-size: 1.05rem; }
.rb-muted, .rb-note { color: var(--muted); }
.rb-note { font-size: .875rem; }
.rb-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-underline-offset: 3px; }
.rb-section { padding: clamp(4.5rem, 12cqi, 8rem) max(1.25rem, env(safe-area-inset-right)) clamp(4.5rem, 12cqi, 8rem) max(1.25rem, env(safe-area-inset-left)); }
/* A page fills the screen and centres what it holds; it is where the scroll comes to rest. */
.rb-page { min-height: 100svh; display: grid; align-content: center; scroll-snap-align: start; }
.rb-motion .rb-scene { opacity: calc(1 - var(--rb-la, 0) * 1.25);
    transform: translate3d(0, calc(var(--rb-l, 0) * 9vh), 0) scale(calc(1 - var(--rb-la, 0) * .08)); }
.rb-narrow { max-width: 34rem; margin-inline: auto; }
/* No boxes around sections: the text reads straight off the misty forest. While a content page is in view
   the stage mist rises (--rb-read), and the text carries a soft halo of the page colour. Only the
   verse quotes sit in a box. */
.rb-narrow, .rb-person-card { text-align: center; }
.rb-main h3 { font: 600 1.15rem/1.35 var(--body); margin: 0 0 .35rem; }
.rb-main :is(p, h2, h3, li, blockquote, figcaption, legend, label, summary) { text-shadow: 0 0 12px rgba(var(--rb-halo), .95), 0 0 3px rgba(var(--rb-halo), .9); }
.rb-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.35rem; border-radius: 999px; border: 1px solid var(--accent);
    background: var(--accent); color: var(--accent-ink); font: 600 .9rem/1 var(--body); letter-spacing: .04em; text-decoration: none; cursor: pointer; }
.rb-button svg { width: 18px; height: 18px; }
.rb-main .rb-button, .rb-main .rb-button * { text-shadow: none; }
.rb-button-ghost { background: transparent; color: var(--accent); }
.rb-button:focus-visible, .rb a:focus-visible, .rb-gift-shell summary:focus-visible { outline: 3px solid var(--rb-gold); outline-offset: 3px; }
.rb-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: inherit; margin: 1rem 0 0; }

/* ---------- Hero ---------- */
.rb-hero { position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 6rem 1.5rem 7rem; }
.rb-hero-arch { position: absolute; left: 50%; top: 50%; width: min(88cqi, 26rem); aspect-ratio: 2 / 3; translate: -50% -54%;
    transition: transform 1.6s var(--rb-dolly-ease) .15s, opacity 1s ease .35s; }
body.is-locked .rb-hero-arch { transform: scale(2.4) translate3d(0, 12%, 0); opacity: 0; }
.rb-arch { width: 100%; height: 100%; display: block; object-fit: contain; transform-origin: 50% 40%;
    transform: scale(calc(1 + var(--rb-la, 0) * 3)); opacity: calc(1 - var(--rb-la, 0) * 1.6); }
.rb-hero-inner { position: relative; max-width: 24rem; margin-top: 8rem; padding: 2rem 1.5rem; background: radial-gradient(closest-side, var(--rb-card) 55%, transparent); }
.rb-names { font: 400 clamp(2.5rem, 10cqi, 4.5rem)/.95 var(--script); color: var(--accent); margin: .25rem 0 .75rem; text-wrap: balance; }
/* Tema Fase 1: on a phone the words stay inside the arch's opening instead of running over its pillars. */
@container rb (max-width: 639px) {
    .rb-hero-arch { width: 100cqi; }
    .rb-hero-inner { max-width: 44cqi; padding-inline: 0; }
    .rb-hero .rb-names { font-size: clamp(1.8rem, 8cqi, 2.4rem); }
}
.rb-amp { display: block; font-size: .55em; color: var(--rb-gold-ink); line-height: 1; }
.rb-date { font: italic 1rem/1.4 var(--body); color: var(--ink); }
/* The scroll cue: a bare white line icon (mouse with a rolling wheel, a chevron below) over the grass, in a 44px tap area. */
.rb-cue { position: absolute; bottom: max(1.25rem, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; z-index: 1; display: grid; place-items: center;
    width: 44px; height: 56px; color: #fff; opacity: .9; text-decoration: none; transition: transform .25s ease, opacity .25s ease; }
.rb-cue svg { width: 21px; height: 32px; overflow: visible; filter: drop-shadow(0 1px 3px rgba(20, 28, 18, .75)) drop-shadow(0 0 8px rgba(20, 28, 18, .45)); }
.rb-cue-wheel { animation: rb-wheel 1.8s ease-in-out infinite; }
.rb-cue-chevron { animation: rb-bob 1.8s ease-in-out infinite; }
.rb-cue:hover, .rb-cue:focus-visible { opacity: 1; transform: translateY(-2px); }
.rb-cue:active { transform: translateY(1px); }
@keyframes rb-wheel { 0% { transform: translate3d(0, 0, 0); opacity: 1; } 70% { transform: translate3d(0, 7px, 0); opacity: 0; } 100% { transform: translate3d(0, 0, 0); opacity: 0; } }

/* ---------- Salam, couple ---------- */
.rb-verse { margin: 1.75rem 0 0; padding: 1.5rem 1.35rem; border: 1px solid rgba(180, 142, 72, .45); border-radius: 1.25rem; background: var(--rb-card);
    box-shadow: 0 14px 30px -18px rgba(40, 30, 20, .45); }
.rb-verse blockquote { margin: 0; font-style: italic; font-size: 1.02rem; }
.rb-verse figcaption { margin-top: .5rem; font-weight: 600; color: var(--accent); }
.rb-person .rb-scene { display: grid; justify-items: center; }
.rb-portal { position: relative; isolation: isolate; width: min(86cqi, 21rem); aspect-ratio: 3 / 4; margin-top: 4rem; }
.rb-portal-frame { position: absolute; z-index: -1; left: -25%; top: -22.5%; width: 150%; max-width: none; height: auto; pointer-events: none; }
.rb-portal-photo { position: absolute; inset: 0 10%; width: 80%; height: 100%; object-fit: cover; border-radius: 999px 999px 1.25rem 1.25rem;
    box-shadow: 0 0 0 4px rgba(var(--rb-fog), .7), 0 18px 40px -18px rgba(30, 24, 16, .55); }
.rb-portal-initial { display: grid; place-items: center; font: 400 7rem/1 var(--script); color: var(--accent); background: linear-gradient(160deg, var(--rb-sky), var(--rb-leaf)); }
.rb-person-card { width: min(100%, 26rem); position: relative; }
/* The couple's words sit on a soft mist card that rises over the foot of the photo. */
.rb-person-card { margin-top: -1.5rem; background: var(--rb-card); border-radius: 2rem; padding: 2rem 1.5rem; box-shadow: 0 0 36px 26px var(--rb-card); }
.rb-person-card :is(p, h3) { text-shadow: none; }
.rb-person-card h3 { font: 600 1.15rem/1.35 var(--body); margin: 0 0 .35rem; }
.rb-script-name { font: 400 clamp(3.25rem, 13cqi, 4rem)/.9 var(--script); color: var(--accent); margin: 0 0 .25rem; }
.rb-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; margin: .25rem 0 0; }
.rb-socials a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-underline-offset: 3px; }

/* ---------- Events ---------- */
.rb-button[hidden] { display: none; }
.rb-countdown-page .rb-title { font-size: clamp(2.6rem, 11cqi, 3.5rem); }
.rb-countdown { text-align: center; max-width: 26rem; margin: 1.75rem auto 0; }
.rb-countdown-page .rb-actions { justify-content: center; margin-top: 2rem; }
.rb-clock { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.rb-clock span { display: grid; gap: .25rem; font: italic .85rem/1.2 var(--body); color: var(--muted); }
.rb-clock b { font: 400 2rem/1 var(--body); color: var(--accent); font-variant-numeric: tabular-nums; }
.rb-event-list { display: grid; gap: 4rem; max-width: 40rem; margin: 0 auto; }
.rb-event { text-align: left; justify-content: flex-start; width: min(100%, 28rem); }
.rb-event:nth-child(even) { text-align: right; justify-self: end; justify-content: flex-end; }
.rb-event .rb-event-title { font: 400 clamp(3rem, 12cqi, 3.75rem)/.95 var(--script); color: var(--accent); margin: 0 0 .5rem; }
.rb-event p { margin: 0 0 .2rem; }
.rb-event-date, .rb-event-place { font-weight: 600; }
.rb-swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1rem; }
.rb-swatch { width: 52px; height: 52px; border-radius: 50%; background: var(--swatch); box-shadow: 0 10px 22px -8px rgba(40, 30, 20, .45); }

/* ---------- Story, gallery, video ---------- */
.rb-story-photo { width: 100%; border-radius: 1rem; margin-bottom: 1.25rem; aspect-ratio: 4 / 3; object-fit: cover; }
.rb-timeline { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.75rem; text-align: left; }
.rb-timeline li { position: relative; padding-left: 1.5rem; border-left: 1px solid var(--rb-gold); }
.rb-timeline li::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 11px; height: 11px; border-radius: 50%; background: var(--rb-gold); }
.rb-timeline img { border-radius: .75rem; margin: .5rem 0; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.rb-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-flow: dense; gap: .5rem; max-width: 60rem; margin: 0 auto; }
.rb-gallery-grid figure { margin: 0; min-width: 0; }
.rb-gallery-grid figure:nth-child(5n + 1) { grid-column: span 2; }
.rb-gallery-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: .75rem; }
.rb-gallery-grid figure:nth-child(5n + 1) img { aspect-ratio: 16 / 10; }
/* Tema Fase 1: a last photo that would stand alone in its row takes the whole row. */
.rb-gallery-grid figure:last-child:is(:nth-child(5n + 2), :nth-child(5n + 4)) { grid-column: span 2; }
.rb-gallery-grid figure:last-child:is(:nth-child(5n + 2), :nth-child(5n + 4)) img { aspect-ratio: 16 / 10; }
.rb-gallery-grid figcaption { font-size: .85rem; color: var(--muted); padding: .35rem .25rem 0; }
.rb-video { max-width: 44rem; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 1rem; overflow: hidden; background: var(--surface); }
.rb-video iframe { width: 100%; height: 100%; border: 0; display: block; }
#rb-video .rb-note { text-align: center; margin-top: .75rem; }

/* ---------- Gifts, responses, closing ---------- */
.rb-gift-shell { margin-top: 1rem; }
.rb-gift-shell summary { list-style: none; }
.rb-gift-shell summary::-webkit-details-marker { display: none; }
.rb-gift-shell[open] summary { background: transparent; color: var(--accent); }
.rb-gift-list { display: grid; gap: 1rem; margin-top: 1.25rem; }
.rb-gift { padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.rb-gift p { margin: 0 0 .25rem; }
.rb-gift-number { font: 600 1.25rem/1.3 var(--body); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.rb-gift .rb-button { margin-top: .5rem; }
.rb-form { margin-top: 1.5rem; text-align: left; }
.rb-form > fieldset, .rb-attendance { min-width: 0; margin: 0; padding: 0; border: 0; }
.rb-field { display: grid; gap: .35rem; margin-bottom: 1rem; font-weight: 600; font-size: .95rem; }
.rb-field[hidden] { display: none; }
.rb-field :is(input, select, textarea) { width: 100%; min-height: 46px; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface);
    color: var(--ink); font: 400 1rem/1.4 var(--body); }
.rb-field textarea { min-height: 7rem; resize: vertical; }
.rb-field :is(input, select, textarea):focus-visible { outline: 3px solid var(--rb-gold); outline-offset: 2px; }
.rb-attendance legend { margin-bottom: .35rem; font-weight: 600; font-size: .95rem; }
.rb-attendance-options { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.rb-attendance-options input { position: absolute; opacity: 0; pointer-events: none; }
.rb-attendance-options label { display: grid; place-items: center; min-height: 46px; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); cursor: pointer; text-shadow: none; }
.rb-attendance-options input:checked + label { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.rb-attendance-options input:focus-visible + label { outline: 3px solid var(--rb-gold); outline-offset: 2px; }
.rb-submit { width: 100%; min-height: 48px; margin-top: .25rem; border-radius: 1rem; }
.rb-submit:disabled { opacity: .6; cursor: progress; }
.rb-form-status { min-height: 1.3rem; margin: .75rem 0 0; color: var(--muted); font-size: .9rem; text-align: center; }
.rb-wish-list { display: grid; gap: .6rem; max-height: min(60svh, 32rem); margin: 1rem 0 0; padding: 0 .2rem 0 0; overflow-y: auto; list-style: none; text-align: left; overscroll-behavior: contain; }
.rb-wish-list .cine-wish { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.rb-wish-list .cine-wish strong { display: block; font-size: .95rem; }
.rb-wish-list .cine-wish p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; text-shadow: none; }
.rb-wish-list .cine-like { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem; min-width: 44px; min-height: 44px; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 999px;
    background: transparent; color: var(--muted); font: 600 .85rem var(--body); cursor: pointer; }
.rb-wish-list .cine-like svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rb-wish-list .cine-like.is-liked { color: #a3352d; }
.rb-wish-list .cine-like.is-liked svg { fill: currentColor; }
.rb-closing { display: flex; flex-direction: column; text-align: center; padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
.rb-closing > :first-child { margin-top: auto; }
.rb-closing-photo { width: min(60cqi, 15rem); aspect-ratio: 3 / 4; object-fit: cover; margin: 0 auto 2.5rem; border-radius: 50%; box-shadow: 0 0 0 6px var(--rb-card), 0 0 0 7px var(--rb-gold); }
.rb-closing-names { font: 400 clamp(3.5rem, 15cqi, 4.75rem)/.95 var(--script); color: var(--accent); margin: .25rem 0 0; }
.rb-credit { display: grid; justify-items: center; gap: .25rem; margin-top: auto; padding-top: 3rem; font-size: .75rem; color: var(--muted); }
.rb-credit p { margin: 0; }
.rb-logo { width: 5.5rem; height: auto; }
.rb-logo-light { display: none; }
:root[data-scheme="dark"] .rb-logo-ink { display: none; }
:root[data-scheme="dark"] .rb-logo-light { display: block; }

/* ---------- Music and light/dark controls ---------- */
[data-theme="rimba"] .music-toggle { background: radial-gradient(circle, var(--rb-gold) 0 18%, var(--accent) 19% 23%, #2a221b 24% 100%); color: #fff; border: 2px solid var(--rb-gold); }
[data-theme="rimba"] .music-toggle[aria-pressed="true"] { animation: rb-spin 6s linear infinite; }
/* Tema Fase 1: the record turns, the volume icon on it stays upright. */
[data-theme="rimba"] .music-toggle[aria-pressed="true"] :is(.ua-volume, .mt-icon) { animation: rb-spin 6s linear infinite reverse; }
[data-theme="rimba"] .scheme-toggle { background: var(--surface); color: var(--accent); }

/* ---------- Opening cover ---------- */
/* Perbaikan 2026-11-17: the cover scrolls when it is taller than the screen (a phone held sideways, a short
   laptop window); it used to hide the overflow, and with it the "Buka Undangan" button. Names and sprig
   also scale with the screen height, so most windows need no scrolling at all. */
.rb-opening { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: 1fr auto; overflow-x: hidden; overflow-y: auto; color: var(--ink);
    padding: max(2rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left)); }
.rb-opening[hidden] { display: none; }
.rb-opening-veil { position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(var(--rb-fog), .3), rgba(var(--rb-fog), .72) 70%, rgba(var(--rb-fog), .9));
    transition: opacity 1s ease .35s; }
.rb-opening-veil.has-cover { background: linear-gradient(180deg, rgba(var(--rb-fog), .62), rgba(var(--rb-fog), .82) 70%, rgba(var(--rb-fog), .94)), var(--cover) center / cover; }
:root[data-scheme="dark"] .rb-opening-veil { background-color: rgba(17, 23, 18, .7); background-blend-mode: multiply; }
.rb-opening-sprig { position: absolute; top: -3%; right: -8%; width: min(54vw, 19rem, 32svh); height: auto; transform-origin: 85% 10%;
    animation: rb-sway 7s ease-in-out infinite; transition: transform 1.1s var(--rb-dolly-ease), opacity .8s ease; }
.rb-opening-names { position: relative; z-index: 1; align-self: center; justify-self: end; text-align: right; max-width: 22rem; padding-top: calc(min(54vw, 19rem, 32svh) * .8); transition: transform 1.1s var(--rb-dolly-ease), opacity .8s ease; }
.rb-opening-title { display: grid; justify-items: end; font: 400 clamp(3.25rem, min(20vw, 12svh), 6rem)/.85 var(--script); color: var(--accent); margin: 0; }
.rb-opening-title .rb-amp { font-size: .55em; margin-right: 1.25em; }
.rb-opening-date { font: italic 1rem/1.4 var(--body); margin-top: .75rem; }
.rb-opening-guest { display: grid; justify-items: center; gap: .15rem; text-align: center; transition: transform .9s var(--rb-dolly-ease), opacity .7s ease; }
.rb-opening-guest p { margin: 0; }
.rb-opening-to { font-size: .9rem; color: var(--muted); }
/* Tema Fase 1: the guest's name is the cover's moment. */
.rb-guest-name { font: 500 clamp(1.45rem, 6.4vw, 1.75rem)/1.3 var(--heading); }
.rb-opening-guest .rb-note { max-width: 20rem; margin-bottom: .9rem; }
.rb-opening.is-closing { pointer-events: none; }
.rb-opening.is-closing .rb-opening-names { transform: translate3d(45%, -35%, 0) scale(.2); opacity: 0; }
.rb-opening.is-closing .rb-opening-sprig { transform: translate3d(35%, -60%, 0) scale(.2); opacity: 0; }
.rb-opening.is-closing .rb-opening-guest { transform: translate3d(0, 3rem, 0); opacity: 0; }
.rb-opening.is-closing .rb-opening-veil { opacity: 0; }

/* ---------- Entrances (only once rimba.js has marked the page) ---------- */
[data-rv] { transition: opacity 1s ease, transform 1.4s var(--rb-out); transition-delay: calc(var(--i, 0) * 90ms); }
/* Hidden at once (no fade-out when the script arrives); the entrance itself is animated. */
.rb-motion [data-rv]:not(.is-in) { opacity: 0; transition: none; }
.rb-motion [data-rv="up"]:not(.is-in) { transform: translate3d(0, 28px, 0); }
.rb-motion [data-rv="left"]:not(.is-in) { transform: translate3d(-32px, 0, 0); }
.rb-motion [data-rv="right"]:not(.is-in) { transform: translate3d(32px, 0, 0); }
.rb-motion [data-rv="zoom"]:not(.is-in) { transform: scale(.92); }

/* ---------- Wider columns (tablet portrait): more room inside the same layout ---------- */
@container rb (min-width: 640px) {
    .rb-person-card { padding: 2.5rem 2.25rem; }
    .rb-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: .75rem; }
    .rb-gallery-grid figure:nth-child(5n + 1) { grid-row: span 2; grid-column: auto; }
    .rb-gallery-grid figure:last-child:is(:nth-child(5n + 2), :nth-child(5n + 4)) { grid-column: auto; }
    .rb-gallery-grid figure:last-child:is(:nth-child(5n + 2), :nth-child(5n + 4)) img { aspect-ratio: 3 / 4; }
    .rb-gallery-grid figure:nth-child(5n + 1) img { aspect-ratio: auto; height: 100%; }
}

/* ---------- Wide screens: a phone-sized invitation beside the forest and the couple's names ---------- */
.rb-aside { display: none; }
@media (min-width: 900px) {
    :root[data-theme="rimba"] { --rb-colw: 430px; }
    .rb-main { width: var(--rb-colw); margin-left: auto; }
    .rb-stage, .rb-opening, .rb-opening-veil { left: auto; width: var(--rb-colw); }
    .rb-stage { box-shadow: -30px 0 60px -20px rgba(20, 26, 18, .45); }
    .rb-aside { display: grid; place-items: center; position: fixed; inset: 0 var(--rb-colw) 0 0; z-index: -2; padding: 3rem clamp(2rem, 6vw, 7rem); text-align: center;
        background: linear-gradient(90deg, rgba(var(--rb-fog), .62), rgba(var(--rb-fog), .3)), url("img/bg-forest.webp") center 35% / cover no-repeat; }
    :root[data-scheme="dark"] .rb-aside { background-image: linear-gradient(90deg, rgba(10, 16, 12, .72), rgba(10, 16, 12, .45)), url("img/bg-night.webp"); }
    .rb-aside-inner { max-width: 40rem; }
    .rb-aside-names { font: 400 clamp(5rem, 8vw, 8.5rem)/.85 var(--script); color: var(--accent); margin: .5rem 0 1rem; }
    .rb-aside-date { font: italic 1.25rem/1.4 var(--body); color: var(--ink); }
    .rb-aside-quote { margin: 2.5rem auto 0; max-width: 32rem; font: italic 1.05rem/1.7 var(--body); color: var(--ink); }
    .rb-aside-quote cite { display: block; margin-top: .5rem; font-style: normal; font-weight: 600; color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
    .rb *, .rb *::before, .rb-opening, .rb-opening *, [data-theme="rimba"] .music-toggle, [data-theme="rimba"] .music-toggle * { animation: none !important; transition: none !important; }
    .rb-far, .rb-mid, .rb-hero-ground, .rb-arch, .rb-flight, .rb-wing { transform: none; }
    .rb-mid-next { opacity: 0; }
    .rb-arch { opacity: 1; }
    body.is-locked .rb-dolly, body.is-locked .rb-hero-arch { transform: none; opacity: 1; }
}

/* Janur stage 8: the arch, bushes and ground step in after the cover opens, so they wait for it. */
:root.has-cover .rb-hero-ground, :root.has-cover .rb-bush { background-image: none; }
/* Only the picture waits; its wrapper keeps the locked transform, so the arch still steps in when the cover opens. */
:root.has-cover .rb-arch, :root.has-cover .rb-portal-frame { display: none; }
