/* ============================================
   Sterling AI - Shared Stylesheet
   Canonical styles for all Sterling AI pages
   ============================================ */

/* Font swap metrics to eliminate CLS */
@font-face {
  font-family: 'Cormorant Garamond Fallback';
  src: local('Times New Roman');
  size-adjust: 112%;
  ascent-override: 90%;
  descent-override: 22%;
}

@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
}

/* Base Body */
body {
    background-color: #0A0B0D;
    color: #EAEAEA;
    font-family: 'Inter', 'Inter Fallback', sans-serif;
    font-size: 16px;
}

/* Global Noise Texture */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 1;
}

/* ---- Layout ---- */

.section-padding {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.max-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---- Text Gradients & Effects ---- */

.text-traditional {
    background: linear-gradient(180deg, #C0C0C0 0%, #8E8E8E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-sterling-silver-shiny {
    background: linear-gradient(180deg, #EAEAEA 0%, #B0B0B0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
}

.text-sterling-silver {
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
}

.border-sterling-silver {
    box-shadow: 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ---- Navigation ---- */

.nav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(234, 234, 234, 0.6);
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0%;
    height: 1px;
    background: #7B2DAB;
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #7B2DAB;
}

/* ---- Scroll Progress Bar ---- */

#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 0%; height: 2px;
    background: linear-gradient(90deg, #7B2DAB, #9B4DCA, #7B2DAB);
    background-size: 200% 100%;
    animation: shimmer 3s ease infinite;
    z-index: 10001;
}

/* ---- Mobile Menu ---- */

#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 11, 13, 0.99);
    backdrop-filter: blur(20px);
    z-index: 9999;
    padding: 6rem 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

#mobile-menu.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* ---- Cards ---- */

.standard-card {
    background: #14161A;
    border: 1px solid rgba(192, 192, 192, 0.1);
    border-radius: 0px;
    padding: 3.5rem;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.standard-card:hover {
    border-color: rgba(192, 192, 192, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
}

.premium-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #111827;
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    border-color: #D1D5DB;
}

.premium-card h3 { color: #111827; }
.premium-card p { color: #4B5563; }

.founder-card {
    background: #F8F8F8;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

.founder-card .text-sterling-amethyst { color: #7B2DAB; }
.founder-card .text-sterling-text { color: #666666; }
.founder-card h3 { color: #1a1a1a; }

.portfolio-card {
    border: 1px solid rgba(192, 192, 192, 0.1);
    padding: 3rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25);
    border-color: rgba(192, 192, 192, 0.4);
}

/* ---- Buttons ---- */

.btn-primary {
    background: transparent;
    border: 1px solid #C0C0C0;
    color: #C0C0C0;
    border-radius: 0px;
    transition: all 0.4s ease;
}

.btn-primary:hover {
    background: #7B2DAB;
    color: #EAEAEA;
    border-color: #7B2DAB;
}

.btn-linkedin {
    background: #0A66C2;
    border: 1px solid #0A66C2;
    color: #FFFFFF;
    border-radius: 0px;
    transition: all 0.4s ease;
}

.btn-linkedin:hover {
    background: #08529B;
    border-color: #08529B;
    color: #FFFFFF;
}

/* ---- Scroll Reveal Animation ---- */

/* Initial hidden state. Animated by GSAP on Sterling pages,
   by IntersectionObserver + CSS transitions on some client pages. */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

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

/* ---- Editorial Elements ---- */

.drop-cap::first-letter {
    font-family: 'Cormorant Garamond', 'Cormorant Garamond Fallback', serif;
    font-size: 5rem;
    float: left;
    line-height: 1;
    padding-right: 1rem;
    color: #7B2DAB;
    font-style: italic;
}

.pull-quote {
    font-family: 'Cormorant Garamond', 'Cormorant Garamond Fallback', serif;
    font-size: 2.5rem;
    line-height: 1.1;
    color: #7B2DAB;
    font-style: italic;
    border-left: 1px solid rgba(123, 45, 171, 0.3);
    padding-left: 2rem;
    margin: 4rem 0;
}

/* ---- Surfaces ---- */

.manuscript-surface {
    background-color: #FDFBF7;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperGrain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paperGrain)' opacity='0.05'/%3E%3C/svg%3E");
    border-radius: 40px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(123, 45, 171, 0.05);
    color: #1A1A1A;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Asset Images ---- */

.asset-image-container {
    position: relative;
    overflow: hidden;
    background: #0A0B0D;
}

.asset-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.05) 0%, rgba(10, 11, 13, 0.2) 100%);
    pointer-events: none;
}

.asset-image {
    filter: grayscale(100%) contrast(110%) brightness(90%);
    mix-blend-mode: luminosity;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.asset-image-container:hover .asset-image {
    filter: grayscale(0%) contrast(100%) brightness(100%);
    transform: scale(1.05);
}

/* ---- Premium Section Dividers ---- */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(123, 45, 171, 0.3) 30%, rgba(192, 192, 192, 0.2) 50%, rgba(123, 45, 171, 0.3) 70%, transparent 100%);
    border: none;
    margin: 0;
}

/* ---- Staggered Reveal Delays ---- */

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---- Hero Glow Effect ---- */

.hero-glow {
    position: relative;
}

.hero-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(123, 45, 171, 0.08) 0%, rgba(123, 45, 171, 0.03) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Enhanced Portfolio Cards with Preview ---- */

.portfolio-preview {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(192, 192, 192, 0.1);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-preview:hover {
    border-color: rgba(123, 45, 171, 0.4);
    box-shadow: 0 30px 80px -12px rgba(123, 45, 171, 0.15), 0 0 0 1px rgba(123, 45, 171, 0.1);
    transform: translateY(-6px);
}

.portfolio-preview iframe {
    width: 200%;
    height: 200%;
    transform: scale(0.5);
    transform-origin: top left;
    pointer-events: none;
    border: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.portfolio-preview iframe::-webkit-scrollbar {
    display: none;
}

.portfolio-preview .preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(10, 11, 13, 0.95) 100%);
    transition: background 0.6s ease;
}

.portfolio-preview:hover .preview-overlay {
    background: linear-gradient(180deg, transparent 60%, rgba(10, 11, 13, 0.9) 100%);
}

/* ---- Glassmorphism Nav ---- */

.nav-glass {
    background: rgba(10, 11, 13, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(192, 192, 192, 0.06);
}

/* ---- Smooth Page Transitions ---- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- Gradient Text for Hero Highlights ---- */

.text-amethyst-glow {
    background: linear-gradient(135deg, #9B4DCA 0%, #7B2DAB 50%, #5B1D8B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(123, 45, 171, 0.3));
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---- Premium Feature Card Icon Container ---- */

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(123, 45, 171, 0.2);
    background: rgba(123, 45, 171, 0.05);
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
}

.standard-card:hover .feature-icon {
    border-color: rgba(123, 45, 171, 0.5);
    background: rgba(123, 45, 171, 0.1);
    box-shadow: 0 0 20px rgba(123, 45, 171, 0.15);
}

/* ---- Magnetic Button ---- */

.magnetic-btn {
    display: inline-flex;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Text Split Reveal ---- */

.split-line {
    overflow: hidden;
    display: block;
}

.split-line > span {
    display: inline-block;
    transform: translateY(105%);
    will-change: transform;
}

/* ---- Parallax Layer ---- */

.parallax-slow {
    will-change: transform;
}

/* ---- Fluid Typography ---- */

.fluid-display {
    font-size: clamp(2.5rem, 1.5rem + 5vw, 7rem);
    line-height: 1.0;
    letter-spacing: -0.03em;
}

.fluid-heading {
    font-size: clamp(2rem, 1.2rem + 3.5vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.fluid-subheading {
    font-size: clamp(1.5rem, 1rem + 2vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

/* ---- CSS Hero Entrance Animations (no JS dependency) ---- */
/* Uses fill-mode:both so content is visible by default if animations fail */

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroSlideUp {
    from { transform: translateY(105%); }
    to { transform: translateY(0); }
}

.hero-enter {
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-enter-d1 { animation-delay: 0.08s; }
.hero-enter-d2 { animation-delay: 0.16s; }
.hero-enter-d3 { animation-delay: 0.24s; }
.hero-enter-d4 { animation-delay: 0.32s; }
.hero-enter-d5 { animation-delay: 0.4s; }

/* Override for split-line text (slide up from below) */
.split-line > span {
    animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.split-line:nth-child(2) > span {
    animation-delay: 0.12s;
}

/* Fallback: if animations are disabled, show everything */
@media (prefers-reduced-motion: reduce) {
    .hero-enter,
    .split-line > span {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---- Smooth Scroll Override ---- */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ---- Accessibility: Amethyst Contrast ---- */
/* Small text labels (text-xs, text-[10px], text-[12px]) on dark backgrounds
   use text-sterling-amethyst-light (#9B4DCA, ~4.6:1 contrast on #0A0B0D).
   The base amethyst (#7B2DAB) is kept for decorative elements, borders,
   backgrounds, large headings, and hover states where contrast is sufficient. */

/* ---- Expandable FAQ ---- */

.faq-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.faq-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.5rem 0;
    font-family: 'Cormorant Garamond', 'Cormorant Garamond Fallback', serif;
    font-size: 1.35rem;
    font-style: italic;
    color: #0A0B0D;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.faq-trigger:hover {
    color: #7B2DAB;
}

.faq-trigger .faq-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: #7B2DAB;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-body {
    max-height: 1000px;
}

.faq-body-inner {
    padding-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
    color: #444;
}

/* ---- Dark FAQ (for dark-bg pages like homepage) ---- */

.faq-dark .faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-dark .faq-trigger {
    color: #E8E8E8;
}

.faq-dark .faq-trigger:hover {
    color: #7B2DAB;
}

.faq-dark .faq-body-inner {
    color: #999;
}

/* ---- Sticky Table of Contents ---- */

.toc {
    position: sticky;
    top: 7rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    scrollbar-width: none;
}

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

.toc-link {
    display: block;
    padding: 0.5rem 0 0.5rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(234, 234, 234, 0.35);
    border-left: 1px solid rgba(234, 234, 234, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
}

.toc-link:hover {
    color: rgba(234, 234, 234, 0.6);
}

.toc-link.active {
    color: #7B2DAB;
    border-left-color: #7B2DAB;
}

/* ---- Sticky Mobile CTA ---- */

.sticky-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: #7B2DAB;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -4px 20px rgba(123, 45, 171, 0.3);
}

.sticky-mobile-cta.visible {
    transform: translateY(0);
}

.sticky-mobile-cta a {
    color: #FFFFFF;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 767px) {
    .sticky-mobile-cta {
        display: flex;
    }
}

/* ---- Form Focus Indicators (WCAG 2.4.7) ---- */

input:focus, textarea:focus {
    outline: 2px solid #9B4DCA;
    outline-offset: 2px;
    border-color: #9B4DCA;
}

