/* ==========================================================================
   Copilărie - kids' party as a board game
   Signature: the letters of the name bounce in one by one; the programme is a
   winding path of coloured squares from START to the cake, with a pawn that
   hops from square to square as you scroll (script.js); the countdown sits on
   dice and the gallery is a collection of trading cards.
   Palette: --inv-primary, --inv-accent + fixed toy colours, --inv-bg, --inv-text
   ========================================================================== */

.copilarie {
    --cp-red: #EF4B4B;
    --cp-yellow: #FFC93C;
    --cp-teal: #19B8A8;
    --cp-pink: #FF7AB6;
    --cp-ink: var(--inv-text);
    --cp-muted: color-mix(in srgb, var(--inv-text) 66%, var(--inv-bg));
    --kit-radius: 16px;
    font-family: var(--inv-font-body);
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--inv-text);
    background:
        radial-gradient(circle, color-mix(in srgb, var(--inv-primary) 14%, transparent) 2px, transparent 2.5px) 0 0 / 34px 34px,
        var(--inv-bg);
    overflow-x: clip;
}
.copilarie h1, .copilarie h2, .copilarie h3 { font-family: var(--inv-font-heading); font-weight: 700; line-height: 1.05; }
/* zero specificity, so the template's own heading classes can set their spacing */
:where(.copilarie) :is(h1, h2, h3) { margin: 0; }
.cp-kicker { font-size: .85rem; font-weight: 700; color: var(--inv-primary); margin: 0 0 6px; }
.cp-h2 { font-size: clamp(2.3rem, 6vw, 3.6rem); color: var(--inv-primary); margin-bottom: 26px !important; text-shadow: 3px 3px 0 var(--inv-accent); }
.cp-h2--big { font-size: clamp(2.6rem, 7vw, 4.2rem); }
.cp-sticker { display: inline-block; margin: 0 0 12px; padding: 6px 16px; border-radius: 999px; background: var(--cp-teal); color: #fff; font-weight: 700; rotate: -2deg; }
.cp-sticker--tilt { rotate: 3deg; background: var(--cp-pink); }

/* ---------- Navigation ---------- */
.cp-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: 16px clamp(16px, 4vw, 44px); display: flex; justify-content: flex-end; }
.cp-nav .kit-nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cp-nav a { text-decoration: none; font-weight: 700; font-size: .95rem; color: var(--inv-text); padding: 6px 14px; border-radius: 999px; background: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--inv-text) 20%, transparent); }
.cp-nav a:hover, .cp-nav a.is-current { background: var(--inv-accent); }
.cp-nav .kit-nav-brand { font-family: var(--inv-font-heading); font-size: 1.5rem; color: var(--inv-primary); margin-right: auto; background: none; box-shadow: none; padding-left: 0; }
.cp-nav.is-stuck { align-items: center; padding: 8px clamp(16px, 4vw, 44px); background: color-mix(in srgb, var(--inv-bg) 94%, transparent); box-shadow: 0 4px 0 var(--inv-accent); }
.copilarie .kit-to-top { background: var(--cp-red); color: #fff; }
@media (max-width: 899px) {
    .cp-nav { padding: 10px 12px; }
    .cp-nav .kit-nav-toggle { color: var(--inv-primary); font-size: 1.6rem; margin-left: auto; }
    .cp-nav .kit-nav-links { display: none; }
    .cp-nav.is-open .kit-nav-links { display: flex; flex-direction: column; gap: 8px; position: absolute; top: 58px; left: 12px; right: 12px; padding: 18px; background: var(--inv-bg); border: 3px solid var(--inv-text); border-radius: 22px; }
}

/* ---------- Hero ---------- */
.cp-hero { min-height: 100svh; display: grid; align-items: center; padding: 100px clamp(20px, 5vw, 64px) 70px; overflow: clip; }
.cp-hero-grid { width: min(1140px, 100%); margin: 0 auto; display: grid; gap: 50px; align-items: center; }
@media (min-width: 900px) { .cp-hero-grid { grid-template-columns: 1.1fr .9fr; } }
.cp-bubble { position: relative; display: inline-block; margin: 0 0 20px; padding: 10px 20px; border-radius: 22px; background: #fff; border: 3px solid var(--inv-text); font-weight: 700; font-size: 1.1rem; }
.cp-bubble::after { content: ""; position: absolute; left: 30px; bottom: -14px; width: 20px; height: 20px; background: #fff; border-right: 3px solid var(--inv-text); border-bottom: 3px solid var(--inv-text); rotate: 45deg; }
.cp-title { font-size: clamp(3.4rem, 10vw, 6.8rem); line-height: 1; }
.cp-letter { display: inline-block; color: var(--cp-c, var(--inv-primary)); text-shadow: 4px 4px 0 var(--inv-text); -webkit-text-stroke: 2px var(--inv-text); animation: cp-bounce .7s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * .07s + .2s); }
.cp-letter:nth-child(5n+1) { --cp-c: var(--cp-red); }
.cp-letter:nth-child(5n+2) { --cp-c: var(--cp-yellow); }
.cp-letter:nth-child(5n+3) { --cp-c: var(--cp-teal); }
.cp-letter:nth-child(5n+4) { --cp-c: var(--cp-pink); }
.cp-letter:nth-child(5n) { --cp-c: var(--inv-primary); }
@keyframes cp-bounce { from { translate: 0 -60px; scale: .6; opacity: 0; } to { translate: 0 0; scale: 1; opacity: 1; } }
.cp-letter:hover { animation: cp-wiggle .5s; }
@keyframes cp-wiggle { 25% { rotate: -10deg; } 75% { rotate: 10deg; } }
.cp-subtitle { max-width: 520px; margin: 22px 0 0; font-size: 1.18rem; }
.cp-when { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.cp-when span { padding: 8px 16px; border-radius: 12px; background: #fff; border: 3px solid var(--inv-text); font-weight: 700; box-shadow: 4px 4px 0 var(--inv-accent); }
.cp-hero-visual { position: relative; width: min(380px, 78vw); margin: 0 auto; }
.cp-card-photo { margin: 0; padding: 12px 12px 50px; border-radius: 22px; background: #fff; border: 4px solid var(--inv-text); box-shadow: 10px 10px 0 var(--inv-primary); rotate: 3deg; }
.cp-card-photo img { display: block; width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; border-radius: 12px; }
.cp-age-die { position: absolute; left: -26px; bottom: -20px; display: grid; place-content: center; width: 110px; height: 110px; border-radius: 22px; background: var(--cp-red); color: #fff; border: 4px solid var(--inv-text); box-shadow: 6px 6px 0 var(--inv-text); rotate: -12deg; text-align: center; animation: cp-roll 1s cubic-bezier(.3, 1.4, .5, 1) .8s both; }
.cp-age-die strong { font-family: var(--inv-font-heading); font-size: 3.2rem; line-height: .9; }
.cp-age-die small { font-weight: 700; }
@keyframes cp-roll { from { rotate: -200deg; translate: -80px -60px; opacity: 0; } to { rotate: -12deg; translate: 0 0; opacity: 1; } }
.cp-toy { position: absolute; animation: cp-float 4s ease-in-out infinite alternate; }
.cp-toy--star { top: -30px; right: -20px; width: 64px; height: 64px; background: var(--cp-yellow); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.cp-toy--ball { right: -30px; bottom: 60px; width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--cp-red) 0 25%, #fff 0 50%, var(--cp-teal) 0 75%, #fff 0); border: 3px solid var(--inv-text); animation-delay: -1.5s; }
.cp-toy--block { top: 40%; left: -40px; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 8px; background: var(--cp-teal); color: #fff; font-family: var(--inv-font-heading); font-size: 1.6rem; border: 3px solid var(--inv-text); rotate: 10deg; animation-delay: -2.4s; }
@keyframes cp-float { to { translate: 0 -14px; } }
@media (max-width: 899px) { .cp-hero-text { text-align: center; } .cp-subtitle { margin-inline: auto; } .cp-when { justify-content: center; } .cp-bubble::after { left: 50%; margin-left: -10px; } .cp-toy--block { left: -14px; } .cp-toy--ball { right: -10px; } .cp-toy--star { right: 0; } }

/* ---------- Sections ---------- */
.cp-section { max-width: 1060px; margin: 0 auto; padding: clamp(60px, 9vw, 100px) 22px; }
.cp-welcome, .cp-theme, .cp-events, .cp-gallery, .cp-info, .cp-contact, .cp-countdown { text-align: center; }
.cp-prose { max-width: 640px; margin: 0 auto; font-size: 1.16rem; }
.cp-prose p { margin: 0 0 1em; }

/* Celebrant */
.cp-band { background: color-mix(in srgb, var(--inv-accent) 22%, var(--inv-bg)); border-block: 4px solid var(--inv-text); }
.cp-band-inner { max-width: 1000px; margin: 0 auto; padding: clamp(60px, 9vw, 100px) 22px; }
.cp-celebrant-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 760px) { .cp-celebrant-grid { grid-template-columns: 300px 1fr; gap: 56px; } }
.cp-portrait { margin: 0 auto; width: min(280px, 72vw); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 5px solid var(--inv-text); box-shadow: 8px 8px 0 var(--cp-pink); }
.cp-portrait img, .cp-initial { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-initial { display: grid; place-items: center; background: #fff; font-family: var(--inv-font-heading); font-size: 6rem; color: var(--inv-primary); }
.cp-celebrant p { margin: 0 0 .8em; }
@media (max-width: 759px) { .cp-celebrant-grid > div { text-align: center; } }

/* ---------- Game board ---------- */
.cp-board { position: relative; display: grid; gap: 34px 26px; padding-top: 40px; text-align: left; }
@media (min-width: 760px) { .cp-board { grid-template-columns: 1fr 1fr; } .cp-board > .cp-square:nth-child(4n+1), .cp-board > .cp-square:nth-child(4n+2) { } }
.cp-square { position: relative; padding: 24px 22px 22px; border-radius: 20px; border: 4px solid var(--inv-text); background: #fff; box-shadow: 6px 6px 0 var(--inv-text); transition: translate .3s, box-shadow .3s; }
.cp-square--event { --sq: var(--cp-yellow); background: color-mix(in srgb, var(--sq) 30%, #fff); }
.cp-square--event[style*="--c: 1"] { --sq: var(--cp-teal); }
.cp-square--event[style*="--c: 2"] { --sq: var(--cp-pink); }
.cp-square--event[style*="--c: 3"] { --sq: var(--cp-red); }
.cp-square--start, .cp-square--finish { display: grid; place-items: center; min-height: 90px; font-family: var(--inv-font-heading); font-size: 2rem; color: #fff; text-align: center; }
.cp-square--start { background: var(--inv-primary); }
.cp-square--finish { background: var(--cp-red); }
.cp-square--finish::before { content: "🎂"; margin-right: 10px; }
.cp-square.is-here { translate: -3px -3px; box-shadow: 9px 9px 0 var(--inv-text); }
.cp-square-num { position: absolute; top: -18px; right: 18px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--inv-text); color: #fff; font-family: var(--inv-font-heading); }
.cp-event-time { font-family: var(--inv-font-heading); font-size: 2.2rem; color: var(--inv-primary); margin: 0; line-height: 1; }
.cp-square h3 { font-size: 1.45rem; margin: 6px 0; }
.cp-event-place { font-weight: 700; margin: 8px 0 0; }
.cp-event-notes { margin: 4px 0 0; }
.copilarie .kit-event-actions { justify-content: flex-start; margin-top: 12px; }
.copilarie .kit-button { border-radius: 999px; border: 3px solid var(--inv-text); color: var(--inv-text); background: #fff; font-weight: 700; box-shadow: 3px 3px 0 var(--inv-text); }
.copilarie .kit-button:hover { background: var(--inv-accent); }
.cp-pawn { position: absolute; top: 0; left: 0; z-index: 3; width: 44px; height: 60px; pointer-events: none; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); }
.cp-pawn::before { content: ""; position: absolute; left: 10px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--cp-red); border: 3px solid var(--inv-text); }
.cp-pawn::after { content: ""; position: absolute; left: 4px; top: 22px; width: 36px; height: 34px; background: var(--cp-red); border: 3px solid var(--inv-text); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); border-radius: 0 0 8px 8px; }
.cp-pawn.is-hop { animation: cp-hop .6s ease; }
@keyframes cp-hop { 40% { margin-top: -26px; } }

/* ---------- Countdown on dice ---------- */
.cp-dice .kit-countdown { gap: clamp(12px, 3vw, 28px); margin-top: 16px; }
.cp-dice .kit-countdown-unit { width: clamp(76px, 18vw, 116px); aspect-ratio: 1; min-width: 0; align-content: center; border-radius: 20px; background: #fff; border: 4px solid var(--inv-text); box-shadow: 6px 6px 0 var(--inv-text); rotate: -4deg; }
.cp-dice .kit-countdown-unit:nth-child(2) { rotate: 3deg; background: var(--cp-yellow); }
.cp-dice .kit-countdown-unit:nth-child(3) { rotate: -2deg; background: color-mix(in srgb, var(--cp-teal) 40%, #fff); }
.cp-dice .kit-countdown-unit:nth-child(4) { rotate: 5deg; background: color-mix(in srgb, var(--cp-pink) 40%, #fff); }
.cp-dice.is-visible .kit-countdown-unit { animation: cp-roll-die .9s cubic-bezier(.3, 1.4, .5, 1) both; }
.cp-dice.is-visible .kit-countdown-unit:nth-child(2) { animation-delay: .12s; }
.cp-dice.is-visible .kit-countdown-unit:nth-child(3) { animation-delay: .24s; }
.cp-dice.is-visible .kit-countdown-unit:nth-child(4) { animation-delay: .36s; }
@keyframes cp-roll-die { from { transform: translateY(-40px) rotate(-180deg); opacity: 0; } }
.cp-dice .kit-countdown-value { font-family: var(--inv-font-heading); color: var(--inv-text); font-size: clamp(1.9rem, 5.5vw, 2.9rem); }
.cp-dice .kit-countdown-label { font-weight: 700; font-size: clamp(.6rem, 1.8vw, .78rem); opacity: 1; }

/* ---------- Gallery: trading cards ---------- */
.cp-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; counter-reset: card; }
@media (min-width: 760px) { .cp-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.cp-gallery-grid a { position: relative; overflow: visible; aspect-ratio: 3 / 4; padding: 10px 10px 40px; border-radius: 16px; background: var(--cp-yellow); border: 4px solid var(--inv-text); box-shadow: 6px 6px 0 var(--inv-text); counter-increment: card; transition: rotate .3s, translate .3s; }
.cp-gallery-grid a:nth-child(3n+2) { background: var(--cp-teal); }
.cp-gallery-grid a:nth-child(3n) { background: var(--cp-pink); }
.cp-gallery-grid img { border-radius: 8px; border: 3px solid var(--inv-text); box-sizing: border-box; }
.cp-gallery-grid a::after { content: "#" counter(card); position: absolute; left: 14px; bottom: 8px; font-family: var(--inv-font-heading); color: var(--inv-text); font-size: 1.1rem; }
.cp-gallery-grid a:hover { rotate: -3deg; translate: 0 -6px; }
.cp-gallery-grid a:hover img { transform: none; }

/* RSVP */
.cp-rsvp-card { max-width: 680px; margin: 0 auto; padding: clamp(28px, 5vw, 50px); border-radius: 28px; background: #fff; border: 4px solid var(--inv-text); box-shadow: 10px 10px 0 var(--inv-primary); text-align: center; }
.copilarie .inv-rsvp__submit { border-radius: 999px; font-weight: 700; border: 3px solid var(--inv-text); }

/* Info */
.cp-info-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); text-align: left; }
.cp-info-item { padding: 24px; border-radius: 20px; background: #fff; border: 3px solid var(--inv-text); box-shadow: 5px 5px 0 var(--inv-accent); }
.cp-info-item h3 { font-size: 1.35rem; color: var(--inv-primary); margin-bottom: 6px; }
.cp-info-item p { margin: 0 0 .5em; }
.cp-faq { max-width: 720px; margin: 44px auto 0; }
.cp-faq details { text-align: left; margin-bottom: 10px; padding: 14px 20px; border-radius: 16px; background: #fff; border: 3px solid var(--inv-text); }
.cp-faq summary { cursor: pointer; font-weight: 700; list-style: none; }
.cp-faq summary::-webkit-details-marker { display: none; }
.cp-faq summary::before { content: "?"; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 50%; background: var(--inv-accent); font-family: var(--inv-font-heading); }
.cp-faq details p { margin: 8px 0 0 36px; }

/* Contact */
.cp-contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.cp-contact-person { min-width: 220px; padding: 22px 28px; border-radius: 20px; background: #fff; border: 3px solid var(--inv-text); box-shadow: 5px 5px 0 var(--cp-teal); }
.cp-contact-name { font-family: var(--inv-font-heading); font-size: 1.6rem; margin: 0 0 4px; }
.cp-contact-person a { color: var(--inv-primary); font-weight: 700; text-decoration: none; }

/* Footer */
.cp-footer { padding: 70px 22px 60px; text-align: center; background: var(--inv-primary); color: #fff; border-top: 4px solid var(--inv-text); }
.cp-footer-title { font-family: var(--inv-font-heading); font-size: clamp(2.6rem, 8vw, 4.4rem); margin: 0 0 10px; text-shadow: 4px 4px 0 var(--inv-text); }
.cp-footer-message { margin: 0 0 6px; font-size: 1.2rem; }
.cp-hashtag { color: var(--inv-accent); font-weight: 700; margin: 0 0 6px; }
.cp-footer .cp-kicker { color: #fff; }

@media (prefers-reduced-motion: reduce) { .cp-letter, .cp-age-die, .cp-toy, .cp-dice.is-visible .kit-countdown-unit, .cp-pawn.is-hop { animation: none; } }

/* Start stays compact; the cake square closes the track on its own row */
.cp-square--start { align-self: start; }
@media (min-width: 760px) { .cp-square--finish { grid-column: 1 / -1; justify-self: center; width: min(420px, 100%); } }
