/* Inphormation — Core Stylesheet */

/* ========================================
   FONTS & RESET
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&family=Source+Sans+3:wght@300;400;600&display=swap');

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

:root {
  --gold: #C8991F;
  --gold-light: #DDB84A;
  --gold-gradient: linear-gradient(135deg, #C8991F, #DDB84A, #C8991F);
  --dark: #0F0F0F;
  --charcoal: #222222;
  --gray: #555555;
  --gray-light: #888888;
  --border: #DEDEDE;
  --bg: #FFFFFF;
  --bg-soft: #F7F7F5;
  --bg-warm: #F0EAE0;
  --font-heading: 'Raleway', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --max-width: 1200px;
  --radius: 4px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--dark);
}

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

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  height: 78px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.logo-wrap {
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.logo-wrap img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
}

nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  flex: 1;
  overflow: visible;
}

nav a {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--charcoal);
  padding: 0.3rem 0.45rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

nav a:hover {
  color: var(--gold);
  background: rgba(200,153,31,0.08);
}

.nav-search-btn {
  background: var(--gold);
  color: white !important;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
}

.nav-search-btn:hover {
  background: var(--dark);
  color: white !important;
}

nav a.active {
  color: var(--gold) !important;
  background: rgba(200,153,31,0.12) !important;
  border: 1px solid rgba(200,153,31,0.35);
  font-weight: 700;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  background: var(--bg-warm);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.2;
  color: var(--dark);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero h1 strong {
  font-weight: 600;
}

.hero p {
  font-size: 1rem;
  color: var(--gray);
  max-width: 560px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

/* Search Bar */
.search-bar {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border: 2px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(184, 150, 46, 0.15);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--dark);
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--gray-light);
}

.search-bar button {
  background: var(--gold);
  border: none;
  padding: 1rem 1.75rem;
  cursor: pointer;
  color: white;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.search-bar button:hover {
  background: var(--dark);
}

.hero-note {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--gray-light);
}

.hero-note a {
  color: var(--gold);
}

/* ========================================
   STATS COUNTER
   ======================================== */

.stats-section {
  background: var(--dark);
  padding: 5rem 2rem;
  border-bottom: 1px solid #333;
}

.stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.stats-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.stat-item {
  padding: 1rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 200;
  color: white;
  line-height: 1;
  margin-bottom: 0.75rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-desc {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 2.8rem; }
}

/* ========================================
   DOCUMENT MOSAIC
   ======================================== */

.mosaic-section {
  background: var(--bg-warm);
  padding: 5rem 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.mosaic-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.mosaic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.mosaic-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
  color: var(--charcoal);
  font-family: var(--font-body);
  line-height: 1.3;
  transition: all 0.2s;
  cursor: pointer;
}

.mosaic-item:hover {
  border-color: var(--gold);
  color: var(--dark);
  background: rgba(184,150,46,0.05);
}

.mosaic-item.mosaic-gold {
  border-color: rgba(184,150,46,0.3);
  background: rgba(184,150,46,0.06);
  color: var(--dark);
  font-weight: 500;
}

.mosaic-item.mosaic-wide {
  flex-grow: 1;
}

/* ========================================
   CONTENT PILLARS / TOPICS
   ======================================== */

.topics {
  padding: 5rem 2rem;
  background: var(--bg);
}

.topics-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 300;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 3rem;
  max-width: 520px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.topic-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.topic-card:hover {
  border-color: var(--gold-light);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.topic-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.topic-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.topic-card p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.6;
}

.topic-card .count {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

/* ========================================
   RECENT ADDITIONS
   ======================================== */

.recent {
  padding: 5rem 2rem;
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.recent-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
}

.recent-header .view-all {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.entry-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.entry-row:hover {
  background: rgba(184, 150, 46, 0.04);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius);
}

.entry-tag {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(184, 150, 46, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  text-align: center;
}

.entry-title {
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 500;
}

.entry-title span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gray);
  margin-top: 0.15rem;
}

.entry-meta {
  font-size: 0.8rem;
  color: var(--gray-light);
  white-space: nowrap;
}

/* ========================================
   ABOUT STRIP
   ======================================== */

.about-strip {
  padding: 5rem 2rem;
  background: var(--dark);
  text-align: center;
}

.about-strip-inner {
  max-width: 680px;
  margin: 0 auto;
}

.about-strip .phi-mark {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  display: block;
}

.about-strip h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 300;
  color: white;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.about-strip p {
  color: #999;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.about-strip a.btn {
  display: inline-block;
  background: var(--gold);
  color: white;
  padding: 0.9rem 2.5rem;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.about-strip a.btn:hover {
  background: var(--gold-light);
  color: white;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo img {
  height: 28px;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--gray);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--gray-light);
}

