:root {
  --ink:#0e0e0e; --ink2:#1a1a1a; --ink3:#2d2d2d;
  --cream:#faf8f3; --cream2:#f2ede3; --cream3:#e8e0d0;
  --gold:#c8922a; --gold2:#e0a83a; --gold3:#f5c842;
  --rust:#c04a2a; --teal:#1a6b6b; --sage:#4a7c59;
  --white:#ffffff; --gray:#7a7060; --lgray:#b8b0a0;
  --border:#ddd5c0; --border2:#c8bfa8;
  --card:#ffffff; --card2:#faf8f3;
  --shadow:0 2px 12px rgba(0,0,0,0.07);
  --shadow2:0 4px 24px rgba(0,0,0,0.10);
  --radius:14px; --radius-sm:9px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--ink); line-height: 1.65; overflow-x: hidden; }
body.nav-open { overflow: hidden; }
h1,h2,h3,h4 { font-family: 'Playfair Display', serif; line-height: 1.2; }
a { color: inherit; text-decoration: none; }

/* SKIP LINK */
.skip-link { position: absolute; left: -9999px; top: 4px; z-index: 9999; background: var(--ink); color: var(--cream); padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.skip-link:focus { left: 4px; }

/* SEARCH OVERLAY */
.search-overlay { position: fixed; inset: 0; background: rgba(14,14,14,0.75); z-index: 400; display: none; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-overlay.is-open { display: flex; }
.search-panel { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow2); margin: 0 20px; }
.search-panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1.5px solid var(--border); }
.search-field { flex: 1; border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: 16px; color: var(--ink); background: transparent; }
.search-close { background: var(--cream2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; color: var(--gray); }
.search-close:hover { background: var(--border); }
.search-results { overflow-y: auto; padding: 8px 0; }
.search-result { display: block; padding: 14px 20px; border-bottom: 1px solid var(--border); text-decoration: none; transition: .15s; }
.search-result:hover { background: var(--cream2); }
.search-result-title { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.search-result-meta { font-size: 11px; color: var(--lgray); margin-bottom: 4px; }
.search-result-snippet { font-size: 13px; color: var(--gray); line-height: 1.5; }
.search-empty { padding: 24px 20px; font-size: 14px; color: var(--lgray); text-align: center; }

/* NAV */
nav { background: rgba(250,248,243,0.96); backdrop-filter: blur(14px); border-bottom: 1.5px solid var(--border); position: sticky; top: 0; z-index: 200; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; height: 62px; gap: 8px; }
.logo { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 900; color: var(--ink); white-space: nowrap; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 22px; }
.logo span { color: var(--gold); }
.nav-cats { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-cats::-webkit-scrollbar { display: none; }
.nav-cat { padding: 5px 13px; border-radius: 100px; font-size: 13px; font-weight: 600; color: var(--gray); transition: .18s; white-space: nowrap; border: 1px solid transparent; }
.nav-cat:hover { background: var(--cream2); color: var(--ink); }
.nav-cat.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.nav-search { margin-left: 8px; display: flex; align-items: center; gap: 6px; background: var(--cream2); border: 1.5px solid var(--border); border-radius: 100px; padding: 6px 14px; font-size: 13px; color: var(--gray); cursor: pointer; font-family: 'DM Sans', sans-serif; transition: .18s; }
.nav-search:hover { border-color: var(--gold); color: var(--ink); }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); margin-left: 8px; line-height: 1; padding: 4px; }

/* MOBILE PANEL */
.mobile-panel { display: none; flex-direction: column; background: var(--cream); border-top: 1px solid var(--border); padding: 12px 20px 20px; }
.mobile-panel.is-open { display: flex; }
.mobile-link { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--ink); font-size: 15px; }
.mobile-link:last-child { border-bottom: none; }
.mobile-link:hover { color: var(--gold); }

