/* ===================================================
   Figgure AI — styles.css
   =================================================== */

/* ----- Reset ----- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ----- CSS Custom Properties (Dark — primary) ----- */
:root {
    --bg: #09090B;
    --surface: #18181B;
    --border: #3F3F46;
    --text: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --accent: #6366F1;
    --accent-light: #818CF8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-secondary: #8B5CF6;
    --cyan: #22D3EE;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --nav-bg: rgba(9, 9, 11, 0.6);
    --nav-bg-scrolled: rgba(9, 9, 11, 0.85);
}

/* ----- Light Mode ----- */
[data-theme="light"] {
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --border: #E4E4E7;
    --text: #09090B;
    --text-secondary: #52525B;
    --text-muted: #71717A;
    --accent: #4F46E5;
    --accent-light: #6366F1;
    --accent-glow: rgba(79, 70, 229, 0.1);
    --accent-secondary: #7C3AED;
    --cyan: #0891B2;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
    --nav-bg: rgba(250, 250, 250, 0.7);
    --nav-bg-scrolled: rgba(250, 250, 250, 0.9);
}

/* ----- Page load animation ----- */
body {
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.loaded {
    opacity: 1;
}

/* noscript fallback — show content immediately */
.no-js body,
body.no-js {
    opacity: 1 !important;
}

/* ----- Base ----- */
body {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ----- Skip to content ----- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border-radius: 0 0 8px 8px;
    z-index: 2000;
    text-decoration: none;
    font-weight: 500;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ----- Scroll Indicator ----- */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    z-index: 1001;
    transition: width 0.1s ease;
}

/* ===================================================
   Navigation
   =================================================== */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: var(--nav-bg-scrolled);
    border-bottom-color: var(--border);
    box-shadow: 0 4px 30px var(--shadow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text);
    text-decoration: none;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

/* Nav right side — links + controls */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    width: 100%;
}

/* ----- Dark Mode Toggle ----- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Default (dark): sun visible, moon hidden */
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* ----- Hamburger Button ----- */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 24px;
    position: relative;
    z-index: 1100;
}

.hamburger span {
    display: block;
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; }

.hamburger.open span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* ----- Mobile Nav Overlay ----- */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.visible {
    opacity: 1;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: var(--surface);
    z-index: 1060;
    padding: 6rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px var(--shadow-lg);
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav a {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.3s ease;
}

.mobile-nav a:hover {
    color: var(--accent);
}

/* ===================================================
   Hero
   =================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

/* Gradient mesh background — replaces dot-grid */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(139, 92, 246, 0.08), transparent),
        radial-gradient(ellipse 50% 50% at 80% 50%, rgba(99, 102, 241, 0.06), transparent);
    pointer-events: none;
}

[data-theme="light"] .hero::before {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 70, 229, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(124, 58, 237, 0.05), transparent),
        radial-gradient(ellipse 50% 50% at 80% 50%, rgba(79, 70, 229, 0.04), transparent);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    transition: opacity 0.3s ease;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
    text-shadow: 0 0 80px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .hero-content h1 {
    text-shadow: none;
}

.hero-content .subtitle {
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Ghost CTA button */
.cta-btn {
    display: inline-block;
    padding: 1.25rem 2.5rem;
    background: transparent;
    color: var(--accent-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--accent);
}

.cta-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(99, 102, 241, 0.1);
}

/* ===================================================
   Shared
   =================================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 4rem;
    line-height: 1.6;
}

/* ===================================================
   Services
   =================================================== */
.services {
    padding: 10rem 0;
    background: var(--surface);
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.service-card {
    padding: 3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    transition: all 0.4s ease;
    position: relative;
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.service-card-number {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    opacity: 0.7;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-card h3 .icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.result {
    padding: 1.25rem;
    background: var(--accent-glow);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    font-style: italic;
    color: var(--accent-light);
    font-weight: 400;
    position: relative;
}

[data-theme="light"] .result {
    color: var(--accent);
}

.result::before {
    content: '\201C';
    font-size: 2rem;
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    color: var(--accent);
    opacity: 0.3;
}

/* ===================================================
   GenAI Section
   =================================================== */
.genai {
    padding: 10rem 0;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.genai::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.genai-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.genai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.genai-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.genai-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.genai-card-header {
    padding: 1.5rem;
    color: white;
    position: relative;
}

/* Muted dark-compatible gradients */
.genai-card:nth-child(1) .genai-card-header {
    background: linear-gradient(135deg, #3730A3 0%, #4F46E5 100%);
}

.genai-card:nth-child(2) .genai-card-header {
    background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 100%);
}

.genai-card:nth-child(3) .genai-card-header {
    background: linear-gradient(135deg, #155E75 0%, #0891B2 100%);
}

.genai-card-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.genai-card-header p {
    font-size: 0.9rem;
    opacity: 0.75;
}

.genai-card-body {
    padding: 2rem;
}

.genai-card-body p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Ghost-style tech pills */
.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.tech-item {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tech-item:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ===================================================
   Selected Projects
   =================================================== */
.projects {
    padding: 10rem 0;
    background: var(--surface);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
}

.project-card {
    padding: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    transition: all 0.4s ease;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.project-tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--accent-glow);
    color: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

[data-theme="light"] .project-tag {
    color: var(--accent);
}

.project-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.project-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.project-metric {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cyan);
}

/* ===================================================
   About
   =================================================== */
.about {
    padding: 10rem 0;
    background: var(--bg);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.about-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
    text-align: left;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Ghost-style tech tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.tech-tag {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-tag:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ===================================================
   Testimonial
   =================================================== */
.testimonial {
    padding: 8rem 0;
    background: var(--surface);
    text-align: center;
}

.testimonial-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    position: relative;
}

.testimonial-quote-mark {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    color: var(--accent);
    opacity: 0.3;
}

.testimonial-quote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.testimonial-divider {
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin: 0 auto 1.5rem;
    border-radius: 1px;
}

.testimonial-author-name {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.testimonial-author-role {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===================================================
   Contact
   =================================================== */
.contact {
    padding: 10rem 0;
    background: linear-gradient(135deg, #09090B 0%, #18181B 100%);
    color: white;
    text-align: center;
}

[data-theme="light"] .contact {
    background: linear-gradient(135deg, #18181B 0%, #27272A 100%);
}

.contact h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    font-weight: 500;
    color: white;
}

.contact-subline {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    margin-bottom: 3rem;
}

.contact-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    padding: 1.25rem 2.5rem;
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    background: transparent;
}

.contact-btn:hover {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(99, 102, 241, 0.1);
}

/* ===================================================
   Footer
   =================================================== */
.footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

/* ===================================================
   Focus-visible (keyboard accessibility)
   =================================================== */
.cta-btn:focus-visible,
.contact-btn:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-links a:focus-visible,
.mobile-nav a:focus-visible,
.logo:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.service-card:focus-visible,
.genai-card:focus-visible,
.project-card:focus-visible,
.testimonial-content:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ===================================================
   Animations
   =================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* noscript: show everything */
.no-js .fade-up {
    opacity: 1 !important;
    transform: none !important;
}

/* ===================================================
   Mobile
   =================================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-overlay,
    .mobile-nav {
        display: block;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .services,
    .genai,
    .projects,
    .about,
    .testimonial,
    .contact {
        padding: 6rem 0;
    }

    .services-grid,
    .genai-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service-card {
        padding: 2rem;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }

    .tech-tags {
        justify-content: center;
    }

    .stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .about-text {
        text-align: center;
        padding: 2rem;
    }

    .hero-content h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .testimonial-quote {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
}
