/* === shared.css — Single source for common styles across all pages === */

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

:root {
    --cta: #233eff;
    --cta-hover: #4d62ff;
    --cta-active: #1a2fcc;
    --bg: #ffffff;
    --bg-tint: rgba(35, 62, 255, 0.035);
    --bg-tint-strong: rgba(35, 62, 255, 0.07);
    --bg-gray: #f8fafc;
    --text: #0f172a;
    --text-sec: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --text-primary: #1a1a2e;
    --text-secondary: #3c4149;
    --text-tertiary: #6f6e77;
    --text-quaternary: #86848d;
    --bg-secondary: #f9f8f9;
    --border-secondary: #e4e2e4;
    --border-translucent: rgba(0,0,0,0.06);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --max-w: 1200px;
    --nav-h: 72px;
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.7; color: var(--text-sec); background: var(--bg); overflow-x: hidden; }
::selection { background: var(--cta); color: #fff; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
h1, h2, h3, h4 { font-family: var(--font); color: var(--text); line-height: 1.15; }
h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 700; letter-spacing: -0.025em; }
h2 em { font-style: normal; color: var(--cta); }
h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font); font-weight: 600; text-decoration: none; border: none; border-radius: 10px; cursor: pointer; transition: all 0.25s var(--ease); }
.btn-primary { padding: 1rem 2rem; font-size: 1rem; background: var(--cta); color: #fff; }
.btn-primary:hover { background: var(--cta-hover); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(35,62,255,0.25); }
.btn-primary:active { background: var(--cta-active); transform: translateY(0); }
.btn-outline { padding: 0.875rem 1.75rem; font-size: 0.9375rem; background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--cta); color: var(--cta); transform: translateY(-2px); }
.btn-icon { transition: transform 0.2s var(--ease); }
.btn:hover .btn-icon { transform: translate(2px, -2px); }
.arrow-icon { width: 16px; height: 16px; }

/* === Nav === */
.nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 100; background: rgba(255,255,255,0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid transparent; transition: border-color 0.3s ease; }
.nav.scrolled { border-bottom-color: var(--border); }
.nav .container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.nav-logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.nav-logo:hover { opacity: 0.7; }
.nav-mark-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.nav-name { font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); text-decoration: none; transition: color 0.2s ease; }
.nav-link:hover { color: var(--text); }
.nav-link-active { color: var(--text); font-weight: 600; }
.nav-cta-btn { padding: 0.625rem 1.25rem; font-size: 0.875rem; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 1px; }
.mobile-menu { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1.25rem 2rem 1.5rem; z-index: 90; flex-direction: column; gap: 0.875rem; }
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { font-size: 1rem; padding: 0.375rem 0; }

/* === Article Tags === */
.article-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.25rem 0.625rem; border-radius: 100px; white-space: nowrap; }
.article-tag-published { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.article-tag-coming { background: rgba(99, 102, 241, 0.07); color: #6366f1; }
.article-tag-operators { background: rgba(245, 158, 11, 0.1); color: #b45309; }
.article-tag-builders { background: rgba(99, 102, 241, 0.1); color: #4338ca; }

/* === Section Helpers === */
.section-label { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cta); margin-bottom: 1.25rem; }
.section-sub { font-size: 1.0625rem; color: var(--text-sec); max-width: 560px; margin-bottom: 0; }
.section-center { text-align: center; max-width: 600px; margin-left: auto; margin-right: auto; }
.section-center .section-sub { margin-left: auto; margin-right: auto; }

/* === Footer === */
.footer { padding: 3rem 0 2rem; border-top: 1px solid var(--border); }
.footer-inner { text-align: center; }
.footer-newsletter { margin-bottom: 2rem; }
.footer-newsletter-label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer-form { display: flex; gap: 0.5rem; max-width: 400px; margin: 0 auto; }
.footer-input { flex: 1; padding: 0.75rem 1rem; font-family: var(--font); font-size: 0.875rem; color: var(--text); background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; outline: none; transition: border-color 0.2s ease; }
.footer-input:focus { border-color: var(--cta); }
.footer-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.footer-btn { padding: 0.75rem 1.25rem; font-size: 0.875rem; white-space: nowrap; }
.footer-newsletter-success { display: none; font-size: 0.875rem; color: var(--cta); margin-top: 0.75rem; }
.footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-nav a { font-size: 0.8125rem; font-weight: 500; color: var(--text-sec); text-decoration: none; transition: color 0.2s ease; }
.footer-nav a:hover { color: var(--text); }
.footer-copy { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

/* === Blog Preview === */
.blog-preview { padding: 5rem 0; background: var(--bg-gray); }
.blog-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.blog-preview-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: all 0.3s var(--ease); }
.blog-preview-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.bp-visual { height: 160px; display: flex; align-items: center; justify-content: center; }
.bp-visual svg { width: 48px; height: 48px; opacity: 0.5; }
.bp-visual-amber { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%); }
.bp-visual-emerald { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%); }
.bp-visual-rose { background: linear-gradient(135deg, #fff1f2 0%, #fecdd3 50%, #fda4af 100%); }
.bp-visual-violet { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%); }
.bp-visual-slate { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%); }
.bp-visual-blue { background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 40%, #c7d2fe 100%); }
.bp-content { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.bp-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.25rem 0.625rem; border-radius: 100px; white-space: nowrap; display: inline-block; width: fit-content; margin-bottom: 0.625rem; }
.bp-tag-operators { background: rgba(245, 158, 11, 0.1); color: #b45309; }
.bp-tag-builders { background: rgba(99, 102, 241, 0.1); color: #4338ca; }
.bp-content h3 { font-size: 1.1875rem; line-height: 1.3; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.bp-content p { font-size: 0.875rem; color: var(--text-sec); line-height: 1.55; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bp-footer { margin-top: 0.75rem; }
.bp-read { font-size: 0.875rem; font-weight: 600; color: var(--cta); display: inline-flex; align-items: center; gap: 0.375rem; transition: gap 0.2s var(--ease); }
.blog-preview-card:hover .bp-read { gap: 0.625rem; }
.blog-preview-all { display: flex; justify-content: center; margin-top: 2rem; }

/* === Reveals === */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }

/* === Keyframes === */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; animation: none; }
    html { scroll-behavior: auto; }
}

/* === Focus & Cursor === */
:focus-visible { outline: 2px solid var(--cta); outline-offset: 3px; border-radius: 4px; }
a, button, .nav-toggle { cursor: pointer; }

/* === FOUC Prevention — hide components until defined === */
site-nav:not(:defined) { display: block; min-height: var(--nav-h); }
site-footer:not(:defined) { display: block; min-height: 120px; }
blog-preview:not(:defined) { display: block; min-height: 200px; }

/* === Responsive — Shared breakpoints === */
@media (max-width: 1024px) {
    .blog-preview-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --nav-h: 64px; }
    .container { padding: 0 1.5rem; }
    .nav-links .nav-link { display: none; }
    .nav-toggle { display: flex; }
    .blog-preview-grid { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
    .blog-preview { padding: 3rem 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 1.25rem; }
    .footer-form { flex-direction: column; }
    .footer-btn { width: 100%; justify-content: center; }
}
