/* framepacer site-wide styles.
   EDIT THIS FILE - it applies to every page via /css/shared.css.
   Page-specific styles live inline in src/pages/<page>.html */

:root {
            color-scheme: dark;
            --color-void: #202020;
            --color-surface: #202020;
            --color-surface-elevated: #2A2A2A;
            --color-text: #FFFFFF;
            --color-dim: #BBBBBB;
            --color-dim-subtle: #888888;
            --color-green: #00D296;
            --color-red: #FF4444;
            --space-1: 8px;
            --space-2: 13px;
            --space-3: 21px;
            --space-4: 34px;
            --space-5: 55px;
            --space-6: 89px;
            --text-xs: 13px;
            --text-sm: 16px;
            --text-md: 21px;
            --text-lg: 34px;
            --text-xl: 55px;
            --transition-fast: 0.2s ease;
            --transition-med: 0.3s ease;
            --color-teal: #00B8D4;
            --color-yellow: #FFAA00;
            --color-amber: #FFAA00;
        
}

/* ============================================
LOCAL FONT - INTER VARIABLE
============================================ */
@font-face {
            font-family: 'Inter';
            font-style: normal;
            font-weight: 100 900;
            font-display: swap;
            src: url('/fonts/inter-variable.woff2') format('woff2');
        
}

/* ============================================
1. CSS RESET & VARIABLES
============================================ */
*, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        
}

/* ============================================
2. BASE STYLES
============================================ */
html, body {
            scroll-behavior: smooth;
            overflow-x: hidden;
            width: 100%;
        
}

html {
            scrollbar-color: var(--color-surface-elevated) var(--color-void);
            scrollbar-width: thin;
        
}

body {
            font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
            font-optical-sizing: auto;
            background-color: var(--color-void);
            color: var(--color-text);
            line-height: 1.7;
        
}

::selection { background: var(--color-text); color: var(--color-void); 
}

/* ============================================
3. CONTAINER & TYPOGRAPHY
============================================ */
.container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 var(--space-3);
        
}

.article-container {
            max-width: 800px;
            margin: 0 auto;
            padding: 0 var(--space-3);
        
}

h1, h2, h3, h4 {
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--color-text);
            line-height: 1.2;
        
}

h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: var(--space-3); 
}

h2 { font-size: clamp(22px, 3.5vw, 28px); margin-top: 36px; margin-bottom: var(--space-2); 
}

h3 { font-size: 20px; margin-top: 28px; margin-bottom: var(--space-1); 
}

.article-header + section > h2:first-child,
        section:first-of-type > h2:first-child {
            margin-top: 0;
        
}

p { font-weight: 300; color: var(--color-dim); margin-bottom: var(--space-3); font-size: 18px; line-height: 1.65; 
}

strong { font-weight: 700; color: var(--color-text); 
}

ul, ol {
            color: var(--color-dim);
            margin-bottom: var(--space-3);
            padding-left: var(--space-4);
            font-size: 18px;
            line-height: 1.65;
        
}

li { margin-bottom: var(--space-2); font-weight: 300; 
}

li strong { font-weight: 600; 
}

a:focus-visible, button:focus-visible, input:focus-visible {
            outline: 2px solid var(--color-text);
            outline-offset: 4px;
        
}

/* ============================================
4. STICKY HEADER
============================================ */
.sticky-header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background: var(--color-header-bg);
            backdrop-filter: blur(14px);
            border-bottom: 1px solid var(--color-surface-elevated);
            z-index: 1000;
        
}

.header-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 100%;
            width: 100%;
        
}

.sticky-header .header-brand {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            text-decoration: none;
            color: var(--color-text);
            font-weight: 800;
            font-size: var(--text-sm);
        
}

.sticky-header .header-brand svg {
            width: 36px;
            height: 36px;
            color: var(--color-text);
        
}

.sticky-header .header-nav {
            display: flex;
            gap: var(--space-3);
        
}

