:root {
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'DM Sans', sans-serif;
    
    /* Shared accents */
    --primary-purple: #9d5ae5;
    --primary-green: #a2e67a;
    --primary-blue: #007AFF;
}

/* Dark Theme Variables (Default) */
:root, [data-theme="dark"] {
    --bg-main: #121212; /* Deep Charcoal */
    --text-main: #f5f5f5;
    --text-muted: #b0b0b0;
    --border-color: #9d5ae5;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --btn-purple: #9d5ae5;
    --btn-blue: #0062CC;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-main: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #7a3ab2;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --btn-purple: #7a3ab2;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

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

/* Header */
.header {
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-main); /* Ensure it covers content scrolling underneath */
    transition: background-color 0.4s ease, border-bottom 0.3s ease;
}

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

.logo .dot {
    color: var(--primary-purple);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: auto;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-purple);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: rgba(122, 58, 178, 0.1);
    transform: rotate(15deg);
}


.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 0 0 2rem 0; /* Keeping content layout */
}

/* ── Hero Background Layer ── */
.hero-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}

.hero-bg-layer::before {
    content:'';
    position:absolute;
    inset:0;
    background:
      radial-gradient(ellipse 80% 60% at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%),
      linear-gradient(180deg, #18181b 0%, #232326 50%, #18181b 100%);
    z-index: 0;
}

[data-theme="light"] .hero-bg-layer::before {
    background:
      radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0,0,0,0.02) 0%, transparent 70%),
      linear-gradient(180deg, #fafafa 0%, #ffffff 50%, #fafafa 100%);
}

.grid-bg {
    position:absolute;
    inset:0;
    z-index:1;
    opacity:.08;
    background-image:
      linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
    background-size:60px 60px;
}

[data-theme="light"] .grid-bg {
    background-image:
      linear-gradient(rgba(0,0,0,.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0,0,0,.1) 1px, transparent 1px);
}

svg.main-svg-pyramid {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    z-index:2;
    transform: translateX(8%);
}

[data-theme="light"] svg.main-svg-pyramid {
    filter: invert(1);
    opacity: 0.6;
}

.relative-container {
    position: relative;
    z-index: 10;
}

/* ── Floating particles ── */
.particle{
  position:absolute;
  width:2px;height:2px;
  background:rgba(255,255,255,.25);
  border-radius:50%;
  z-index:1;
  animation: drift linear infinite;
}
[data-theme="light"] .particle{
  background:rgba(0,0,0,.2);
}
@keyframes drift{
  0%  { transform:translateY(0) translateX(0); opacity:0 }
  10% { opacity:1 }
  90% { opacity:1 }
  100%{ transform:translateY(-100vh) translateX(40px); opacity:0 }
}

/* ── Piece animations ── */
.piece-top, .piece-left, .piece-right, .piece-bl, .piece-br { opacity: 0; }

.animate-pyramid .piece-top{ animation: dropFromTop 2.4s cubic-bezier(.22,.68,.36,1.0) 0.6s both; }
@keyframes dropFromTop{
  0%  { transform:translate(0,-250px) rotate(-8deg); opacity:0 }
  15% { opacity:1 }
  100%{ transform:translate(0,0) rotate(0deg); opacity:1 }
}

.animate-pyramid .piece-left{ animation: slideFromLeft 2.4s cubic-bezier(.22,.68,.36,1.0) 1.1s both; }
@keyframes slideFromLeft{
  0%  { transform:translate(-300px,50px) rotate(12deg); opacity:0 }
  15% { opacity:1 }
  100%{ transform:translate(0,0) rotate(0deg); opacity:1 }
}

.animate-pyramid .piece-right{ animation: slideFromRight 2.4s cubic-bezier(.22,.68,.36,1.0) 1.1s both; }
@keyframes slideFromRight{
  0%  { transform:translate(300px,50px) rotate(-12deg); opacity:0 }
  15% { opacity:1 }
  100%{ transform:translate(0,0) rotate(0deg); opacity:1 }
}

.animate-pyramid .piece-bl{ animation: slideFromBL 2.4s cubic-bezier(.22,.68,.36,1.0) 1.6s both; }
@keyframes slideFromBL{
  0%  { transform:translate(-280px,100px) rotate(10deg); opacity:0 }
  15% { opacity:1 }
  100%{ transform:translate(0,0) rotate(0deg); opacity:1 }
}

.animate-pyramid .piece-br{ animation: slideFromBR 2.4s cubic-bezier(.22,.68,.36,1.0) 1.6s both; }
@keyframes slideFromBR{
  0%  { transform:translate(280px,100px) rotate(-10deg); opacity:0 }
  15% { opacity:1 }
  100%{ transform:translate(0,0) rotate(0deg); opacity:1 }
}

