/* ========================================
   Ondřej Zach – Premium Design System v3
   Apple-level visual polish
   ======================================== */

/* ── Base ── */


html { scroll-behavior: auto; }

/* ══════════════════════════════════════
   WARM AMBIENT BACKGROUND — single accent hue
   ══════════════════════════════════════ */

.ambient-warm {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(60% 50% at 78% 18%, rgba(212,163,92,0.14), transparent 60%),
        radial-gradient(55% 45% at 12% 88%, rgba(212,163,92,0.07), transparent 65%),
        radial-gradient(120% 90% at 50% 0%, rgba(28,22,14,0.9), transparent 70%);
}

/* ══════════════════════════════════════
   NOISE OVERLAY
   ══════════════════════════════════════ */

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}

/* ══════════════════════════════════════
   HERO ORB — Floating Glassmorphism Sphere
   ══════════════════════════════════════ */

.hero-visual-container {
    position: relative;
    width: 320px;
    height: 320px;
}

/* ══════════════════════════════════════
   HERO SCENE — Character + Sphere
   ══════════════════════════════════════ */

.hero-scene {
    position: relative;
    width: 380px;
    height: 480px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

@media (min-width: 768px) {
    .hero-scene {
        width: 440px;
        height: 560px;
    }
}

/* Layer 1: Background glow behind character */
.scene-bg-glow {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.04) 40%,
        transparent 70%
    );
    animation: sceneGlowPulse 6s ease-in-out infinite alternate;
    z-index: 1;
    pointer-events: none;
}

@keyframes sceneGlowPulse {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* Layer 2: Character Image */
.scene-character {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: auto;
    z-index: 2;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4));
    pointer-events: none;
    transform-origin: bottom center;
}

/* Layer 3: Hand illumination glow (emitted from sphere onto hands) */
.scene-hand-glow {
    position: absolute;
    bottom: 15%; /* Placed on the hands */
    left: 52%; /* Centers glow slightly to the right */
    transform: translateX(-50%);
    width: 220px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at top,
        rgba(255, 255, 255, 0.14) 0%,
        rgba(255, 255, 255, 0.08) 30%,
        transparent 70%
    );
    z-index: 3;
    mix-blend-mode: screen;
    animation: handGlowPulse 6s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes handGlowPulse {
    0%   { opacity: 0.6; transform: translateX(-50%) scale(0.95); }
    100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* Layer 4: Floating sphere container (above hands) */
.scene-sphere-wrap {
    position: absolute;
    bottom: 25%; /* Positioned right between the hands */
    left: 52%; /* Centers sphere slightly to the right */
    margin-left: -70px; /* Half of width */
    width: 140px;
    height: 140px;
    z-index: 4;
    animation: sphereFloat 6s ease-in-out infinite alternate;
}

@media (min-width: 768px) {
    .scene-sphere-wrap {
        bottom: 28%;
        margin-left: -90px;
        width: 180px;
        height: 180px;
    }
}

@keyframes sphereFloat {
    0%   { transform: translateY(0px) rotate(0deg); }
    50%  { transform: translateY(-15px) rotate(2deg); }
    100% { transform: translateY(5px) rotate(-1deg); }
}

/* Outer sphere glow */
.scene-sphere-glow {
    position: absolute;
    inset: -40%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255,255,255,0.18) 0%,
        rgba(255,255,255,0.07) 40%,
        transparent 70%
    );
    animation: orbGlowPulse 4s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Main glass sphere base */
.scene-sphere {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.1) 0%,
        rgba(255,255,255,0.02) 50%,
        rgba(255,255,255,0.06) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.08) inset,
        0 20px 40px rgba(0,0,0,0.4),
        0 0 30px rgba(255,255,255,0.08);
    overflow: hidden;
}

/* Inner gradient fill */
.scene-sphere-inner {
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(255,255,255,0.22) 0%,
        rgba(255,255,255,0.08) 50%,
        transparent 80%
    );
    animation: orbInnerShift 10s ease-in-out infinite alternate;
}

@keyframes orbInnerShift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6px, -6px) scale(1.1); }
}

/* Thin ring inside */
.scene-sphere-ring {
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.2);
    animation: orbRingSpin 20s linear infinite;
}

@keyframes orbRingSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating code snippets */
.scene-sphere-code {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.scene-sphere-code span {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.65);
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    text-shadow: 0 0 8px rgba(255,255,255,0.2);
    animation: codeFloat 4s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * 0.6s);
    white-space: nowrap;
}

@media (min-width: 768px) {
    .scene-sphere-code { gap: 6px; }
    .scene-sphere-code span {
        font-size: 0.6rem;
        padding: 4px 10px;
    }
}

@keyframes codeFloat {
    0%   { transform: translateY(0) translateX(0); opacity: 0.7; }
    50%  { transform: translateY(-3px) translateX(1px); opacity: 1; }
    100% { transform: translateY(1.5px) translateX(-1px); opacity: 0.8; }
}