/* AD SLOTS */
.ad-slot { background: var(--cream2); border: 1.5px dashed var(--border2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--lgray); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.ad-banner { width: 100%; height: 90px; }
.ad-inline { width: 100%; height: 90px; margin: 24px 0; }
.ad-rect { width: 300px; height: 250px; }
.ad-half { width: 300px; height: 600px; }
.ad-strip { width: 100%; height: 100px; margin: 28px 0; }

/* HERO */
.hero { background: var(--ink2); color: var(--cream); position: relative; overflow: hidden; padding: 64px 20px 56px; }
.hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: center; position: relative; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(200,146,42,0.2); border: 1px solid rgba(200,146,42,0.4); color: var(--gold3); font-size: 12px; font-weight: 600; padding: 4px 14px; border-radius: 100px; margin-bottom: 16px; letter-spacing: .5px; }
.hero h1 { font-size: clamp(32px,5vw,60px); font-weight: 900; line-height: 1.08; margin-bottom: 18px; }
.hero h1 .accent { color: var(--gold3); }
.hero-sub { font-size: 17px; color: rgba(250,248,243,0.72); margin-bottom: 28px; max-width: 520px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-gold { background: var(--gold); color: var(--white); font-weight: 700; font-size: 15px; padding: 13px 28px; border-radius: var(--radius-sm); border: none; cursor: pointer; transition: .2s; display: inline-block; }
.btn-gold:hover { background: var(--gold2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--cream); font-weight: 600; font-size: 15px; padding: 12px 24px; border-radius: var(--radius-sm); border: 1.5px solid rgba(255,255,255,0.2); cursor: pointer; transition: .2s; display: inline-block; }
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06); }
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 36px; }
.h-stat { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 16px 14px; text-align: center; }
.h-stat-num { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 900; color: var(--gold3); }
.h-stat-label { font-size: 12px; color: rgba(250,248,243,0.55); margin-top: 2px; }
.hero-featured { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); padding: 24px; }
.hf-label { font-size: 11px; font-weight: 700; color: var(--gold3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.hf-fact { font-family: 'Playfair Display', serif; font-size: 17px; line-height: 1.5; color: var(--cream); margin-bottom: 14px; transition: opacity .3s; }
.hf-source { font-size: 12px; color: rgba(250,248,243,0.45); }
.hf-nav { display: flex; gap: 8px; margin-top: 14px; }
.hf-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: var(--cream); font-size: 13px; font-weight: 600; padding: 7px 16px; cursor: pointer; transition: .18s; font-family: 'DM Sans', sans-serif; }
.hf-btn:hover { background: rgba(255,255,255,0.14); }

/* CATEGORIES STRIP */
.cat-strip { background: var(--cream2); border-bottom: 1.5px solid var(--border); padding: 18px 0; }
.cat-strip-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.cat-strip-inner::-webkit-scrollbar { display: none; }
.cat-card-sm { flex-shrink: 0; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 18px; display: flex; align-items: center; gap: 10px; text-decoration: none; transition: .18s; min-width: 130px; }
.cat-card-sm:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card-sm.active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.ccs-icon { font-size: 20px; }
.ccs-text .ccs-name { font-weight: 700; font-size: 14px; }
.ccs-text .ccs-count { font-size: 11px; color: var(--lgray); }
.cat-card-sm.active .ccs-text .ccs-count { color: rgba(250,248,243,0.55); }

/* PAGE LAYOUT */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 36px 20px 60px; display: grid; grid-template-columns: 1fr 320px; gap: 36px; }
.sidebar-sticky { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 20px; }

/* SECTION HEADERS */
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.sec-head h2 { font-size: 22px; color: var(--ink); }
.sec-head .sec-line { flex: 1; height: 1.5px; background: var(--border); margin-bottom: 3px; }
.sec-head a { font-size: 13px; color: var(--gold); font-weight: 600; white-space: nowrap; }
.sec-head a:hover { color: var(--gold2); }

