/* ============================================================
   TI-84 Premium CE Online Calculator – Standalone Web App
   Premium Dark Theme | Mobile-First | Glassmorphism
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #06081a;
    --bg-secondary: #0d1033;
    --bg-card: rgba(15, 20, 60, 0.65);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent-blue: #4f7df7;
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-gradient: linear-gradient(135deg, #4f7df7 0%, #00d4ff 50%, #a855f7 100%);
    --text-primary: #f0f2ff;
    --text-secondary: #a0a8c8;
    --text-muted: #6b7199;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-glow: 0 0 40px rgba(79, 125, 247, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --max-width: 1200px;
    --header-height: 64px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Override tn.css bootstrap body styling */
body, a, p, h1, h2, h3, h4, h5, h6, li, ul, ol, table, th, td, label, input, button, select, textarea {
    font-family: var(--font-body) !important;
    color: var(--text-primary);
}

a {
    color: var(--accent-cyan) !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

a:hover, a:focus {
    color: var(--accent-blue) !important;
    text-decoration: none !important;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Background Pattern ---------- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(79, 125, 247, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Container ---------- */
.container {
    width: 100% !important;
    max-width: var(--max-width) !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    position: relative;
    z-index: 1;
}

/* ---------- HEADER ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: transparent;
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(6, 8, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.logo-area .site-name {
    font-family: var(--font-heading) !important;
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Desktop Nav */
.desktop-nav {
    display: none;
    gap: 8px;
}

.desktop-nav a {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.desktop-nav a:hover {
    color: var(--text-primary) !important;
    background: var(--bg-glass);
}

/* Hamburger */
.hamburger {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    cursor: pointer;
    padding: 8px !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    z-index: 1001;
    -webkit-appearance: none;
    appearance: none;
}

.hamburger:focus,
.hamburger:focus-visible,
.hamburger:active,
.hamburger:hover {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.hamburger span {
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    background: var(--text-primary) !important;
    border-radius: 2px !important;
    transition: all 0.3s ease;
    pointer-events: none;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 8, 26, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.mobile-menu a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-glass);
}

.mobile-menu a:hover {
    color: var(--text-primary) !important;
    background: var(--bg-glass);
}

/* ==========================================================================
   HERO CALCULATOR CENTERED SECTION
   ========================================================================== */
.hero-split-section {
    padding: calc(var(--header-height) + 50px) 0 60px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-centered-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    z-index: 2;
    position: relative;
    text-align: center;
    width: 100%;
}

.hero-header-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.6s ease-out;
}

.hero-calculator {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0px 0;
}

.hero-footer-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.6s ease-out;
}

/* Premium radial glow for hero background */
.hero-split-section::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 10%;
    width: 80%;
    height: 120%;
    background: radial-gradient(circle at 50% 50%, rgba(79, 125, 247, 0.12) 0%, rgba(168, 85, 247, 0.05) 40%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
}

/* Animated Floating SVGs */
.hero-graphics {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-svg {
    position: absolute;
    width: 180px;
    height: 180px;
    opacity: 0.6;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.2));
}

.hero-svg-left {
    top: 25%;
    left: 8%;
    animation: float-slow 6s ease-in-out infinite;
}

.hero-svg-right {
    top: 15%;
    right: 8%;
    animation: float-slow 8s ease-in-out infinite reverse;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@media (max-width: 1024px) {
    .hero-svg { width: 120px; height: 120px; opacity: 0.4; }
    .hero-svg-left { left: -2%; }
    .hero-svg-right { right: -2%; }
}

@media (max-width: 768px) {
    .hero-graphics { display: none; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-cyan);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: #00e676;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.hero-header-content h1 {
    font-family: var(--font-heading) !important;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero-header-content h1 .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-footer-content .hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

/* Features List replacing CTA */
.centered-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    margin-bottom: 0px;
}

.feature-tick {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.feature-tick svg {
    width: 20px;
    height: 20px;
    color: #00d4ff;
}

@media (max-width: 768px) {
    .hero-split-section {
        padding: calc(var(--header-height) + 20px) 0 60px;
    }
    
    .hero-centered-container {
        gap: 0px;
        padding-top: 10px;
    }
    
    .hero-header-content h1 {
        font-weight: 600;
        margin-bottom: 10px;
    }
    
    .centered-features {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* ---------- CALCULATOR SECTION ---------- */
.calculator-section {
    padding: 60px 0 80px;
    position: relative;
    z-index: 1;
}

.calc-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers the container by default */
    width: 100%;
    max-width: 100vw;
    overflow-x: auto; /* Allow scrolling if calculator is zoomed in larger than screen */
    padding: 0 10px 20px 10px; /* Small padding so scroll doesn't hug the very edge of screen */
}

.calc-wrapper::-webkit-scrollbar {
    display: none;
}

.calc-container {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 100%;
    max-width: 375px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* CRITICAL FIX: prevents transform scaling from overflowing bottom */
    min-height: 300px;
    /* overflow: hidden; Removed to prevent color swatches from cutting off */
}

.calc-container #calculatorDiv {
    margin: 74px auto 0 !important; /* Increased from 64px to create empty gap for swatches */
    position: relative !important; /* CRITICAL FIX: traps any absolute SVG children from jumping to the top of container */
    transform-origin: top center !important;
    overflow: hidden !important; /* Prevent temporary scrollbars right side during load */
    border-radius: 12px;
}

.calc-container #calculatorDiv::-webkit-scrollbar {
    display: none;
}

/* Calc glass wrapper (TI-30XS page) */
.calc-glass {
    position: relative;
}

/* When controls are inside .calc-glass (TI-30XS), use normal flow instead of absolute */
.calc-glass .calc-top-controls {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto 12px;
}

@media (max-width: 768px) {
    .calc-glass .calc-top-controls {
        transform: scale(0.85);
        margin: 0 auto 8px;
    }
}

/* Top Controls: Colors & Zoom */
.calc-top-controls {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 20, 60, 0.9);
    border: 1px solid rgba(79, 125, 247, 0.4);
    border-radius: 50px;
    padding: 6px 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    box-shadow: 0 6px 20px rgba(79, 125, 247, 0.25);
    transition: all 0.3s ease;
    width: max-content;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.control-divider {
    width: 1px;
    height: 24px;
    background: var(--border-glass);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(79, 125, 247, 0.4);
    transform: translateY(-2px);
}

.zoom-btn::after {
    display: none; /* Prevent any default tn.css button styles */
}

.zoom-btn svg {
    width: 16px;
    height: 16px;
}

.zoom-level {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 42px;
    text-align: center;
    font-family: var(--font-heading) !important;
}

@media (max-width: 768px) {
    .calc-top-controls {
        top: 10px;
        width: 90vw;
        max-width: 400px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 8px 12px;
        transform: translateX(-50%);
        border-radius: 20px;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .color-picker {
        gap: 6px;
    }
    .zoom-controls {
        gap: 8px;
    }
    .control-divider {
        display: none;
    }
}

/* Loading spinner */
.calc-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 10;
}

.calc-loader.hidden {
    display: none;
}

.calc-loader .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.calc-loader p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.calc-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.calc-info-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.calc-info-tag svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

/* ---------- TABLE OF CONTENTS ---------- */
.toc-section {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

.toc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 32px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toc-card .toc-heading {
    font-family: var(--font-heading) !important;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc-card .toc-heading svg {
    width: 22px;
    height: 22px;
    color: var(--accent-cyan);
}

.toc-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    counter-reset: toc-counter;
}

.toc-list li {
    counter-increment: toc-counter;
    margin: 0 !important;
}

.toc-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.toc-list li a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-family: var(--font-heading) !important;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 28px;
}

.toc-list li a:hover,
.toc-list li a.active {
    color: var(--text-primary) !important;
    background: var(--bg-glass);
    border-left-color: var(--accent-blue);
}

/* ---------- CONTENT SECTIONS ---------- */
.content-area {
    padding: 40px 0 0px;
    position: relative;
    z-index: 1;
}

.content-section {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--header-height) + 32px);
}

