/* ==========================================================================
   Porțelan - fine hand-painted china: the photo sits in the well of a plate whose rim paints itself, stroke by stroke;
   the plates turn slowly as the guest scrolls and a sheen crosses the glaze; tiles with ornate corners, gold rims
   Palette: --inv-primary (the painted motifs: cobalt, pink, celadon or gold), --inv-accent (the gold rims), --inv-bg, --inv-text
   script.js paints the rims on canvases with --po-paint and --po-gold, and sets --po-turn / --po-shine on <body>
   ========================================================================== */

.portelan {
    --po-script: 'The Nautigal', 'Segoe Script', cursive;
    --po-paint: var(--inv-primary);
    --po-gold: color-mix(in srgb, var(--inv-accent) 85%, var(--inv-text));
    --po-ink-soft: color-mix(in srgb, var(--inv-text) 70%, var(--inv-bg));
    --po-line: color-mix(in srgb, var(--inv-primary) 26%, transparent);
    --po-glaze: color-mix(in srgb, var(--inv-surface) 91%, var(--inv-accent));
    --po-glaze-shade: color-mix(in srgb, var(--po-glaze) 88%, var(--inv-primary));
    --po-shadow: 0 1px 2px color-mix(in srgb, var(--inv-text) 12%, transparent), 0 28px 50px -34px color-mix(in srgb, var(--inv-primary) 60%, transparent);
    --po-corner-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='black' stroke-linecap='round'%3E%3Cpath stroke-width='1.3' d='M1 1H34M1 1V34'/%3E%3Cpath stroke-width='.9' d='M5 5H22M5 5V22'/%3E%3Cpath stroke-width='1.3' d='M10 26C10 16 16 10 26 10C30 10 32 13 30 15C28 17 25 15 26 13'/%3E%3C/g%3E%3Cpath d='M11 11c8 0 11 3 11 11c-8 0-11-3-11-11z'/%3E%3Ccircle cx='38' cy='5' r='1.8'/%3E%3Ccircle cx='5' cy='38' r='1.8'/%3E%3Ccircle cx='28' cy='6' r='1.1'/%3E%3Ccircle cx='6' cy='28' r='1.1'/%3E%3C/svg%3E");
    --po-motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M30 18c4 6 4 9 0 12c-4-3-4-6 0-12zM30 42c4-6 4-9 0-12c-4 3-4 6 0 12zM18 30c6-4 9-4 12 0c-3 4-6 4-12 0zM42 30c-6-4-9-4-12 0c3 4 6 4 12 0z'/%3E%3Ccircle cx='0' cy='0' r='2'/%3E%3Ccircle cx='60' cy='0' r='2'/%3E%3Ccircle cx='0' cy='60' r='2'/%3E%3Ccircle cx='60' cy='60' r='2'/%3E%3C/svg%3E");
    --kit-radius: 4px;
    --kit-field-bg: var(--inv-surface);
    --kit-field-border: var(--po-line);
    font-family: var(--inv-font-body);
    font-size: 1.08rem;
    line-height: 1.7;
    background:
        radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--inv-primary) 9%, transparent), transparent 70%),
        var(--inv-bg);
    overflow-x: clip;
}
/* A faint painted pattern behind everything, like the glaze of a tiled wall */
.portelan::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background-color: var(--inv-primary); opacity: .035;
    -webkit-mask: var(--po-motif) 0 0 / 72px 72px repeat; mask: var(--po-motif) 0 0 / 72px 72px repeat; }
.portelan h1, .portelan h2, .portelan h3 { font-family: var(--inv-font-heading); font-weight: 400; line-height: 1.2; }
:where(.portelan) :is(h1, h2, h3) { margin: 0; }
:where(.portelan) p { margin: 0 0 .9em; }
.portelan a { color: var(--inv-primary); }
.po-kicker { font-size: .74rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--inv-primary); margin: 0 0 10px; }
.po-role { font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--po-ink-soft); margin: 0 0 6px; }
.po-names-line { font-family: var(--inv-font-heading); font-size: 1.3rem; margin: 0; }
.po-hero, .po-main, .po-footer { position: relative; z-index: 1; }
.po-hero { z-index: 2; }