/* FACT CARDS */
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.fact-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 22px; transition: .2s; display: flex; flex-direction: column; cursor: pointer; }
.fact-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.fc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fc-cat { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; text-transform: uppercase; letter-spacing: .5px; }
.fc-num { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--lgray); }
.fc-icon { font-size: 32px; margin-bottom: 10px; }
.fc-fact { font-family: 'Playfair Display', serif; font-size: 15px; line-height: 1.5; color: var(--ink); flex: 1; }
.fc-fact .highlight { color: var(--gold); font-style: italic; }
.fc-source { font-size: 11px; color: var(--lgray); margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.fc-share { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.fc-share-btn { background: none; border: 1px solid var(--border); border-radius: 7px; color: var(--gray); font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; transition: .18s; font-family: 'DM Sans', sans-serif; }
.fc-share-btn:hover { border-color: var(--gold); color: var(--gold); }
.fc-wow { font-size: 12px; color: var(--lgray); }
.fc-wow span { color: var(--gold); font-weight: 700; }

/* CATEGORY BADGES */
.badge-animals { background: #e8f5e0; color: #3a6b2a; }
.badge-science { background: #e0ecf5; color: #1a4a7a; }
.badge-history { background: #f5ece0; color: #7a4a1a; }
.badge-space { background: #e8e0f5; color: #4a1a7a; }
.badge-food { background: #f5e8e0; color: #7a2a1a; }
.badge-human { background: #f5e0e8; color: #7a1a3a; }
.badge-world { background: #e0f5f0; color: #1a5a4a; }
.badge-records { background: #f5f0e0; color: #5a4a1a; }

/* FEATURE CARD (large) */
.fact-card-large { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 16px; transition: .2s; }
.fact-card-large:hover { border-color: var(--gold); box-shadow: var(--shadow2); }
.fcl-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.fcl-icon { font-size: 44px; line-height: 1; }
.fcl-meta { flex: 1; }
.fcl-cat-badge { display: inline-block; margin-bottom: 6px; }
.fcl-title { font-family: 'Playfair Display', serif; font-size: 19px; line-height: 1.35; }
.fcl-body { font-size: 15px; color: var(--ink3); line-height: 1.75; margin-bottom: 16px; }
.fcl-body strong { color: var(--ink); font-weight: 700; }
.fcl-body em { color: var(--gold); font-style: italic; }
.fcl-extra { background: var(--cream2); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--ink3); border-left: 3px solid var(--gold); margin-bottom: 16px; line-height: 1.65; }
.fcl-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fcl-source { font-size: 12px; color: var(--lgray); flex: 1; }
.read-more { background: var(--ink); color: var(--cream); font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: 8px; display: inline-block; transition: .18s; }
.read-more:hover { background: var(--gold); }

/* SIDEBAR */
.sidebar-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; overflow: hidden; }
.sb-title { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--ink); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.sb-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sb-item:last-child { border-bottom: none; }
.sb-rank { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--lgray); min-width: 20px; margin-top: 1px; }
.sb-text { font-size: 13px; line-height: 1.4; color: var(--ink3); flex: 1; }
.sb-text:hover { color: var(--gold); }
.sb-icon { font-size: 18px; flex-shrink: 0; }
.newsletter-card { background: var(--ink); border-radius: var(--radius); padding: 22px; }
.nl-title { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--cream); margin-bottom: 6px; }
.nl-desc { font-size: 13px; color: rgba(250,248,243,0.6); margin-bottom: 14px; line-height: 1.5; }
.nl-form { display: flex; flex-direction: column; gap: 8px; }
.nl-input { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: var(--cream); font-size: 13px; padding: 10px 14px; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .18s; }
.nl-input::placeholder { color: rgba(250,248,243,0.4); }
.nl-input:focus { border-color: rgba(200,146,42,0.6); }
.nl-btn { background: var(--gold); color: var(--white); font-weight: 700; font-size: 14px; padding: 10px; border: none; border-radius: 8px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: .18s; }
.nl-btn:hover { background: var(--gold2); }
.nl-btn:disabled { background: var(--lgray); cursor: not-allowed; }
.nl-msg { font-size: 12px; color: rgba(250,248,243,0.7); margin-top: 4px; min-height: 16px; }

/* ON THIS DAY */
.otd-card { background: linear-gradient(135deg, var(--ink2), var(--ink3)); border-radius: var(--radius); padding: 24px; color: var(--cream); margin-bottom: 28px; }
.otd-label { font-size: 11px; font-weight: 700; color: var(--gold3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.otd-date { font-family: 'Playfair Display', serif; font-size: 18px; margin-bottom: 8px; }
.otd-fact { font-size: 14px; color: rgba(250,248,243,0.8); line-height: 1.6; }

/* ARTICLE PAGES */
.article-hero { background: var(--ink2); color: var(--cream); padding: 48px 20px 40px; }
.article-hero-inner { max-width: 820px; margin: 0 auto; }
.article-badge { display: inline-block; margin-bottom: 14px; }
.article-h1 { font-size: clamp(26px,4vw,46px); font-weight: 900; margin-bottom: 14px; line-height: 1.12; }
.article-meta { font-size: 13px; color: rgba(250,248,243,0.5); display: flex; gap: 16px; flex-wrap: wrap; }
.article-wrap { max-width: 1200px; margin: 0 auto; padding: 36px 20px 60px; display: grid; grid-template-columns: 1fr 300px; gap: 36px; }
.article-body { font-size: 16px; line-height: 1.8; color: var(--ink3); }
.article-body h2 { font-family: 'Playfair Display', serif; font-size: 24px; color: var(--ink); margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.article-body h3 { font-family: 'Playfair Display', serif; font-size: 19px; color: var(--ink); margin: 24px 0 10px; }
.article-body p { margin-bottom: 16px; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body em { color: var(--gold); font-style: italic; }
.pull-quote { background: var(--cream2); border-left: 4px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 18px 22px; margin: 24px 0; font-family: 'Playfair Display', serif; font-size: 17px; color: var(--ink); line-height: 1.5; }
.fact-box { background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.fact-box .fb-label { font-size: 11px; font-weight: 700; color: var(--gold3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.fact-box .fb-text { font-family: 'Playfair Display', serif; font-size: 16px; line-height: 1.5; }
.num-list { counter-reset: nl; list-style: none; padding: 0; margin: 16px 0 20px; }
.num-list li { counter-increment: nl; display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; align-items: flex-start; }
.num-list li:last-child { border-bottom: none; }
.num-list li::before { content: counter(nl); font-family: 'DM Mono', monospace; font-size: 13px; color: var(--gold); font-weight: 700; background: var(--cream2); border-radius: 6px; padding: 2px 8px; flex-shrink: 0; margin-top: 2px; }
.num-list li strong { color: var(--ink); }

/* SEO SECTION */
.seo-section { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px 32px; margin-top: 32px; }
.seo-section h2 { font-family: 'Playfair Display', serif; font-size: 20px; margin-bottom: 12px; }
.seo-section h3 { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--gold); margin: 18px 0 8px; }
.seo-section p { font-size: 14px; color: var(--gray); line-height: 1.75; margin-bottom: 10px; }

/* TAGS */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag { background: var(--cream2); border: 1px solid var(--border); border-radius: 100px; padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--gray); transition: .18s; display: inline-block; }
.tag:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* BREADCRUMB */
.breadcrumb { font-size: 13px; color: var(--lgray); margin-bottom: 20px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.breadcrumb a { color: var(--gold); }
.breadcrumb .sep { color: var(--lgray); }

/* FOOTER */
footer { background: var(--ink); color: var(--cream); }
.footer-top { max-width: 1200px; margin: 0 auto; padding: 52px 20px 36px; display: grid; grid-template-columns: 2.5fr 1fr 1fr 1fr; gap: 48px; }
.footer-brand .fl { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 900; color: var(--cream); margin-bottom: 10px; display: block; }
.footer-brand .fl span { color: var(--gold3); }
.footer-brand p { font-size: 13px; color: rgba(250,248,243,0.5); line-height: 1.6; max-width: 280px; }
.footer-col h4 { font-size: 11px; font-weight: 700; color: var(--gold3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: rgba(250,248,243,0.6); margin-bottom: 9px; transition: .18s; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 18px 20px; }
.fbot-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.fbot-inner p, .fbot-inner a { font-size: 12px; color: rgba(250,248,243,0.35); }
.fbot-inner a:hover { color: rgba(250,248,243,0.7); }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fu { animation: fadeUp .5s ease both; }
.fu1 { animation-delay: .08s; }
.fu2 { animation-delay: .16s; }
.fu3 { animation-delay: .24s; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-featured { display: none; }
  .page-wrap, .article-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .nav-cats { display: none; }
  .hamburger { display: block; }
  .fact-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .ad-rect, .ad-half { width: 100%; }
}
