/* =====================================================================
   HAUSRUMA — MODERN LAYER (v2 makeover)
   Loaded after styles.css. Elevates the Imperial Gold & Ink identity
   into a cutting-edge treatment: glass surfaces, aurora gradients,
   gradient-border cards, refined type, and the 3D shepherd stage.
   ===================================================================== */

/* ============================ TOKENS ============================ */
:root {
    /* Deepened core palette */
    --ink:          #0a0812;
    --ink-soft:     #14101f;
    --ink-raise:    #1b1628;
    --purple-deep:  #2d1b69;
    --purple-mid:   #4a3b8c;
    --gold:         #d4af5a;
    --gold-bright:  #f0d488;
    --gold-dim:     #a07830;
    --gold-elec:    #ffd76e;

    /* Semantic — refined light theme */
    --text-primary:   #17122a;
    --text-secondary: #4d4468;
    --background:     #f7f4ec;
    --surface:        #fffdf8;
    --border:         rgba(160, 120, 48, 0.22);

    --gradient-gold:  linear-gradient(120deg, #f0d488 0%, #d4af5a 45%, #b08838 100%);
    --gradient-royal: linear-gradient(135deg, #14101f 0%, #2d1b69 55%, #14101f 100%);
    --gradient-dark:  radial-gradient(120% 120% at 80% 0%, #241a4d 0%, #14101f 45%, #0a0812 100%);
    --gradient-hero:  radial-gradient(120% 120% at 80% 0%, #241a4d 0%, #14101f 45%, #0a0812 100%);

    --glow-gold:  0 0 44px rgba(212, 175, 90, 0.30);
    --glass-bg:      rgba(255, 253, 248, 0.72);
    --glass-border:  rgba(212, 175, 90, 0.28);
    --card-bg:       rgba(255, 253, 248, 0.85);

    --shadow-sm: 0 2px 10px rgba(23, 18, 42, 0.07);
    --shadow-md: 0 10px 34px rgba(23, 18, 42, 0.10);
    --shadow-lg: 0 24px 64px rgba(23, 18, 42, 0.16);
    --shadow-xl: 0 36px 90px rgba(23, 18, 42, 0.22);

    --radius-lg: 22px;
    --radius-xl: 30px;
}

[data-theme="dark"] {
    --text-primary:   #f2ecdd;
    --text-secondary: #b3a486;
    --background:     #0a0812;
    --surface:        #14101f;
    --border:         rgba(212, 175, 90, 0.20);
    --glass-bg:       rgba(20, 16, 31, 0.66);
    --glass-border:   rgba(212, 175, 90, 0.22);
    --card-bg:        rgba(27, 22, 40, 0.82);
    --gradient-surface: linear-gradient(160deg, #0a0812 0%, #14101f 100%);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 36px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
}

/* ============================ BASE POLISH ============================ */
::selection { background: rgba(212, 175, 90, 0.35); color: var(--text-primary); }

html { scrollbar-color: var(--gold-dim) transparent; }
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--gold-dim), var(--purple-mid));
    border-radius: 8px;
}
body::-webkit-scrollbar-track { background: var(--ink); }

/* subtle film grain over everything for a premium finish */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* ============================ NAVBAR ============================ */
.navbar {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(10, 8, 18, 0.10);
}
.nav-link {
    position: relative;
    letter-spacing: 0.02em;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -4px;
    width: 0; height: 2px;
    background: var(--gradient-gold);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.35s var(--ease, ease);
}
.nav-link:hover::after,
.nav-link.active::after { width: 70%; }

/* ============================ SPLASH ============================ */
.splash-screen {
    background: var(--gradient-dark) !important;
}
.splash-screen::before {
    content: "";
    position: absolute; inset: 0;
    background:
      radial-gradient(42% 34% at 22% 24%, rgba(74, 59, 140, 0.45), transparent 70%),
      radial-gradient(36% 30% at 78% 72%, rgba(212, 175, 90, 0.18), transparent 70%);
    animation: splashAurora 9s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes splashAurora {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}
.splash-title {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 6px 30px rgba(212, 175, 90, 0.35));
}

/* ============================ HERO ============================ */
.hero {
    background: var(--gradient-hero) !important;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
/* hero is dark in both themes — force light-on-dark text inside it */
.hero, .hero .hero-title, .hero .title-line, .hero .stat-text { color: #f2ecdd; }
.hero .hero-subtitle { color: rgba(242, 236, 221, 0.78); }

.hero .hero-pattern { opacity: 0.25; }
.hero .hero-gradient {
    background:
      radial-gradient(48% 40% at 18% 18%, rgba(74, 59, 140, 0.50), transparent 70%),
      radial-gradient(40% 36% at 85% 70%, rgba(212, 175, 90, 0.16), transparent 70%),
      radial-gradient(30% 26% at 60% 10%, rgba(45, 27, 105, 0.55), transparent 70%) !important;
    animation: heroAurora 12s ease-in-out infinite alternate;
}
@keyframes heroAurora {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.05); }
}

.hero .title-highlight {
    background: linear-gradient(110deg, #f0d488 10%, #d4af5a 40%, #b08838 62%, #f0d488 90%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldSheen 6s linear infinite;
    filter: drop-shadow(0 8px 40px rgba(212, 175, 90, 0.28));
}
@keyframes goldSheen {
    to { background-position: 220% center; }
}

.hero .hero-badge {
    background: rgba(20, 16, 31, 0.55);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    color: var(--gold-bright);
    box-shadow: inset 0 1px 0 rgba(240, 212, 136, 0.18), 0 8px 30px rgba(10, 8, 18, 0.4);
}

.hero .hero-stats {
    border-top: 1px solid rgba(212, 175, 90, 0.16);
}
.hero .stat-number {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --------- 3D shepherd stage --------- */
#heroDogStage {
    position: relative;
    width: 100%;
    aspect-ratio: 10 / 9;
    min-height: 320px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background:
      radial-gradient(70% 55% at 50% 78%, rgba(212, 175, 90, 0.14), transparent 72%),
      radial-gradient(90% 90% at 50% 0%, rgba(74, 59, 140, 0.28), transparent 75%);
    border: 1px solid rgba(212, 175, 90, 0.20);
    box-shadow: inset 0 1px 0 rgba(240, 212, 136, 0.10), 0 30px 80px rgba(10, 8, 18, 0.45);
}
#heroDogStage canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}
#heroDogStage .stage-caption {
    position: absolute;
    left: 50%; bottom: 14px;
    transform: translateX(-50%);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(240, 212, 136, 0.65);
    pointer-events: none;
    white-space: nowrap;
}
#heroDogStage.dog3d-unsupported .stage-caption { display: none; }
/* graceful fallback if WebGL/three.js is unavailable: show the photo big */
#heroDogStage.dog3d-unsupported { display: none; }
#heroDogStage.dog3d-unsupported ~ .hero-main-image,
.hero-visual.no-3d .hero-main-image {
    position: relative !important;
    width: 100% !important;
    transform: none !important;
}

/* demote the champions photo to a floating polaroid chip on the stage */
.hero .hero-image-container { position: relative; }
.hero .hero-main-image {
    position: absolute;
    right: -6px;
    bottom: -10px;
    width: 34%;
    min-width: 150px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(240, 212, 136, 0.35);
    box-shadow: 0 22px 50px rgba(10, 8, 18, 0.55);
    transform: rotate(3deg);
    transition: transform 0.4s var(--ease-bounce, ease), box-shadow 0.4s ease;
    z-index: 4;
}
.hero .hero-main-image:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 30px 70px rgba(10, 8, 18, 0.65), var(--glow-gold);
}
.hero .hero-main-image img { display: block; width: 100%; height: auto; }

/* ============================ BUTTONS ============================ */
.btn {
    border-radius: 999px !important;
    letter-spacing: 0.03em;
}
.btn-primary {
    background: var(--gradient-gold) !important;
    color: #17122a !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(212, 175, 90, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.25s var(--ease-bounce, ease), box-shadow 0.25s ease;
}
.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 16px 44px rgba(212, 175, 90, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.hero .btn-secondary {
    background: rgba(20, 16, 31, 0.4) !important;
    border: 1px solid rgba(212, 175, 90, 0.45) !important;
    color: var(--gold-bright) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.hero .btn-secondary:hover {
    background: rgba(212, 175, 90, 0.14) !important;
    box-shadow: var(--glow-gold);
}

/* ============================ SECTIONS ============================ */
.section-badge {
    background: transparent !important;
    border: 1px solid var(--glass-border);
    color: var(--gold-dim) !important;
    border-radius: 999px;
    padding: 0.35em 1.1em;
    letter-spacing: 0.24em !important;
    text-transform: uppercase;
    font-size: 0.72rem !important;
    position: relative;
}
[data-theme="dark"] .section-badge { color: var(--gold-bright) !important; }
.section-title { letter-spacing: -0.015em; }
.section-title::after {
    content: "";
    display: block;
    width: 64px; height: 3px;
    margin: 0.55em auto 0;
    border-radius: 3px;
    background: var(--gradient-gold);
}

/* ============================ CARDS ============================ */
.champion-card, .health-card, .stat-card, .bloodline-card,
.parent-card, .contact-card, .video-card, .litter-card,
.stud-details-card, .breed-info .info-card, .award-card {
    background: var(--card-bg) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--ease, ease), box-shadow 0.35s ease, border-color 0.35s ease;
}
.champion-card::before, .health-card::before, .stat-card::before,
.bloodline-card::before, .parent-card::before, .contact-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.champion-card:hover, .health-card:hover, .stat-card:hover,
.bloodline-card:hover, .parent-card:hover, .contact-card:hover,
.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--glow-gold);
    border-color: rgba(212, 175, 90, 0.5) !important;
}
.champion-card:hover::before, .health-card:hover::before,
.stat-card:hover::before, .bloodline-card:hover::before,
.parent-card:hover::before, .contact-card:hover::before { opacity: 1; }