.sticky-header .header-nav a {
            color: var(--color-dim);
            text-decoration: none;
            font-size: var(--text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            transition: color var(--transition-fast);
            padding: var(--space-1) 0;
        
}

.sticky-header .header-nav a:hover {
            color: var(--color-text);
        
}

.sticky-header .header-cta {
            display: inline-flex;
            align-items: center;
            background: var(--color-text);
            color: var(--color-void);
            padding: var(--space-1) var(--space-3);
            border-radius: 34px;
            text-decoration: none;
            font-weight: 800;
            font-size: var(--text-xs);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            transition: transform var(--transition-fast), box-shadow var(--transition-fast);
        
}

.sticky-header .header-cta:hover {
            transform: scale(1.06);
            box-shadow: 0 0 20px rgba(var(--rgb-wash), 0.2);
        
}

/* Mobile Hamburger Button */
.mobile-menu-toggle {
            display: none;
            flex-direction: column;
            justify-content: space-between;
            width: 24px;
            height: 18px;
            background: transparent;
            border: none;
            cursor: pointer;
            z-index: 1100;
            padding: 0;
        
}

.mobile-menu-toggle .bar {
            display: block;
            width: 100%;
            height: 2px;
            background-color: var(--color-text);
            border-radius: 2px;
            transition: transform var(--transition-fast), opacity var(--transition-fast);
        
}

.mobile-menu-toggle.active .bar:nth-child(1) {
            transform: translateY(8px) rotate(45deg);
        
}

.mobile-menu-toggle.active .bar:nth-child(2) {
            opacity: 0;
        
}

.mobile-menu-toggle.active .bar:nth-child(3) {
            transform: translateY(-8px) rotate(-45deg);
        
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
            position: fixed;
            top: 60px;
            left: 0;
            width: 100%;
            height: 0;
            background-color: var(--color-overlay-bg);
            backdrop-filter: blur(20px);
            z-index: 999;
            overflow: hidden;
            transition: height var(--transition-med);
        
}

.mobile-menu-overlay.open {
            height: calc(100vh - 60px);
        
}

.mobile-menu-links {
            display: flex;
            flex-direction: column;
            padding: var(--space-4) var(--space-3);
            gap: var(--space-3);
            max-width: 1200px;
            margin: 0 auto;
        
}

.mobile-nav-link {
            color: var(--color-text);
            text-decoration: none;
            font-size: var(--text-md);
            font-weight: 700;
            padding: var(--space-1) 0;
        
}

.mobile-nav-cta {
            margin-top: var(--space-3);
            display: inline-block;
            background: var(--color-text);
            color: var(--color-void) !important;
            padding: var(--space-2) var(--space-4);
            border-radius: 34px;
            font-weight: 800;
            text-align: center;
        
}

/* ============================================
5. ARTICLE CONTENT STYLES
============================================ */
.article-header {
            padding: calc(60px + var(--space-4)) 0 var(--space-3) 0;
        
}

.back-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: var(--text-xs);
            color: var(--color-dim);
            text-decoration: none;
            margin-bottom: var(--space-3);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            transition: color var(--transition-fast), transform var(--transition-fast);
        
}

.back-link:hover {
            color: var(--color-text);
            transform: translateX(-2px);
        
}

.article-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: var(--space-2);
        
}

.article-featured-image {
            margin: 20px 0;
            border-radius: 13px;
            overflow: hidden;
            border: 1px solid var(--color-surface-elevated);
            background: var(--color-surface-elevated);
        
}

.article-featured-image img {
            width: 100%;
            height: auto;
            display: block;
            aspect-ratio: 16 / 9;
            object-fit: cover;
        
}

/* Related Guides */
.related-guides {
            padding: var(--space-5) 0;
            border-top: 1px solid var(--color-surface-elevated);
            margin-top: var(--space-5);
        
}

.related-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--space-3);
            margin-top: var(--space-3);
        
}

.guide-card,
.guide-card:visited {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            background: var(--color-surface);
            border: 1px solid var(--color-surface-elevated);
            border-radius: 13px;
            padding: 24px;
            text-decoration: none;
            color: inherit;
            transition: transform var(--transition-med), border-color var(--transition-med), box-shadow var(--transition-med);
        
}

.guide-card:hover {
            transform: translateY(-4px);
            border-color: rgba(var(--rgb-wash), 0.25);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 1px rgba(var(--rgb-wash), 0.1) inset;
        
}

.card-thumb {
            width: 100%;
            aspect-ratio: 16 / 9;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: var(--space-2);
            background: var(--color-surface-elevated);
            border: 1px solid rgba(var(--rgb-wash), 0.06);
        
}

.card-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transition: transform var(--transition-med);
        
}

.guide-card:hover .card-thumb img {
            transform: scale(1.04);
        
}

.card-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: var(--space-2);
        
}

.card-date,
.card-read-time {
            font-size: 13px;
            color: var(--color-dim-subtle) !important;
            line-height: 1;
        
}

.meta-dot {
            font-size: 13px;
            color: var(--color-dim-subtle);
            line-height: 1;
            user-select: none;
            opacity: 0.6;
        
}

.guide-card h3 {
            font-size: 19px;
            line-height: 1.35;
            margin-top: 0 !important;
            margin-bottom: var(--space-2) !important;
            color: var(--color-text);
            text-align: left;
        
}

.guide-card p {
            font-size: 15px !important;
            line-height: 1.6 !important;
            margin-top: 0 !important;
            margin-bottom: 0 !important;
            text-align: left;
            color: var(--color-dim);
            font-weight: 300;
        
}

/* Guides Grid & Featured Section */
.guides-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: var(--space-3);
            margin-top: var(--space-3);
        
}

.featured-guides-section {
            padding: var(--space-4) 0 var(--space-6) 0;
        
}

.featured-guides-cta {
            display: flex;
            justify-content: center;
            margin-top: var(--space-4);
        
}

.featured-guides-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 28px;
            font-size: var(--text-xs);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--color-text);
            background: var(--color-surface);
            border: 1px solid var(--color-surface-elevated);
            border-radius: 9999px;
            text-decoration: none;
            transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
        
}

