/*
 * BLOCO V8.1 · docs-cinema.css · estilo shared para todas docs pages
 * Override do .hero antigo + KnightWish + cinema animations
 *
 * Carregado via <x-docs-header> em quickstart/webhooks/sdks/errors
 */

@font-face {
    font-family: 'KnightWish';
    src: url('/fonts/knightwish/KnightWish-Regular.otf') format('opentype'),
         url('/fonts/knightwish/KnightWish-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'KnightWish';
    src: url('/fonts/knightwish/KnightWish-Italic.otf') format('opentype'),
         url('/fonts/knightwish/KnightWish-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* ============================================
   Hero · upgrade para KnightWish + grain + animations
   ============================================ */

.hero {
    position: relative;
    padding: 8rem 1.5rem 5rem !important;
    text-align: center;
    background: none !important;
    border-bottom: 1px solid rgba(91, 47, 203, 0.2) !important;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(91, 47, 203, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(138, 72, 245, 0.22) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.8'/></svg>");
    pointer-events: none;
    z-index: 1;
}

.hero > * {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-family: 'KnightWish', Georgia, serif !important;
    font-size: clamp(56px, 9vw, 120px) !important;
    line-height: 0.92 !important;
    letter-spacing: -0.03em !important;
    font-weight: 400 !important;
    color: #fff !important;
    text-shadow: 0 4px 60px rgba(91, 47, 203, 0.5);
    animation: hero-fade-up 0.9s cubic-bezier(0.6, 0.01, 0.05, 0.95) 0.1s both;
    margin-bottom: 1.5rem !important;
}

.hero h1 em {
    font-style: italic;
    background: linear-gradient(135deg, #b591f2 0%, #5b2fcb 50%, #8a48f5 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    background-size: 200% 100%;
    animation: gradient-shift 6s cubic-bezier(0.6, 0.01, 0.05, 0.95) infinite;
}

.hero p {
    max-width: 720px !important;
    margin: 0 auto 2.5rem !important;
    font-size: 1.15rem !important;
    line-height: 1.65 !important;
    color: rgba(232, 230, 244, 0.85) !important;
    animation: hero-fade-up 1s cubic-bezier(0.6, 0.01, 0.05, 0.95) 0.2s both;
}

.hero .badge,
.hero > .badge {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem !important;
    border: 1px solid rgba(91, 47, 203, 0.5) !important;
    background: rgba(15, 8, 31, 0.5) !important;
    border-radius: 100px !important;
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: #b591f2 !important;
    margin-bottom: 2rem !important;
    animation: hero-fade-up 0.8s cubic-bezier(0.6, 0.01, 0.05, 0.95) 0s both;
}

.hero .badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px #34d399;
    animation: pulse-glow 2s cubic-bezier(0.6, 0.01, 0.05, 0.95) infinite;
}

/* Search box upgrade (errors page) */
.hero .search-box {
    max-width: 640px;
    margin: 2rem auto 0;
    animation: hero-fade-up 1.1s cubic-bezier(0.6, 0.01, 0.05, 0.95) 0.3s both;
}

.hero .search-box input {
    width: 100%;
    padding: 1rem 1.5rem !important;
    background: rgba(15, 8, 31, 0.6) !important;
    border: 1px solid rgba(91, 47, 203, 0.3) !important;
    border-radius: 0.75rem !important;
    color: #fff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem !important;
    transition: all 0.4s cubic-bezier(0.6, 0.01, 0.05, 0.95);
}

.hero .search-box input:focus {
    outline: none !important;
    border-color: #b591f2 !important;
    background: rgba(15, 8, 31, 0.8) !important;
    box-shadow: 0 0 0 4px rgba(91, 47, 203, 0.15), 0 12px 40px rgba(91, 47, 203, 0.25);
    transform: translateY(-1px);
}

/* ============================================
   Sections · scroll reveal target + cubic-bezier
   ============================================ */

.section,
.feature-card,
.product-card,
section.section {
    transition: all 0.6s cubic-bezier(0.6, 0.01, 0.05, 0.95);
}

/* ============================================
   Code blocks · upgrade premium
   ============================================ */

pre {
    position: relative;
    transition: all 0.4s cubic-bezier(0.6, 0.01, 0.05, 0.95);
}

pre[data-lang]::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.4rem 0.9rem;
    background: rgba(91, 47, 203, 0.15);
    color: #b591f2;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-bottom-left-radius: 0.5rem;
    z-index: 4;
    pointer-events: none;
}

/* ============================================
   Buttons / CTAs · magnetic + cinema
   ============================================ */

.cta,
.cta-btn,
button.cta,
a.cta,
.throne-btn {
    transition: all 0.4s cubic-bezier(0.6, 0.01, 0.05, 0.95) !important;
}

.cta:hover,
.cta-btn:hover,
a.cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(91, 47, 203, 0.4);
}

/* ============================================
   Animations
   ============================================ */

@keyframes hero-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes marquee-slide {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ============================================
   Floating TOC (BLOCO V8.4)
   ============================================ */

.throne-toc {
    position: fixed;
    top: 130px;
    right: 1.5rem;
    width: 220px;
    z-index: 50;
    background: rgba(15, 8, 31, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(91, 47, 203, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    font-family: 'Inter', sans-serif;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.6, 0.01, 0.05, 0.95);
}

.throne-toc__title {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #b591f2;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(91, 47, 203, 0.15);
}

.throne-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.throne-toc__list li {
    margin: 0;
    padding: 0;
}

.throne-toc__link {
    display: block;
    padding: 0.4rem 0.6rem;
    border-left: 2px solid transparent;
    border-radius: 0.25rem;
    font-size: 0.78rem;
    color: rgba(180, 169, 212, 0.7);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.6, 0.01, 0.05, 0.95);
}

.throne-toc__link:hover {
    color: #fff;
    background: rgba(91, 47, 203, 0.15);
    border-left-color: #8a48f5;
    padding-left: 0.8rem;
}

.throne-toc__link.active {
    color: #fff;
    background: rgba(91, 47, 203, 0.2);
    border-left-color: #8a48f5;
    box-shadow: -1px 0 8px rgba(138, 72, 245, 0.4);
}

@media (max-width: 1280px) {
    .throne-toc { display: none; }
}

/* ============================================
   Marquee infinito (BLOCO V8.6)
   ============================================ */

.throne-marquee {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 0;
    margin: 4rem -1.5rem;
    border-top: 1px solid rgba(91, 47, 203, 0.15);
    border-bottom: 1px solid rgba(91, 47, 203, 0.15);
    background: rgba(15, 8, 31, 0.4);
}

.throne-marquee__track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: marquee-slide 40s linear infinite;
}

.throne-marquee:hover .throne-marquee__track {
    animation-play-state: paused;
}

.throne-marquee__item {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.9rem;
    color: rgba(181, 145, 242, 0.6);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.throne-marquee__item::before {
    content: '·';
    color: #5b2fcb;
}

@media (max-width: 768px) {
    .hero { padding: 5rem 1rem 3.5rem !important; }
    .hero h1 { font-size: clamp(40px, 10vw, 72px) !important; }
}

/* ============================================
   Bento grid · "Por que Throne" (BLOCO V8.5)
   ============================================ */

.api-bento {
    position: relative;
    padding: 6rem 1.5rem;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(91, 47, 203, 0.08) 0%, transparent 60%);
}

.api-bento__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.api-bento__title {
    font-family: 'KnightWish', Georgia, serif;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1;
    letter-spacing: -0.03em;
    font-weight: 400;
    color: #fff;
    text-align: center;
    margin: 0 0 1rem;
}

.api-bento__title em {
    font-style: italic;
    background: linear-gradient(135deg, #b591f2 0%, #5b2fcb 50%, #8a48f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.api-bento__subtitle {
    max-width: 640px;
    margin: 0 auto 4rem;
    font-size: 1.05rem;
    color: rgba(180, 169, 212, 0.85);
    text-align: center;
    line-height: 1.6;
}

.api-bento__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.25rem;
    grid-template-areas:
        "card1 card2 card3 card4"
        "card1 card2 card3 card4";
}

.api-bento__card {
    position: relative;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(91, 47, 203, 0.1) 0%, rgba(15, 8, 31, 0.5) 100%);
    border: 1px solid rgba(91, 47, 203, 0.2);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.6, 0.01, 0.05, 0.95);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.api-bento__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(138, 72, 245, 0.18) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.6, 0.01, 0.05, 0.95);
    pointer-events: none;
}