.outline-pyramid{
  opacity:0;
}
.animate-pyramid .outline-pyramid {
  animation: outlineReveal 2s ease 4.2s both;
}
@keyframes outlineReveal{
  0%  { opacity:0 }
  100%{ opacity:1 }
}

.animate-pyramid .piece-shimmer{
  animation: shimmer 4s ease-in-out 4.8s infinite alternate;
}
@keyframes shimmer{
  0%  { filter:drop-shadow(0 0 2px rgba(255,255,255,0.05)) }
  100%{ filter:drop-shadow(0 0 12px rgba(255,255,255,0.12)) }
}

.hero .container {
    display: flex;
    flex-wrap: nowrap;
    gap: 2rem;
    align-items: flex-end; /* Ground both content and video/photo blocks */
}

.hero-content {
    flex: 1;
    min-width: 50%;
    position: relative;
}

/* Dark Mode Headlines */
.headline {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 4.5rem; /* Increase size slightly for serif elegance */
    font-weight: 400;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 2.5rem;
    color: var(--text-main);
}

.purple-text {
    color: var(--primary-purple);
    font-weight: 400;
    text-shadow: 0 0 20px rgba(157, 90, 229, 0.15);
}

.green-text {
    color: var(--primary-green);
    font-weight: 400;
    text-shadow: 0 0 20px rgba(162, 230, 122, 0.15);
}

.blue-text {
    color: var(--blue-bright);
    font-style: italic;
    font-weight: 400;
}

.sub-headline {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    max-width: 800px;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* ── Hero Logo Strip ── */
.hero-logos {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    width: max-content;
}

.hero-logos-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255,255,255,0.25);
    display: block;
    margin-bottom: 1.2rem;
}

.hero-logos-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.client-logo-img {
    height: 28px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.3;
    transition: opacity 0.4s ease;
}

.client-logo-img:hover {
    opacity: 0.6;
}

[data-theme="light"] .hero-logos {
    border-top-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .hero-logos-label {
    color: rgba(0,0,0,0.3);
}
[data-theme="light"] .client-logo-img {
    filter: grayscale(1);
    opacity: 0.35;
}
[data-theme="light"] .client-logo-img:hover {
    opacity: 0.7;
    filter: grayscale(0);
}

@media (max-width: 768px) {
    .hero-logos {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    .hero-logos-row {
        gap: 1.5rem;
    }
    .client-logo-img {
        height: 22px;
    }
}

.btn-primary {
    display: inline-block;
    background-color: var(--btn-blue);
    color: white;
    text-decoration: none;
    padding: 1rem 2.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--btn-blue);
    color: var(--btn-blue);
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--shadow-color);
    filter: brightness(1.1);
}

/* Video Section with Fade Effect */
.hero-video {
    flex: 1;
    height: 400px;
    display: flex;
    align-items: flex-end; /* Ground the wrapper to the same line as buttons */
    justify-content: flex-end;
    position: relative;
    overflow: visible; /* Allow growth within hero context */
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 450px;
    margin-right: -3rem; /* Shift slightly more right */
    z-index: 1;
    background-color: transparent;
    transition: background-color 0.8s ease;
    overflow: visible;
    /* Clean horizontal fade */
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.video-wrapper.portrait-active {
    mask-image: none !important;
    -webkit-mask-image: none !important;
}

#hero-portrait {
    position: absolute;
    bottom: 0; /* Pin to bottom */
    left: 50%;
    transform: translate(-54%, -0.5%) scale(1.01) !important;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    opacity: 0.01; /* Non-zero so browser counts it for LCP; visually imperceptible under blur */
    filter: grayscale(1) blur(8px) brightness(0.9) contrast(1.1); /* Base state: match end-state tone, only blur animates */
    transition: width 4.5s ease-out, height 4.5s ease-out, filter 2.7s ease-out, transform 4.5s ease-out, opacity 1.8s ease-out;
    pointer-events: none;
    z-index: 1;
    will-change: width, height, filter, transform;
    transform-origin: bottom center; /* Scale upwards from the baseline */
}

#hero-portrait.visible {
    opacity: 0.88 !important; 
    width: 100% !important; /* Match video dimensions exactly */
    height: 100% !important;
    transform: translate(-54%, -0.5%) scale(1.01) !important; /* Final vertical nudge and micro-zoom */
    filter: grayscale(1) blur(0) brightness(0.9) contrast(1.1) !important;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2; /* Ensure video is on top during playback */
    transition: opacity 1.5s ease;
}

