/* ==========================================================================
   Animations & modern touches (shared by index.html and matika-cermat.html)
   Everything that moves is gated behind html.js-anim, which is only set when
   the visitor has not asked for reduced motion.
   ========================================================================== */

/* --- Scroll progress bar ------------------------------------------------ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #8c6d14, #d4af37, #f5d76e);
    pointer-events: none;
}

/* --- Header: stronger glass + shadow after scrolling -------------------- */
.glass-header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-header.is-scrolled {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 30px rgba(17, 24, 39, 0.08);
}

.nav-link {
    text-decoration-color: transparent;
    transition: color 0.2s ease, text-decoration-color 0.3s ease;
}

.nav-link.active {
    text-decoration-color: currentColor;
}

/* --- Hero entrance ------------------------------------------------------ */
@keyframes anim-fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes anim-fade-scale {
    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.js-anim main>section:first-child .grid>div:has(h1)>*,
.js-anim main>section:first-child h1>span {
    animation: anim-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.js-anim main>section:first-child .grid>div:has(h1)>*:nth-child(1) {
    animation-delay: 0.05s;
}

.js-anim main>section:first-child h1>span:nth-child(1) {
    animation-delay: 0.15s;
}

.js-anim main>section:first-child h1>span:nth-child(2) {
    animation-delay: 0.3s;
}

.js-anim main>section:first-child .grid>div:has(h1)>*:nth-child(3) {
    animation-delay: 0.45s;
}

.js-anim main>section:first-child .grid>div:has(h1)>*:nth-child(4) {
    animation-delay: 0.6s;
}

.js-anim main>section:first-child .grid>div:has(h1)>*:nth-child(n+5) {
    animation-delay: 0.75s;
}

/* The h1 itself only hosts the animated spans */
.js-anim main>section:first-child .grid>div:has(h1)>h1 {
    animation: none;
}

.js-anim main>section:first-child .aspect-square {
    animation: anim-fade-scale 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* Gold shimmer on gradient headline words */
@keyframes anim-shimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.js-anim .text-gradient-gold {
    background-image: linear-gradient(110deg, #8c6d14 0%, #c19a2e 25%, #f5d76e 40%, #c19a2e 55%, #8c6d14 75%, #c19a2e 100%);
    background-size: 200% auto;
    animation: anim-shimmer 6s linear infinite;
}

/* Floating gold glow across the whole page background.
   Sections become transparent so the fixed glow layer shows between cards. */
main section.bg-white {
    background-color: transparent;
}

.page-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.page-glow__blob {
    position: absolute;
    border-radius: 9999px;
    /* Parallax offset driven by --scroll (0..1) from JS; independent of the float animation */
    translate: 0 calc(var(--scroll, 0) * var(--drift, 0px));
}

.page-glow__blob--1 {
    width: 620px;
    height: 620px;
    top: -180px;
    right: -160px;
    --drift: -260px;
    background: radial-gradient(circle closest-side, rgba(245, 215, 110, 0.38), rgba(245, 215, 110, 0.152) 55%, transparent);
}

.page-glow__blob--2 {
    width: 520px;
    height: 520px;
    top: 38%;
    left: -200px;
    --drift: -180px;
    background: radial-gradient(circle closest-side, rgba(212, 175, 55, 0.26), rgba(212, 175, 55, 0.104) 55%, transparent);
}

.page-glow__blob--3 {
    width: 560px;
    height: 560px;
    bottom: -220px;
    right: 8%;
    --drift: -120px;
    background: radial-gradient(circle closest-side, rgba(245, 215, 110, 0.3), rgba(245, 215, 110, 0.12) 55%, transparent);
}

.page-glow__blob--4 {
    width: 380px;
    height: 380px;
    top: 12%;
    left: 35%;
    --drift: 200px;
    background: radial-gradient(circle closest-side, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.056) 55%, transparent);
}

/* On phones the glow is too distracting behind narrow content */
@media (max-width: 767px) {
    .page-glow {
        display: none;
    }
}

@keyframes anim-float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-40px, 30px) scale(1.08);
    }

    66% {
        transform: translate(30px, -25px) scale(0.95);
    }
}

