/* ==========================================================================
   CHIPMEDIA — Digital Agency & Custom Web Engineering
   Production Design System Stylesheet
   ========================================================================== */

:root {
    --bg-primary: #07070B;
    --bg-secondary: #111119;
    --text-primary: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(19, 19, 28, 0.72);
    --logo-text-fill: #FFFFFF;
    --logo-text-stroke: rgba(255, 255, 255, 0.25);
}

html.light {
    --bg-primary: #F8F7FC;
    --bg-secondary: #FFFFFF;
    --text-primary: #09090E;
    --text-muted: #475569;
    --border-color: rgba(15, 23, 42, 0.09);
    --card-bg: rgba(255, 255, 255, 0.88);
    --logo-text-fill: #000000;
    --logo-text-stroke: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.35s ease, color 0.35s ease;
}

/* ==========================================================================
   Typography & Collision Prevention
   ========================================================================== */
.font-display {
    font-family: 'Unbounded', sans-serif;
}

/* Balanced wrapping and safe line-height to prevent glyph collisions in Unbounded */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

.leading-headline {
    line-height: 1.28 !important;
}

/* ==========================================================================
   Subtle Ambient Tech Grid
   ========================================================================== */
.bg-tech-grid {
    background-size: 48px 48px;
    background-image: 
        linear-gradient(to right, rgba(118, 20, 214, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(118, 20, 214, 0.06) 1px, transparent 1px);
}

/* ==========================================================================
   Glassmorphic Surface
   ========================================================================== */
.glass-panel {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   Global Cursor Ambient Glow Follower
   ========================================================================== */
#cursorGlow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(650px circle at var(--cursor-x, 50vw) var(--cursor-y, 30vh), rgba(148, 56, 245, 0.16), rgba(236, 72, 153, 0.05) 38%, transparent 68%),
        radial-gradient(220px circle at var(--cursor-x, 50vw) var(--cursor-y, 30vh), rgba(184, 119, 255, 0.14), transparent 70%);
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   Interactive Spotlight Card & Glass Panel Cursor Glow
   ========================================================================== */
.spotlight-card {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.spotlight-card::before,
.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(520px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(148, 56, 245, 0.24), rgba(236, 72, 153, 0.06) 40%, transparent 65%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.spotlight-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(340px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(184, 119, 255, 0.75), transparent 65%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.spotlight-card:hover::before,
.spotlight-card:hover::after,
.glass-panel:hover::before {
    opacity: 1;
}

.spotlight-card:hover {
    border-color: rgba(148, 56, 245, 0.55);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -12px rgba(118, 20, 214, 0.35);
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(32px) scale(0.98);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }

/* ==========================================================================
   Dynamic Brand Logo Modes & Theme Switching
   ========================================================================== */
.dark-logo-img {
    display: inline-block;
}
.light-logo-img {
    display: none;
}

html.light .light-logo-img {
    display: inline-block !important;
}
html.light .dark-logo-img {
    display: none !important;
}
html:not(.light) .light-logo-img {
    display: none !important;
}
html:not(.light) .dark-logo-img {
    display: inline-block !important;
}

.chip-wordmark {
    fill: var(--logo-text-fill);
    stroke: var(--logo-text-stroke);
    stroke-width: 0.5px;
    transition: fill 0.35s ease, stroke 0.35s ease;
}

/* Outlined White Logo Variant Mode (matches logo-white.png) */
.logo-outline-mode .chip-wordmark {
    fill: rgba(255, 255, 255, 0.96);
    stroke: #cbd5e1;
    stroke-width: 1.2px;
}

/* ==========================================================================
   Gradient Text
   ========================================================================== */
.text-gradient-purple {
    background: linear-gradient(135deg, #B877FF 0%, #7614D6 55%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #07070B;
}

::-webkit-scrollbar-thumb {
    background: #2E1052;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7614D6;
}

/* ==========================================================================
   3D Perspective Tilt
   ========================================================================== */
.tilt-container {
    perspective: 1200px;
}

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out;
}

/* ==========================================================================
   Typewriter Blinking Neon Cursor (Strictly Inline & Non-Dropping)
   ========================================================================== */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: linear-gradient(180deg, #B877FF 0%, #EC4899 100%);
    margin-left: 4px;
    vertical-align: -0.06em;
    border-radius: 2px;
    box-shadow: 0 0 10px #9438F5;
    animation: cursorBlink 0.85s infinite;
}

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ==========================================================================
   Active Typewriter Pill Styling
   ========================================================================== */
.typewriter-pill {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.typewriter-pill.active-pill {
    background: rgba(118, 20, 214, 0.28);
    border-color: #9438F5;
    box-shadow: 0 0 20px rgba(118, 20, 214, 0.28);
    transform: translateY(-1px);
}

/* ==========================================================================
   Mobile Scroll Depth Card Transition
   ========================================================================== */
.mobile-scroll-card {
    will-change: transform;
    transition: transform 0.15s ease-out;
}
