/* ========================================
   Intelligence Advantage — Nexus Theme
   ======================================== */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface2: #eef0f4;
  --border: #d8dbe5;
  --text: #1a1d27;
  --text-muted: #5f6478;
  --accent: #4f46e5;
  --accent2: #0891b2;
  --accent3: #f59e0b;
  --accent4: #059669;
  --header-h: 60px;
  --sidebar-w: 240px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========================================
   HEADER
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.header-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-monogram {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.logo-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.nav-links a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  background: rgba(79,70,229,0.08);
  color: var(--accent);
  font-weight: 700;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.hamburger svg { display: block; }

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem 1rem;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(79,70,229,0.08);
  color: var(--accent);
}

/* ========================================
   FEATURED BANNER
   ======================================== */
.featured-banner {
  background: linear-gradient(135deg, rgba(79,70,229,0.08) 0%, rgba(8,145,178,0.06) 50%, rgba(5,150,105,0.04) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem;
}

.featured-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.featured-content {
  flex: 1;
  min-width: 280px;
}

.featured-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.featured-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.featured-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.featured-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.featured-stat {
  text-align: center;
}

.featured-stat .num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.featured-stat .lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.featured-cta {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.featured-cta:hover {
  background: #4338ca;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

/* ========================================
   MAIN LAYOUT (Sidebar + Content)
   ======================================== */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - var(--header-h) - 200px);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 1.5rem 1rem 2rem 1.5rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(79,70,229,0.08);
  color: var(--accent);
  font-weight: 700;
}

.sidebar-link .count {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0.5rem;
}

.sidebar-parts {
  display: none;
}

.sidebar-parts.visible {
  display: block;
}

.sidebar-social {
  display: flex;
  gap: 0.75rem;
  padding-left: 0.5rem;
  margin-top: 0.5rem;
}

.sidebar-social a {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-social a:hover {
  color: var(--accent);
}

.sidebar-subscribe { padding: 0.5rem; }
.sidebar-subscribe input {
  width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 5px;
  font-size: 0.72rem; font-family: inherit; color: var(--text); background: var(--bg); outline: none;
  transition: border-color 0.15s; margin-bottom: 0.35rem;
}
.sidebar-subscribe input:focus { border-color: var(--accent); }
.sidebar-subscribe button {
  width: 100%; padding: 0.35rem; background: var(--accent); color: #fff; border: none; border-radius: 5px;
  font-size: 0.72rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.sidebar-subscribe button:hover { background: #4338ca; }
.sidebar-subscribe button:disabled { opacity: 0.6; cursor: not-allowed; }
.sidebar-subscribe .sb-msg { font-size: 0.65rem; margin-top: 0.25rem; min-height: 1em; }
.sidebar-subscribe .sb-msg.success { color: var(--accent4); }
.sidebar-subscribe .sb-msg.error { color: #e11d48; }
.sidebar-subscribe .sb-privacy { font-size: 0.6rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ========================================
   CONTENT GRID
   ======================================== */
.content-area {
  flex: 1;
  padding: 1.5rem 1.5rem 3rem;
  min-width: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.content-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.content-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Content Cards */
.content-card {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}

.content-card:first-child {
  border-top: 1px solid var(--border);
}

.content-card:hover {
  background: rgba(79,70,229,0.02);
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 2px);
  text-decoration: none;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.card-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.card-tag.report {
  background: rgba(79,70,229,0.08);
  color: #4f46e5;
}

.card-tag.book {
  background: rgba(8,145,178,0.08);
  color: #0891b2;
}

.card-tag.article {
  background: rgba(5,150,105,0.08);
  color: #059669;
}

.card-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Highlighted card (executive summary) */
.content-card.highlight {
  background: linear-gradient(135deg, rgba(79,70,229,0.04) 0%, rgba(8,145,178,0.03) 100%);
  border: 1px solid rgba(79,70,229,0.15);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.content-card.highlight:hover {
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, rgba(79,70,229,0.06) 0%, rgba(8,145,178,0.04) 100%);
}

/* ========================================
   MOBILE TABS (sidebar replacement)
   ======================================== */
.mobile-tabs {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 0.25rem;
}

.mobile-tabs::-webkit-scrollbar { height: 0; }

.mobile-tab {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.mobile-tab:hover {
  background: var(--bg);
  color: var(--text);
}

.mobile-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* ========================================
   NEWSLETTER
   ======================================== */
.newsletter-section {
  background: linear-gradient(135deg, rgba(79,70,229,0.06) 0%, rgba(8,145,178,0.04) 100%);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.newsletter-inner {
  max-width: 560px;
  margin: 0 auto;
}
.newsletter-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.newsletter-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}
.newsletter-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
}
.newsletter-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.newsletter-input:focus {
  border-color: var(--accent);
}
.newsletter-btn {
  padding: 0.55rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.newsletter-btn:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.newsletter-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.newsletter-msg {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}
.newsletter-msg.success { color: var(--accent4); }
.newsletter-msg.error { color: #e11d48; }
.newsletter-privacy {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ========================================
   PAGE: ABOUT / BOOK DETAIL / ARTICLES
   ======================================== */
.page-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.page-breadcrumb a {
  color: var(--text-muted);
}

.page-breadcrumb a:hover {
  color: var(--accent);
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.page-section {
  margin-bottom: 2rem;
}

.page-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.page-section p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1rem;
}

/* Credential cards */
.credential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.credential-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.credential-card .label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.credential-card .value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.credential-card .detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Career timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-item .period {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-item .role {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-item .company {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-item .desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* Book detail */
.book-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.book-cover-placeholder {
  width: 200px;
  height: 300px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.book-cover-placeholder.ia {
  background: linear-gradient(135deg, rgba(79,70,229,0.1) 0%, rgba(8,145,178,0.08) 100%);
}

.book-cover-placeholder.da {
  background: linear-gradient(135deg, rgba(8,145,178,0.1) 0%, rgba(5,150,105,0.08) 100%);
}

.book-cover-placeholder .cover-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.book-cover-placeholder .cover-author {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.book-info {
  flex: 1;
  min-width: 250px;
}

.book-info .year {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.amazon-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.amazon-btn:hover {
  background: #4338ca;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

/* 4A Framework visual */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.framework-card {
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
}

.framework-card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.framework-card .name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.framework-card .desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.framework-card.automate { background: rgba(79,70,229,0.04); }
.framework-card.augment { background: rgba(8,145,178,0.04); }
.framework-card.amplify { background: rgba(5,150,105,0.04); }
.framework-card.awaken { background: rgba(245,158,11,0.04); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state .ia-mark {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.2;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 0.9rem;
}

/* Related content */
.related-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.related-link {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
  margin-bottom: 0.25rem;
}

.related-link:hover {
  background: rgba(79,70,229,0.04);
  color: var(--accent);
  text-decoration: none;
}

.related-link .arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .mobile-tabs { display: flex; }
  .main-layout { flex-direction: column; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }

  .featured-inner { flex-direction: column; text-align: center; }
  .featured-stats { justify-content: center; }

  .page-title { font-size: 1.4rem; }
  .book-header { flex-direction: column; align-items: center; text-align: center; }
  .book-info { text-align: left; }

  .content-card { padding: 0.75rem 1rem; }
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .featured-title { font-size: 1.2rem; }
  .framework-grid { grid-template-columns: 1fr 1fr; }
}