/* ---------- The plates ---------- */
.po-plate { --size: 200px; position: relative; width: var(--size); max-width: 100%; aspect-ratio: 1; border-radius: 50%; isolation: isolate;
    background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--po-glaze) 70%, white), var(--po-glaze) 46%, var(--po-glaze-shade) 100%);
    box-shadow: var(--po-shadow), inset 0 -6px 14px color-mix(in srgb, var(--inv-primary) 10%, transparent); }
.po-paint { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; transform: rotate(calc(var(--po-turn, 0) * 1deg)); }
.po-well { position: absolute; inset: 21%; border-radius: 50%; overflow: hidden; background: var(--po-glaze-shade);
    box-shadow: 0 0 0 2px var(--po-gold), 0 0 0 5px var(--po-glaze), 0 0 0 6px color-mix(in srgb, var(--po-gold) 60%, transparent), inset 0 3px 10px color-mix(in srgb, black 30%, transparent); }
.po-well img { display: block; width: 100%; height: 100%; object-fit: cover; }
.po-initial { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--po-script); font-size: calc(var(--size) * .2); color: var(--inv-primary); }
/* the glaze: a fixed highlight, and a sheen that moves as the page scrolls */
.po-plate::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 2;
    background:
        radial-gradient(40% 24% at 30% 18%, color-mix(in srgb, white 55%, transparent), transparent 70%),
        linear-gradient(125deg, transparent 38%, color-mix(in srgb, white 38%, transparent) 48%, transparent 58%) calc(var(--po-shine, 50) * 1%) 50% / 260% 260% no-repeat;
    /* only on the rim: the photo in the well stays clear */
    -webkit-mask: radial-gradient(closest-side, transparent 0 59%, #000 61%); mask: radial-gradient(closest-side, transparent 0 59%, #000 61%); }

/* Tiles: glazed, a fine painted inner frame, ornate corners */
.po-tile { position: relative; background: linear-gradient(160deg, color-mix(in srgb, var(--po-glaze) 80%, white), var(--po-glaze) 60%); border: 1px solid var(--po-line); border-radius: 4px;
    box-shadow: var(--po-shadow), inset 0 0 0 6px var(--po-glaze), inset 0 0 0 7px var(--po-line); }
.po-tile::before { content: ""; position: absolute; inset: 10px; pointer-events: none; background-color: var(--po-paint); opacity: .85;
    -webkit-mask: var(--po-corner-tl) top left / 44px 44px no-repeat; mask: var(--po-corner-tl) top left / 44px 44px no-repeat; }
.po-tile::after { content: ""; position: absolute; inset: 10px; pointer-events: none; background-color: var(--po-paint); opacity: .85; transform: rotate(180deg);
    -webkit-mask: var(--po-corner-tl) top left / 44px 44px no-repeat; mask: var(--po-corner-tl) top left / 44px 44px no-repeat; }

/* Framed photos: a glazed mat with a painted line and a gold lip */
.po-framed { margin: 0; padding: 10px; background: var(--po-glaze); border-radius: 6px; box-shadow: var(--po-shadow), 0 0 0 1px var(--po-gold), inset 0 0 0 5px var(--po-glaze), inset 0 0 0 6px var(--po-line); }
.po-framed img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* A saucer: gold lip, a painted ring, the glaze in the middle */
.po-saucer span, .po-countdown .kit-countdown-value {
    display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; color: var(--inv-primary); font-family: var(--inv-font-heading);
    background: radial-gradient(circle, color-mix(in srgb, var(--po-glaze) 70%, white) 0 50%, var(--po-paint) 51% 53%, var(--po-glaze) 54% 80%, transparent 81%),
        repeating-conic-gradient(var(--po-paint) 0 4deg, transparent 4deg 15deg), var(--po-glaze);
    box-shadow: 0 0 0 2px var(--po-gold), var(--po-shadow);
}

/* ---------- Titles ---------- */
.po-title { margin: 0 auto clamp(28px, 4.5vw, 46px); text-align: center; }
.po-sprig { display: block; width: 104px; margin: 0 auto 10px; overflow: visible; }
.po-sprig-stem { fill: none; stroke: var(--po-paint); stroke-width: 1.6; stroke-linecap: round; }
.po-sprig-leaf, .po-sprig-dot { fill: var(--po-paint); }
.po-sprig-flower { fill: color-mix(in srgb, var(--po-paint) 30%, transparent); stroke: var(--po-paint); stroke-width: 1.4; }
.po-sprig-heart { fill: var(--po-gold); }
.kit-js .po-sprig-stem { stroke-dasharray: 1; stroke-dashoffset: 1; }
.kit-js .po-sprig :is(.po-sprig-leaf, .po-sprig-flower, .po-sprig-heart, .po-sprig-dot) { opacity: 0; transform: scale(.3); transform-box: fill-box; transform-origin: center; }
.kit-js .po-title.is-visible .po-sprig-stem { animation: po-draw 1.1s ease forwards; }
.kit-js .po-title.is-visible .po-sprig :is(.po-sprig-leaf, .po-sprig-flower, .po-sprig-heart, .po-sprig-dot) { animation: po-bloom .6s cubic-bezier(.3, 1.4, .5, 1) .7s forwards; }
.kit-js .po-title.is-visible .po-sprig :is(.po-sprig-flower, .po-sprig-heart) { animation-delay: 1.1s; }
@keyframes po-draw { to { stroke-dashoffset: 0; } }
@keyframes po-bloom { to { opacity: 1; transform: none; } }
.po-title h2 { font-size: clamp(2rem, 5.6vw, 2.8rem); letter-spacing: .01em; }

/* ---------- Navigation ---------- */
.po-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: center; padding: 18px; }
.po-nav .kit-nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; }
.po-nav a { text-decoration: none; font-size: .76rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--inv-text); padding: 6px 0; border-bottom: 1px solid transparent; }
.po-nav a:hover, .po-nav a.is-current { color: var(--inv-primary); border-bottom-color: currentColor; }
.po-nav .kit-nav-brand { font-family: var(--po-script); font-size: 1.9rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--inv-primary); margin-right: auto; border: 0; line-height: 1; }
.po-nav.is-stuck { justify-content: space-between; align-items: center; padding: 6px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--inv-bg) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--po-line); }
.portelan .kit-to-top { border-radius: 50%; background: var(--inv-surface); color: var(--inv-primary); border: 1px solid var(--po-line); }
@media (max-width: 899px) {
    .po-nav { justify-content: flex-end; padding: 12px; }
    .po-nav .kit-nav-toggle { width: 46px; height: 46px; border-radius: 50%; background: var(--inv-surface); color: var(--inv-primary); border: 1px solid var(--po-line); font-size: 1.2rem; }
    .po-nav .kit-nav-links { display: none; }
    .po-nav.is-open .kit-nav-links {
        display: flex; flex-direction: column; gap: 12px; position: absolute; top: 66px; left: 12px; right: 12px;
        padding: 24px; border-radius: 6px; background: var(--inv-surface); box-shadow: var(--po-shadow);
    }
    .po-nav.is-stuck { padding: 6px 12px; }
}

