/**
 * Tygash Landing Page — impeccable.style design system
 * Dark mode default, light mode via body.landing-light
 * Overrides Bootstrap 5.3 with impeccable.style tokens
 */

/* ── Bootstrap Overrides (Dark Mode Default) ──────────────────────── */

/* Reset & Base */
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

/* ── Navigation (Buggazi pattern: custom nav, not Bootstrap) ─────── */
/* Override Bootstrap's .nav { display:flex; flex-wrap:wrap } */
nav.nav {
    display: block !important;
    flex-wrap: nowrap !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(12, 10, 8, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding-top: env(safe-area-inset-top);
    transition: box-shadow var(--duration-state) var(--ease-default);
}

nav.nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo-img {
    height: 28px;
    width: auto;
    filter: invert(1);
    transition: opacity var(--duration-state) var(--ease-default);
}

.nav-logo-img:hover { opacity: 0.8; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a:not(.btn) {
    color: #d1cdc8;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: color var(--duration-state) var(--ease-default),
                background var(--duration-state) var(--ease-default);
}

.nav-links a:not(.btn):hover {
    color: var(--white);
    background: var(--dark-light);
}

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { display: inline-flex; align-items: center; gap: 4px; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
    padding: 6px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--gray-400) !important;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
    background: var(--dark-light);
    color: var(--white) !important;
}

/* Nav Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 10px 22px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    white-space: nowrap;
    line-height: 1;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration-state) var(--ease-default);
}

.btn:active { transform: scale(0.97); transition-duration: var(--duration-micro); }

.btn-primary {
    background: var(--accent);
    color: #0c0a08 !important;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(234, 179, 8, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-300);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--dark-light);
    color: var(--white);
    border-color: var(--gray-500);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Mobile Nav */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-mobile-toggle span {
    width: 20px;
    height: 2px;
    background: var(--gray-400);
    border-radius: 1px;
}

.nav-mobile {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.nav-mobile.active { display: flex; }

.nav-mobile a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ── Hero Section (Buggazi pattern: centered single-column) ───────── */
.hero-section {
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 600px;
    background: radial-gradient(ellipse at top center, rgba(234, 179, 8, 0.08) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

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

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(234, 179, 8, 0.15);
    color: var(--accent);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 50px;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-content h1 {
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--white);
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: var(--text-lg);
    color: var(--gray-300);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
}

.hero-cta .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #faf9f7 !important;
    padding: 14px 28px;
    font-weight: 600;
    border-radius: 9999px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--duration-state) var(--ease-default);
}

.hero-cta .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(234, 179, 8, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-300);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 14px 28px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    transition: all var(--duration-state) var(--ease-default);
    text-decoration: none;
}

.btn-ghost:hover {
    background: var(--dark-light);
    color: var(--white);
    border-color: var(--gray-500);
}

/* Hero terminal (signup curl) */
.hero-terminal {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.hero-terminal pre {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--gray-300);
    overflow-x: auto;
    margin: 0;
}

.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
}

.hero-stats .stat {
    text-align: center;
    white-space: nowrap;
}

.hero-stats .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.hero-stats .stat-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.browser-mockup {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow var(--duration-state) var(--ease-default);
}

