/* ============================================
   Glitch AI Engine Website - Common Styles
   Navigation, Footer, Header, Base
   ============================================ */

@font-face {
    font-family: 'Glitch Logo';
    src: url('/assets/font/log0-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables - warm editorial palette */
:root {
    --color-page-bg: #f6f3ef;
    --color-paper-white: #ffffff;
    --color-frost-surface: #f8f6f3;
    --color-ash-hairline: #e0dbd3;
    --color-pewter-rule: #d4cfc6;
    --color-stone-mid: #8a8580;
    --color-granite-mute: #4b4b4b;
    --color-iron-caption: #3a3a3a;
    --color-graphite-body: #1b1b1b;
    --color-obsidian: #101010;
    --color-carbon: #101010;
    --color-ink: #101010;
    --color-signal-orange: #ff6b3d;
    --color-ember-edge: #e85a2a;
    --color-accent-2: #2bb4a6;
    --color-accent-3: #6d5dfc;
    --color-surface-warm: #fff7f2;
    --color-peach: #fff3ec;
    --color-mint: #e8fbf8;
    --color-lilac: #f7f2ff;
    --color-chrome-surface: #f8f6f3;
    --color-chrome-surface-top: #faf8f5;

    --font-geist: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-geist-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-logo: 'Glitch Logo', var(--font-geist);

    --text-caption: 12px;
    --text-body-sm: 14px;
    --text-body: 16px;
    --text-subheading: 18px;
    --text-heading-sm: 24px;
    --text-heading: 48px;
    --text-display: 60px;
    --tracking-body: -0.48px;

    --spacing-4: 4px;
    --spacing-8: 8px;
    --spacing-12: 12px;
    --spacing-16: 16px;
    --spacing-20: 20px;
    --spacing-24: 24px;
    --spacing-32: 32px;
    --spacing-40: 40px;
    --spacing-48: 48px;
    --spacing-56: 56px;
    --spacing-64: 64px;
    --spacing-80: 80px;
    --spacing-120: 120px;

    --page-max-width: 1200px;
    --page-padding-x: 24px;
    --section-gap: 80px;
    --card-padding: 24px;
    --sidebar-width: 280px;
    --docs-content-max: 900px;
    --content-wide: 1000px;
    --element-gap: 24px;
    --copy-max: 520px;
    --feature-copy-max: 480px;
    --intro-max: 720px;
    --cli-max: 520px;

    --radius-nav: 4px;
    --radius-cards: 4px;
    --radius-badges: 4px;
    --radius-inputs: 4px;
    --radius-panels: 4px;
    --radius-buttons: 4px;
    --radius-special: 8px;

    --bg: var(--color-page-bg);
    --accent: var(--color-signal-orange);
    --text: var(--color-ink);
    --muted: var(--color-granite-mute);
    --border: var(--color-ash-hairline);

    --bg-primary: var(--color-page-bg);
    --bg-secondary: var(--color-chrome-surface);
    --bg-tertiary: var(--color-frost-surface);
    --bg-card: var(--color-paper-white);
    --bg-hover: var(--color-surface-warm);
    --bg-elevated: var(--color-frost-surface);

    --text-primary: var(--color-ink);
    --text-secondary: var(--color-iron-caption);
    --text-tertiary: var(--color-granite-mute);
    --text-muted: var(--color-granite-mute);

    --accent-primary: var(--color-signal-orange);
    --accent-secondary: var(--color-accent-3);
    --accent-hover: var(--color-ember-edge);
    --accent-light: var(--color-graphite-body);

    --border-color: var(--color-ash-hairline);
    --border-hover: var(--color-pewter-rule);
    --border-light: var(--color-ash-hairline);

    --code-bg: var(--color-surface-warm);
    --code-text: var(--color-ink);
    --code-border: var(--color-ash-hairline);
    --code-accent: var(--color-signal-orange);

    --success: #059669;
    --warning: var(--color-signal-orange);
    --error: #dc2626;
    --info: var(--color-signal-orange);

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-2xl: none;

    --gradient-primary: none;
    --gradient-secondary: none;

    --glitch-green: var(--color-ink);
    --glitch-green-hover: var(--color-carbon);
    --glitch-green-soft: rgba(2, 2, 2, 0.06);
    --glitch-green-soft-strong: rgba(2, 2, 2, 0.1);
    --navbar-height: 3.5rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-geist);
    font-weight: 400;
    letter-spacing: -0.03em;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Links - reset browser default blue; theme prose style */
a {
    color: inherit;
    text-decoration: none;
}

a.logo,
a.footer-logo,
a.nav-link,
a.btn-factory,
a.news-card,
a.trust-card,
a.mobile-nav-link,
a.nav-card,
a.team-link,
a.about-feature-link,
.footer-factory-nav a,
.docs-sidebar a,
.learn-more {
    text-decoration: none;
}

.hero-download-hint a,
.download-note a,
.lead-text a,
.facts-panel a,
.info-box a,
.warning-box a,
.highlight-cell p a,
.highlight-cell li a,
.docs-content-wrapper p a,
.docs-content-wrapper li a,
.docs-content-wrapper dd a,
.docs-content-wrapper td a,
.docs-content-wrapper .info-box a,
.docs-content-wrapper .warning-box a,
.docs-content-wrapper a:not(.nav-card):not(.feature-link):not(.btn-factory),
.about-main-content a:not(.btn-factory):not(.team-link):not(.about-feature-link),
.privacy-main-content a:not(.btn-factory),
.privacy-content a:not(.btn-factory),
.provider-link {
    color: var(--color-signal-orange);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 400;
}

.hero-download-hint a:visited,
.download-note a:visited,
.lead-text a:visited,
.facts-panel a:visited,
.info-box a:visited,
.warning-box a:visited,
.highlight-cell p a:visited,
.highlight-cell li a:visited,
.docs-content-wrapper p a:visited,
.docs-content-wrapper li a:visited,
.docs-content-wrapper dd a:visited,
.docs-content-wrapper td a:visited,
.docs-content-wrapper .info-box a:visited,
.docs-content-wrapper .warning-box a:visited,
.docs-content-wrapper a:not(.nav-card):not(.feature-link):not(.btn-factory):visited,
.about-main-content a:not(.btn-factory):not(.team-link):not(.about-feature-link):visited,
.privacy-main-content a:not(.btn-factory):visited,
.privacy-content a:not(.btn-factory):visited,
.provider-link:visited {
    color: var(--color-ember-edge);
}

.hero-download-hint a:hover,
.download-note a:hover,
.lead-text a:hover,
.facts-panel a:hover,
.info-box a:hover,
.warning-box a:hover,
.highlight-cell p a:hover,
.highlight-cell li a:hover,
.docs-content-wrapper p a:hover,
.docs-content-wrapper li a:hover,
.docs-content-wrapper dd a:hover,
.docs-content-wrapper td a:hover,
.docs-content-wrapper .info-box a:hover,
.docs-content-wrapper .warning-box a:hover,
.docs-content-wrapper a:not(.nav-card):not(.feature-link):not(.btn-factory):hover,
.about-main-content a:not(.btn-factory):not(.team-link):not(.about-feature-link):hover,
.privacy-main-content a:not(.btn-factory):hover,
.privacy-content a:not(.btn-factory):hover,
.provider-link:hover {
    color: var(--color-accent-3);
}

.container {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding-left: var(--page-padding-x);
    padding-right: var(--page-padding-x);
    width: 100%;
}

/* SVG Icon Styles */
svg {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.3s ease;
    box-shadow: none;
    border-radius: 0;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    width: 100%;
}

/* Desktop: slimmer header */
@media (min-width: 769px) {
    :root {
        --navbar-height: 3.25rem;
    }

    .nav-content {
        padding: 0.625rem 0;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 1.875rem;
        height: 1.875rem;
    }
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: translateX(2px);
}

.logo-img,
.logo-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.logo-img {
    object-fit: contain;
    display: block;
}

.logo-icon {
    color: var(--glitch-green);
}

.logo:hover .logo-img {
    transform: scale(1.06);
}

.logo:hover .logo-icon {
    transform: rotate(-15deg) scale(1.1);
}

.logo-text {
    display: inline-block;
}

.logo-text.glitch,
.footer-logo-text.glitch {
    color: #111;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    margin-left: auto;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    letter-spacing: 0.01em;
}

.nav-link:hover {
    color: var(--glitch-green);
}

/* Active navigation link styles - high specificity */
.nav-link.active,
a.nav-link.active,
.nav-links .nav-link.active,
.nav-links a.nav-link.active,
.nav-content .nav-links .nav-link.active,
.nav-content .nav-links a.nav-link.active,
.navbar .nav-links .nav-link.active,
.navbar .nav-links a.nav-link.active {
    color: var(--glitch-green) !important;
    font-weight: 600 !important;
}

.nav-link.active::after,
a.nav-link.active::after,
.nav-links .nav-link.active::after,
.nav-links a.nav-link.active::after,
.nav-content .nav-links .nav-link.active::after,
.nav-content .nav-links a.nav-link.active::after,
.navbar .nav-links .nav-link.active::after,
.navbar .nav-links a.nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: var(--glitch-green) !important;
    border-radius: 2px 2px 0 0 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
}

/* Desktop nav link hover & active - underline style */
@media (min-width: 769px) {
    .navbar .nav-links .nav-link:hover,
    .navbar .nav-links a.nav-link:hover {
        color: var(--glitch-green);
    }

    .navbar .nav-links .nav-link.active,
    .navbar .nav-links a.nav-link.active {
        color: var(--glitch-green) !important;
        font-weight: 600 !important;
    }
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--color-ink);
    color: var(--color-paper-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-buttons, 4px);
    font-family: var(--font-geist-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--color-carbon);
    border-color: var(--color-carbon);
    transform: none;
    box-shadow: none;
}

