/* === GLOBAL TOKENS === */
:root {
  --color-black: #0a0a0a;
  --color-white: #ffffff;
  --color-off-white: #f7f6f2;
  --color-text-primary: #0a0a0a;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-accent: #5b4eff;
  --color-accent-hover: #4a3ee0;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-strong: rgba(0, 0, 0, 0.14);

  --color-hero-bg: #07070e;
  --color-hero-particle-1: hsla(260, 65%, 68%, 0.55);
  --color-hero-particle-2: hsla(200, 60%, 62%, 0.4);
  --color-hero-particle-3: hsla(280, 55%, 65%, 0.35);

  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-display: clamp(40px, 5.5vw, 72px);
  --text-h2: clamp(28px, 3.5vw, 42px);
  --text-h3: 22px;
  --text-body: 16px;
  --text-small: 14px;
  --text-micro: 12px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --nav-height: 64px;
  --bottom-nav-height: 72px;
  --max-width: 1440px;
  --section-padding: clamp(80px, 8vw, 120px) 0;
}

/* === BASE === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  background: #f5f4fa; /* very faint lavender — particles read on this */
  overflow: hidden;
}

/* === GLOBAL PARTICLE BACKGROUND === */
.particles-global {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particles-global canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 999;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* === LAYOUT: STICKY SPLIT === */
.page {
  height: 100vh;
  position: relative;
  z-index: 1;
}

.split-layout {
  display: flex;
  align-items: stretch;
  height: 100vh;
  overflow: hidden;
}

.split-left {
  width: 48%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 64px 0 80px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

.split-left::-webkit-scrollbar {
  width: 10px;
}

.split-left::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.split-left::-webkit-scrollbar-track {
  background: transparent;
}

.split-right {
  width: 52%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
  padding: 16px 16px 16px 16px;
}

.split-right-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  /* Nearly transparent so particles are the background */
  background: rgba(240, 236, 255, 0.18);
}

.section {
  padding: var(--section-padding);
}

.section-header {
  margin-bottom: 28px;
}

.section-title {
  margin: 0;
  font-size: var(--text-h2);
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-weight: 700;
}

.title-muted {
  color: var(--color-text-muted);
}

.title-period {
  color: var(--color-accent);
}

.section-subtitle {
  margin: 12px 0 0;
  max-width: 520px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: 16px;
}

/* === REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  /* invisible sections must not absorb pointer events */
  pointer-events: none;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* === NAVIGATION === */
.nav {
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 244, 250, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Home + all-projects index: static header (no sticky; mobile uses bottom nav) */
.home-page .nav,
body.projects-page:not(.single-project-page) .nav {
  position: relative;
  top: auto;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-logo {
  margin-right: 32px;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  transition: opacity 0.15s ease;
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-logo-dot {
  color: var(--color-accent);
}

.nav-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
}

.nav-link {
  position: relative;
  display: inline-flex;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: color 0.15s ease, font-weight 0.18s ease;
  border-radius: 999px;
  z-index: 1;
}

.nav-link:not(.is-active):hover {
  color: var(--color-text-primary);
}

.nav-link.is-active {
  color: var(--color-text-primary);
  font-weight: 500;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 1px;
  width: 100%;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.nav-link:not(.is-active):hover::after {
  transform: scaleX(1);
}

.nav-link.is-active::after {
  transform: scaleX(0);
}

/* Shared "liquid" pill that moves between active nav items */
.nav-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  background: rgba(91, 78, 255, 0.12);
  border: 1px solid rgba(91, 78, 255, 0.18);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(91, 78, 255, 0.10);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  --pill-shift: 0px;
  --pill-shift2: 0px;
  --pill-shift-mid: 0px;
  --pill-pop: 1;
  --pill-squish: 1;
  transform: translateY(-50%);
  will-change: left, width, height, transform;
  transition: left 760ms cubic-bezier(0.2, 0.85, 0.25, 1),
    width 760ms cubic-bezier(0.2, 0.85, 0.25, 1),
    height 760ms cubic-bezier(0.2, 0.85, 0.25, 1),
    opacity 160ms ease;
}

.nav-pill.is-visible {
  opacity: 1;
}

.nav-pill.is-liquid {
  animation: none;
}

@keyframes navPillLiquid {
  0% {
    transform: translateY(-50%) translateX(var(--pill-shift))
      scaleX(calc(0.96 * var(--pill-pop))) scaleY(calc(1.02 * var(--pill-squish)));
  }
  28% {
    transform: translateY(-50%) translateX(var(--pill-shift2))
      scaleX(calc(1.26 * var(--pill-pop))) scaleY(calc(0.92 * var(--pill-squish)));
  }
  52% {
    transform: translateY(-50%) translateX(calc(var(--pill-shift-mid) * -0.55))
      scaleX(calc(0.88 * var(--pill-pop))) scaleY(calc(1.09 * var(--pill-squish)));
  }
  74% {
    transform: translateY(-50%) translateX(var(--pill-shift-mid))
      scaleX(calc(1.07 * var(--pill-pop))) scaleY(calc(0.98 * var(--pill-squish)));
  }
  100% {
    transform: translateY(-50%) translateX(0px) scaleX(1) scaleY(1);
  }
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.availability {
  font-size: 12px;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-xl);
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

/* Active / pressed feedback on pill buttons only — not full-width buttons */
.btn-primary:active,
.btn-secondary:active,
.btn-nav:active,
.nav-contact-btn:active,
.drawer-cta:active,
.carousel-btn:active,
.drawer-close:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 0.05s;
}

.is-pressed {
  transform: translateY(1px) scale(0.98) !important;
}

/* Universal focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid rgba(91, 78, 255, 0.5);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn:focus-visible,
.nav-link:focus-visible,
.nav-contact-btn:focus-visible,
.nav-logo:focus-visible,
.card-top:focus-visible,
.accordion-q:focus-visible,
.drawer-close:focus-visible,
.carousel-btn:focus-visible,
.dot:focus-visible,
.process-link:focus-visible {
  outline: 2px solid rgba(91, 78, 255, 0.55);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  padding: 14px 28px;
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 78, 255, 0.35);
}

.btn-arrow {
  display: inline-block;
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border-strong);
  padding: 14px 28px;
  font-weight: 500;
  font-size: 15px;
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 78, 255, 0.15);
  color: var(--color-accent);
}

.btn-nav {
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
}

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

/* Plain text-style contact button in nav */
.nav-contact-btn {
  background: transparent;
  border: 0;
  padding: 6px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.nav-contact-btn:hover {
  color: var(--color-accent);
}

.nav-contact-dot {
  color: var(--color-accent);
}

/* === DRAWER (MOBILE NAV) === */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  z-index: 120;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 92vw);
  background: var(--color-white);
  border-left: 1px solid var(--color-border);
  border-top-left-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
  z-index: 130;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.drawer-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.drawer-title-dot {
  color: var(--color-accent);
}

.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-off-white);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}

.drawer-close:hover {
  background: #e8e6ff;
  border-color: rgba(91, 78, 255, 0.25);
  transform: rotate(90deg);
}

.drawer-close:active {
  transform: rotate(90deg) scale(0.92);
  transition-duration: 0.05s;
}

.drawer-links {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  background: rgba(247, 246, 242, 0.55);
  width: 100%;
}

.drawer-link:hover {
  border-color: var(--color-border-strong);
  background: rgba(247, 246, 242, 0.9);
  transform: translateX(2px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.drawer-cta {
  width: 100%;
  margin-top: 8px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.18s ease, transform 0.15s ease;
}

.drawer-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.drawer-cta:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

/* === BOTTOM NAV (MOBILE) — fixed bar, hidden on desktop === */
.bottom-nav {
  display: none;
}

/* === HERO === */
.hero {
  padding-top: 56px;
  padding-bottom: 64px;
}

.hero-left {
  max-width: 620px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-xl);
  padding: 6px 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.hero-badge.is-in {
  opacity: 1;
  transform: translateY(0);
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.hero-title {
  margin: 22px 0 0;
  font-size: var(--text-display);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-title-line {
  display: block;
}

.hero-title-anim {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: wordIn 0.5s ease-out forwards;
}

.hero-muted {
  color: var(--color-text-muted);
}

.hero-period {
  color: var(--color-accent);
  font-weight: 700;
}

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

.hero-subtitle {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 420px;
}

.hero-cta {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trust-line {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(10, 10, 10, 0.75);
  letter-spacing: -0.01em;
}

.avatar + .avatar {
  margin-left: -10px;
}

.avatar-1 {
  background: rgba(91, 78, 255, 0.16);
}

.avatar-2 {
  background: rgba(34, 197, 94, 0.12);
}

.avatar-3 {
  background: rgba(200, 120, 255, 0.14);
}

.trust-text {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* === RIGHT PANEL: CAROUSEL === */
.carousel {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.carousel-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.55s ease;
  pointer-events: none;
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.carousel-link {
  display: block;
  width: 100%;
  height: 100%;
}

.carousel-media {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e4ff 0%, #d4cfff 100%);
}

.carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.carousel-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.25) 40%,
    transparent 68%
  );
}

.carousel-info {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 72px;
  z-index: 2;
  max-width: 75%;
}

.carousel-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.carousel-subtitle {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Persistent pagination — always visible, centered in right panel */
.carousel-pagination {
  position: absolute;
  /* Bottom-align with .carousel-controls (same bottom offset as chevron row) */
  bottom: 42px;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.carousel-controls {
  position: absolute;
  right: 42px;
  bottom: 42px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 10px;
  background: rgba(91, 78, 255, 0.28);
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* All properties transition together for a fluid morph */
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease,
              border-radius 0.35s ease,
              transform 0.2s ease,
              opacity 0.2s ease;
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: inherit;
}

.dot.is-active::after {
  animation: dotFill var(--carousel-auto-advance-ms, 4500ms) linear forwards;
}

@keyframes dotFill {
  to {
    transform: scaleX(1);
  }
}

.dot:hover {
  background: rgba(91, 78, 255, 0.6);
  transform: scale(1.5);
}

.dot:active {
  transform: scale(0.9);
  transition-duration: 0.08s;
}

.dot.is-active {
  width: 22px;
  border-radius: 10px;
  background: rgba(91, 78, 255, 0.16);
  transform: none;
}

.dot.is-active:hover {
  transform: none;
  background: rgba(91, 78, 255, 0.16);
}

.dot.is-active:hover::after {
  background: var(--color-accent-hover);
}

.card-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 28px;
  transition: max-height 0.35s ease;
}

.card.is-open .card-body {
  max-height: 600px;
}

.accordion-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-item.is-open .accordion-a {
  max-height: 500px;
}

.footer-card {
  background: var(--color-black);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  margin-bottom: 40px;
}

.icon-link svg {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.icon-link:hover svg {
  transform: translateY(-1px);
}

/* Expertise card icons */
.icon-box svg {
  width: 24px;
  height: 24px;
}

/* Value-prop icons */
.value-icon svg {
  width: 22px;
  height: 22px;
}

/* Carousel arrow icons */
.carousel-btn svg {
  width: 26px;
  height: 26px;
}

.carousel-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.carousel-btn:active {
  transform: scale(0.95);
}


/* === LOGO STRIP === */
.logo-strip {
  padding: 40px 0;
}

.logo-strip-inner {
  padding-top: 40px;
}

.logo-strip-heading {
  margin: 0 0 24px;
  text-align: left;
  font-size: 14px;
  color: var(--color-text-muted);
}

.logo-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.logo-carousel::before,
.logo-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 2;
  pointer-events: none;
}

.logo-carousel::before {
  left: 0;
  background: linear-gradient(to right, #f5f4fa 0%, rgba(245, 244, 250, 0) 100%);
}

.logo-carousel::after {
  right: 0;
  background: linear-gradient(to left, #f5f4fa 0%, rgba(245, 244, 250, 0) 100%);
}

.logo-track {
  display: flex;
  align-items: center;
  gap: 1px;
  width: max-content;
  animation: none;
  will-change: transform;
}

@keyframes logo-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.logo {
  flex: 0 0 min(calc((100% - 2px) / 3), 350px);
  max-width: min(calc((100% - 2px) / 3), 350px);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  height: 22px;
  width: auto;
  display: block;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.25;
  filter: grayscale(1) brightness(0.9);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Overwolf logo slightly larger */
.logo-img[src*="overwolf.svg"] {
  height: 62px;
}

/* Sensos logo slightly larger */
.logo-img[src*="sensos.svg"] {
  height: 62px;
}

/* Opster logo larger */
.logo-img[src*="opster.svg"] {
  height: 62px;
}

/* Orbitsight logo larger */
.logo-img[src*="orbitsight.svg"] {
  height: 42px;
}

.logo:hover .logo-img {
  opacity: 0.5;
  filter: grayscale(1) brightness(0.95);
}

/* === EXPERTISE CARDS === */
.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  /* Only the + icon box should react on hover */
  border-color: var(--color-border);
  box-shadow: none;
}

.card-top {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease;
}

.card-top:hover {
  background: transparent;
}

.card-top:active {
  background: rgba(235, 233, 255, 0.7);
  transform: none;
}

.card-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #313131;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}

.card-headings {
  padding-top: 2px;
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.card-subtext {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.card-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
  background: rgba(247, 246, 242, 0.65);
  border: 1px solid var(--color-border);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
  flex: 0 0 auto;
}

.card-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.card.is-open .card-toggle {
  transform: rotate(45deg);
}

/* Hover: match hero "Download resume" button feel */
.card-top:hover .card-toggle {
  background: var(--color-white);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 78, 255, 0.15);
}

.card.is-open .card-top:hover .card-toggle {
  transform: translateY(-1px) rotate(45deg);
}

.card-body p {
  margin: 0 0 18px;
  padding-top: 2px;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.tag-row {
  padding: 0 28px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--color-off-white);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* === WHY WORK WITH ME === */
.value-props {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.value-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.value-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #313131;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}

.value-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.value-body {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 15px;
}

.process-link {
  margin-top: 18px;
  display: inline-flex;
  font-weight: 500;
  font-size: 15px;
  color: var(--color-accent);
}

.process-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--color-accent-hover);
  letter-spacing: 0.005em;
  transition: color 0.15s ease, letter-spacing 0.2s ease;
}

/* === SELECTED WORK GRID === */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.work-tile {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid #d9d9d9;
  transform: scale(1);
  filter: brightness(1);
  transition: transform 0.3s ease, filter 0.3s ease, border-color 0.2s ease;
  cursor: zoom-in;
}

.work-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-tile:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
  border-color: #9a9a9a;
}

.tile-1 {
  border-color: #dedede;
  background: linear-gradient(135deg, #1a1230 0%, #2d1f5e 100%);
}
.tile-2 {
  border-color: #d7d7d7;
  background: linear-gradient(135deg, #0f1f2e 0%, #1a3548 100%);
}
.tile-3 {
  border-color: #d0d0d0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}
.tile-4 {
  border-color: #c9c9c9;
  background: linear-gradient(135deg, #1f1420 0%, #3d1f42 100%);
}
.tile-5 {
  border-color: #c2c2c2;
  background: linear-gradient(135deg, #0f1222 0%, #1b2740 100%);
}
.tile-6 {
  border-color: #bbbbbb;
  background: linear-gradient(135deg, #17141f 0%, #2a2240 100%);
}
.tile-7 {
  border-color: #b4b4b4;
  background: linear-gradient(135deg, #141a1f 0%, #29333b 100%);
}
.tile-8 {
  border-color: #adadad;
  background: linear-gradient(135deg, #1a1520 0%, #3a2b44 100%);
}

.work-tile:focus-visible {
  outline: 2px solid rgba(91, 78, 255, 0.5);
  outline-offset: 2px;
}

.thumb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(8, 8, 10, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.thumb-lightbox[hidden] {
  display: none;
}

.thumb-lightbox-content {
  width: min(1100px, 94vw);
  max-height: 88vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  background: #111;
}

.thumb-lightbox-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;
  background: #111;
}

.thumb-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.work-cta {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

/* === FAQ ACCORDION === */
.accordion {
  border-top: 1px solid var(--color-border);
}

.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 20px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.accordion-q:hover {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.accordion-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(247, 246, 242, 0.65);
  border: 1px solid var(--color-border);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
  color: var(--color-text-secondary);
}

.accordion-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(45deg);
}

.accordion-q:hover .accordion-icon {
  background: var(--color-white);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 78, 255, 0.15);
}

.accordion-item.is-open .accordion-q:hover .accordion-icon {
  transform: translateY(-1px) rotate(45deg);
}

.accordion-a p {
  margin: 0;
  padding: 0 0 20px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: 15px;
}

/* === FOOTER CARD === */
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* === PROJECTS PAGE (alexmaslii.com/projects style) === */
.projects-page #projects.section {
  padding: 0;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(-80px);
}

.projects-header {
  padding-top: 60px;
  padding-bottom: 48px;
}

.projects-title {
  font-family: var(--font-family);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}

.projects-title__dot {
  color: var(--color-accent);
}

.projects-subtitle {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 530px;
}

.all-projects-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 20px;
}

.all-projects-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #ffffff;
  color: #0a0a0a;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.all-projects-btn:hover {
  border-color: #5b4eff;
  color: #5b4eff;
  transform: translateY(-1px);
}

/* Case study only: duplicate “All Projects” in nav for mobile sticky row (hidden on desktop) */
.all-projects-btn--nav-sticky {
  display: none;
}

.single-project-page .page-content {
  width: 100%;
}

.single-project-page .all-projects-row .all-projects-btn {
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  transform: none;
}

.single-project-page .all-projects-row .all-projects-btn:hover {
  transform: none;
}

.single-project-page .all-projects-row {
  margin-bottom: 100px;
}

/* Single project pages should use natural top-to-bottom flow (no centered shift). */
.single-project-page #projects.section {
  min-height: auto;
  display: block;
  justify-content: flex-start;
  transform: none;
  padding: 12px 0 0;
}

.single-project-page .project-header {
  margin-bottom: 8px;
}

.single-project-page .project-title {
  margin: 0 0 16px;
  font-family: var(--font-family);
  font-size: clamp(36px, 4.8vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #0a0a0a;
}

.single-project-page .meta-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 18px 28px;
  margin-bottom: 8px;
  align-items: start;
}

.single-project-page .meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.single-project-page .meta-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999999;
}

.single-project-page .meta-value {
  font-size: 14px;
  color: #666666;
}

.single-project-page .meta-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}

/* Team roles: wrap so labels never get squeezed/truncated; Team column uses remaining row width */
.single-project-page .meta-tags--grid-3x2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.single-project-page .meta-tags .meta-tag {
  display: block;
  flex: 0 1 auto;
  min-width: min-content;
  max-width: 100%;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  color: #666666;
  background: none;
  border: none;
  border-radius: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
}

.single-project-page .content-block {
  margin-bottom: 32px;
}

.single-project-page .body-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: #666666;
}

.single-project-page .divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.14);
  margin: 20px 0 26px;
}

.single-project-page .subheader {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #0a0a0a;
}

.single-project-page .subheader-period {
  color: #5b4eff;
}

.single-project-page .subheader-desc {
  margin: 8px 0 20px;
  color: #999999;
  font-size: 14px;
  line-height: 1.6;
}

.single-project-page .process-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.single-project-page .process-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 28px;
}

.single-project-page .process-card-label {
  margin-bottom: 10px;
  color: #5b4eff;
  font-size: 13px;
  font-weight: 500;
}

.single-project-page .process-card-title {
  margin-bottom: 10px;
  color: #0a0a0a;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.single-project-page .process-card-body {
  margin: 0;
  color: #666666;
  font-size: 15px;
  line-height: 1.75;
}

.single-project-page .img-grid + .img-single {
  margin-top: 24px;
}

.single-project-page .img-single + .img-single {
  margin-top: 20px;
}

.single-project-page .img-single {
  margin-top: 14px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #f7f6f2;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  color: #999999;
  text-align: center;
  padding: 12px;
}

.single-project-page .img-single:has(> img) {
  padding: 0;
  overflow: hidden;
  display: block;
}

.single-project-page .img-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.single-project-page .img-single-label {
  font-size: 13px;
}

.single-project-page .img-caption {
  margin-top: 8px;
  font-size: 13px;
  color: #999999;
}

.single-project-page .img-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.single-project-page .img-grid-item {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: #f7f6f2;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  color: #999999;
  text-align: center;
  padding: 0;
  font-size: 13px;
  overflow: hidden;
}

.single-project-page .img-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.single-project-page .img-single img:focus-visible,
.single-project-page .img-grid-item img:focus-visible {
  outline: 2px solid rgba(91, 78, 255, 0.55);
  outline-offset: 3px;
}

.single-project-page .img-grid-item.tall {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.single-project-page .next-project {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  padding: 28px 32px;
  transition: border-color 0.22s ease;
}

.single-project-page .next-project:hover {
  border-color: #5b4eff;
}

.single-project-page .footer-card {
  margin-top: 18px;
}

.single-project-page .next-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #999999;
}

.single-project-page .next-title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0a0a0a;
}

.single-project-page .next-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #0a0a0a;
  font-size: 18px;
}

.projects-list {
  width: 100%;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid #e8e8e4;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s ease;
  cursor: pointer;
}

.project-row:first-child {
  border-top: 1px solid #e8e8e4;
}

.project-row:hover {
  padding-left: 4px;
}

.project-row:hover .project-row__name {
  color: #aaaaaa;
}

.project-row:hover .project-row__tags {
  color: #cccccc;
}

.project-row:hover .project-row__arrow {
  opacity: 1;
  transform: translateX(0);
}

.project-row__left {
  flex: 1;
  min-width: 0;
  padding-right: 24px;
}

.project-row__name {
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 600;
  color: #0a0a0a;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-name-with-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #f0cf6b;
  background: #fff8df;
  color: #8a6200;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-row__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.project-row__tags {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  color: #aaaaaa;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.project-row__arrow {
  font-size: 16px;
  color: var(--color-text-secondary);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  line-height: 1;
  flex-shrink: 0;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(91, 78, 255, 0.3);
  overflow: hidden;
  display: block;
}

.footer-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.footer-name {
  color: #fff;
  font-weight: 600;
  font-size: 18px;
}

.footer-role {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-link {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
}

.footer-icons {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-link {
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s ease;
  display: inline-flex;
}

.icon-link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.footer-lower {
  margin-top: 32px;
}

.footer-copy {
  margin: 0;
  padding-bottom: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.42);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom {
  margin-top: 0;
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 24px;
}

.footer-vibe {
  font-size: 13px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  padding: 6px 14px;
  justify-self: start;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.footer-mini-nav {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.25);
}

.footer-mini-nav a:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* Footer appears only after scrolling */
.footer-card.is-scroll-hidden {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.footer-card.is-scroll-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s ease;
}


/* === MEDIA QUERIES === */
@media (min-width: 769px) {
  .carousel-mobile-thumbs {
    display: none !important;
  }
}

@media (max-width: 1440px) {
  .split-left {
    padding: 0 52px 0 68px;
  }
}

@media (max-width: 1280px) {
  .split-left {
    padding: 0 44px 0 56px;
  }
  .carousel-info {
    left: 28px;
    right: 28px;
    bottom: 64px;
  }
}

@media (max-width: 1024px) {
  .split-left {
    padding: 0 36px 0 44px;
  }
  .nav-inner {
    gap: 18px;
  }
  .nav-logo {
    margin-right: 18px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    overflow: auto;
  }

  body {
    overflow-x: hidden;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 10px);
  }

  .split-layout {
    height: auto;
    flex-direction: column;
    overflow: visible;
  }

  /* Surface main chunks + carousel to one column so carousel can sit mid-page on mobile */
  .split-left {
    display: contents;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  main#main,
  #main {
    display: contents;
  }

  .single-project-page #main > section#projects {
    display: contents;
  }

  /*
   * Top nav lives under .split-left, not as a direct child of .split-layout
   * (`.split-layout > nav` never matched — nav stayed visible on mobile).
   * Hides top bar on home, all projects, and case studies; use bottom nav.
   */
  .split-left > nav.nav {
    display: none !important;
  }

  /* Home + all-projects index: belt-and-suspenders */
  .home-page .nav-inner,
  body.projects-page:not(.single-project-page) .nav-inner {
    display: none !important;
  }

  /* Case study: no top bar — hide logo, sticky “All Projects”, tabs, divider */
  .single-project-page .nav-inner,
  .single-project-page .nav-logo,
  .single-project-page .all-projects-btn--nav-sticky,
  .single-project-page .nav-links,
  .single-project-page .nav-right {
    display: none !important;
  }

  .single-project-page .all-projects-row {
    display: none;
  }

  .mobile-stack-before-carousel {
    order: 2;
    width: 100%;
    padding-left: 18px;
    padding-right: 18px;
    box-sizing: border-box;
  }

  .split-layout > .split-right {
    order: 3;
  }

  .mobile-stack-after-carousel {
    order: 4;
    width: 100%;
    padding-left: 18px;
    padding-right: 18px;
    box-sizing: border-box;
  }

  body.projects-page:not(.single-project-page) .mobile-stack-after-carousel {
    margin-top: 24px;
  }

  /* Case study: footer/lightbox are siblings of section — pull them after carousel + body copy */
  .single-project-page #main > footer.footer-card {
    order: 5;
    width: auto;
    align-self: stretch;
    margin-left: 18px;
    margin-right: 18px;
    max-width: calc(100% - 36px);
    box-sizing: border-box;
    padding: 36px 28px;
  }

  .single-project-page #main > .thumb-lightbox {
    order: 6;
  }

  /* All projects index: table list hidden on small screens (carousel is primary) */
  body.projects-page:not(.single-project-page) .projects-list {
    display: none;
  }

  .split-right {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 12px 18px 20px;
  }

  .split-right-inner {
    border-radius: var(--radius-xl);
  }

  /* Mobile: stacked thumbnails instead of carousel */
  .carousel-mobile-thumbs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-bottom: 4px;
  }

  .carousel-mobile-thumb {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  }

  .carousel-mobile-thumb:active {
    transform: scale(0.99);
  }

  .carousel-mobile-thumb-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1a1a1a;
  }

  .carousel-mobile-thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .carousel-mobile-thumb-body {
    padding: 14px 16px 16px;
  }

  .carousel-mobile-thumb-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text-primary);
  }

  .carousel-mobile-thumb-sub {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-secondary);
  }

  /* Remove carousel layer so stacked thumbnails receive taps (carousel was position:absolute inset:0) */
  .split-right .carousel {
    display: none !important;
  }

  .carousel-info {
    left: 20px;
    right: 20px;
    bottom: 52px;
    max-width: none;
  }

  .carousel-pagination {
    left: 0;
    right: 0;
    bottom: 28px;
    justify-content: center;
  }

  .carousel-controls {
    right: 28px;
    bottom: 28px;
  }

  .nav-inner {
    padding: 0 2px;
  }

  .nav-links {
    display: none;
  }

  .nav-right {
    display: none;
  }

  .availability {
    display: none;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: flex-end;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    overflow: visible;
    column-gap: 4px;
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 10px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.07);
  }

  .bottom-nav-cluster {
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    gap: 2px;
    min-width: 0;
  }

  .bottom-nav-cluster--start {
    grid-column: 1;
  }

  .bottom-nav-cluster--end {
    grid-column: 3;
  }

  .bottom-nav-link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-link--featured {
    grid-column: 2;
    flex: none;
    width: 58px;
    height: 58px;
    min-width: 58px;
    padding: 0;
    margin-bottom: 2px;
    margin-top: -22px;
    border-radius: 14px;
    background: linear-gradient(155deg, #6b5cff 0%, var(--color-accent) 45%, #4330d4 100%);
    color: #fff;
    box-shadow: 0 12px 32px rgba(91, 78, 255, 0.42);
    z-index: 1;
    gap: 3px;
  }

  .bottom-nav-link--featured:active {
    transform: scale(0.96);
    background: linear-gradient(155deg, #7d6fff 0%, var(--color-accent-hover) 45%, #4a38e8 100%);
  }

  .bottom-nav-link--featured .bottom-nav-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.95);
  }

  .bottom-nav-link--featured.is-active {
    color: #fff;
    box-shadow: 0 12px 36px rgba(91, 78, 255, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.35);
  }

  .bottom-nav-link.is-active:not(.bottom-nav-link--featured) {
    color: var(--color-accent);
  }

  .bottom-nav-link:active:not(.bottom-nav-link--featured) {
    background: rgba(91, 78, 255, 0.06);
  }

  .bottom-nav-ico {
    display: flex;
    line-height: 0;
    color: currentColor;
  }

  .bottom-nav-link--featured .bottom-nav-ico svg {
    width: 26px;
    height: 26px;
  }

  .footer-card {
    margin-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .hero {
    padding-top: 24px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .projects-page #projects.section {
    min-height: auto;
    justify-content: flex-start;
    transform: none;
  }

  .single-project-page .meta-row,
  .single-project-page .process-cols,
  .single-project-page .img-grid {
    grid-template-columns: 1fr;
  }

  .single-project-page .meta-tags--grid-3x2 {
    gap: 10px 14px;
  }

  .single-project-page .next-project {
    padding: 20px 22px;
  }

  .single-project-page .next-title {
    font-size: 18px;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    align-items: flex-start;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 14px;
  }

  .footer-mini-nav {
    justify-self: start;
  }

  /* Allow document to extend past one viewport (fixes scroll + footer below fold) */
  .page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    /* Breathing room below the status bar / top edge (top nav is hidden on mobile) */
    padding-top: 60px;
  }

  /*
   * Desktop uses scroll-gated footer (is-scroll-hidden). On mobile, window scroll
   * often stays at 0 with the split→column layout, so the footer never unhides.
   * Always show the footer in the mobile breakpoint.
   */
  .footer-card.is-scroll-hidden,
  .footer-card.is-scroll-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
