/* ===== SHARED CSS — Tracely Website ===== */
/* Extracted from inline styles across all pages for browser caching */

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

/* ===== CSS VARIABLES (Dark Mode Default) ===== */
:root {
    --bg-primary: #0a0b0f;
    --bg-secondary: #12131a;
    --bg-card: #181a24;
    --bg-card-hover: #1e2030;
    --bg-input: #1a1b21;
    --border: #2a2d3e;
    --border-light: #353849;
    --text-primary: #f0f0f5;
    --text-secondary: #b8bbd0;
    --text-muted: #a8adc2;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --accent-glow-strong: rgba(139, 92, 246, 0.3);
    --green: #4ade80;
    --green-dim: rgba(74, 222, 128, 0.15);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.15);
    --amber: #fbbf24;
    --amber-dim: rgba(251, 191, 36, 0.15);
    --blue: #60a5fa;
    --blue-dim: rgba(96, 165, 250, 0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== LIGHT MODE ===== */
html[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f7fb;
    --bg-input: #f5f7fb;
    --border: #e2e5ef;
    --border-light: #eef1f8;
    --text-primary: #1a1d2e;
    --text-secondary: #555d73;
    --text-muted: #7a8294;
    --accent-glow: rgba(139, 92, 246, 0.08);
    --accent-glow-strong: rgba(139, 92, 246, 0.12);
    --green-dim: rgba(74, 222, 128, 0.12);
    --red-dim: rgba(248, 113, 113, 0.12);
    --amber-dim: rgba(251, 191, 36, 0.12);
    --blue-dim: rgba(96, 165, 250, 0.12);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
p { color: var(--text-secondary); }

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ===== NAV (shared base) ===== */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.nav-logo img {
    height: 40px;
    width: auto;
}
.nav-logo .logo-dark { display: block; }
.nav-logo .logo-light { display: none; }
html[data-theme="light"] .nav-logo .logo-dark { display: none; }
html[data-theme="light"] .nav-logo .logo-light { display: block; }

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-back:hover { color: var(--accent-light); }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Theme transition */
body, nav {
    transition: background-color 0.3s, border-color 0.3s;
}

/* ===== HAMBURGER MENU BUTTON ===== */
.nav-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
}

/* ===== MOBILE NAV OVERLAY ===== */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 15, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 80px 24px 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav.closing { opacity: 0; pointer-events: none; transition: opacity 0.25s ease-in 0.15s; }

.mobile-nav a, .mobile-nav .theme-toggle {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 8px 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, color 0.2s;
}
.mobile-nav.open a, .mobile-nav.open .theme-toggle {
    opacity: 1;
    transform: translateY(0);
}
.mobile-nav.open a:nth-child(2) { transition-delay: 0.05s; }
.mobile-nav.open a:nth-child(3) { transition-delay: 0.1s; }
.mobile-nav.open a:nth-child(4) { transition-delay: 0.15s; }
.mobile-nav.open a:nth-child(5) { transition-delay: 0.2s; }
.mobile-nav.open a:nth-child(6) { transition-delay: 0.25s; }
.mobile-nav.open a:nth-child(7) { transition-delay: 0.3s; }
.mobile-nav.open a:nth-child(8) { transition-delay: 0.35s; }
.mobile-nav.open a:nth-child(9) { transition-delay: 0.4s; }
.mobile-nav.open .theme-toggle { transition-delay: 0.45s; }

.mobile-nav.closing a, .mobile-nav.closing .theme-toggle {
    opacity: 0;
    transform: translateY(-15px);
    transition: opacity 0.2s ease-in, transform 0.2s ease-in;
}

.mobile-nav-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    opacity: 0;
    transform: rotate(-90deg);
    transition: opacity 0.2s ease-out, transform 0.3s ease-out, color 0.2s;
}
.mobile-nav.open .mobile-nav-close {
    opacity: 1;
    transform: rotate(0deg);
}
.mobile-nav.closing .mobile-nav-close {
    opacity: 0;
    transform: rotate(90deg);
    transition: opacity 0.15s ease-in, transform 0.2s ease-in;
}
.mobile-nav-close:hover { color: var(--accent); }

/* ===== COMMON FOOTER (simple pages) ===== */
.footer-simple {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.footer-simple a { color: var(--accent-light); }
