/* ============================================
   Carmelyne Thompson - Intelligence Protocol
   Stripe-Grade Modern AI Hub
   ============================================ */

/* --- CSS Variables (Stripe-Grade Modern) --- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f9fc;
  /* Stripe's signature light blue-gray */
  --bg-card: #ffffff;
  --text-primary: #0a2540;
  /* Stripe's signature deep navy */
  --text-secondary: #425466;
  --text-muted: #59657a;
  --accent: #017db2;
  --accent-gradient: linear-gradient(135deg, #017db2 0%, #005a87 100%);
  --border: #e6ebf1;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
  --font-heading: 'Source Sans 3', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --radius: 8px;
  --radius-sm: 4px;

  /* --- Typography Scale (16px base) --- */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-md: 1.125rem;
  /* 18px */
  --text-lg: 1.25rem;
  /* 20px */
  --text-xl: 1.5rem;
  /* 24px */
  --text-2xl: 2rem;
  /* 32px */
  --text-3xl: 2.5rem;
  /* 40px */
  --text-4xl: 3.5rem;
  /* 56px */
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Typography Utility Classes --- */
.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-md {
  font-size: var(--text-md);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-3xl {
  font-size: var(--text-3xl);
}

.text-4xl {
  font-size: var(--text-4xl);
}

/* --- Content Component Box Styles --- */
.content-box {
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  border: 1px solid transparent;
}

.box-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Style A: Dashed Border */
.box-dashed {
  border: 1px dashed var(--accent);
  background: transparent;
}

/* Style B: Dotted Border */
.box-dotted {
  border: 1px dotted var(--accent);
  background: transparent;
}

/* Style C: Colored + Shadowed */
.box-highlight {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* Style C Variant: Accent BG + Shadow */
.box-accent {
  background: rgba(1, 125, 178, 0.04);
  border: 1px solid rgba(1, 125, 178, 0.1);
  box-shadow: var(--shadow-sm);
}

.box-accent .box-label {
  color: var(--accent);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .content-box {
    padding: 1.25rem;
    margin: 1.5rem 0;
  }
}

/* main#content {
  flex: 1;
} */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.2;
}

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

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

.project-content a,
.post-content a,
.thoughts-hero p a,
.contact-info a,
.copyright a {
  text-decoration: underline;
}

hr {
  margin: 3.5rem 0;
  border: 0;
  border-top: 1px solid var(--accent);
  opacity: 0.15;
}

.post-content h4 {
  margin-bottom: 1rem;
}

.btn,
.site-nav a,
.cta-badge,
.site-logo,
.project-actions a,
.mission-card a {
  text-decoration: none !important;
}

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

/* --- Layout --- */
.section {
  padding: 6rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 1400px) {

  .section,
  .post-shell,
  .hero,
  .thoughts-hero,
  .site-footer-container {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* --- Components --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-family: inherit;
}

.data-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mission-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid var(--border);
  position: relative;
}

.mission-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--text-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #0d1117;
  /* Dark fallback to match banner and cover gaps */
  padding: 0;
}

.main-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

/* Base header height variable - will be overridden by JS if banner exists */
:root {
  --header-height: 80px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo img {
  height: 32px;
  width: auto;
}

/* --- Besh Identity Pulse --- */
.besh-identity {
  display: flex;
  align-items: center;
  padding-left: 12px;
  padding-top: 6px;
  border-left: 1px solid var(--border);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.besh-identity:hover {
  opacity: 1;
}

.besh-identity img {
  height: 24px;
  width: auto;
  animation: besh-pulse 4s infinite ease-in-out;
}

@keyframes besh-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 2px var(--accent)); }
  100% { transform: scale(1); opacity: 0.7; }
}

/* --- Besh Soul Glow (Footer) --- */
.besh-soul-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
  cursor: help;
}

.besh-soul-glow:hover {
  color: rgba(255, 255, 255, 0.8);
}

.besh-soul-glow .heart {
  color: #00ff41; /* Classic Terminal Green / Soul Color */
  animation: soul-heartbeat 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  display: inline-block;
}