/* ========================================
   RESPONSIVE
   ======================================== */

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

  nav {
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }

  nav {
    display: none;
  }

  .hero {
    padding: 3.5rem 1.5rem;
  }

  .entry-row {
    grid-template-columns: 80px 1fr;
  }

  .entry-meta {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================
   AD SLOTS
   ======================================== */

.ad-slot {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
  color: var(--gray-light);
  font-size: 0.75rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

.ad-label {
  display: block;
  font-size: 0.65rem;
  color: var(--gray-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0 0;
}

.ad-leaderboard {
  padding: 0.5rem 1rem 1rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-inline {
  padding: 0.5rem 1rem 1rem;
  min-height: 100px;
  margin: 2.5rem 0;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ========================================
   PAGE HERO (inner pages)
   ======================================== */

.page-hero {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 2rem 1.5rem;
}

.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0.25rem 0 0.5rem;
}

.page-hero p {
  font-size: 0.97rem;
  color: var(--gray);
  max-width: 680px;
  line-height: 1.6;
}

/* ========================================
   CONTENT SECTION (inner pages)
   ======================================== */

.content-section {
  padding: 3rem 2rem 5rem;
}

.content-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ========================================
   VIDEOS PAGE
   ======================================== */

.video-categories {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.video-category {
  border-top: 2px solid var(--border);
  padding-top: 2rem;
}

.category-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow 0.2s;
}

.video-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.placeholder-thumb {
  background: var(--charcoal);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s;
}

.placeholder-thumb:hover {
  background: var(--gold);
  color: white;
}

.video-info {
  padding: 1.25rem;
}

.video-info h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.video-info p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.video-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  color: var(--gray);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-right: 0.4rem;
  margin-top: 0.25rem;
}

.submit-video-cta {
  margin-top: 4rem;
  padding: 3rem;
  background: var(--bg-warm);
  border-radius: var(--radius);
  text-align: center;
}

.submit-video-cta h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--dark);
  margin: 0.5rem 0 1rem;
}

.submit-video-cta p {
  color: var(--gray);
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

/* ========================================
   MIND TECH PAGE
   ======================================== */

.research-entry {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.research-entry h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.3rem;
}

.entry-meta-line {
  font-size: 0.85rem;
  color: var(--gold);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
}

.research-entry p {
  color: var(--charcoal);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.97rem;
}

.research-entry ul {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--charcoal);
  line-height: 1.9;
  font-size: 0.97rem;
}

.featured-entry {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  position: relative;
  margin-bottom: 1rem;
}

.entry-badge {
  font-size: 0.7rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gold);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 1rem;
}

.subentry {
  background: var(--bg);
  border-left: 3px solid var(--gold-light);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.subentry h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.6rem;
}

.subentry p {
  font-size: 0.92rem;
  color: var(--gray);
  margin-bottom: 0;
}