/* Responsive */
@media (max-width: 1100px) {
    .container {
        padding: 0 2rem;
    }
    .headline {
        font-size: 2.8rem;
    }
}

@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        min-width: 100%;
    }
    
    .hero-video {
        width: 100%;
        height: 400px;
        justify-content: center;
    }

    .video-wrapper {
        max-width: 400px;
        margin: 0 auto;
        mask-image: none;
        -webkit-mask-image: none;
    }
    #hero-portrait {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none !important;
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
}

/* ═══════════════════════════════════════
   NEW SECTIONS CSS
   ═══════════════════════════════════════ */
:root {
  /* Surface */
  --bg-elevated: #0c0c10;
  --bg-card: #111116;
  --bg-card-hover: #16161c;
  --border-subtle: rgba(255,255,255,0.06);
  --border-medium: rgba(255,255,255,0.1);

  /* Brand */
  --blue: #2563EB;
  --blue-bright: #3B82F6;
  --blue-glow: rgba(37,99,235,0.15);
  --purple: #8B5CF6;
  --purple-glow: rgba(139,92,246,0.12);

  /* Pillar Accents */
  --ai: #8B5CF6;
  --system: #F97316;
  --product: #EAB308;
  --career: #EC4899;
  --trends: #10B981;

  /* Text */
  --text-tertiary: rgba(255,255,255,0.3);
  --text-accent: var(--blue-bright);

  /* Motion */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 0.35s;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
}

[data-theme="light"] {
  --bg-elevated: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --border-subtle: rgba(0,0,0,0.06);
  --border-medium: rgba(0,0,0,0.1);
  --text-tertiary: rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════
   SECTION UTILITIES
   ═══════════════════════════════════════ */
.section {
  padding: 100px 48px;
  max-width: 1320px;
  margin: 0 auto;
}
@media (max-width: 768px) { .section { padding: 60px 20px; } }

.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow .bar {
  width: 28px;
  height: 2px;
  border-radius: 1px;
}
.section-heading {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.section-desc {
  font-size: 15px;
  color: var(--text-secondary); /* wait user's var was --text-secondary which conflicts slightly, mapped to var(--text-muted) in old code. I'll use text-muted */
  max-width: 520px;
  line-height: 1.7;
}

/* Divider line between sections */
.divider {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
}
.divider-line {
  height: 1px;
  background: var(--border-subtle);
}
@media (max-width: 768px) { .divider { padding: 0 20px; } }

/* ═══════════════════════════════════════
   1. FEATURED WRITING
   ═══════════════════════════════════════ */
.writing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}
@media (max-width: 768px) { .writing-grid { grid-template-columns: 1fr; } }

.writing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 32px 28px;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  position: relative;
  overflow: hidden;
}
.writing-card::after {
  content: '↗';
  position: absolute;
  top: 28px;
  right: 28px;
  font-size: 18px;
  color: var(--blue-bright);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: all var(--t) var(--ease);
}
.writing-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-3px);
}
.writing-card:hover::after { opacity: 1; transform: translate(0,0); }

.wc-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.pill-ai     { background: rgba(139,92,246,0.12); color: #A78BFA; }
.pill-system { background: rgba(249,115,22,0.12); color: #FB923C; }
.pill-product{ background: rgba(234,179,8,0.12);  color: var(--product); }
.pill-career { background: rgba(236,72,153,0.12); color: #F472B6; }
.pill-trends { background: rgba(16,185,129,0.12); color: #34D399; }

.writing-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
  letter-spacing: -0.2px;
  padding-right: 32px;
}
.writing-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}
.wc-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.writing-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.featured-visual {
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(139,92,246,0.08));
  border-radius: var(--r-sm);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.featured-visual .code-lines {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: left;
  line-height: 2;
}
.featured-visual .code-lines .kw { color: var(--ai); }
.featured-visual .code-lines .fn { color: var(--blue-bright); }
.featured-visual .code-lines .str { color: var(--trends); }
.featured-visual .code-lines .cm { color: rgba(255,255,255,0.35); }
@media (max-width: 768px) {
  .writing-card.featured { grid-template-columns: 1fr; }
  .featured-visual { height: 140px; }
}

.view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-bright);
  text-decoration: none;
  transition: gap var(--t) var(--ease);
}
.view-all:hover { gap: 10px; }