.featured-guides-btn:hover {
            background: var(--color-surface-elevated);
            border-color: rgba(var(--rgb-wash), 0.25);
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
        
}

/* ============================================
6. FOOTER
============================================ */
footer {
            padding: var(--space-5) 0;
            border-top: 1px solid var(--color-surface-elevated);
            text-align: center;
        
}

.footer-logo {
            display: flex;
            justify-content: center;
            margin-bottom: var(--space-3);
        
}

.footer-logo svg {
            width: 68px;
            height: 68px;
            color: var(--color-text);
        
}

.footer-links {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: var(--space-2);
            margin-bottom: var(--space-3);
        
}

.footer-nav-links {
            display: flex;
            justify-content: center;
            gap: var(--space-3);
        
}

.footer-contact-wrapper {
            color: var(--color-dim);
            font-size: var(--text-xs);
        
}

.footer-nav-links a,
        .footer-contact {
            color: var(--color-dim);
            text-decoration: none;
            font-size: var(--text-xs);
            transition: color var(--transition-fast);
            font-weight: 600;
        
}

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

.copyright {
            font-size: var(--text-xs);
            color: var(--color-dim);
        
}

@media (max-width: 992px) {
	.guides-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.sticky-header .header-nav { display: none; }
	.sticky-header .header-cta { display: none; }
	.mobile-menu-toggle { display: flex; }
	.related-grid { grid-template-columns: 1fr; }
	.guides-grid { grid-template-columns: 1fr; }
	.featured-guides-section { padding: var(--space-3) 0 var(--space-5) 0; }
	footer { padding: var(--space-4) 0; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
	html { scroll-behavior: auto; }
}

html[data-theme="light"] {
            color-scheme: light;
            --color-void: #F3F3F3;
            --color-surface: #F3F3F3;
            --color-surface-elevated: #CCCCCC;
            --color-text: #1B1B1B;
            --color-dim: #5C5C5C;
            --color-dim-subtle: #767676;
            --color-dim-translucent: rgba(0, 0, 0, 0.12);
            --color-green: #00966E;
            --color-teal: #007489;
            --color-red: #C42B1C;
            --color-yellow: #9A6700;
            --color-amber: #9A6700;
            --rgb-green: 0, 150, 110;
            --rgb-red: 196, 43, 28;
            --rgb-wash: 32, 32, 32;
            --rgb-amber: 154, 103, 0;
            --rgb-cyan: 0, 112, 137;
            --rgb-blue: 0, 105, 168;
            --shadow-soft: 0 8px 16px rgba(0, 0, 0, 0.08);
            --color-panel: #FFFFFF;
            --panel-deep: #FFFFFF;
            --panel-mid: #F9F9F8;
            --panel-head: #EFEFEF;
            --color-sunken: #E9E9E9;
            --color-hover-wash: #E9E9E9;
            --color-header-bg: rgba(243, 243, 243, 0.88);
            --color-overlay-bg: rgba(245, 245, 245, 0.99);
            --color-tooltip-bg: rgba(251, 251, 251, 0.97);
            --tone-red-soft: #A1352A;
            --tone-green-soft: #0E6B4F;
            --tone-amber-text: #7A5200;
            --tone-cyan-text: #075A70;
            --accent-blue: #0069A8;
            --graph-line-inactive: #8C8C8C;
        
}

/* Brand logo stays white in both themes; shadow keeps it visible on light */
.sticky-header .header-brand svg,
        .footer-logo .logo-svg,
        .footer-logo svg {
            color: #FFFFFF;
        
}

html[data-theme="light"] .sticky-header .header-brand svg,
        html[data-theme="light"] .footer-logo .logo-svg,
        html[data-theme="light"] .footer-logo svg {
            filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.22)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28));
        
}

/* Floating theme toggle button */
.theme-toggle {
            position: fixed;
            bottom: 18px;
            right: 18px;
            width: 46px;
            height: 46px;
            border-radius: 50%;
            border: 1px solid var(--color-surface-elevated);
            background: var(--color-header-bg);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            color: var(--color-text);
            display: none; /* Toggle UI hidden for now; theme logic stays active */
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
            z-index: 1200;
            box-shadow: var(--shadow-soft);
            transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
        
}

.theme-toggle:hover {
            transform: scale(1.08);
            border-color: var(--color-dim);
        
}

.theme-toggle:focus-visible {
            outline: 2px solid var(--color-text);
            outline-offset: 3px;
        
}

.theme-toggle svg {
            position: absolute;
            width: 22px;
            height: 22px;
            transition: opacity var(--transition-med), transform var(--transition-med);
        
}

html[data-theme="dark"] .theme-toggle .icon-sun,
        html:not([data-theme="light"]) .theme-toggle .icon-sun { opacity: 1; transform: none; 
}

html[data-theme="dark"] .theme-toggle .icon-moon,
        html:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.4); 
}

html[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.4); 
}

html[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: none; 
}