.entry-tags {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ========================================
   EBOOKS PAGE
   ======================================== */

.ebooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.ebook-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.featured-ebook {
  border-color: var(--gold-light);
}

.ebook-badge {
  background: var(--gold);
  color: white;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
}

.ebook-cover-placeholder {
  background: var(--charcoal);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ebook-symbol {
  font-size: 4rem;
  opacity: 0.4;
}

.ebook-info {
  padding: 1.75rem;
}

.ebook-info h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.2rem;
}

.ebook-author {
  color: var(--gold);
  font-size: 0.85rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  margin-bottom: 1rem !important;
}

.ebook-desc {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.ebook-tags {
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ebook-btn {
  margin-top: 0.5rem;
  display: inline-block;
}

.ebooks-coming {
  padding: 3rem 0;
  border-top: 2px solid var(--border);
}

.ebooks-coming h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--dark);
  margin: 0.5rem 0 0.75rem;
}

.ebooks-coming > p {
  color: var(--gray);
  margin-bottom: 2rem;
}

.coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.coming-soon-item {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.ebook-symbol-sm {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.75rem;
}

.coming-soon-item h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.coming-soon-item p {
  font-size: 0.83rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.coming-tag {
  font-size: 0.68rem;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  color: var(--gray-light);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

@media (max-width: 640px) {
  .ebooks-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 2rem; }
  .featured-entry { padding: 1.5rem; }
}

/* ========================================
   MOBILE — HAMBURGER NAV & RESPONSIVE
   ======================================== */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  z-index: 200;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: all 0.25s;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  /* Show hamburger, hide inline nav */
  .nav-hamburger { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--gold);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1rem 1rem;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 150;
  }
  nav.nav-open { display: flex; }

  nav a {
    font-size: 0.85rem;
    padding: 0.75rem 0.5rem;
    width: 100%;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.04em;
  }
  nav a:last-child { border-bottom: none; }

  .nav-search-btn {
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem !important;
    font-size: 0.85rem !important;
  }

  /* Header stays single row */
  .header-inner {
    overflow: visible !important;
  }
}

@media (max-width: 640px) {
  /* Hero — single column */
  .hero-inner {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  .hero { padding: 1.5rem 1rem; }
  .hero h1 { font-size: 1.6rem !important; }
  .hero-left { order: 1; }
  .hero-right { order: 2; }

  /* Stats bar — 2 columns on mobile */
  .stats-bar-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }
  .stat { text-align: center; }

  /* Page hero */
  .page-hero { padding: 0.75rem 1rem; }
  .page-hero h1 { font-size: 1.1rem; }
  .page-hero p { font-size: 0.9rem; }
  .page-hero-inner { flex-direction: column; gap: 0.4rem; }

  /* Topics chips — wrap tighter */
  .chip-cloud { gap: 0.4rem; }
  .chip { font-size: 0.72rem; padding: 0.3rem 0.6rem; }

  /* Research cards — single column */
  .papers-grid { grid-template-columns: 1fr !important; }

  /* Inventor cards — single column */
  .inventors-grid { grid-template-columns: 1fr !important; }

  /* General grids */
  .card-grid, .grid-3, .video-grid, .image-grid {
    grid-template-columns: 1fr !important;
  }

  /* Section padding */
  .section { padding: 1.5rem 1rem; }
  .section-inner { padding: 0 !important; }

  /* Logo size on small mobile */
  .logo-wrap img { height: 44px; }

  /* Tab bar horizontal scroll on mobile */
  .tab-bar-inner { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .tab-btn { font-size: 0.78rem; padding: 0.5rem 1rem; white-space: nowrap; }

  /* Footer stacked */
  .footer-links { gap: 0.5rem 1rem; }
}

/* ========================================
   ALGOLIA SEARCH RESULTS
   ======================================== */

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
}

#search-input {
  width: 100%;
  padding: 0.85rem 1.1rem 0.85rem 2.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
}
#search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,153,31,0.15);
}
#search-input::placeholder { color: #aaa; }

#search-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 299;
}
#search-overlay.active { display: block; }

#search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 300;
  max-height: 70vh;
  overflow-y: auto;
}
#search-results.active { display: block; }

.sr-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: white; z-index: 1;
}
.sr-count { font-size: 0.82rem; color: var(--gray); }
.sr-count strong { color: var(--dark); }
.sr-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--gray-light); padding: 0.25rem 0.5rem;
  border-radius: 3px;
}
.sr-close:hover { color: var(--dark); background: var(--bg-warm); }

.sr-list { padding: 0.4rem 0; }

.sr-hit {
  display: block; padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none; color: var(--charcoal);
  transition: background 0.15s;
}
.sr-hit:last-child { border-bottom: none; }
.sr-hit:hover { background: var(--bg-warm); }

.sr-hit-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.sr-title { font-family: var(--font-heading); font-size: 0.88rem; font-weight: 700; color: var(--dark); flex: 1; }
.sr-title em { font-style: normal; background: rgba(200,153,31,0.2); border-radius: 2px; }

.sr-ctype {
  font-family: var(--font-heading); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--dark); color: white;
  padding: 0.1rem 0.4rem; border-radius: 3px; white-space: nowrap;
}
.sr-pdfs { font-size: 0.72rem; color: var(--gray-light); white-space: nowrap; }

.sr-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.sr-inventor {
  font-size: 0.75rem; font-weight: 600; color: var(--gold);
  font-family: var(--font-heading);
}
.sr-topic {
  font-size: 0.68rem; color: var(--gray);
  background: var(--bg-soft); padding: 0.1rem 0.45rem;
  border-radius: 20px; border: 1px solid var(--border);
}
.sr-preview { font-size: 0.78rem; color: var(--gray); line-height: 1.5; }
.sr-preview em { font-style: normal; background: rgba(200,153,31,0.15); border-radius: 2px; }

.sr-footer {
  padding: 0.6rem 1rem;
  font-size: 0.72rem; color: var(--gray-light);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
}
.sr-footer a { color: var(--gold); }

.sr-empty { padding: 1.5rem 1rem; text-align: center; color: var(--gray); font-size: 0.88rem; }