/* ═══════════════════════════════════════
   2. EXPERIENCE STATS (Minimal)
   ═══════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
}
@media (max-width: 768px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr; } }

.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--t) var(--ease);
}
.stat-block:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
}
.stat-number {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-number.blue { color: var(--blue-bright); }
.stat-number.purple { color: var(--purple); }
.stat-number.green { color: var(--trends); }
.stat-number.orange { color: var(--system); }
.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════
   3. CONTENT PILLARS
   ═══════════════════════════════════════ */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 48px;
}
@media (max-width: 960px) { .pillars-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 580px) { .pillars-grid { grid-template-columns: 1fr 1fr; } }

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 28px 20px;
  text-align: center;
  transition: all var(--t) var(--ease);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.pillar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0.6;
  transition: opacity var(--t), height var(--t);
}
.pillar-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-3px);
}
.pillar-card:hover::before { opacity: 1; height: 3px; }

.pillar-card.pc-ai::before { background: var(--ai); }
.pillar-card.pc-sys::before { background: var(--system); }
.pillar-card.pc-prod::before { background: var(--product); }
.pillar-card.pc-career::before { background: var(--career); }
.pillar-card.pc-trends::before { background: var(--trends); }

.pillar-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: block;
}
.pillar-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.pillar-card p {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   4. CASE STUDIES PREVIEW
   ═══════════════════════════════════════ */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}
@media (max-width: 768px) { .cases-grid { grid-template-columns: 1fr; } }

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.case-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
}
.case-thumb {
  height: 160px;
  position: relative;
  overflow: hidden;
}
.case-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  position: relative;
}
/* Decorative pattern backgrounds per case */
.case-thumb-inner.ct-1 {
  background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(139,92,246,0.1));
}
.case-thumb-inner.ct-2 {
  background: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(234,179,8,0.1));
}
.case-thumb-inner.ct-3 {
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(37,99,235,0.1));
}
/* Grid overlay on case thumbs */
.case-thumb-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 24px 24px;
}

.case-body {
  padding: 24px;
}
.case-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.case-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.case-card p {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.55;
}

/* ═══════════════════════════════════════
   5. ABOUT (brief)
   ═══════════════════════════════════════ */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
  align-items: center;
}
@media (max-width: 768px) { .about-layout { grid-template-columns: 1fr; gap: 32px; } }

.about-text p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}
.about-text strong { color: var(--text-main); font-weight: 600; }
.about-text .highlight {
  color: var(--blue-bright);
  font-weight: 600;
}

.about-quote {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-md);
  padding: 32px;
}
.about-quote blockquote {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 12px;
}
.about-quote cite {
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ═══════════════════════════════════════
   6. NEWSLETTER
   ═══════════════════════════════════════ */
.newsletter-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 48px;
}
.newsletter-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--blue-glow), transparent 60%);
  pointer-events: none;
}
.newsletter-block .section-heading,
.newsletter-block .section-desc { position: relative; z-index: 2; }
.newsletter-block .section-desc { margin: 0 auto 32px; }

.nl-form {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.nl-input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border var(--t) var(--ease);
}
.nl-input::placeholder { color: var(--text-tertiary); }
.nl-input:focus { border-color: var(--blue); }
.nl-btn {
  padding: 14px 24px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  white-space: nowrap;
}
.nl-btn:hover { background: #1d4fd0; }
@media (max-width: 480px) {
  .newsletter-block { padding: 40px 24px; }
  .nl-form { flex-direction: column; }
}

/* ═══════════════════════════════════════
   7. CONNECT (Primary — LinkedIn/YouTube)
   ═══════════════════════════════════════ */
.connect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  max-width: 700px;
}
@media (max-width: 580px) { .connect-grid { grid-template-columns: 1fr; } }

.connect-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 36px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  text-decoration: none;
}
.connect-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}
.connect-card.primary {
  border-color: rgba(37,99,235,0.2);
}
.connect-card.primary:hover {
  border-color: rgba(37,99,235,0.4);
  box-shadow: 0 0 40px rgba(37,99,235,0.08);
}

.cc-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cc-linkedin .cc-icon { background: rgba(37,99,235,0.1); }
.cc-youtube .cc-icon { background: rgba(236,72,153,0.1); }
.cc-substack .cc-icon { background: rgba(249,115,22,0.1); }
.cc-twitter .cc-icon { background: rgba(139,92,246,0.1); }

.cc-text h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-main);
}
.cc-text p {
  font-size: 12px;
  color: var(--text-tertiary);
}
.cc-arrow {
  margin-left: auto;
  font-size: 16px;
  color: var(--text-tertiary);
  transition: all var(--t) var(--ease);
}
.connect-card:hover .cc-arrow { color: var(--blue-bright); transform: translateX(3px); }

