/* ============================================
   Carmelyne Thompson - Jekyll Theme
   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: #697386;
  --accent: #029bde;
  --accent-gradient: linear-gradient(135deg, #029bde 0%, #05668d 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;
}

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

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

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

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);
}

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: #ffffff;
  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: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

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

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

.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: color 0.2s;
}

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

.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);
}

/* --- 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;
  }
}

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

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

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

/* --- Responsive --- */
@media (max-width: 1400px) {
  .header-container {
    padding: 0 2rem;
  }
}

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

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

  .site-header {
    padding: 0.9rem 0;
  }

  .header-container {
    padding: 0 1rem;
    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 1rem;
  }

  .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;
  }

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

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

  .section {
    padding: 4rem 1rem !important;
  }

  .hero {
    padding: 5rem 1rem 3rem !important;
  }

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

  .footer-nav {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

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

  /* 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;
    }
  }
}

/* --- 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;
}

/* --- 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: 2rem;
  }

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