/* ---------- Hero: the plate with your photo, the names beneath ---------- */
.po-hero { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 92px 16px 64px; text-align: center; }
.po-hero-inner { width: min(760px, 100%); display: grid; justify-items: center; }
.po-hero-plate { --size: min(500px, 86vw); margin: 10px 0 24px; }
.portelan .po-names { font-family: var(--po-script); font-weight: 400; font-size: clamp(3.8rem, 13vw, 6.6rem); line-height: 1; color: var(--inv-primary); display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 .25em; overflow-wrap: anywhere; margin: 0; }
.po-and { font-family: var(--inv-font-heading); font-size: .36em; color: var(--po-gold); }
.po-hero-date { font-family: var(--inv-font-heading); font-size: 1.32rem; margin: 18px 0 2px; }
.po-hero-place { font-size: .74rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--po-ink-soft); margin: 0; }
.portelan .po-subtitle { max-width: 40ch; margin: 20px auto 0; color: var(--po-ink-soft); }
@keyframes po-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes po-set { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.kit-js .po-hero-inner > * { animation: po-rise 1.1s ease .9s both; }
.kit-js .po-hero-inner > .po-kicker { animation-delay: .1s; }
.kit-js .po-hero-inner > .po-hero-plate { animation: po-set 1.3s cubic-bezier(.3, .9, .4, 1) .2s both; }
.kit-js .po-hero-inner > :nth-child(n+4) { animation-delay: 1.3s; }
@media (min-width: 1000px) and (min-height: 760px) { .po-hero-plate { --size: 470px; } }

/* ---------- Sections ---------- */
.po-main { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }
.po-section { padding-top: clamp(78px, 11vw, 124px); }
.po-letter { padding: clamp(40px, 6vw, 66px) clamp(28px, 6vw, 66px); text-align: center; max-width: 780px; margin: 0 auto; }
.po-letter p { font-size: 1.1rem; }
.portelan .po-welcome-title { font-family: var(--po-script); font-size: clamp(2.8rem, 8vw, 3.8rem); line-height: 1.1; color: var(--inv-primary); margin-bottom: 14px; }
.po-quote-author { font-family: var(--inv-font-heading); color: var(--inv-primary); }
.po-lead { text-align: center; font-family: var(--inv-font-heading); font-style: italic; font-size: 1.22rem; color: var(--po-ink-soft); max-width: 40ch; margin: 0 auto 26px; }

/* Couple: two little plates with the portraits */
.po-couple-grid { display: grid; gap: 52px; justify-items: center; }
.po-person { text-align: center; max-width: 380px; display: grid; justify-items: center; }
.po-portrait { --size: min(300px, 74vw); margin-bottom: 22px; }
.po-person h3 { font-size: 1.6rem; margin: 6px 0 8px; }
.po-person p { color: var(--po-ink-soft); }
@media (min-width: 760px) { .po-couple-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

/* Family */
.po-family-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); text-align: center; }
.po-family-item { padding: 30px 26px; }