/* Secondary social row */
.connect-secondary {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.connect-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  text-decoration: none;
  flex: 1;
}
.connect-sm:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}
.connect-sm .cc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 17px;
}
.connect-sm h3 { font-size: 13px; font-weight: 600; color: var(--text-main); }
.connect-sm p { font-size: 11px; color: var(--text-tertiary); }
@media (max-width: 580px) { .connect-secondary { flex-direction: column; } }

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
}
@media (max-width: 768px) { .site-footer { padding: 32px 20px; flex-direction: column; text-align: center; } }

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-mono {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
}
.footer-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}
.footer-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.8;
}
.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.footer-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition) ease;
}
.footer-links a:hover { color: var(--primary-purple); }

/* ═══════════════════════════════════════
   HAMBURGER MENU
   ═══════════════════════════════════════ */
.nav-linkedin {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.25s ease;
    margin-left: 1rem;
}
.nav-linkedin:hover { color: #0A66C2; }

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

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--bg-main);
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding: 12px 20px 20px;
        z-index: 150;
    }
    .nav.nav-open { display: flex; }
    .nav-link { padding: 12px 0; font-size: 1.2rem; width: 100%; }
    .hero-btns { flex-direction: column; align-items: stretch; }
    .btn-primary, .btn-secondary { text-align: center; }

    /* Disable heavy animations on mobile to reduce main-thread work */
    .particle { display: none; }
    .scan-line { animation: none; }
    .dot-grid { display: none; }

    /* Hero mobile layout */
    .hero { padding-top: 2.5rem; }
    .hero-logos {
        position: relative;
        top: auto;
        width: 100%;
        margin-top: 2.5rem;
        text-align: center;
    }
    .hero-logos-row { justify-content: center; }
}

/* ═══════════════════════════════════════
   SITE BACKGROUND LAYER
   ═══════════════════════════════════════ */
.bg-layer{
  position:fixed;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
}

[data-theme="light"] .bg-layer {
  filter: invert(1) hue-rotate(180deg);
  opacity: 0.8;
}

/* Soft ambient gradient that slowly shifts */
.bg-layer::before{
  content:'';
  position:absolute;
  inset:-20%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(59,130,246,0.018) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 80% 70%, rgba(59,130,246,0.012) 0%, transparent 70%),
    radial-gradient(ellipse 60% 30% at 50% 50%, rgba(255,255,255,0.008) 0%, transparent 60%);
  animation: ambientDrift 25s ease-in-out infinite alternate;
}
@keyframes ambientDrift{
  0%  { transform:translate(0,0) scale(1) }
  33% { transform:translate(30px,-20px) scale(1.02) }
  66% { transform:translate(-20px,30px) scale(0.98) }
  100%{ transform:translate(10px,-10px) scale(1.01) }
}

/* Very faint dot grid */
.dot-grid{
  position:absolute;
  inset:0;
  opacity:1;
  background-image:radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size:48px 48px;
  animation: gridPulse 12s ease-in-out infinite alternate;
}
@keyframes gridPulse{
  0%  { opacity:1 }
  100%{ opacity:0.5 }
}

/* ═══════════════════════════════════════
   SVG CANVAS – floating shapes
   ═══════════════════════════════════════ */
.bg-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

/* Floating triangles – very slow drift */
.float-shape{
  opacity:0;
  animation: floatIn 3s ease forwards, floatDrift linear infinite;
}

@keyframes floatIn{
  to{ opacity:1 }
}

@keyframes floatDrift{
  0%  { transform:translate(0,0) rotate(0deg) }
  25% { transform:translate(15px,-20px) rotate(3deg) }
  50% { transform:translate(-10px,-40px) rotate(-2deg) }
  75% { transform:translate(20px,-25px) rotate(4deg) }
  100%{ transform:translate(0,0) rotate(0deg) }
}

/* Horizontal scan line – extremely subtle */
.scan-line{
  position:absolute;
  left:0;right:0;
  height:1px;
  background:linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.025) 30%, rgba(255,255,255,0.025) 70%, transparent 100%);
  animation: scanMove 18s linear infinite;
}
@keyframes scanMove{
  0%  { top:-2px }
  100%{ top:100% }
}

/* Slow vertical accent lines */
.accent-line{
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  animation: lineGlow 10s ease-in-out infinite alternate;
}
@keyframes lineGlow{
  0%  { opacity:0.02 }
  50% { opacity:0.06 }
  100%{ opacity:0.02 }
}

/* ── Blog post image lightbox ── */
.post-image img { cursor: zoom-in; }

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.lightbox-overlay.active { display: flex; }
.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-inner img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.6);
    display: block;
    cursor: default;
}
.lightbox-caption {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    text-align: center;
}
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav.hidden { opacity: 0; pointer-events: none; }