.content-section h2 {
    font-family: var(--font-heading) !important;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 14px;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 3px;
}

.content-section h3 {
    font-family: var(--font-heading) !important;
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    font-weight: 600;
    margin: 28px 0 14px;
    color: #ffffff;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.8;
}

.content-section ul, .content-section ol {
    margin: 0 0 20px 0 !important;
    padding: 0 0 0 24px !important;
}

.content-section li {
    color: var(--text-secondary);
    margin-bottom: 10px !important;
    line-height: 1.7;
}

.content-section li::marker {
    color: var(--accent-blue);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}

.feature-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: rgba(79, 125, 247, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(79, 125, 247, 0.1);
}

.feature-card .feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 1.8rem;
}

.feature-card h4 {
    font-family: var(--font-heading) !important;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    background: var(--bg-card);
}

.comparison-table th,
.comparison-table td {
    padding: 14px 18px !important;
    text-align: left !important;
    border-bottom: 1px solid var(--border-glass) !important;
    font-size: 0.92rem;
    vertical-align: top !important;
    border-top: none !important;
}

.comparison-table thead th {
    background: rgba(79, 125, 247, 0.12) !important;
    font-family: var(--font-heading) !important;
    font-weight: 600;
    color: var(--accent-cyan) !important;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--accent-blue) !important;
}

.comparison-table tbody td {
    color: var(--text-secondary);
}

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

.comparison-table .highlight-row td {
    background: rgba(79, 125, 247, 0.06);
    color: var(--text-primary);
    font-weight: 500;
}

/* Tips Box */
.tips-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 24px 0;
}

.tips-box h4 {
    font-family: var(--font-heading) !important;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* FAQ Accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.faq-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(79, 125, 247, 0.2);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text-primary);
    transition: background 0.3s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font-body) !important;
}

.faq-question:hover {
    background: var(--bg-glass);
}