.js-anim .page-glow__blob--1 {
    animation: anim-float 18s ease-in-out infinite;
}

.js-anim .page-glow__blob--2 {
    animation: anim-float 24s ease-in-out infinite reverse;
}

.js-anim .page-glow__blob--3 {
    animation: anim-float 21s ease-in-out infinite;
}

.js-anim .page-glow__blob--4 {
    animation: anim-float 27s ease-in-out infinite reverse;
}

/* Photo tilt (driven by --tilt-x / --tilt-y from JS) */
.hero-tilt {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* --- Scroll reveal ------------------------------------------------------ */
.js-anim .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-anim .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Audience toggle: sliding pill -------------------------------------- */
.pill-toggle {
    position: relative;
}

.pill-toggle>button {
    position: relative;
    z-index: 1;
}

.pill-toggle>button.bg-gold-cta {
    background-image: none;
    box-shadow: none;
}

.pill-toggle__pill {
    position: absolute;
    z-index: 0;
    border-radius: 9999px;
    background-image: linear-gradient(135deg, #d4af37 0%, #f5d76e 50%, #d4af37 100%);
    box-shadow: 0 4px 20px 0 rgba(212, 175, 55, 0.3);
    transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

@keyframes anim-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.js-anim .panel-in {
    animation: anim-panel-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Pricing cards: cursor spotlight + animated featured border ---------- */
.spotlight-card {
    background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), rgba(212, 175, 55, 0.16), transparent 45%);
    transition: border-color 0.2s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

@media (hover: hover) {
    .js-anim .spotlight-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
    }
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes anim-border-spin {
    to {
        --border-angle: 360deg;
    }
}

.card-featured {
    border-color: transparent !important;
    background:
        radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), rgba(212, 175, 55, 0.16), transparent 45%) padding-box,
        linear-gradient(var(--card-bg, #fcf9f0), var(--card-bg, #fcf9f0)) padding-box,
        conic-gradient(from var(--border-angle), #d4af37, #f5d76e, #8c6d14, #f5d76e, #d4af37) border-box;
}

.js-anim .card-featured {
    animation: anim-border-spin 6s linear infinite;
}

/* --- CTA shine ---------------------------------------------------------- */
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
    transform: translateX(-120%);
    pointer-events: none;
}

.js-anim .btn-primary:hover::after {
    transform: translateX(120%);
    transition: transform 0.8s ease;
}

/* --- Reduced motion: make sure nothing is left hidden ------------------- */
@media (prefers-reduced-motion: reduce) {

    .reveal,
    .hero-tilt {
        opacity: 1 !important;
        transform: none !important;
    }

    .pill-toggle__pill {
        transition: none;
    }
}

/* --- Interactive tools (source/tools.js) --------------------------------- */
.quiz-progress,
.quiz-bar {
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-anim .quiz-step {
    animation: anim-panel-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.js-anim .quiz-step+.quiz-step {
    animation-delay: 0.08s;
}

/* Gold range slider (strengths map, calculator) */
.gold-range {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 9999px;
    background: #e5e1d5;
    cursor: pointer;
    accent-color: #d4af37;
}

.gold-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #d4af37 0%, #f5d76e 50%, #d4af37 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(140, 109, 20, 0.35);
    transition: transform 0.15s ease;
}

.gold-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #d4af37 0%, #f5d76e 50%, #d4af37 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(140, 109, 20, 0.35);
}

.gold-range:active::-webkit-slider-thumb {
    transform: scale(1.15);
}

.gold-range:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 4px;
}

@keyframes anim-line-in {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.js-anim .calc-line-in {
    animation: anim-line-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.strength-opt[aria-checked="true"] {
    box-shadow: inset 0 0 0 1.5px #d4af37;
}

/* Horizontal chip rows without a visible scrollbar (shared by both pages) */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Readiness traffic light: blinking orange before it is filled in */
@keyframes anim-light-blink {

    0%,
    100% {
        opacity: 1;
        filter: brightness(1.1);
    }

    50% {
        opacity: 0.2;
        filter: brightness(0.7);
        box-shadow: none;
    }
}

.js-anim .light-blink {
    animation: anim-light-blink 1.2s ease-in-out infinite;
}