/* Story */
.po-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(46px, 7vw, 76px); }
.po-chapter { display: grid; gap: 28px; align-items: center; }
.po-chapter-photo { aspect-ratio: 4 / 3; }
.po-chapter-text h3 { font-size: 1.8rem; margin-bottom: 8px; }
.po-chapter-text p:not(.po-kicker) { color: var(--po-ink-soft); }
@media (min-width: 900px) {
    .po-chapter { grid-template-columns: 1fr 1fr; gap: 58px; }
    .po-chapter:nth-child(even) .po-chapter-photo { order: 2; }
}

/* Programme: each tile carries a saucer with the hour */
.po-moments { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.po-moment { padding: 34px 28px 30px; text-align: center; }
.po-saucer { margin: 0 auto 18px; width: max-content; }
.po-saucer span { width: 98px; font-size: 1.3rem; }
.po-moment h3 { font-size: 1.45rem; margin-bottom: 6px; }
.po-moment-place { font-weight: 600; margin: 12px 0 0; }
.po-moment-address, .po-moment-notes { color: var(--po-ink-soft); margin: 0; }
.po-moment-notes { font-style: italic; margin-top: 6px; }
.portelan .kit-button { border-radius: 999px; border: 1px solid var(--po-line); color: var(--inv-primary); background: transparent; font-size: .8rem; font-weight: 500; padding: 9px 16px; text-decoration: none; }
.portelan .kit-button:hover { background: var(--inv-primary); color: var(--inv-bg); }

/* Countdown: every number in a gold-rimmed saucer */
.po-countdown { text-align: center; }
.po-countdown .kit-countdown { gap: clamp(8px, 2.6vw, 22px); }
.po-countdown .kit-countdown-unit { min-width: 0; }
.po-countdown .kit-countdown-value { width: clamp(70px, 19.5vw, 118px); font-size: clamp(1.4rem, 5.4vw, 2.3rem); }
.po-countdown .kit-countdown-label { margin-top: 10px; opacity: 1; color: var(--po-ink-soft); }

/* Gallery */
.po-gallery-grid.kit-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 20px); }
.po-gallery-grid.kit-gallery a { aspect-ratio: 4 / 5; border-radius: 6px; padding: 7px; background: var(--po-glaze); box-shadow: var(--po-shadow), 0 0 0 1px var(--po-gold), inset 0 0 0 4px var(--po-glaze), inset 0 0 0 5px var(--po-line); }
.po-gallery-grid.kit-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
@media (min-width: 760px) { .po-gallery-grid.kit-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* RSVP */
.po-reply { max-width: 700px; margin: 0 auto; padding: clamp(40px, 6vw, 60px) clamp(26px, 6vw, 56px); }
.portelan .inv-rsvp__intro { font-family: var(--inv-font-heading); font-size: 1.14rem; }
.portelan .inv-rsvp__deadline { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--inv-primary); }
.portelan .inv-rsvp__choice label { border-radius: 999px; }