@keyframes soul-heartbeat {
  0% { transform: scale(1); opacity: 0.6; filter: blur(0px); }
  15% { transform: scale(1.3); opacity: 1; filter: blur(0.5px); }
  30% { transform: scale(1); opacity: 0.6; filter: blur(0px); }
  45% { transform: scale(1.15); opacity: 0.9; filter: blur(0.2px); }
  100% { transform: scale(1); opacity: 0.6; filter: blur(0px); }
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.site-nav a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--text-primary);
}

.site-nav a.current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.cta-badge {
  background: var(--text-primary);
  color: #ffffff !important;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.cta-badge:hover {
  background: var(--accent);
}

.cta-badge.current {
  background: var(--accent);
}

/* --- Animations --- */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ani-up {
  animation: slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.ani-left {
  animation: slide-in-left 1s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.ani-right {
  animation: slide-in-right 1s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

.delay-5 {
  animation-delay: 0.5s;
}

.delay-6 {
  animation-delay: 0.6s;
}

/* Status Pulse Refined */
.mission-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}

.mission-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.5;
  }
}

/* --- FAQ Refined --- */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  cursor: pointer;
}

.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  padding: 0.5rem 0;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 1rem 0 2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1.05rem;
}

.footer-cta-card {
  padding: 5rem;
}