/* ============================ GALLERY ============================ */
.carousel-container, .gallery-carousel {
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
}
.carousel-btn {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border) !important;
}
.carousel-btn:hover { box-shadow: var(--glow-gold); }

/* ============================ FOOTER ============================ */
.footer {
    background: var(--gradient-dark) !important;
    border-top: 1px solid rgba(212, 175, 90, 0.18);
}
.footer .social-icon {
    background: rgba(240, 212, 136, 0.06);
    border: 1px solid rgba(212, 175, 90, 0.25);
    transition: transform 0.3s var(--ease-bounce, ease), box-shadow 0.3s ease, background 0.3s ease;
}
.footer .social-icon:hover {
    transform: translateY(-3px);
    background: var(--gradient-gold);
    color: #17122a;
    box-shadow: var(--glow-gold);
}

/* ============================ CHATBOT ============================ */
.chatbot-toggle {
    background: var(--gradient-gold) !important;
    box-shadow: 0 12px 34px rgba(212, 175, 90, 0.45) !important;
    animation: chatbotPulse 3.2s ease-in-out infinite;
}
@keyframes chatbotPulse {
    0%, 100% { box-shadow: 0 12px 34px rgba(212, 175, 90, 0.45); }
    50%      { box-shadow: 0 12px 44px rgba(212, 175, 90, 0.75); }
}
.chatbot-window {
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--glass-border) !important;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-xl) !important;
}