.browser-mockup:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.browser-header {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.browser-buttons {
    display: flex;
    gap: 0.375rem;
    margin-right: 0.75rem;
}

.btn-close-mockup,
.btn-minimize-mockup,
.btn-maximize-mockup {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.btn-close-mockup { background: var(--error); }
.btn-minimize-mockup { background: var(--warning); }
.btn-maximize-mockup { background: var(--success); }

.browser-url {
    background: var(--bg-primary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    flex: 1;
    border: 1px solid var(--border-subtle);
}

.browser-content {
    background: var(--dark);
    position: relative;
    padding: 1.25rem;
}

.browser-content pre {
    margin: 0;
    color: var(--gray-300);
    font-size: 0.8125rem;
    line-height: 1.6;
    font-family: var(--font-mono);
    white-space: pre;
    overflow-x: auto;
}

.browser-content .code-keyword { color: var(--accent); }
.browser-content .code-string { color: #86EFAC; }
.browser-content .code-flag { color: #93C5FD; }
.browser-content .code-url { color: #FCA5A5; }
.browser-content .code-comment { color: var(--gray-500); font-style: italic; }

/* ── Features Section ─────────────────────────────────────────────── */
.features-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.features-section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.features-section .lead {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    transition: border-color var(--duration-state) var(--ease-default);
    border: 1px solid var(--border);
}

.feature-card:hover {
    border-color: var(--accent);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-subtle);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon i {
    font-size: 1.125rem;
    color: var(--accent);
}

.feature-card h4 {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-top: 0.75rem;
}

.feature-list li {
    padding: 0.1875rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.feature-list li::before {
    content: '\2713';
    color: var(--accent);
    font-weight: 600;
    margin-right: 0.5rem;
}

/* ── Code Example / API Section ───────────────────────────────────── */
.pricing-section {
    padding: 4rem 0;
    background: var(--bg-secondary) !important;
}

.pricing-section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.pricing-section .lead {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ── Pricing Section ──────────────────────────────────────────────── */
#pricing {
    background: var(--bg-primary);
}

.pricing-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--duration-state) var(--ease-default);
    height: 100%;
    border: 1px solid var(--border);
}

.pricing-card:hover {
    border-color: var(--accent);
}

.pricing-card.featured {
    border: 2px solid var(--accent);
    position: relative;
}

.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #faf9f7;
    padding: 0.375rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    letter-spacing: 0.03em;
}

.pricing-header {
    padding: 1.5rem 1.5rem 0.75rem;
    text-align: center;
    position: relative;
}

.pricing-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-body {
    padding: 0 1.5rem 1.5rem;
}

.price-display {
    text-align: center;
    margin-bottom: 0.75rem;
}

.price-display .currency {
    font-size: 1.25rem;
    vertical-align: top;
    color: var(--text-muted);
}

.price-display .amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.price-display .period {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.pricing-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
}

.pricing-features li {
    padding: 0.375rem 0;
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pricing-features li i {
    margin-right: 0.625rem;
    font-size: 1rem;
}

.pricing-features li i.text-success,
.pricing-features li .fa-circle-check {
    color: var(--accent) !important;
}

.pricing-features li i.text-muted,
.pricing-features li .fa-circle-minus {
    color: var(--text-muted) !important;
}

.pricing-cta {
    margin-top: 1.25rem;
    text-align: center;
}

.pricing-cta .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #faf9f7;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all var(--duration-state) var(--ease-default);
}

.pricing-cta .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.25);
}

.pricing-cta .btn-outline-primary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gray-300);
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 9999px;
    transition: all var(--duration-state) var(--ease-default);
}

.pricing-cta .btn-outline-primary:hover {
    background: var(--dark-light);
    border-color: var(--gray-500);
    color: var(--white);
}

/* ── Comparison Table ─────────────────────────────────────────────── */
.comparison-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.comparison-section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.comparison-section .lead {
    color: var(--text-secondary);
}

.comparison-table {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table {
    margin-bottom: 0;
    color: var(--text-secondary);
    --bs-table-color: var(--text-secondary);
    --bs-table-bg: var(--bg-secondary);
    --bs-table-border-color: var(--border);
    --bs-table-striped-color: var(--text-secondary);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-hover-bg: var(--bg-tertiary);
}

.table thead th {
    background: var(--dark-medium);
    color: var(--white);
    font-weight: 600;
    border: none;
    padding: 1rem;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.8125rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.table tbody td strong {
    color: var(--text-primary);
}

.table tbody tr:hover td {
    background: var(--bg-tertiary);
}

.table tbody td .text-success,
.table tbody td.text-success {
    color: var(--accent) !important;
}

.table tbody td .text-danger,
.table tbody td.text-danger {
    color: var(--error) !important;
}

/* ── CTA Section ──────────────────────────────────────────────────── */
.cta-section {
    background: var(--dark-medium) !important;
    color: var(--white);
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cta-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
}

.cta-section .lead {
    font-size: 0.9375rem;
    color: var(--gray-400);
}

.cta-section .btn-light {
    background: var(--accent);
    color: #0c0a08 !important;
    border: none;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 9999px;
    font-size: var(--text-sm);
    transition: all var(--duration-state) var(--ease-default);
}

.cta-section .btn-light:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.25);
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
    background: var(--dark);
    color: var(--white);
    border-top: 1px solid var(--border-subtle);
}

.footer h5,
.footer h6 {
    color: var(--white);
    font-size: var(--text-sm);
    font-weight: 600;
}

