
:root {
  --moss: #1F2C26;
  --sienna: #9C6644;
  --parchment: #F4EDE4;
  --stone: #D4BFA8;
  --text: #1F2C26;
  --surface: #FFFFFF;
  --radius: 12px;
  --focus: #5F3A27;
}

@media (prefers-color-scheme: dark) {
:root {
    --text: #EDE4D6;
    --surface: #1F2C26;
    --parchment: #0F1A17;
  }
}
[data-theme="light"] {
  --text: #1F2C26;
  --surface: #FFFFFF;
  --parchment: #F4EDE4;
}
[data-theme="dark"] {
  --text: #EDE4D6;
  --surface: #1F2C26;
  --parchment: #0F1A17;
}
* { box-sizing: border-box; }
body, .grok-sections { margin:0; background:var(--parchment); color:var(--text); font-family:system-ui,-apple-system,sans-serif; line-height:1.6; }
.primary-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--stone);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.primary-nav .brand {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: var(--moss);
  text-decoration: none;
}
.nav-list {
  display: none;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.nav-list a:hover,
.nav-list a.active {
  color: var(--sienna);
}
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--stone);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 110;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}
.bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text);
  text-decoration: none;
}
.bottom-link.active { color: var(--sienna); }
.chat-float {
  position: absolute;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--sienna);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(156,102,68,0.3);
  z-index: 120;
}
.mobile-menu-panel {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 200;
  padding: 80px 24px 40px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu-panel:not([hidden]) {
  display: flex;
}
.mobile-menu-panel .close-menu {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--moss);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mobile-menu-list li {
  border-bottom: 1px solid var(--stone);
}
.mobile-menu-list a {
  display: block;
  padding: 20px 8px;
  color: var(--text);
  font-size: 1.25rem;
  text-decoration: none;
}
.mobile-menu-list a:hover,
.mobile-menu-list a.active {
  color: var(--sienna);
}
.grok-sections .hub-hero {
  background: linear-gradient(135deg, #1F2C26, #5F3A27);
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
  border-radius: 0 0 24px 24px;
}
.grok-sections .hub-hero h1 {
  font-family: Georgia, serif;
  font-size: 2.25rem;
  margin: 0 0 .5rem;
}
.grok-sections .hub-subtitle { font-size: 1.1rem; max-width: 640px; margin: 0 auto; opacity: .95; }
.grok-sections .scope-note {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 16px 20px;
  background: #fff9e6;
  border-left: 5px solid #9C6644;
  font-size: 0.95rem;
  color: #3f2c1f;
}
.grok-sections .category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 2rem auto 1.5rem;
  padding: 0 16px;
}
.grok-sections .category-filters button {
  background: var(--surface);
  border: 2px solid var(--stone);
  color: var(--text);
  padding: .5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all .2s;
}
.grok-sections .category-filters button.active,
.grok-sections .category-filters button[aria-pressed="true"] {
  background: #5F3A27;
  color: #fff;
  border-color: #5F3A27;
}
.grok-sections .hub-masonry,
.grok-sections .hub-video-grid,
.grok-sections .key-grid {
  display: grid;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
@media (min-width: 1024px) {
.grok-sections .hub-masonry { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
}
.grok-sections .carousel-container .card { flex: 0 0 280px; scroll-snap-align: start; }
.grok-sections .card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(31,44,38,.08);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .2s cubic-bezier(0.4,0,0.2,1);
}
.grok-sections .card:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}
.grok-sections .card:hover { transform: translateY(-8px); }
.grok-sections .card-image { position: relative; height: 210px; }
.grok-sections .card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grok-sections .card-content { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.grok-sections .card-badge {
  align-self: start;
  font-size: .75rem;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #fff;
}
.grok-sections .card-badge.rust { background: #9C6644; }
.grok-sections .card-badge.claret { background: #7A2A3F; }
.grok-sections .card-badge.plum { background: #5F2A5A; }
.grok-sections .card-badge.cobalt { background: #1C4A6B; }
.grok-sections .card-badge.teal { background: #1E6B5F; }
.grok-sections .card-badge.ochre { background: #6B4F1C; }
.grok-sections .card-badge.moss { background: #1F4A2C; }
.grok-sections .card-badge.rose { background: #9C2A4F; }
.grok-sections .card h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.3; }
.grok-sections .card-summary { flex: 1; font-size: .95rem; color: var(--text); margin-bottom: 1rem; }
.grok-sections .card-meta { font-size: .8rem; color: var(--sienna); }
.grok-sections .video-card .poster-wrapper { position: relative; }
.grok-sections .video-card .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 64px;
  height: 64px;
  background: rgba(156,102,68,.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.grok-sections .silent-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 4px;
}
.grok-sections .key-records h2 {
  text-align: center;
  font-family: Georgia, serif;
  font-size: 1.75rem;
  margin: 3rem 0 1.5rem;
  color: var(--moss);
}
.grok-sections .key-grid .card { box-shadow: 0 6px 20px rgba(156,102,68,.15); }
.grok-sections .carousel {
  position: relative;
  max-width: 1280px;
  margin: 3rem auto;
  padding: 0 16px;
}
.grok-sections .carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.grok-sections .carousel-header h2 {
  font-family: Georgia, serif;
  font-size: 1.75rem;
  margin: 0;
  color: var(--moss);
}
.grok-sections .carousel-controls {
  display: flex;
  gap: 8px;
}
.grok-sections .carousel-btn,
.grok-sections .carousel-controls button {
  width: 44px;
  height: 44px;
  border: 2px solid var(--moss);
  background: var(--surface);
  color: var(--moss);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
}
.grok-sections .carousel-track {
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.grok-sections .carousel-track::-webkit-scrollbar { display: none; }
.grok-sections .carousel-container {
  display: flex;
  gap: 24px;
  padding: 8px 4px 32px;
  scroll-snap-type: x mandatory;
}
.grok-sections .carousel-status { text-align: center; font-size: .8rem; color: var(--sienna); margin: .5rem 0; }
.grok-sections .all-link {
  display: block;
  text-align: right;
  color: var(--sienna);
  font-weight: 500;
  margin: 1rem 16px 3rem;
  text-decoration: none;
}


@media (min-width: 768px) {
.nav-list { display: flex; }
.mobile-bottom-bar { display: none; }
.mobile-menu-btn { display: none; }
.grok-sections .card { flex: 0 0 320px; }
}

@media (max-width: 767px) {
main { padding-bottom: 120px; }
.grok-sections .hub-masonry,
.grok-sections .hub-video-grid,
.grok-sections .key-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
.grok-sections .carousel-track { scroll-behavior: auto; }
.grok-sections .card { transition: none; }
}

.grok-sections .card h3 { color: inherit; }
.grok-sections .hub-hero h1, .grok-sections .hub-hero h2 { color: inherit; }
.grok-sections .category-filters[hidden] { display: none; }
.primary-nav [hidden], .grok-sections [hidden] { display: none !important; }
.primary-nav .mobile-menu-btn { color: var(--text); background: var(--surface); }
@media (prefers-reduced-motion: reduce) {
  .grok-sections .category-filters button { transition: none; }
}
@media (min-width: 768px) {
  .grok-sections .carousel-container .card { flex: 0 0 320px; }
}
.grok-page a { color: var(--sienna); }
.grok-page .fh-page__skip {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 200;
  padding: 0.65rem 0.9rem;
  border-radius: 0 0 0.5rem 0.5rem;
  background: var(--sienna-dark);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
}
.grok-page .fh-page__skip:focus { top: 8px; left: 8px; }