.api-bento__card:hover {
    border-color: rgba(138, 72, 245, 0.6);
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(91, 47, 203, 0.3);
}

.api-bento__card:hover::before {
    opacity: 1;
}

.api-bento__card--lg {
    grid-row: span 2;
}

.api-bento__card:nth-child(1) { grid-area: card1; }
.api-bento__card:nth-child(2) { grid-area: card2; }
.api-bento__card:nth-child(3) { grid-area: card3; }
.api-bento__card:nth-child(4) { grid-area: card4; }

.api-bento__icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(91, 47, 203, 0.4), rgba(138, 72, 245, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b591f2;
    margin-bottom: 0.5rem;
    transition: all 0.5s cubic-bezier(0.6, 0.01, 0.05, 0.95);
}

.api-bento__card:hover .api-bento__icon {
    transform: scale(1.1) rotate(5deg);
    color: #fff;
    background: linear-gradient(135deg, #5b2fcb, #8a48f5);
}

.api-bento__icon svg {
    width: 24px;
    height: 24px;
}

.api-bento__card-tag {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(181, 145, 242, 0.8);
}

.api-bento__card h3 {
    font-family: 'KnightWish', Georgia, serif;
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.api-bento__card p {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(232, 230, 244, 0.78);
    margin: 0;
}

@media (max-width: 1024px) {
    .api-bento__grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "card1 card1"
            "card2 card3"
            "card4 card4";
    }
}

@media (max-width: 640px) {
    .api-bento__grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "card1"
            "card2"
            "card3"
            "card4";
    }
    .api-bento__card { padding: 1.5rem; }
}