/* Info, contact */
.po-info-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.po-info-item { padding: 34px 26px 18px; text-align: center; }
.po-info-item h3 { font-size: 1.35rem; color: var(--inv-primary); margin-bottom: 8px; }
.po-faq { max-width: 720px; margin: 44px auto 0; text-align: center; }
.po-faq details { text-align: left; border-bottom: 1px solid var(--po-line); }
.po-faq details:first-of-type { border-top: 1px solid var(--po-line); }
.po-faq summary { cursor: pointer; list-style: none; padding: 16px 44px 16px 6px; position: relative; font-family: var(--inv-font-heading); font-size: 1.14rem; }
.po-faq summary::-webkit-details-marker { display: none; }
.po-faq summary::after { content: ""; position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--po-gold); transform: translateY(-50%); background: radial-gradient(circle, var(--po-paint) 0 2.5px, transparent 3px); transition: background .3s; }
.po-faq details[open] summary::after { background: var(--po-paint); }
.po-faq summary:focus-visible { outline: 2px solid var(--inv-primary); outline-offset: 2px; }
.po-faq details p { padding: 0 6px; color: var(--po-ink-soft); }
.po-faq details p:last-child { padding-bottom: 16px; }
.po-contact { text-align: center; }
.po-contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 60px; }
.po-contact-person a { text-decoration: none; }

/* Footer: a teacup with steam rising */
.po-footer { text-align: center; padding: clamp(110px, 15vw, 170px) 16px 70px; }
.po-cup { position: relative; width: 190px; margin: 0 auto 22px; }
.po-cup svg { display: block; width: 100%; overflow: visible; }
.po-cup-saucer { fill: var(--po-glaze-shade); stroke: var(--po-gold); stroke-width: 1.6; }
.po-cup-saucer-lip { fill: none; stroke: var(--po-paint); stroke-width: 1; opacity: .6; }
.po-cup-handle { fill: none; stroke: var(--po-gold); stroke-width: 6; stroke-linecap: round; }
.po-cup-body { fill: color-mix(in srgb, var(--po-glaze) 70%, white); stroke: var(--po-gold); stroke-width: 1.2; }
.po-cup-rim { fill: var(--po-glaze-shade); stroke: var(--po-gold); stroke-width: 2; }
.po-cup-band { fill: none; stroke: var(--po-paint); stroke-width: 1.6; }
.po-cup-motif, .po-cup-leaf { fill: var(--po-paint); }
.po-steam { position: absolute; bottom: 78%; width: 14px; height: 46px; border-left: 2px solid color-mix(in srgb, var(--inv-text) 30%, transparent); border-radius: 50%; opacity: 0; animation: po-steam 4.2s ease-in-out infinite; }
.po-steam:nth-child(1) { left: 34%; }
.po-steam:nth-child(2) { left: 46%; animation-delay: 1.4s; }
.po-steam:nth-child(3) { left: 58%; animation-delay: 2.8s; }
@keyframes po-steam { 0% { opacity: 0; transform: translateY(10px) scaleX(1); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-34px) scaleX(-1.4) rotate(8deg); } }
.po-footer-message { font-family: var(--inv-font-heading); font-style: italic; font-size: 1.25rem; color: var(--po-ink-soft); }
.po-footer-names { font-family: var(--po-script); font-size: clamp(3rem, 10vw, 5rem); line-height: 1.05; color: var(--inv-primary); margin: 6px 0 10px; }
.po-hashtag { letter-spacing: .12em; color: var(--inv-primary); }

@media (prefers-reduced-motion: reduce) {
    .kit-js .po-hero-inner > * { animation: none; }
    .kit-js .po-sprig-stem { stroke-dashoffset: 0; animation: none !important; }
    .kit-js .po-sprig :is(.po-sprig-leaf, .po-sprig-flower, .po-sprig-heart, .po-sprig-dot) { opacity: 1; transform: none; animation: none !important; }
    .po-steam { animation: none; opacity: .5; }
    .po-paint { transform: none; }
}