.footer p.text-muted,
.footer .text-muted {
    color: var(--gray-500) !important;
    font-size: 0.8125rem;
}

.footer a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color var(--duration-state) var(--ease-default);
}

.footer a:hover {
    color: var(--white);
}

.footer ul li {
    margin-bottom: 0.375rem;
}

.social-links a {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    text-align: center;
    line-height: 32px;
    transition: background var(--duration-state) var(--ease-default);
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.social-links a:hover {
    background: var(--dark-medium);
    color: var(--white);
}

/* ── Badge Overrides ──────────────────────────────────────────────── */
.badge.bg-success,
.badge.bg-info,
.badge.bg-warning {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border);
}

/* ── Bootstrap Utility Overrides ──────────────────────────────────── */
.bg-light {
    background-color: var(--bg-secondary) !important;
}

.bg-primary {
    background-color: var(--dark) !important;
}

.bg-dark {
    background-color: var(--dark) !important;
}

.text-white {
    color: var(--white) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.fw-bold {
    font-weight: 700 !important;
}

/* ── Mode Toggle (fixed bottom-left) ──────────────────────────────── */
#modeToggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 900;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 0;
    opacity: 0.7;
    transition: opacity var(--duration-state) var(--ease-default),
                background var(--duration-state) var(--ease-default),
                color var(--duration-state) var(--ease-default);
}

#modeToggle:hover {
    opacity: 1;
    background: var(--dark-medium);
    color: var(--white);
}

/* ── Light Mode Overrides ─────────────────────────────────────────── */
body.landing-light nav.nav {
    background: rgba(250, 249, 247, 0.92);
    border-bottom-color: var(--border);
}

body.landing-light .nav-logo-img {
    filter: none;
}

body.landing-light .nav-logo-img {
    filter: none;
}

body.landing-light .nav-links a:not(.btn) {
    color: var(--text-secondary);
}

body.landing-light .nav-links a:not(.btn):hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

body.landing-light .btn-ghost {
    color: var(--text-secondary);
    border-color: var(--border);
}

body.landing-light .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

body.landing-light .btn-primary {
    background: var(--accent);
    color: #0c0a08 !important;
}

body.landing-light .nav-dropdown-menu {
    background: #faf9f7;
    border-color: var(--border);
}

body.landing-light .nav-dropdown-menu a {
    color: var(--text-secondary) !important;
}

body.landing-light .nav-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary) !important;
}

body.landing-light .nav-mobile {
    background: #faf9f7;
}

body.landing-light .nav-mobile a {
    color: var(--text-secondary);
}

body.landing-light .hero-cta .btn-primary {
    color: #0c0a08 !important;
}

body.landing-light .pricing-card.featured::before {
    color: #faf9f7;
}

body.landing-light .pricing-cta .btn-primary {
    color: #faf9f7;
}

body.landing-light .cta-section {
    background: var(--bg-tertiary) !important;
    border-color: var(--border);
}

body.landing-light .cta-section h2 {
    color: var(--text-primary);
}

body.landing-light .cta-section .lead {
    color: var(--text-secondary);
}

body.landing-light .cta-section .btn-light {
    background: var(--accent);
    color: #0c0a08 !important;
}

body.landing-light #modeToggle {
    background: var(--bg-tertiary);
    border-color: var(--border);
    color: var(--text-secondary);
}

body.landing-light #modeToggle:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    html, body { overflow-x: hidden !important; max-width: 100vw; }

    .nav-links { display: none; }
    .nav-mobile-toggle { display: flex; }

    .hero-content h1 {
        font-size: var(--text-2xl);
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn-primary,
    .hero-cta .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .feature-card {
        margin-bottom: 1rem;
    }

    .pricing-card {
        margin-bottom: 1rem;
    }

    .price-display .amount {
        font-size: 2rem;
    }

    .comparison-table {
        font-size: 0.8125rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.625rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: var(--text-xl);
    }

    .feature-icon {
        width: 40px;
        height: 40px;
    }

    .feature-icon i {
        font-size: 1rem;
    }

    .price-display .amount {
        font-size: 1.75rem;
    }
}

/* ── Print ────────────────────────────────────────────────────────── */
@media print {
    .navbar,
    .hero-section,
    .cta-section,
    .footer,
    #modeToggle {
        display: none !important;
    }

    .features-section,
    #pricing,
    .comparison-section {
        page-break-inside: avoid;
    }
}