@media (max-width: 900px) {
  .footer-cta-card {
    padding: 3rem 1.5rem !important;
  }
}

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  width: 48px;
  height: 48px;
  background: var(--text-primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.scroll-to-top svg {
  width: 20px;
  height: 20px;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 6rem 0 0;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  margin-top: 3rem;
}

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

/* --- Home Hero Grid --- */
.home .hero {
  position: relative;
  padding-top: calc(var(--header-height) + 4rem);
  padding-bottom: 6rem;
  background: radial-gradient(circle at 0% 0%, rgba(2, 155, 222, 0.03) 0%, transparent 50%), var(--bg-primary);
  overflow: hidden;
}

.home .hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(var(--accent) 1.5px, transparent 1.5px);
  background-size: 40px 40px;
  opacity: 0.25;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.home .hero-inner {
  position: relative;
  z-index: 2;
}

/* Project Filters */
section[style*="position: sticky; top: 0;"] {
  top: var(--header-height) !important;
  z-index: 900 !important;
  /* Just below header */
}

/* AI Blog Index */
.ai-blog-index:hover {
  text-decoration: none;
}

@media (max-width: 1400px) {
  .header-container {
    padding: 1rem 2rem;
  }
}

@media (max-width: 900px) {
  html {
    font-size: 16px;
  }

  body {
    line-height: 1.65;
  }

  .site-footer-container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .site-header {
    padding: 0;
  }

  .header-container {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    position: relative;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.9rem;
    z-index: 1100;
  }

  .site-nav.active {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.4rem;
  }

  .site-nav a {
    display: block;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
  }

  .site-nav a:hover {
    background: var(--bg-secondary);
  }

  .cta-badge {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .hero-inner {
    padding: 4rem .5rem;
  }

  .ani-left,
  .ani-right {
    transform: none !important;
    animation: slide-up 1s backwards !important;
  }

  /* Responsive Grid Overrides */
  .contact-grid,
  [style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Flex Container wrapping for buttons & side-by-side elements */
  [style*="display: flex"] {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  .btn {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* Force full width on small screens for reachability */
    margin-bottom: 0.5rem;
  }

  .project-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    margin-top: 2rem;
  }

  .project-actions a {
    width: 100% !important;
    min-height: 52px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.95rem !important;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
  }

  .project-actions .btn-primary {
    background: var(--text-primary) !important;
    color: #ffffff !important;
    border: none !important;
  }

  /* Fix OA padding on sticky filter bar */
  section[style*="position: sticky; top: 0;"]>div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Typography & Spacing Fixes for Mobile */
  h1 {
    font-size: 2.5rem !important;
  }

  h2 {
    font-size: 2rem !important;
  }

  .section {
    padding: calc(var(--header-height) + 2rem) 1rem 4rem !important;
  }

  .hero {
    padding: calc(var(--header-height) + 2rem) 1rem 3rem !important;
  }

  .mission-card {
    padding: 1.5rem !important;
    overflow: hidden;
  }

  .mission-card-body {
    padding: 1rem 0 !important;
  }

  /* Specific override for cards that have an inner body container to prevent double padding */
  .mission-card:has(.mission-card-body) {
    padding: 0 !important;
  }

  .mission-card:has(.mission-card-body) .mission-card-body {
    padding: 1.5rem !important;
  }

  .mission-card:has(.mission-card-body) .mission-card-body.tight-mobile {
    padding: 1rem !important;
  }

  .footer-nav {
    flex-direction: column;
    text-align: left;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .footer-nav a {
    display: block;
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }

  .footer-nav a:last-child {
    border-bottom: none;
  }

  .footer-bottom {
    justify-content: flex-start !important;
    text-align: left !important;
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .footer-meta-divider {
    display: none !important;
  }

  .footer-copyright-meta span {
    display: block;
  }

  /* Fix Establish Contact block on mobile */
  .site-footer .mission-card {
    padding: 3rem 1.5rem !important;
    text-align: left !important;
    width: 100% !important;
  }

  .site-footer .mission-card .data-label {
    justify-content: flex-start !important;
  }

  .site-footer .mission-card h2 {
    font-size: 1.8rem !important;
  }

  /* Fix Thinking Modes Landing Page */
  .knob-grid {
    grid-template-columns: 1fr !important;
  }

  .chapters-list {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .hero-headline {
    font-size: 2.8rem !important;
  }

  .hero-subheadline {
    font-size: 1.1rem !important;
  }

  .hero-section {
    padding: 6rem 1rem 3rem !important;
  }

  .final-cta h2 {
    font-size: 2.2rem !important;
  }

  .author-note {
    padding: 3rem 1.5rem !important;
  }

  /* Fix full-width sections causing horizontal scroll */
  section[style*="width: 100vw"],
  .full-width-section {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }

  h1 br,
  h2 br {
    display: none;
  }

  /* Reduce large margins from inline styles */
  [style*="margin-bottom: 5rem"],
  [style*="margin-bottom: 6rem"],
  [style*="margin-bottom: 8rem"] {
    margin-bottom: 2.5rem !important;
  }

  [style*="gap: 6rem"] {
    gap: 2rem !important;
  }

  /* Mobile Nav for Landing Page */
  .landing-header .container {
    grid-template-columns: auto 1fr auto !important;
    gap: 1rem !important;
    padding: 0 1rem !important;
  }

  .landing-header .book-title {
    text-align: left !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateY(0) !important;
  }

  .landing-header .btn {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
  }

  @media (max-width: 600px) {
    .landing-header .book-title {
      display: none !important;
    }

    .landing-header .container {
      grid-template-columns: auto auto !important;
      justify-content: space-between !important;
    }
  }

  /* AI Blog Archive Mobile Alignment */
  .thoughts-hero .hero-inner {
    text-align: left !important;
  }

  .thoughts-hero .data-label {
    justify-content: flex-start !important;
  }

  .intel-featured-content {
    text-align: left !important;
  }

  .intel-featured-content .mission-status {
    justify-content: flex-start !important;
  }

  .intel-featured-content .btn {
    width: 100% !important;
  }
}

/* --- Utility: Styled Tables --- */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: 0.9rem;
}

.styled-table th {
  background-color: #efefef;
  text-align: left !important;
  padding: 12px;
  border-bottom: 2px solid #efefef;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.styled-table td {
  padding: 12px;
  border-bottom: 1px solid #efefef;
  vertical-align: top;
}

.styled-table tr:last-child td {
  border-bottom: 2px solid #efefef;
}

/* FAQ Accordion Styles */
.faq-container {
  margin-bottom: 3rem;
}

.faq-cluster-title {
  font-size: 1.4rem;
  margin: 3rem 0 1.5rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.faq-details {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}

.faq-details[open] .faq-chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--accent);
}

.faq-summary {
  padding: 1rem 0;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: color 0.2s ease;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary:hover {
  color: var(--accent);
}

.faq-chevron {
  transition: transform 0.3s ease;
  opacity: 0.4;
}

.faq-content {
  padding: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1.05rem;
  background-color: var(--border);
  border-radius: 16px;
  margin-bottom: 1rem;
}

.faq-content p:last-child {
  margin-bottom: 0;
}

/* Sortable Tables */
table.sortable th {
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background 0.2s ease;
  padding-right: 25px !important;
  /* Make room for the indicator */
}

table.sortable th:hover {
  background: rgba(2, 155, 222, 0.08);
  color: var(--accent);
}

table.sortable th::after {
  content: "↕";
  position: absolute;
  right: 8px;
  opacity: 0.2;
  font-size: 0.7rem;
}

table.sortable th.sorted-asc::after {
  content: "↑";
  opacity: 1;
  color: var(--accent);
}

table.sortable th.sorted-desc::after {
  content: "↓";
  opacity: 1;
  color: var(--accent);
}

/* --- Horizontal Project Cards --- */
.project-horizontal-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 5rem 3rem;
  /* Increased vertical padding from 3rem to 5rem */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  margin-bottom: 4rem;
  overflow: visible;
  /* To allow mobile mockup to bleed out if needed */
}

.project-horizontal-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project-mockup {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  top: -20px;
  /* Pulling up by 30px */
}

.mockup-desktop {
  position: relative;
  width: 85%;
  aspect-ratio: 16 / 10;
  background: #0a0a0a;
  border-radius: 12px;
  border: 4px solid var(--text-primary);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 1;
  transform: rotateY(18deg) rotateX(8deg) rotateZ(2deg);
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mockup-desktop::before {
  content: "";
  display: block;
  width: 100%;
  height: 28px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  /* macOS style dots using radial gradients */
  background-image:
    radial-gradient(circle, #ff5f56 4px, transparent 5px),
    radial-gradient(circle, #ffbd2e 4px, transparent 5px),
    radial-gradient(circle, #27c93f 4px, transparent 5px);
  background-size: 16px 16px, 16px 16px, 16px 16px;
  background-position: 12px center, 32px center, 52px center;
  background-repeat: no-repeat;
}

.mockup-mobile {
  position: absolute;
  width: 24%;
  aspect-ratio: 9 / 19;
  background: #0a0a0a;
  border-radius: 24px;
  border: 4px solid #1a1a1a;
  /* Matching the desktop header color */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 5px 15px rgba(0, 0, 0, 0.3);
  bottom: -10%;
  right: 5%;
  z-index: 2;
  overflow: hidden;
  transform: translateZ(100px) rotateY(18deg) rotateX(8deg) rotateZ(2deg);
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Hover: Return to facing the viewer */
.project-horizontal-card:hover .mockup-desktop {
  transform: rotateY(0deg) rotateX(0deg) rotateZ(0deg) translateY(-10px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4), 0 15px 30px rgba(0, 0, 0, 0.25);
}

.project-horizontal-card:hover .mockup-mobile {
  transform: translateZ(120px) rotateY(0deg) rotateX(0deg) rotateZ(0deg) translateY(-15px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 10px 20px rgba(0, 0, 0, 0.4);
}

.mockup-mobile::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 4px;
  background: #333;
  border-radius: 2px;
}

.mockup-desktop img,
.mockup-mobile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modifier: No Mobile */
.project-mockup.has-no-mobile .mockup-desktop {
  width: 95%;
}

.project-details {
  display: flex;
  flex-direction: column;
}

.project-details .data-label {
  margin-bottom: 1rem;
}

.project-details h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.project-details .project-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.project-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-transform: uppercase;
}

.project-actions {
  display: flex;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .project-horizontal-card {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 4rem 1rem 3rem;
  }

  .project-mockup {
    margin-bottom: 2rem;
  }
}