/* ============================ PUPPY CHASER ============================ */
#puppyCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 900;              /* above content, under navbar(1000)/chatbot(9999) */
    pointer-events: none;      /* never blocks clicks */
    display: block;
}
#puppyToggle {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 9997;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s var(--ease-bounce, ease), box-shadow 0.25s ease, opacity 0.25s ease;
}
#puppyToggle:hover { transform: scale(1.12); box-shadow: var(--shadow-lg), var(--glow-gold); }
#puppyToggle.puppy-off { opacity: 0.45; filter: grayscale(1); }

/* ============================ SCROLL REVEAL ============================ */
@media (prefers-reduced-motion: no-preference) {
    .section-header, .champion-card, .health-card, .bloodline-card,
    .parent-card, .contact-card, .stat-card {
        animation: riseIn 0.7s var(--ease-out, ease) both;
        animation-timeline: view();
        animation-range: entry 0% entry 32%;
    }
    @keyframes riseIn {
        from { opacity: 0; transform: translateY(28px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ============================ RESPONSIVE ============================ */
/* Base stylesheet hides .hero-visual on smaller screens — bring it back
   so the 3D shepherd shows on mobile too, in a compact stage. */
@media (max-width: 1100px) {
    .hero-visual {
        display: block !important;
        max-width: 520px;
        margin: 2rem auto 0;
        animation: none;
    }
    .hero-visual .hero-scroll-indicator { display: none; }
    .hero-visual .floating-cards, .hero-visual .decorative-elements { display: none; }
}
.hero .hero-main-image { height: auto !important; }
@media (max-width: 900px) {
    #heroDogStage { aspect-ratio: 1 / 1; min-height: 260px; }
    .hero .hero-main-image { width: 40%; right: 0; bottom: -6px; }
}
@media (max-width: 560px) {
    #puppyToggle { left: 12px; bottom: 12px; width: 40px; height: 40px; }
    #heroDogStage { min-height: 230px; }
}

/* Reduced motion: kill decorative animation, keep content usable */
@media (prefers-reduced-motion: reduce) {
    .hero .hero-gradient, .splash-screen::before,
    .hero .title-highlight, .chatbot-toggle { animation: none !important; }
    #puppyCanvas, #puppyToggle { display: none !important; }
}