/* Top-left reflection arc */
.scene-sphere-reflection {
    position: absolute;
    top: 5%;
    left: 10%;
    width: 45%;
    height: 30%;
    border-radius: 50%;
    background: linear-gradient(
        160deg,
        rgba(255,255,255,0.25) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Layer 5: Foreground light overlay */
.scene-fg-light {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 60%,
        rgba(255,255,255,0.04) 0%,
        transparent 60%
    );
    z-index: 5;
    pointer-events: none;
}

/* ══════════════════════════════════════
   GLASSMORPHISM CARD
   ══════════════════════════════════════ */

.glass-card {
    background: #101012;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card-interactive:hover {
    background: #141416;
    border-color: rgba(255, 255, 255, 0.16);
}

/* ══════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════ */

.hero-reveal {
    opacity: 0;
    transform: translateY(40px);
}

.reveal-section {
    opacity: 0;
    transform: translateY(50px);
}

/* ══════════════════════════════════════
   TEXT GRADIENTS
   ══════════════════════════════════════ */

.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-hero {
    background: linear-gradient(135deg, #ffffff 30%, #71717a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════
   GLOW BUTTON
   ══════════════════════════════════════ */

.btn-glow {
    position: relative;
    overflow: hidden;
    background: #fff;
    color: #0a0a0a;
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1),
                background 0.3s;
}

.btn-glow:hover {
    transform: translateY(-2px);
    background: #e7e7ea;
}

/* ══════════════════════════════════════
   SOCIAL BUTTON
   ══════════════════════════════════════ */

.social-btn {
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

/* ══════════════════════════════════════
   EMAIL LINK — animated underline
   ══════════════════════════════════════ */

.email-link {
    position: relative;
    text-decoration: none;
}
.email-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(212,163,92,0.5), rgba(212,163,92,0.1));
    transform: scaleX(0.35);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), background 0.3s;
}
.email-link:hover::after {
    transform: scaleX(1);
    background: linear-gradient(90deg, rgba(212,163,92,0.9), rgba(212,163,92,0.3));
}

/* ══════════════════════════════════════
   FOOTER / NAV LINK — animated underline
   ══════════════════════════════════════ */

.footer-link, .nav-link {
    position: relative;
}

.footer-link::after, .nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: #d4a35c;
    transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}

.footer-link:hover::after, .nav-link:hover::after {
    width: 100%;
}

/* ══════════════════════════════════════
   CARD SHIMMER
   ══════════════════════════════════════ */

.card-visual {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #111113 0%, #18181b 100%);
}

.card-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .card-visual::before {
    transform: translateX(100%);
}

/* ══════════════════════════════════════
   SECTION LABEL
   ══════════════════════════════════════ */

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d4a35c;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.section-label::before {
    content: '';
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,163,92,0.7));
}

/* ══════════════════════════════════════
   TAG / BADGE
   ══════════════════════════════════════ */

.tag {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
}

/* ══════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* Selection */
::selection { background: rgba(255,255,255,0.18); }

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.price {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ══════════════════════════════════════
   NAV BLUR
   ══════════════════════════════════════ */

.nav-blur {
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* ══════════════════════════════════════
   STAGGER
   ══════════════════════════════════════ */

.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 100ms; }
.stagger > *:nth-child(3) { transition-delay: 200ms; }
.stagger > *:nth-child(4) { transition-delay: 300ms; }
.stagger > *:nth-child(5) { transition-delay: 400ms; }
.stagger > *:nth-child(6) { transition-delay: 500ms; }

/* ══════════════════════════════════════
   LANGUAGE SWITCHER
   ══════════════════════════════════════ */

.lang-switcher { user-select: none; }

.lang-btn {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #52525b;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    transition: color 0.3s ease, background 0.3s ease;
}

@media (max-width: 767px) { .lang-btn { cursor: pointer; } }
.lang-btn:hover { color: #a1a1aa; }
.lang-btn.lang-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* ══════════════════════════════════════
   GRADIO CUSTOMIZATION
   ══════════════════════════════════════ */

gradio-app {
    --background-fill-primary: transparent !important;
    --background-fill-secondary: rgba(255, 255, 255, 0.02) !important;
    --border-color-primary: rgba(255, 255, 255, 0.08) !important;
    --border-color-accent: rgba(255, 255, 255, 0.15) !important;
    --body-text-color: #f4f4f5 !important;
    --body-text-color-subdued: #a1a1aa !important;
    --color-accent: #ffffff !important;
    
    /* Input Fields */
    --input-background-fill: rgba(255, 255, 255, 0.03) !important;
    
    /* Buttons */
    --button-primary-background-fill: #ffffff !important;
    --button-primary-text-color: #09090b !important;
    --button-primary-background-fill-hover: #e4e4e7 !important;
    
    --button-secondary-background-fill: rgba(255, 255, 255, 0.06) !important;
    --button-secondary-background-fill-hover: rgba(255, 255, 255, 0.1) !important;
    --button-secondary-text-color: #ffffff !important;
    
    /* Panel Blocks */
    --block-background-fill: transparent !important;
    --block-border-color: rgba(255, 255, 255, 0.08) !important;
    --block-border-width: 1px !important;
    --block-radius: 12px !important;
    --panel-background-fill: rgba(255, 255, 255, 0.01) !important;
}