.btn-primary .btn-icon {
    fill: white;
}

.btn-secondary {
    background: var(--color-paper-white);
    color: var(--color-ink);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-buttons, 4px);
    font-family: var(--font-geist-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.btn-secondary:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
    background: var(--color-frost-surface);
    transform: none;
    box-shadow: none;
}

.btn-secondary .btn-icon {
    stroke: currentColor;
    fill: none;
}

/* Hero Section - Common Styles */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    padding-top: calc(var(--navbar-height) + 2rem);
    background: var(--bg-primary);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

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

/* Section Styles */
section {
    padding: 5rem 0;
}

section:first-of-type {
    padding-top: calc(var(--navbar-height) + 2.5rem);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Quick Links Section */
.quick-links {
    background: var(--bg-primary);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
}



.link-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.link-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.link-icon svg {
    width: 100%;
    height: 100%;
}

.link-card:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
}

.link-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.link-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Footer - base; Factory layout in factory.css */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Mobile bottom nav — see factory.css (.mobile-nav floating pill) */

/* Responsive Design - Common */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-content {
        padding: 0.75rem 0;
    }
    
    .navbar {
        padding: 0;
        border-bottom-left-radius: 1rem;
        border-bottom-right-radius: 1rem;
        border-bottom: none;
    }
    
    .logo-group {
        gap: 0.75rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-img,
    .logo-icon {
        width: 1.625rem;
        height: 1.625rem;
    }

    .footer-logo-img {
        width: 1.75rem;
        height: 1.75rem;
    }
/* Reduce paragraph font size on mobile */
    p {
        font-size: 0.9375rem; /* 15px - reduced from default 16px */
        line-height: 1.7;
    }
    
    .content p,
    .section-content p,
    .info-box p,
    .card p,
    .link-card p {
        font-size: 0.9375rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding-left: var(--page-padding-x);
        padding-right: var(--page-padding-x);
    }
    
}

@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast-notification {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xl);
    min-width: 250px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}



.toast-notification {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.toast-message {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    flex: 1;
}

/* Mobile Toast */
@media (max-width: 768px) {
    .toast-container {
        top: calc(var(--navbar-height) + 0.75rem);
        right: 1rem;
        left: 1rem;
        align-items: stretch;
    }
    
    .toast-notification {
        min-width: auto;
        max-width: 100%;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