.faq-question .faq-toggle {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--accent-blue);
}

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 12px 22px 0px;
}

.faq-answer p {
    font-size: 0.94rem;
    line-height: 1.75;
}

/* ---------- FOOTER ---------- */
.site-footer {
    border-top: 1px solid var(--border-glass);
    padding: 48px 0 32px;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo svg {
    width: 28px;
    height: 28px;
}

.footer-logo span {
    font-family: var(--font-heading) !important;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.6;
}

.footer-disclaimer {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.7;
    max-width: 500px;
    line-height: 1.6;
}

.footer-bottom {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ---------- SCROLL TO TOP ---------- */
.scroll-top-btn {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(79, 125, 247, 0.4);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(79, 125, 247, 0.55);
}

.scroll-top-btn svg {
    width: 20px;
    height: 20px;
    color: #000000;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animate on scroll */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* ---------- RESPONSIVE – Tablet (≥768px) ---------- */
@media (min-width: 768px) {
    .container {
        padding: 0 40px !important;
    }

    .desktop-nav {
        display: flex;
    }

    .hamburger {
        display: none !important;
    }

    .hero-section {
        padding-top: calc(var(--header-height) + 70px);
        padding-bottom: 40px;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .calc-container {
        max-width: 460px;
        padding: 32px;
    }

    .toc-card {
        padding: 36px 40px;
    }

    .content-section {
        margin-bottom: 80px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* ---------- RESPONSIVE – Desktop (≥1024px) ---------- */
@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .content-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 48px;
        align-items: start;
    }

    .toc-section {
        display: none; /* hide inline TOC, show sidebar instead */
    }

    .sidebar-toc {
        display: block !important;
        position: sticky;
        top: calc(var(--header-height) + 32px);
    }

    .sidebar-toc .toc-card {
        background: var(--bg-card);
        border: 1px solid var(--border-glass);
        border-radius: var(--radius-lg);
        padding: 28px;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .sidebar-toc .toc-list li a {
        font-size: 0.88rem;
        padding: 10px 14px;
    }
}

/* ---------- RESPONSIVE – Large Desktop (≥1280px) ---------- */
@media (min-width: 1280px) {
    .container {
        padding: 0 24px !important;
    }

    .content-layout {
        grid-template-columns: 280px 1fr;
        gap: 56px;
    }
}

/* ==========================================================================
   EMBED MODAL & BUTTON
   ========================================================================== */
.embed-trigger-btn {
    background: rgba(15, 20, 60, 0.6);
    border: 1px solid rgba(79, 125, 247, 0.4);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: inherit;
    font-size: 1rem;
}

.embed-trigger-btn:hover {
    background: rgba(79, 125, 247, 0.2);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(79, 125, 247, 0.3);
    transform: translateY(-2px);
}

.embed-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 7, 25, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.embed-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.embed-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.embed-modal-overlay.active .embed-modal-content {
    transform: translateY(0) scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0 8px;
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.embed-modal-header h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.embed-modal-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.code-block-wrapper {
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    padding: 16px;
    position: relative;
}

.code-block-wrapper textarea {
    width: 100%;
    height: 120px;
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    font-family: monospace;
    font-size: 13px;
    resize: none;
    outline: none;
    line-height: 1.4;
}

.copy-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.copy-btn {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(79, 125, 247, 0.4);
}

.copy-feedback {
    color: var(--accent-green, #43a047);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.copy-feedback.show {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   PWA INSTALL NOTIFICATION
   ========================================================================== */
.pwa-install-prompt {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 440px;
    background: rgba(15, 20, 60, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(79, 125, 247, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 9999999;
    transition: bottom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
}

.pwa-install-prompt.show {
    bottom: 24px;
    opacity: 1;
    pointer-events: auto;
}

.pwa-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.pwa-icon img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pwa-text {
    flex: 1;
}

.pwa-text h4 {
    margin: 0 0 6px 0;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
}

.pwa-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.3;
}

.pwa-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.pwa-btn-install {
    background: white;
    color: #000000;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s;
}

.pwa-btn-install:hover {
    transform: scale(1.05);
}

.pwa-btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.pwa-btn-close:hover {
    color: var(--text-primary);
}

/* ---------- Calculator Emulator Overrides ---------- */
/* Scope tn.css bootstrap resets to not affect page */
.calculatorDiv, .calculatorDiv * {
    font-family: inherit;
}

#calculatorDiv {
    transform-origin: top center;
}

/* Ensure the SVG faceplate fits */
.calculatorDiv svg {
    max-width: 100%;
    height: auto;
}

/* Hide emulator's bootstrap styles on body */
.site-header *,
.hero-section *,
.calculator-section *:not(.calculatorDiv):not(.calculatorDiv *),
.toc-section *,
.content-area *,
.site-footer * {
    border-collapse: separate;
}

/* Fix for body padding issues on desktop */
@media (min-width: 980px) {
    body:not(.altSkin, .vueRefreshSkin) {
        padding-top: inherit !important;
    }
}
