/* ==========================================================================
   JOHN BENSER SERRAON — PORTFOLIO DESIGN SYSTEM
   Exact replication of francisconavalta.com & bryl-minimal-design
   ========================================================================== */


@font-face {
  font-family: 'Geist Pixel';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/GeistPixel.ttf') format('truetype'),
       url('https://fonts.gstatic.com/s/geistpixel/v1/CSRs4zxZluGGW3oyI0A_AN0hQBvYDU4hBmqoKzAMWg.ttf') format('truetype');
}

:root {
  /* LIGHT THEME (Default) */
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --bg-soft: #f5f5f5;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.18);
  --text: #1a1a1a;
  --text-strong: #0a0a0a;
  --muted: #666666;
  --muted-2: #888888;
  --hover: rgba(0, 0, 0, 0.035);
  --grid-dot: rgba(0, 0, 0, 0.09);
  
  --card-bg: #ffffff;
  --card-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.18);
  --card-shadow-hover: 0 18px 36px -18px rgba(0, 0, 0, 0.28);
  --modal-backdrop: rgba(255, 255, 255, 0.85);

  --header-h: 74px;
  --max: 1160px;
  --font-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --font-display: 'Geist Pixel', 'Geist Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --trans-theme: background-color 500ms var(--ease-out), color 500ms var(--ease-out), border-color 500ms var(--ease-out);
}

[data-theme="dark"] {
  --bg: #0d0e11;
  --bg-alt: #111318;
  --bg-soft: #15171c;
  --line: rgba(184, 192, 188, 0.105);
  --line-strong: rgba(196, 205, 200, 0.18);
  --text: #e8e8e3;
  --text-strong: #f1f1ec;
  --muted: #a0a29f;
  --muted-2: #737872;
  --hover: rgba(232, 232, 227, 0.035);
  --grid-dot: rgba(160, 170, 164, 0.12);

  --card-bg: #111318;
  --card-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.65);
  --card-shadow-hover: 0 18px 38px -16px rgba(0, 0, 0, 0.85);
  --modal-backdrop: rgba(8, 9, 12, 0.78);
}

/* ==========================================================================
   SMOOTH 60FPS THEME TRANSITION
   GPU-Accelerated Circular Clip-Path Reveal & Zero-Jank Compositor Blending
   ========================================================================== */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
}

/* While transitioning theme, suppress DOM CSS transitions so snapshot is captured instantly at 60fps */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: none !important;
}

/* Non-blocking color transitions for interactive surfaces (isolated to main containers) */
body,
header.nav,
main,
footer,
.section,
.page {
  transition: background-color 220ms ease, color 220ms ease;
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Touch Responsiveness: Zero 300ms tap delay & clean mobile tap states */
a, button, input, select, textarea, [role="button"], .ugc-sound-toggle-btn, .theme-toggle, .content-row, .card, .ugc-index-card, .tab-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

#root, .portfolio-app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1025px) {
  html {
    font-size: 16.5px;
  }
}

@media (min-width: 1440px) {
  html {
    font-size: 17.5px;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  padding-top: var(--header-h);
  transition: var(--trans-theme);
}

main, .page, .section, .hero, .stats, footer {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

@supports not (overflow-x: clip) {
  main, .page, .section, .hero, .stats, footer {
    overflow-x: hidden;
  }
}

@keyframes bgGridDrift {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 24px 18px;
  }
  100% {
    background-position: 0 0;
  }
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  animation: bgGridDrift 24s ease-in-out infinite alternate;
  will-change: background-position;
}

body::before {
  top: 0;
  right: 0;
  width: min(34vw, 520px);
  height: 360px;
}

body::after {
  left: 0;
  bottom: 0;
  width: min(16vw, 240px);
  height: 280px;
}

html.modal-open,
body.modal-open,
body.menu-open {
  overflow: hidden !important;
  overscroll-behavior: contain;
}

.mono {
  font-family: var(--font-mono);
}

.pixel-heading {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  text-transform: lowercase !important;
  letter-spacing: -0.02em !important;
}

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--text-strong);
  color: var(--bg);
}

:focus-visible {
  outline: 1px solid var(--text-strong);
  outline-offset: 4px;
}

/* Reading Progress Bar (Removed line loading per user instruction) */
.reading-progress {
  display: none !important;
}

/* ==========================================================================
   HEADER & NAVIGATION
   Top-Left: John Benser Serraon
   Center: home↗, blog↗, projects↗, journey↗, stack↗, gallery↗ (lowercase)
   Top-Right: Theme switcher button & mobile menu
   ========================================================================== */
header.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  padding: 0 clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  gap: 16px;
}

/* Brand on TOP LEFT (Spaced from navigation links) */
.brand-left {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: clamp(16px, 2.5vw, 40px);
  padding-right: 4px;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--text-strong);
  transition: opacity 160ms ease;
}

.brand-name:hover {
  opacity: 0.8;
}

/* Clean Nav Links Centered (Directly in Header without Card Pill Frame) */
nav.links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 18px);
  margin: 0 auto;
  font-size: 13.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  background: transparent;
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0;
  box-shadow: none;
  flex-shrink: 0;
}

nav.links a {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 4px;
  border-radius: 4px;
  text-decoration: none !important;
  transition: color 160ms ease, opacity 160ms ease;
}

nav.links a .nav-text,
.mobile-nav-list a .nav-text {
  display: inline-block;
  text-decoration: none;
}

nav.links a:hover,
nav.links a.is-active {
  opacity: 1;
  color: var(--text-strong);
  text-decoration: none !important;
}

/* Only underline the text, never the arrow icon */
nav.links a:hover .nav-text,
nav.links a.is-active .nav-text,
.mobile-nav-list a:hover .nav-text,
.mobile-nav-list a.is-active .nav-text {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-color: var(--text-strong);
}

/* Universal Arrow Animation (.chev) — strictly excluded from text-decoration underline */
.chev {
  display: inline-block !important;
  text-decoration: none !important;
  font-size: 11px;
  color: var(--muted-2);
  transform: translateY(-1px);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms ease;
  will-change: transform;
}

/* Universal hover for any link, button, or card containing an arrow */
a:hover .chev,
button:hover .chev,
.nav-link:hover .chev,
.social-row a:hover .chev,
.view-link:hover .chev,
.stat:hover .chev,
.content-row:hover .chev,
.project-row-card:hover .chev,
.github-link-btn:hover .chev,
.contact-mail-link:hover .chev,
.footer-mid a:hover .chev,
.detail-btn:hover .chev,
.contact-trigger:hover .chev,
nav.links a:hover .chev,
nav.links a.is-active .chev {
  color: var(--text-strong);
  transform: translate(3px, -3px);
}

.back-top:hover .chev {
  transform: translateY(-4px);
}

/* Actions on TOP RIGHT - Guaranteed visible on Desktop & Mobile */
.header-right-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: 0;
  z-index: 5;
}

/* Minimalist Pure-Icon Theme Switcher (Suits the portfolio's minimal aesthetic) */
.theme-toggle {
  width: 36px;
  height: 36px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  box-shadow: none;
  transform: translateY(0);
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color 160ms ease,
              border-color 160ms ease,
              color 160ms ease;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  padding: 0;
}

[data-theme="dark"] .theme-toggle {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

.theme-toggle:hover {
  background: var(--hover);
  border-color: var(--line);
  color: var(--text-strong);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: scale(0.92) !important;
  background: var(--hover);
}

.theme-toggle:focus-visible {
  outline: 1.5px solid var(--text-strong);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), color 160ms ease;
}

.theme-toggle:hover svg {
  color: var(--text-strong);
  transform: rotate(15deg);
}

/* Mobile drawer integrated theme switch */
.mobile-theme-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  width: auto;
  height: auto;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  color: var(--text-strong);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.mobile-theme-btn:hover {
  background: var(--hover);
  border-color: var(--text-strong);
}

/* Mobile Toggle Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text-strong);
  cursor: pointer;
  padding: 8px 7px;
  flex-shrink: 0;
  transition: background 180ms ease, border-color 180ms ease, transform 120ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.menu-toggle:active {
  transform: scale(0.92);
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

/* Burger Animation when drawer is open */
body.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

body.menu-open .menu-toggle span:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

.mobile-menu-drawer {
  display: none;
}

/* ==========================================================================
   PAGE BASE (Matching francisconavalta.com)
   ========================================================================== */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  min-height: calc(100vh - var(--header-h));
  position: relative;
  z-index: 1;
  animation: pageFadeIn 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

body.page-exiting main,
body.page-exiting .mobile-menu-drawer,
main.is-transitioning {
  opacity: 0 !important;
  transform: translateY(8px) !important;
  transition: opacity 140ms ease, transform 140ms ease !important;
}

/* ==========================================================================
   PIXEL-PERFECT DETERMINISTIC SKELETON STRUCTURE ENGINE
   Ensures 100% exact layout matching with zero shift
   ========================================================================== */
:root {
  --skeleton-base: #e1e4ea;
  --skeleton-shine: #f4f6fa;
  --skeleton-card-bg: #f8f9fb;
}

[data-theme="dark"] {
  --skeleton-base: #1c202a;
  --skeleton-shine: #353b4e;
  --skeleton-card-bg: #141720;
}

@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Base Skeleton State on Main Container */
main.is-skeleton-loading {
  pointer-events: none !important;
  user-select: none !important;
}

/* 1. Typography & Text Elements Become Animated High-Contrast Shimmer Bars */
main.is-skeleton-loading h1,
main.is-skeleton-loading h2,
main.is-skeleton-loading h3,
main.is-skeleton-loading h4,
main.is-skeleton-loading h5,
main.is-skeleton-loading p:not(.mono):not(.ugc-see-more-sub),
main.is-skeleton-loading .page-kicker,
main.is-skeleton-loading .page-desc,
main.is-skeleton-loading .page-lead,
main.is-skeleton-loading .hero-lead,
main.is-skeleton-loading .hero-headline,
main.is-skeleton-loading .hero-sub,
main.is-skeleton-loading .stat-val,
main.is-skeleton-loading .stat-num,
main.is-skeleton-loading .stat-value,
main.is-skeleton-loading .stat-lbl,
main.is-skeleton-loading .stat-label,
main.is-skeleton-loading .stat .num,
main.is-skeleton-loading .stat .label,
main.is-skeleton-loading .stat .sub,
main.is-skeleton-loading .ugc-card-title,
main.is-skeleton-loading .ugc-card-meta,
main.is-skeleton-loading .blog-title,
main.is-skeleton-loading .blog-meta,
main.is-skeleton-loading .meta-tag,
main.is-skeleton-loading .tag-pill,
main.is-skeleton-loading .tech-tag,
main.is-skeleton-loading .badge,
main.is-skeleton-loading .stack-chip,
main.is-skeleton-loading .exp-role,
main.is-skeleton-loading .exp-company,
main.is-skeleton-loading .exp-date,
main.is-skeleton-loading .meta-line > *,
main.is-skeleton-loading .row-meta > *,
main.is-skeleton-loading .stack-category-title,
main.is-skeleton-loading .deck-verify-btn,
main.is-skeleton-loading .filter-btn,
main.is-skeleton-loading .brand-count-badge,
main.is-skeleton-loading .brand-pill,
main.is-skeleton-loading .client-hub-btn,
main.is-skeleton-loading .btn:not(.theme-toggle):not(.menu-toggle),
main.is-skeleton-loading .control,
main.is-skeleton-loading select,
main.is-skeleton-loading input {
  color: transparent !important;
  border-color: transparent !important;
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: skeletonShimmer 1.25s infinite linear !important;
  border-radius: var(--radius-sm, 6px) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

main.is-skeleton-loading h1,
main.is-skeleton-loading h2,
main.is-skeleton-loading h3 {
  min-height: 22px;
}

main.is-skeleton-loading p:not(.mono):not(.ugc-see-more-sub) {
  min-height: 16px;
}

/* Ensure inline kickers and badges have proper minimum structural width */
main.is-skeleton-loading .page-kicker,
main.is-skeleton-loading .meta-tag,
main.is-skeleton-loading .badge,
main.is-skeleton-loading .tag-pill {
  display: inline-block;
  min-width: 68px;
}

/* 2. Media, Videos, Images and Thumbnails */
main.is-skeleton-loading img,
main.is-skeleton-loading video,
main.is-skeleton-loading iframe,
main.is-skeleton-loading svg:not(.nav svg):not(.theme-toggle svg) {
  opacity: 0 !important;
}

main.is-skeleton-loading .ugc-video-container,
main.is-skeleton-loading .project-card-media,
main.is-skeleton-loading .project-peek-track,
main.is-skeleton-loading .gallery-card-thumb,
main.is-skeleton-loading .gallery-item,
main.is-skeleton-loading .thumb-wrapper,
main.is-skeleton-loading .cert-badge-frame,
main.is-skeleton-loading .company-logo,
main.is-skeleton-loading .ugc-inline-logo {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: skeletonShimmer 1.3s infinite linear !important;
  border-color: var(--line) !important;
}

/* 3. Cards & Structural Grids Retain Layout & Neutral Shell */
main.is-skeleton-loading .project-row-card,
main.is-skeleton-loading .ugc-index-card,
main.is-skeleton-loading .ugc-reel-card,
main.is-skeleton-loading .blog-card,
main.is-skeleton-loading .cert-card,
main.is-skeleton-loading .exp-card,
main.is-skeleton-loading .stack-group,
main.is-skeleton-loading .content-row,
main.is-skeleton-loading .stat-cell,
main.is-skeleton-loading .deck-slide {
  border-color: var(--line) !important;
  box-shadow: none !important;
  cursor: default !important;
}

/* Pulse shimmer for in-page filters */
.is-skeleton-pulse > * {
  color: transparent !important;
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: skeletonShimmer 1.3s infinite linear !important;
  border-color: transparent !important;
  pointer-events: none !important;
}

.is-skeleton-pulse img,
.is-skeleton-pulse video {
  opacity: 0 !important;
}

/* Smooth Transition Out of Skeleton into Real Content */
main .page > *,
main > .page,
main > footer,
main h1, main h2, main h3, main h4,
main p, main img, main video,
main .ugc-video-container,
main .project-card-media,
main .gallery-card-thumb,
main .btn,
main .meta-tag,
main .badge {
  transition: color 240ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color 240ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

main.is-page-entering {
  animation: navPageFadeIn 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: opacity, transform;
}

/* Post-skeleton content reveal. The layout stays unchanged; only loaded
   content receives a short, silky lift as it becomes available. */
main.is-page-entering .page > *,
main.is-page-entering > .page,
main.is-page-entering > footer {
  animation: pageContentReveal 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

main.is-page-entering .page > *:nth-child(2) { animation-delay: 35ms; }
main.is-page-entering .page > *:nth-child(3) { animation-delay: 70ms; }
main.is-page-entering .page > *:nth-child(4) { animation-delay: 105ms; }
main.is-page-entering .page > *:nth-child(5) { animation-delay: 140ms; }

@keyframes pageContentReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navPageFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  main.is-page-entering,
  main.is-page-entering .page > *,
  main.is-page-entering > .page,
  main.is-page-entering > footer {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}

.title-slash {
  opacity: 0.35;
  font-weight: 300;
  margin: 0 4px;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 48px 40px;
}

.page-head {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.page-kicker {
  color: var(--muted-2);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-family: var(--font-mono);
}

.page h1,
.pixel-heading {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  font-size: 46px !important;
  line-height: 1.05 !important;
  margin: 0 0 18px !important;
  letter-spacing: 0 !important;
  text-transform: lowercase !important;
  color: var(--text-strong) !important;
}

.page-intro {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 680px;
  margin: 0;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 46px 48px 20px;
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.section-head .eyebrow {
  font-size: clamp(17px, 1.8vw, 24px);
  color: var(--text-strong);
  text-transform: lowercase;
  font-family: var(--font-mono);
  font-weight: 550;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-head .eyebrow .idx {
  color: var(--muted-2);
  font-weight: 600;
}

.view-link {
  font-size: clamp(12.5px, 1.1vw, 14.5px);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  font-weight: 600;
  transition: color 160ms ease, transform 160ms ease;
}

.view-link:hover {
  color: var(--text-strong);
  transform: translateX(2px);
}

/* ==========================================================================
   HERO & STATS BAR (Home page)
   ========================================================================== */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 48px 56px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 58px;
  align-items: center;
}

.avatar-wrap {
  width: 100%;
  aspect-ratio: 2016 / 2112;
  background: var(--bg-soft);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  position: relative;
  box-shadow: var(--card-shadow);
  transition: border-color 500ms var(--ease-out), box-shadow 500ms var(--ease-out);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 48% 30%;
  filter: contrast(1.02) brightness(1);
  transition: transform 380ms var(--ease-out), filter 500ms var(--ease-out);
}

.avatar-wrap:hover img { transform: scale(1.022); }
[data-theme="dark"] .avatar-wrap {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 38px -14px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .avatar-wrap img { filter: contrast(1.04) brightness(0.96); }

.hero-copy h1 {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  font-size: clamp(42px, 6vw, 64px) !important;
  line-height: 0.96 !important;
  margin: 0 0 16px !important;
  letter-spacing: 0 !important;
  color: var(--text-strong) !important;
  text-transform: none !important;
}
.hero-role {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: clamp(21px, 2.6vw, 27px);
  color: var(--muted);
  min-height: 38px;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
  font-family: var(--font-mono);
  font-weight: 500;
}
.hero-role .role-text, .hero-role .type-cursor { color: var(--text-strong); }
.hero-role .type-cursor {
  display: inline-block;
  font-weight: 300;
  margin-left: 3px;
  animation: cursorBlink 750ms step-end infinite;
}
@keyframes cursorBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-copy p {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 580px;
  margin: 0 0 22px;
}
.hero-copy p strong { color: var(--text-strong); font-weight: 600; }
.social-row {
  margin-top: 24px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.social-row a, .social-row button {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  transition: color 160ms ease;
}
.social-row a:hover, .social-row button:hover { color: var(--text-strong); }

.stats {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: var(--trans-theme);
}
.stat {
  padding: 34px 30px;
  border-right: 1px solid var(--line);
  min-width: 0;
  transition: background 160ms ease;
  display: block;
}
.stat:hover { background: var(--hover); }
.stat:last-child { border-right: none; }
.stat .num-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.stat .num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-strong);
  font-family: var(--font-sans);
}
.stat .label {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat .chev { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.stat:hover .chev { color: var(--text-strong); transform: translate(2px, -2px); }
.stat .sub {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ==========================================================================
   PROJECT ROWS (Exact Screenshot 1 Layout)
   ========================================================================== */
.content-list {
  border-bottom: 1px solid var(--line);
}

.content-row {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 28px;
  align-items: start;
  transition: background 160ms ease, padding-left 160ms ease;
  cursor: pointer;
}

.content-row:last-child {
  border-bottom: 0;
}

.content-row:hover {
  background: var(--hover);
  padding-left: 10px;
}

.project-row-card {
  grid-template-columns: 140px minmax(0, 1fr) minmax(200px, 280px);
  gap: 32px;
  align-items: start;
}

.project-row-card .thumb {
  width: 140px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-alt);
  overflow: hidden;
}

.project-row-card .thumb img,
.project-row-card .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms var(--ease-out);
}

.project-row-card:hover .thumb img,
.project-row-card:hover .thumb video {
  transform: scale(1.05);
}

.row-main h2,
.row-main h3 {
  font-size: 19px;
  margin: 0 0 8px;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text-strong);
}

.row-main p {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
  max-width: 680px;
}

/* Tag Pill Stack with # prefix */
.tag-pill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 14px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 160ms ease, color 160ms ease;
}

.project-row-card:hover .tag-chip {
  border-color: var(--line-strong);
  color: var(--text);
}

.row-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  text-align: right;
  font-size: 11.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.meta-label {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.meta-status {
  color: var(--text-strong);
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* Inverted black chip badge (Screenshot 1 & 2) */
.badge-featured,
.badge-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--text-strong);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ==========================================================================
   JOURNEY / TIMELINE (Screenshot 2 Layout)
   ========================================================================== */
.timeline-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 36px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms ease;
}

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-meta-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-date {
  font-size: 13px;
  color: var(--text-strong);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.timeline-location svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
}

.timeline-body h2,
.timeline-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 650;
  color: var(--text-strong);
  line-height: 1.3;
}

.timeline-body .org {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.timeline-body .org-name {
  color: var(--text-strong);
  font-weight: 600;
}

.timeline-body .org-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-body p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 0;
  max-width: 720px;
}

.timeline-body p strong {
  color: var(--text-strong);
  font-weight: 600;
}

.timeline-bullets {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.58;
  color: var(--muted);
}

.timeline-bullets li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.58;
}

.timeline-bullets li strong {
  color: var(--text-strong);
  font-weight: 600;
}

/* ==========================================================================
   JOURNEY SIMPLE ROW (Index Page — Minimal Layout)
   ========================================================================== */
.journey-simple {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.journey-item {
  border-bottom: 1px solid var(--line);
  transition: border-color 180ms ease;
}

.journey-item:last-child {
  border-bottom: 0;
}

.journey-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 80px minmax(0, 1.2fr) minmax(0, 1fr) 28px;
  gap: 20px;
  align-items: center;
  padding: 18px 8px;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
  transition: background 160ms ease, padding-left 160ms ease;
}

.journey-trigger:hover,
.journey-item.is-expanded .journey-trigger {
  background: var(--hover);
  padding-left: 12px;
}

.journey-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  font-weight: 500;
}

.journey-role {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text-strong);
  line-height: 1.35;
}

.journey-company {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-align: right;
}

.journey-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), background 160ms ease, border-color 160ms ease, color 160ms ease;
  flex-shrink: 0;
  justify-self: end;
}

.journey-arrow svg {
  width: 13px;
  height: 13px;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.journey-trigger:hover .journey-arrow {
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.journey-item.is-expanded .journey-arrow {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text-strong);
}

.journey-item.is-expanded .journey-arrow svg {
  transform: rotate(180deg);
}

/* Accordion Drawer */
.journey-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  opacity: 0;
  overflow: hidden;
}

.journey-item.is-expanded .journey-drawer {
  grid-template-rows: 1fr;
  opacity: 1;
}

.journey-drawer-inner {
  min-height: 0;
  padding: 4px 12px 20px 100px;
}

.journey-submeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: 12px;
}

.journey-subtag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
}

.journey-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journey-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.journey-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 680px) {
  .journey-trigger {
    grid-template-columns: 50px 1fr 26px;
    row-gap: 6px;
    column-gap: 10px;
    padding: 14px 4px;
  }
  .journey-company {
    grid-column: 2 / 3;
    text-align: left;
    font-size: 11.5px;
  }
  .journey-arrow {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    align-self: center;
  }
  .journey-drawer-inner {
    padding: 4px 4px 16px 4px;
  }
  .journey-bullets li {
    font-size: 12.5px;
    line-height: 1.55;
    padding-left: 16px;
  }
}

/* ==========================================================================
   STACK CHIPS FLAT (Index Page — Single Row Matching Screenshot)
   ========================================================================== */
.stack-chips-flat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.stack-chips-flat .stack-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--text-strong);
  transition: all 160ms ease;
  user-select: none;
}

.stack-chips-flat .stack-chip:hover {
  border-color: var(--line-strong);
  background: var(--hover);
  transform: translateY(-1px);
}

.stack-chips-flat .stack-chip.chip-more {
  color: var(--muted-2);
  border-style: dashed;
}

/* ==========================================================================
   GALLERY / VISUAL ARCHIVE (Screenshot 3 Layout)
   ========================================================================== */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.text-button {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  background: transparent;
  cursor: pointer;
  transition: all 140ms ease;
}

.text-button:hover {
  border-color: var(--text-strong);
  color: var(--text-strong);
}

.text-button.is-active,
.text-button[aria-pressed="true"] {
  background: var(--text-strong) !important;
  color: var(--bg) !important;
  border-color: var(--text-strong) !important;
  font-weight: 600;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 26px;
}

@media (max-width: 680px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.gallery-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--card-shadow);
  transition: transform 220ms ease, border-color 180ms ease, box-shadow 220ms ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--card-shadow-hover);
}

.gallery-media {
  width: 100%;
  aspect-ratio: 16 / 11;
  min-height: 240px;
  overflow: hidden;
  background: var(--bg-alt);
}

.gallery-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms var(--ease-out);
}

.gallery-item:hover .gallery-media img {
  transform: scale(1.03);
}

.gallery-caption {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gallery-caption h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.35;
}

.gallery-meta {
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

/* ==========================================================================
   CINEMA CAROUSEL (Home page)
   ========================================================================== */
.project-carousel,
.cert-carousel {
  --project-card-width: clamp(480px, 64vw, 760px);
  --project-gap: 20px;
  position: relative;
  margin: 24px 0 36px;
  width: 100%;
}

@media (max-width: 640px) {
  .project-carousel,
  .cert-carousel {
    --project-card-width: 86vw;
    --project-gap: 12px;
  }
}

/* Phones benefit more from responsive input than from expensive compositing.
   Preserve the palette, spacing, and hierarchy while avoiding GPU-heavy blur
   layers and continuous decorative animations. */
@media (max-width: 700px) {
  .nav,
  .mobile-menu-drawer,
  .modal-overlay,
  .contact-modal,
  .certificate-modal,
  .gallery-lightbox,
  .tiktok-modal,
  .cookie-consent-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .bg-grid,
  .type-cursor,
  .term-cursor,
  .live-indicator,
  .tiktok-swipe-tutorial,
  .ugc-scroll-hint {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.project-carousel-window {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 16px 0;
}

.project-carousel-track {
  display: flex;
  align-items: center;
  gap: var(--project-gap);
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  transition: transform 420ms var(--ease-out);
}

.project-carousel-track.is-dragging {
  cursor: grabbing;
  transition: none;
}

.project-carousel-slide {
  flex: 0 0 var(--project-card-width);
  min-width: 0;
}

.project-cinema-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-alt);
  color: var(--text);
  text-align: left;
  opacity: 0.62;
  transform: scale(0.90);
  transform-origin: center;
  transition: transform 280ms ease, opacity 220ms ease, border-color 220ms ease, box-shadow 280ms ease;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

.cert-carousel {
  --project-card-width: clamp(280px, 50vw, 620px);
}

@media (max-width: 640px) {
  .cert-carousel {
    --project-card-width: min(86vw, 360px);
  }
}

.cert-cinema-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.38 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0d0f14;
  color: var(--text);
  text-align: left;
  opacity: 0.62;
  transform: scale(0.92);
  transform-origin: center;
  transition: transform 300ms ease, opacity 240ms ease, border-color 220ms ease, box-shadow 300ms ease;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

.cert-mobile-icon {
  display: none;
}

.cert-verify-btn {
  display: none;
}

.date-year {
  display: none;
}

.date-full {
  display: inline;
}

.project-cinema-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform 360ms ease;
}

.cert-cinema-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #090a0d;
  padding: 0;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-cinema-card:hover img {
  transform: scale(1.04);
}

[data-theme="light"] .cert-cinema-card {
  background: #171920;
}

[data-theme="light"] .cert-cinema-card img {
  background: #101217;
}

.cert-carousel-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #a4abb8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.project-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 10, 13, 0.05) 30%, rgba(9, 10, 13, 0.58) 65%, rgba(9, 10, 13, 0.96) 100%);
  pointer-events: none;
}

.project-card-copy {
  position: absolute;
  left: clamp(18px, 3vw, 30px);
  right: clamp(18px, 3vw, 30px);
  bottom: clamp(16px, 2.5vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  pointer-events: none;
}

.project-card-title {
  color: #f1f1ec;
  font-size: clamp(18px, 2.8vw, 28px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

.project-card-description {
  color: #c3c6c1;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 680px;
}

.project-carousel-slide.is-active .project-cinema-card,
.project-carousel-slide.is-active .cert-cinema-card {
  opacity: 1;
  transform: scale(1);
  border-color: var(--line-strong);
  box-shadow: var(--card-shadow-hover);
}

.project-carousel-slide.is-active .cert-cinema-card:hover {
  transform: scale(1.02);
  border-color: var(--text-strong);
}

.project-carousel-slide.is-active .cert-cinema-card:hover img {
  transform: scale(1.05);
}

.project-carousel-control {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 50%;
  background: #ffffff !important;
  color: #111318 !important;
  font-size: 19px;
  font-weight: 700;
  transform: translateY(-50%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 1;
  transition: opacity 350ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.project-carousel-control:hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.project-carousel-control:active {
  transform: translateY(-50%) scale(0.94);
}

.project-carousel-control-prev { left: 16px; }
.project-carousel-control-next { right: 16px; }

.project-carousel-control.is-idle-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-50%) scale(0.88);
}

[data-theme="light"] .project-carousel-control {
  background: #ffffff !important;
  border-color: #d0d3d8 !important;
  color: #111318 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .project-carousel-control:hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #111318 !important;
}

.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  transition: all 160ms ease;
  cursor: pointer;
}

.carousel-dot.is-active {
  background: var(--text-strong);
  width: 22px;
  border-radius: 999px;
}

/* ==========================================================================
   HOMEPAGE CERTIFICATIONS SECTION (#certifications.section)
   Unified clean card badges matching the mobile design preferred by user
   ========================================================================== */
#certifications.section {
  padding-bottom: 8px;
}

#certifications.section .cert-carousel {
  --project-card-width: 100%;
  margin: 16px 0 10px;
}

#certifications.section .cert-carousel .project-carousel-window {
  overflow: visible;
  padding: 0;
}

#certifications.section .cert-carousel .project-carousel-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  transform: none !important;
  cursor: default;
}

#certifications.section .cert-carousel .project-carousel-slide {
  flex: 0 1 220px;
  min-width: 200px;
  max-width: 250px;
  width: 100%;
}

#certifications.section .project-carousel-control,
#certifications.section .carousel-dots {
  display: none !important;
}

#certifications.section .cert-cinema-card {
  aspect-ratio: auto;
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 18px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  opacity: 1 !important;
  transform: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  height: 100%;
}

#certifications.section .cert-cinema-card:hover {
  transform: translateY(-3px) !important;
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] #certifications.section .cert-cinema-card {
  background: var(--card-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #certifications.section .cert-cinema-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

#certifications.section .cert-cinema-card > img {
  display: none !important; /* Hide large cover image across all viewports */
}

#certifications.section .cert-mobile-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  margin: 0 auto 12px;
  color: var(--text-strong);
  transition: border-color 180ms ease, transform 180ms ease;
}

#certifications.section .cert-cinema-card:hover .cert-mobile-icon {
  border-color: var(--line-strong);
  transform: scale(1.05);
}

#certifications.section .cert-mobile-icon svg {
  width: 22px;
  height: 22px;
}

#certifications.section .cert-mobile-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  transform: none;
}

#certifications.section .project-card-shade {
  display: none !important;
}

#certifications.section .project-card-copy {
  position: static;
  padding: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

#certifications.section .project-card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.35;
}

#certifications.section .cert-carousel-tag {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  order: 2;
}

#certifications.section .project-card-description {
  display: none !important;
}

#certifications.section .cert-verify-btn {
  display: inline-block !important;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 160ms ease;
}

#certifications.section .cert-cinema-card:hover .cert-verify-btn {
  color: var(--text-strong);
}

@media (max-width: 680px) {
  #certifications.section {
    padding-bottom: 6px;
  }
  #certifications.section .cert-carousel .project-carousel-track {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  #certifications.section .cert-carousel .project-carousel-slide {
    flex: 1 1 100%;
    max-width: 100%;
  }
  #google-developer-program.section {
    padding-top: 24px !important;
  }
}

/* ==========================================================================
   GOOGLE DEVELOPER PROGRAM BADGES SECTION
   ========================================================================== */
#google-developer-program.section {
  margin-top: 0;
  padding-top: 36px;
}

.google-badges-intro {
  margin: 12px 0 20px;
}

.google-badges-intro p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 680px;
}

.google-badges-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.google-badge-card {
  flex: 0 1 220px;
  min-width: 200px;
  max-width: 250px;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, box-shadow 220ms ease;
}

.google-badge-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
}

.google-badge-extra.is-badge-hidden {
  display: none !important;
}

.google-badge-extra.is-badge-revealed {
  display: flex !important;
  animation: badgeGlideDown 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.google-badge-extra.is-badge-revealed:nth-child(7) { animation-delay: 40ms; }
.google-badge-extra.is-badge-revealed:nth-child(8) { animation-delay: 90ms; }
.google-badge-extra.is-badge-revealed:nth-child(9) { animation-delay: 140ms; }
.google-badge-extra.is-badge-revealed:nth-child(10) { animation-delay: 190ms; }

.google-badge-extra.is-badge-collapsing {
  display: flex !important;
  animation: badgeGlideUp 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes badgeGlideDown {
  0% {
    opacity: 0;
    transform: translateY(-22px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes badgeGlideUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.95);
  }
}

.badge-btn-icon {
  display: inline-block;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#toggle-more-badges-btn[aria-expanded="true"] .badge-btn-icon {
  transform: rotate(180deg);
}

[data-theme="dark"] .google-badge-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .google-badge-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

/* Canvas / Top Half */
.google-badge-canvas {
  position: relative;
  width: 100%;
  height: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  background: var(--bg-alt);
  transition: background-color 200ms ease;
}

/* Pastel tints matching Google Developer profile badges */
.google-badge-canvas.tint-blue     { background: #dce7fe; }
.google-badge-canvas.tint-peach    { background: #faedd0; }
.google-badge-canvas.tint-lavender { background: #e0e7fd; }
.google-badge-canvas.tint-cream    { background: #fbeed3; }
.google-badge-canvas.tint-green    { background: #dbf0e2; }
.google-badge-canvas.tint-slate    { background: #e1e4ea; }

[data-theme="dark"] .google-badge-canvas.tint-blue     { background: #1c2738; }
[data-theme="dark"] .google-badge-canvas.tint-peach    { background: #2f251c; }
[data-theme="dark"] .google-badge-canvas.tint-lavender { background: #222538; }
[data-theme="dark"] .google-badge-canvas.tint-cream    { background: #2d2618; }
[data-theme="dark"] .google-badge-canvas.tint-green    { background: #1a2a22; }
[data-theme="dark"] .google-badge-canvas.tint-slate    { background: #23252a; }

.google-badge-menu {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 2px;
  pointer-events: none;
}

[data-theme="dark"] .google-badge-menu {
  color: rgba(255, 255, 255, 0.35);
}

.google-badge-icon-wrap {
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.google-badge-card:hover .google-badge-icon-wrap {
  transform: scale(1.08);
}

.google-badge-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
}

/* Info / Bottom Half */
.google-badge-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px 14px;
  background: #18191c;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 86px;
}

.google-badge-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.google-badge-date {
  font-size: 11px;
  color: #9aa0a6;
  letter-spacing: 0.02em;
}

@media (max-width: 680px) {
  .google-badges-grid {
    gap: 12px;
  }
  .google-badge-card {
    flex: 1 1 calc(50% - 8px);
    min-width: 145px;
    max-width: 100%;
  }
  .google-badge-canvas {
    height: 120px;
    padding: 12px 10px;
  }
  .google-badge-icon-wrap {
    width: 68px;
    height: 68px;
  }
  .google-badge-info {
    padding: 12px 10px 10px;
    min-height: 76px;
  }
  .google-badge-title {
    font-size: 12.5px;
  }
  .google-badge-date {
    font-size: 10.5px;
  }
}

@media (max-width: 380px) {
  .google-badge-card {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   STACK & BLOG CONTROLS
   ========================================================================== */
.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 170px;
  gap: 12px;
  margin: 24px 0 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--text-strong);
  padding: 0 13px;
  font-size: 14px;
}

.stack-page-groups {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 32px;
}

.stack-page-group {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.stack-page-group:last-child {
  border-bottom: none;
}

.stack-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 14px;
}

.stack-page-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: border-color 160ms ease, transform 160ms ease;
}

.stack-page-tags span:hover {
  border-color: var(--text-strong);
  color: var(--text-strong);
  transform: translateY(-1px);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stack-card {
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  box-shadow: var(--card-shadow);
  transition: border-color 160ms ease, transform 160ms ease;
}

.stack-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.stack-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.stack-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-strong);
  margin-bottom: 14px;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

/* Featured Blog Post */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease, padding-left 160ms ease;
}

.featured:hover {
  background: var(--hover);
  padding-left: 10px;
}

.featured h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 650;
  color: var(--text-strong);
}

.featured p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14.5px;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  margin-top: 10px;
}

/* ==========================================================================
   MODALS (Contact, Project Detail, Lightbox)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  background: var(--modal-backdrop);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 180ms ease;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-overlay.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.contact-card {
  position: relative;
  width: min(430px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
  padding: 32px 28px 28px;
  transform: translateY(8px) scale(0.985);
  transition: transform 180ms ease;
}

.modal-overlay.is-open .contact-card {
  transform: translateY(0) scale(1);
}

.contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
  color: var(--text-strong);
  font-size: 18px;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  transition: all 160ms ease;
}

.contact-close:hover {
  color: var(--bg);
  border-color: var(--text-strong);
  background: var(--text-strong);
}

.modal-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
  color: var(--text-strong);
  font-size: 18px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  transition: all 160ms ease;
}

.modal-close:hover {
  color: var(--bg);
  border-color: var(--text-strong);
  background: var(--text-strong);
}

.contact-kicker {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.contact-card h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 24px;
  line-height: 1.15;
}

.contact-note {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.contact-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-soft);
}

.contact-email-value {
  min-width: 0;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.contact-copy {
  min-width: 66px;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 5px;
  background: var(--text-strong);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: opacity 160ms ease;
}

.contact-copy:hover {
  opacity: 0.88;
}

.contact-mail-link {
  min-height: 46px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text-strong);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 160ms ease;
}

.contact-mail-link:hover {
  border-color: var(--text-strong);
  background: var(--hover);
}

/* Lightbox */
/* ==========================================================================
   SOCIAL MEDIA GALLERY MODAL (Instagram / Behance Style)
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  background: rgba(8, 9, 12, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms var(--ease-out), visibility 220ms var(--ease-out);
}

.lightbox[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: var(--card-bg);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  animation: modalPopIn 260ms var(--ease-out);
  max-height: 94vh;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Social Media Post Header */
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--card-bg);
  gap: 12px;
}

.lightbox-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  object-fit: cover;
  object-position: 48% 28%;
  flex-shrink: 0;
  background: var(--bg-soft);
  transition: border-color 500ms var(--ease-out);
}

.lightbox-user-meta {
  display: flex;
  flex-direction: column;
}

.lightbox-username {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-strong);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  margin-top: 2px;
  text-transform: uppercase;
}

.lightbox-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}

.lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-strong);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms ease;
}

.lightbox-close:hover {
  background: var(--text-strong);
  color: var(--bg);
  border-color: var(--text-strong);
}

/* Image Stage */
.lightbox-media-wrap {
  position: relative;
  width: 100%;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 260px;
  max-height: 52vh;
  border-bottom: 1px solid var(--line);
}

.lightbox-media-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.lightbox-media-box img {
  max-width: 100%;
  max-height: 48vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.lightbox-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--card-bg) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-strong);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 180ms ease;
}

.lightbox-control.prev {
  left: 12px;
}

.lightbox-control.next {
  right: 12px;
}

.lightbox-control:hover {
  background: var(--text-strong);
  color: var(--bg);
  border-color: var(--text-strong);
}

/* Social Media Post Description */
.lightbox-meta {
  padding: 16px 20px 18px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.lightbox-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.3;
}

.lightbox-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.lightbox-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

.lightbox-archive-link {
  color: var(--text-strong);
  text-decoration: none;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  transition: color 160ms ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lightbox-archive-link:hover {
  color: var(--text);
}

/* Project Detail Modal */
.project-modal-shell {
  position: relative;
  width: min(920px, 100%);
  max-height: min(86dvh, 840px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.modal-overlay.is-open .project-modal-shell {
  transform: translateY(0) scale(1);
}

.project-modal-scroll {
  max-height: min(86dvh, 840px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 40px);
}

.project-modal-img {
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-ratio, 16 / 9);
  max-height: 65dvh;
  margin-inline: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--bg-alt);
}
.project-modal-img img,
.project-modal-img video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.project-card-media img,
.project-card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-card-media .is-sliding-from-left { animation: projectMediaFromLeft 560ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes projectMediaFromLeft {
  from { transform: translateX(-100%); opacity: 0.55; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes projectMediaFromRight {
  from { transform: translateX(100%); opacity: 0.55; }
  to { transform: translateX(0); opacity: 1; }
}

.modal-media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card-bg, #ffffff);
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
  transition: all 180ms ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-media-nav:hover {
  background: var(--text-strong);
  color: var(--bg);
  transform: translateY(-50%) scale(1.08);
}

.modal-media-prev {
  left: 12px;
}

.modal-media-next {
  right: 12px;
}

.modal-media-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg, #ffffff);
  color: var(--text-strong);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  user-select: none;
  pointer-events: none;
}

.project-modal-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.project-modal-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.project-modal-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.project-modal-section h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.project-modal-section p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.project-modal-bullets {
  list-style: none;
  padding: 0;
}

.project-modal-bullets li {
  font-size: 14px;
  color: var(--muted);
  position: relative;
  padding-left: 18px;
  margin: 6px 0;
}

.project-modal-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--text-strong);
}

.project-modal-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: all 160ms ease;
}

.detail-btn:hover {
  background: var(--text-strong);
  color: var(--bg);
  border-color: var(--text-strong);
}

/* ==========================================================================
   CODE BLOCK WIDGET (Template Code Component matching attached screenshot)
   ========================================================================== */
.code-block-wrapper {
  margin: 26px 0;
  border-radius: 20px;
  background: #0d0f14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .code-block-wrapper {
  background: #111318;
  border-color: rgba(0, 0, 0, 0.14);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-block-lang {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  color: #f1f3f6;
  letter-spacing: -0.01em;
}

.code-block-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 160ms ease;
  position: relative;
}

.code-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.code-action-btn svg {
  width: 17px;
  height: 17px;
}

.code-copy-feedback {
  position: absolute;
  top: -28px;
  right: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 7px;
  background: #ffffff;
  color: #0c0d11;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: all 180ms ease;
  white-space: nowrap;
  font-weight: 600;
}

.code-copy-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.code-block-pre {
  margin: 0;
  padding: 18px 22px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #e2e8f0;
  background: transparent;
}

.code-block-pre code {
  font-family: inherit;
  font-size: inherit;
}

/* Architecture Diagram Preformatting */
.diagram-pre {
  margin: 0;
  padding: 22px 24px 26px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.44;
  color: #cbd5e1;
  background: transparent;
  white-space: pre;
  letter-spacing: 0;
}

.diagram-pre code {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}

.diag-frame { color: #64748b; font-weight: 500; }
.diag-title { color: #38bdf8; font-weight: 600; }
.diag-node  { color: #f8fafc; font-weight: 600; }
.diag-arrow { color: #c084fc; font-weight: 600; }
.diag-bullet { color: #34d399; }
.diag-sub   { color: #94a3b8; }

/* Syntax Tokens matching screenshot */
.token-comment { color: #6b7280; font-style: normal; }
.token-keyword { color: #818cf8; }
.token-builtin { color: #fb7185; }
.token-func { color: #93c5fd; }
.token-num { color: #fb7185; }
.token-var { color: #e2e8f0; }
.token-punct { color: #94a3b8; }

/* ==========================================================================
   BLOG / ARTICLE READER MODAL
   ========================================================================== */
.article-modal-shell {
  width: min(860px, 100%);
  max-width: 100%;
  max-height: min(92vh, 900px);
  background: var(--card-bg);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: auto;
  animation: modalPopIn 260ms var(--ease-out);
}

.article-modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  flex-shrink: 0;
}

.article-modal-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.article-modal-scroll {
  padding: 32px clamp(20px, 4vw, 48px) 48px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.article-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.article-title {
  font-size: clamp(23px, 3.4vw, 34px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 12px 0 16px;
}

.article-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
}

.article-meta-tag {
  color: var(--text-strong);
  font-weight: 600;
}

.article-body {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--text);
}

.article-body p {
  margin-bottom: 20px;
}

.article-lead {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-strong);
  font-weight: 450;
}

.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.article-body ul {
  margin: 14px 0 22px 24px;
  padding: 0;
}

.article-body li {
  margin-bottom: 9px;
  line-height: 1.65;
}

.article-body .asset-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--text-strong);
  font-weight: 500;
}

.article-callout {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--text-strong);
  background: var(--bg-alt);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-strong);
}

.content-row[data-blog-id] {
  cursor: pointer;
}

/* ==========================================================================
   GITHUB CONTRIBUTION GRAPH & ACTIVITY (Section 06)
   ========================================================================== */
.github-panel {
  padding: 10px 0 0;
}

.github-calendar-shell {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 20px;
  box-shadow: var(--card-shadow);
  transition: var(--trans-theme), box-shadow 350ms var(--ease-out);
  position: relative;
}

.github-calendar-shell:hover {
  border-color: var(--line-strong);
  box-shadow: var(--card-shadow-hover);
}

.github-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.github-user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.github-avatar-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.github-user-meta {
  display: flex;
  flex-direction: column;
}

.github-handle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.2;
}

.github-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.github-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-strong);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 180ms ease;
  white-space: nowrap;
}

.github-link-btn:hover {
  background: var(--text-strong);
  color: var(--bg);
  border-color: var(--text-strong);
}

.github-card-bio {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 680px;
}

/* Quick Metrics Row */
.github-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 768px) {
  .github-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.github-metric-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 180ms ease, transform 180ms ease;
}

.github-metric-box:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.github-metric-num {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.github-metric-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Pinned Repositories Grid (2x2 on Desktop, 1 Col on Mobile) */
.github-pinned-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.github-pinned-title {
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.github-pinned-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 680px) {
  .github-pinned-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.github-repo-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.github-repo-card:hover {
  border-color: var(--text-strong);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .github-repo-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.github-repo-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.github-repo-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.github-repo-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted-2);
}

.github-repo-name {
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-strong);
  word-break: break-word;
}

.github-repo-badge {
  font-size: 9.5px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.github-repo-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 14px;
  flex-grow: 1;
}

.github-repo-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-2);
}

.github-repo-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.github-lang-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.github-lang-dot.lang-python { background-color: #3572A5; }
.github-lang-dot.lang-js { background-color: #f1e05a; }
.github-lang-dot.lang-php { background-color: #4F5D95; }
.github-lang-dot.lang-ts { background-color: #3178c6; }

/* 100% Width Responsive Activity Overview (Zero Horizontal Sliding) */
.github-activity-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  width: 100%;
}

.github-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.github-activity-title {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-strong);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.github-activity-sub {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--muted-2);
}

/* 12-Month Responsive Grid that stretches 100% without overflowing */
.github-activity-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 8px);
  width: 100%;
  margin-bottom: 10px;
}

.github-month-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.github-month-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  transition: transform 140ms ease, border-color 140ms ease;
}

.github-month-cell:hover {
  transform: scale(1.15);
  border-color: var(--text-strong);
  z-index: 2;
}

.github-month-cell[data-level="0"] { background: var(--bg-alt); }
.github-month-cell[data-level="1"] { background: color-mix(in srgb, var(--text-strong) 25%, var(--bg-alt)); }
.github-month-cell[data-level="2"] { background: color-mix(in srgb, var(--text-strong) 50%, var(--bg-alt)); }
.github-month-cell[data-level="3"] { background: color-mix(in srgb, var(--text-strong) 75%, var(--bg-alt)); }
.github-month-cell[data-level="4"] { background: var(--text-strong); }

.github-month-text {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--muted-2);
  text-transform: uppercase;
  margin-top: 4px;
}

.github-calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  flex-wrap: wrap;
  gap: 10px;
}

.github-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  text-transform: uppercase;
}

.github-legend-squares {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.github-legend-cell {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.github-legend-cell[data-level="0"] { background: var(--bg-alt); border: 1px solid var(--line); }
.github-legend-cell[data-level="1"] { background: color-mix(in srgb, var(--text-strong) 25%, var(--bg-alt)); }
.github-legend-cell[data-level="2"] { background: color-mix(in srgb, var(--text-strong) 50%, var(--bg-alt)); }
.github-legend-cell[data-level="3"] { background: color-mix(in srgb, var(--text-strong) 75%, var(--bg-alt)); }
.github-legend-cell[data-level="4"] { background: var(--text-strong); }

.github-stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.github-stats-bar .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   HOMEPAGE GALLERY SHOWCASE (Section 07)
   ========================================================================== */
.home-gallery-intro {
  margin-bottom: 24px;
}

.home-gallery-intro p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 640px;
}

.home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 24px;
}

@media (min-width: 900px) {
  .home-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .home-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }
  .home-gallery-card {
    border-radius: 12px;
  }
  .home-gallery-thumb {
    min-height: 0;
  }
  .home-gallery-info {
    padding: 10px 10px 12px;
    gap: 4px;
  }
  .home-gallery-tag {
    font-size: 8.5px;
  }
  .home-gallery-title {
    font-size: 12px;
    line-height: 1.3;
  }
}

@media (max-width: 420px) {
  .home-gallery-grid {
    gap: 8px;
  }
  .home-gallery-card {
    border-radius: 10px;
  }
  .home-gallery-info {
    padding: 8px 8px 10px;
  }
  .home-gallery-tag {
    font-size: 8px;
  }
  .home-gallery-title {
    font-size: 11px;
    line-height: 1.25;
  }
}

.home-gallery-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--card-shadow);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out), border-color 200ms ease;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  padding: 0;
}

.home-gallery-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: var(--card-shadow-hover);
}

.home-gallery-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}

.home-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms var(--ease-out);
}

.home-gallery-card:hover .home-gallery-thumb img {
  transform: scale(1.04);
}

.home-gallery-info {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.home-gallery-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.home-gallery-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
  margin: 0;
}

.home-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 12px;
}

.home-gallery-hint {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   FOOTER (francisconavalta.com layout)
   ========================================================================== */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 48px 64px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  position: relative;
  z-index: 1;
  transition: var(--trans-theme);
}

.footer-left .cta {
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 650;
  line-height: 1.08;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.footer-left .sub {
  font-size: clamp(18px, 2.7vw, 27px);
  line-height: 1.3;
  color: var(--muted);
}

.footer-mid {
  font-size: clamp(16px, 2.4vw, 24px);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-mid a {
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-mid a:hover {
  text-decoration: underline;
}

.footer-right {
  font-size: clamp(15px, 2vw, 20px);
  color: var(--muted-2);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-right .back-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-strong);
  margin-left: 0;
}



/* ==========================================================================
   06: SPOTLIGHT 3D CARD DECK & CERTIFICATIONS
   Based on bryllim.com / bryl-minimal-design
   ========================================================================== */
.deck-section {
  padding: 32px 0 24px;
  position: relative;
  overflow: hidden;
}

.deck {
  position: relative;
  height: 29rem;
  max-width: var(--max);
  margin: 24px auto 28px;
  overflow: hidden;
  perspective: 1200px;
}

@media (min-width: 640px) {
  .deck { height: 32rem; }
}

@media (min-width: 768px) {
  .deck { margin-inline: auto; height: 33rem; }
}

.deck-card {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  width: 21rem;
  margin-left: -10.5rem;
  transform-origin: center bottom;
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  outline: none;
  background: var(--card-bg);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .deck-card {
    width: 26rem;
    margin-left: -13rem;
    padding: 22px 24px;
  }
}

/* Slot classes with hardware-accelerated 3D transforms */
.deck-card.is-center {
  transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  z-index: 30;
  box-shadow: 0 20px 48px -18px rgba(10, 10, 10, 0.28);
  cursor: default;
  opacity: 1;
  visibility: visible;
}

[data-theme="dark"] .deck-card.is-center {
  box-shadow: 0 24px 55px -18px rgba(0, 0, 0, 0.85);
  border-color: var(--line-strong);
}

.deck-card.is-left {
  transform: translate3d(-40%, 18px, 0) rotate(-14deg) scale(0.88);
  z-index: 10;
  box-shadow: 0 12px 28px -14px rgba(10, 10, 10, 0.18);
  cursor: pointer;
  opacity: 0.85;
  visibility: visible;
}

[data-theme="dark"] .deck-card.is-left {
  box-shadow: 0 14px 32px -16px rgba(0, 0, 0, 0.65);
}

.deck-card.is-right {
  transform: translate3d(40%, 18px, 0) rotate(14deg) scale(0.88);
  z-index: 20;
  box-shadow: 0 12px 28px -14px rgba(10, 10, 10, 0.18);
  cursor: pointer;
  opacity: 0.85;
  visibility: visible;
}

[data-theme="dark"] .deck-card.is-right {
  box-shadow: 0 14px 32px -16px rgba(0, 0, 0, 0.65);
}

.deck-card.is-hidden {
  transform: translate3d(0, 40px, 0) scale(0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
}

/* Dim overlay for back cards */
.deck-card.is-left::after,
.deck-card.is-right::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.46);
  transition: background 360ms ease;
  pointer-events: none;
}

[data-theme="dark"] .deck-card.is-left::after,
[data-theme="dark"] .deck-card.is-right::after {
  background: rgba(13, 14, 17, 0.58);
}

.deck-card.is-left:hover::after,
.deck-card.is-right:hover::after {
  background: transparent;
}

/* Hover lifts */
.deck-card.is-center:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 36px 70px -20px rgba(10, 10, 10, 0.35);
}

[data-theme="dark"] .deck-card.is-center:hover {
  box-shadow: 0 36px 72px -18px rgba(0, 0, 0, 0.95);
}

.deck-card.is-left:hover {
  transform: translateX(-46%) translateY(4px) rotate(-11deg) scale(0.92);
  z-index: 25;
}

.deck-card.is-right:hover {
  transform: translateX(46%) translateY(4px) rotate(11deg) scale(0.92);
  z-index: 25;
}

/* Only center card links are active */
.deck-card:not(.is-center) a,
.deck-card:not(.is-center) button {
  pointer-events: none;
}

/* Certificate & Project Preview Container inside Deck Card */
.deck-cert-preview,
.deck-media-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  margin-bottom: 12px;
  cursor: pointer;
  display: block;
  padding: 0;
  text-align: left;
}

.deck-cert-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  display: block;
  transition: transform 420ms var(--ease-out);
}

.deck-media-preview img,
.deck-media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 420ms var(--ease-out);
}

[data-theme="dark"] .deck-cert-preview img {
  background: #0f1013;
}

.deck-card.is-center:hover .deck-cert-preview img,
.deck-card.is-center:hover .deck-media-preview img,
.deck-card.is-center:hover .deck-media-preview video {
  transform: scale(1.03);
}

.deck-cert-lens {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(14, 16, 22, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.deck-card.is-center:hover .deck-cert-lens {
  opacity: 1;
}

/* Deck Controls (Arrows & Dots) */
.deck-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 6px;
  margin-bottom: 12px;
}

/* Reduced gap between Projects and AI UGC showcase */
#ai-ugc.section {
  padding-top: 20px;
}

@media (max-width: 768px) {
  #projects .deck-controls-bar {
    margin-bottom: 8px;
  }
  #ai-ugc.section {
    padding-top: 16px;
  }
}

.deck-arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
  background: #ffffff !important;
  color: #111318 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  opacity: 1;
  transition: opacity 350ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.deck-arrow-btn:hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  transform: scale(1.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.deck-arrow-btn:active {
  transform: scale(0.94);
}

.deck-arrow-btn.is-idle-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.88);
}

[data-theme="light"] .deck-arrow-btn {
  background: #ffffff !important;
  border-color: #d0d3d8 !important;
  color: #111318 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .deck-arrow-btn:hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #111318 !important;
}

.deck-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.deck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--line-strong);
  cursor: pointer;
  transition: all 220ms ease;
}

.deck-dot.is-active {
  width: 22px;
  border-radius: 9999px;
  background: var(--text-strong);
}

/* Card badges */
.deck-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.badge-inverted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--text-strong);
  color: var(--bg);
  padding: 3.5px 10px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-leaf {
  font-size: 11px;
  line-height: 1;
  opacity: 0.85;
}

.badge-outline {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Card content row */
.deck-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.deck-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.deck-icon img,
.deck-icon svg {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.deck-head h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.28;
  margin: 0;
}

.deck-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 16px;
  flex: 1;
}

.deck-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.deck-verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-strong);
  transition: opacity 160ms ease, color 160ms ease;
}

.deck-verify-btn:hover {
  opacity: 0.8;
}

.deck-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Certificate Grid (Below deck) */
.cert-folder-sections {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 24px;
}

.cert-folder-group { min-width: 0; }

.cert-folder-title {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-strong);
  font: 600 14px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cert-folder-group .certs-grid { margin-top: 0; }

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.cert-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.cert-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--card-shadow);
}

.cert-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cert-card-top .cert-issuer {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.cert-card-top .cert-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
}

.cert-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 8px;
  line-height: 1.35;
}

.cert-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
  flex: 1;
}

.cert-card-footer {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
}

.cert-card-footer .deck-verify-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: auto;
  justify-content: flex-end;
  white-space: nowrap;
}

.cert-card-footer > span { min-width: 0; overflow-wrap: anywhere; }

.cert-card-footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-strong);
}

.cert-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  margin-bottom: 14px;
  cursor: pointer;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
}

.cert-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  display: block;
  transition: transform 300ms var(--ease-out);
}

[data-theme="dark"] .cert-card-thumb img {
  background: #0f1013;
}

.cert-card:hover .cert-card-thumb img {
  transform: scale(1.04);
}

/* ==========================================================================
   CERTIFICATE VIEWER MODAL (Full Resolution, High Definition)
   ========================================================================== */
#certificate-modal {
  z-index: 10000;
}

#certificate-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: flex !important;
}

.cert-modal-shell {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 94vh;
  background: var(--card-bg);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  animation: modalPopIn 260ms var(--ease-out);
  margin: auto;
}

.cert-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card-bg);
  gap: 16px;
  flex-wrap: wrap;
}

.cert-modal-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cert-modal-seal {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  flex-shrink: 0;
}

.cert-modal-titles {
  display: flex;
  flex-direction: column;
}

.cert-modal-issuer {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cert-modal-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-strong);
  line-height: 1.25;
}

.cert-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.cert-modal-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.cert-modal-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 280px;
  max-height: calc(90vh - 170px);
  background: #08080a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

[data-theme="light"] .cert-modal-stage {
  background: #121316;
}

.cert-modal-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-modal-img {
  max-width: 100%;
  max-height: calc(90vh - 190px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75);
  user-select: none;
  cursor: zoom-in;
  transition: transform 220ms ease;
}

.cert-modal-img:hover {
  transform: scale(1.02);
}

.cert-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18, 19, 23, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 180ms ease;
  line-height: 1;
  padding: 0;
}

.cert-modal-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.cert-modal-nav.prev { left: 16px; }
.cert-modal-nav.next { right: 16px; }

.cert-modal-meta {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cert-modal-desc-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 620px;
}

.cert-modal-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.cert-modal-signers {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.03em;
}

.cert-modal-open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-strong);
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  text-decoration: none;
  transition: all 160ms ease;
  white-space: nowrap;
}

.cert-modal-open-link:hover {
  background: var(--text-strong);
  color: var(--bg);
}

@media (max-width: 680px) {
  .cert-modal-shell {
    width: 96vw;
    max-height: 96vh;
    border-radius: 14px;
  }
  .cert-modal-head {
    padding: 10px 14px;
    gap: 8px;
  }
  .cert-modal-title {
    font-size: 12px;
  }
  .cert-modal-stage {
    min-height: 220px;
    max-height: 52vh;
    padding: 10px;
  }
  .cert-modal-img {
    max-height: 48vh;
  }
  .cert-modal-meta {
    padding: 10px 14px;
  }
  .cert-modal-desc {
    font-size: 11px;
  }
  .cert-modal-nav {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 320px 1fr; gap: 40px; padding: 60px 32px 40px; }
  .stats { padding: 0 32px; grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .project-row-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .project-row-card .row-meta {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  footer {
    padding: 48px 32px;
    grid-template-columns: 1fr 1fr;
  }
  .footer-right {
    grid-column: span 2;
    text-align: left;
  }
  .footer-right .back-top {
    margin-left: 0;
  }
}

@media (max-width: 960px) {
  :root {
    --header-h: 60px;
  }
  header.nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 20px !important;
    height: var(--header-h) !important;
    min-height: var(--header-h) !important;
  }
  .brand-left {
    margin-right: 0 !important;
  }
  nav.links {
    display: none !important;
  }
  .header-right-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }
  .menu-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .theme-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin-top: 0 !important;
  }
  .mobile-menu-drawer {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 80;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 220ms var(--ease-out);
    border-bottom: 1px solid var(--line);
  }
  .mobile-menu-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .mobile-nav-list a,
  .mobile-nav-list button {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
  }
  .mobile-nav-list a.is-active,
  .mobile-nav-list a:hover,
  .mobile-nav-list button:hover {
    color: var(--text-strong);
  }

  /* Page & Section Container Spacing */
  .page, .section {
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 44px;
    padding-bottom: 24px;
  }

  /* Section Header on Mobile */
  .section-head {
    padding-bottom: 14px;
    margin-bottom: 20px;
    align-items: center;
    gap: 12px;
  }
  .section-head .eyebrow {
    font-size: 16px;
    font-weight: 600;
  }
  .view-link {
    font-size: 12px;
    letter-spacing: 0.05em;
    font-weight: 600;
  }

  /* Hero Section on Mobile */
  .hero { grid-template-columns: 1fr; padding: 32px 20px 24px; gap: 20px; position: relative; overflow: hidden; }
  .hero::before {
    content: ''; position: absolute; inset: 0 0 auto; height: 320px;
    background-image: radial-gradient(rgba(10, 10, 10, 0.12) 1.2px, transparent 1.2px);
    background-size: 10px 10px;
    mask-image: radial-gradient(ellipse at 50% 32%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 32%, black 20%, transparent 75%);
    pointer-events: none; z-index: 0;
  }
  [data-theme="dark"] .hero::before { background-image: radial-gradient(rgba(244, 244, 245, 0.15) 1.2px, transparent 1.2px); }
  .avatar-wrap { max-width: 240px; margin: 0 auto; aspect-ratio: 2016 / 2112; border-radius: 14px; position: relative; z-index: 1; }
  .hero-copy { position: relative; z-index: 1; text-align: left; }
  .hero-copy h1 { font-size: 38px !important; line-height: 1.05 !important; margin: 0 0 10px !important; }
  .hero-role { font-size: 18px; min-height: 30px; margin: 0 0 16px; line-height: 1.35; }
  .hero-copy p { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
  .social-row { margin-top: 18px; gap: 20px; font-size: 12.5px; }
  .stats { padding: 0 20px; display: grid !important; grid-template-columns: repeat(2, 1fr) !important; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
  .stats::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 48%;
    background-image: radial-gradient(rgba(10, 10, 10, 0.08) 1px, transparent 1px);
    background-size: 10px 10px;
    mask-image: radial-gradient(circle at 15% 45%, black 15%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 15% 45%, black 15%, transparent 80%);
    pointer-events: none; z-index: 0;
  }
  [data-theme="dark"] .stats::before { background-image: radial-gradient(rgba(244, 244, 245, 0.10) 1px, transparent 1px); }
  .stat { padding: 20px 14px; border: none; position: relative; z-index: 1; }
  .stat:nth-child(1) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .stat:nth-child(3) { border-right: 1px solid var(--line); }
  .stat .num-row { gap: 4px; margin-bottom: 4px; }
  .stat .num { font-size: 26px; font-family: var(--font-display); font-weight: 400; color: var(--text-strong); line-height: 1.1; }
  .stat .label { display: none; }
  .stat .chev { font-size: 13px; color: var(--muted-2); }
  .stat .sub { font-size: 10.5px; font-family: var(--font-mono); color: var(--muted-2); letter-spacing: 0.08em; text-transform: uppercase; }

  /* Section 01 — blog: Clean horizontal rows (Screenshot 1) */
  #blog .content-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title date"
      "desc  desc";
    row-gap: 5px;
    column-gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
  }
  #blog .content-row:hover {
    padding-left: 0;
    background: transparent;
  }
  #blog .content-row .row-main {
    display: contents;
  }
  #blog .content-row .row-main h3 {
    grid-area: title;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-strong);
    margin: 0;
  }
  #blog .content-row .row-meta {
    grid-area: date;
    font-size: 12.5px;
    font-family: var(--font-mono);
    color: var(--muted-2);
    white-space: nowrap;
    text-align: right;
  }
  #blog .content-row .row-main p {
    grid-area: desc;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #blog .content-row .meta-line {
    display: none;
  }

  /* Section 02 — projects: Spotlight 3D Card Deck on Mobile (Screenshot 1) */
  .deck {
    height: 31rem;
    perspective: 1000px;
    margin: 16px auto 20px;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
  }
  .deck-card {
    width: min(84vw, 320px);
    margin-left: calc(min(84vw, 320px) / -2);
    border-radius: 18px;
    padding: 16px 16px 18px;
    top: 0.25rem;
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
    will-change: transform, opacity;
  }
  .deck-card.is-center {
    transform: translate3d(0, 0, 0) scale(1);
    z-index: 30;
    box-shadow: 0 14px 36px -12px rgba(10, 10, 10, 0.16);
    opacity: 1;
    visibility: visible;
  }
  [data-theme="dark"] .deck-card.is-center {
    box-shadow: 0 18px 42px -14px rgba(0, 0, 0, 0.85);
  }
  .deck-card.is-left {
    transform: translate3d(-36%, 10px, 0) rotate(-6deg) scale(0.88);
    z-index: 10;
    opacity: 0.5;
    visibility: visible;
  }
  .deck-card.is-right {
    transform: translate3d(36%, 10px, 0) rotate(6deg) scale(0.88);
    z-index: 10;
    opacity: 0.5;
    visibility: visible;
  }
  .deck-card.is-hidden {
    transform: translate3d(0, 30px, 0) scale(0.7);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .deck-badges {
    margin-bottom: 10px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .deck-badges .badge-inverted,
  .deck-badges .badge-outline {
    font-size: 9px;
    padding: 3px 8px;
    letter-spacing: 0.05em;
  }
  .deck-media-preview {
    height: 145px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .deck-head h3 {
    font-size: 15.5px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
  }
  .deck-desc {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .deck-actions {
    margin-top: auto;
  }
  .deck-verify-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 12px;
    border-radius: 8px;
  }
  .deck-hint {
    display: none;
  }

  /* Section 03 — journey: Clean 2-Line Role Rows (Screenshot 2) */
  #journey .timeline-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "year title"
      "blank company";
    column-gap: 12px;
    row-gap: 2px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
  }
  #journey .timeline-meta-col {
    display: contents;
  }
  #journey .timeline-date {
    grid-area: year;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--muted-2);
  }
  #journey .timeline-date .date-full {
    display: none;
  }
  #journey .timeline-date .date-year {
    display: inline;
  }
  #journey .timeline-location {
    display: none;
  }
  #journey .timeline-body {
    display: contents;
  }
  #journey .timeline-body h3 {
    grid-area: title;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.35;
    margin: 0;
  }
  #journey .timeline-body .org {
    grid-area: company;
    font-size: 13.5px;
    color: var(--muted);
    font-family: var(--font-sans);
    margin: 0;
  }
  #journey .timeline-body .org-name {
    color: var(--muted);
  }
  #journey .timeline-body .org-tag {
    display: none;
  }
  #journey .timeline-bullets {
    display: none;
  }

  /* STACK: Unified Pill Cloud (Screenshot 2) */
  #stack.section .stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  #stack.section .stack-card {
    display: contents;
  }
  #stack.section .stack-kicker,
  #stack.section .stack-title {
    display: none;
  }
  #stack.section .stack-chips {
    display: contents;
  }
  #stack.section .stack-chip {
    padding: 6px 13px;
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--text);
    font-family: var(--font-sans);
  }
  #stack.section .stack-chip.chip-more {
    border-style: dashed;
    color: var(--muted-2);
  }

  /* Projects & Gallery Pages on Mobile */
  .project-row-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .controls {
    grid-template-columns: 1fr;
  }
  footer {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 20px;
  }
  .footer-right {
    grid-column: span 1;
  }
}

/* ==========================================================================
   EXTRA COMPACT PHONE BREAKPOINT (≤ 520px)
   ========================================================================== */
@media (max-width: 520px) {
  .hero { padding: 28px 16px 20px; }
  .avatar-wrap { max-width: 220px; }
  .hero-copy h1 { font-size: 34px !important; }
  .stats { padding: 0 16px; }
  :root {
    --header-h: 56px;
  }
  header.nav {
    padding: 0 16px !important;
    height: var(--header-h) !important;
    min-height: var(--header-h) !important;
  }
  .brand-name {
    font-size: 14.5px;
    letter-spacing: -0.01em;
  }
  .theme-toggle,
  .menu-toggle {
    width: 38px;
    height: 38px;
  }
  .modal-overlay {
    padding: 10px 8px;
    align-items: center;
    overflow-x: hidden;
  }
  .article-modal-shell,
  .project-modal-shell,
  .lightbox-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px !important;
    margin: 0 !important;
    overflow: hidden;
  }
  .contact-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    padding: 24px 18px !important;
    margin: 0 !important;
  }
  .article-modal-head,
  .project-modal-head {
    padding: 12px 16px;
  }
  .article-modal-scroll {
    padding: 18px 16px 36px;
    overflow-x: hidden;
  }
  .article-title {
    font-size: clamp(20px, 5.5vw, 26px) !important;
    line-height: 1.25 !important;
    margin: 8px 0 12px !important;
  }
  .article-meta-line {
    font-size: 11px;
    gap: 8px 10px;
  }
  .article-body {
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
  }
  .article-lead {
    font-size: 16px;
    line-height: 1.65;
  }
  .code-block-wrapper {
    margin: 16px 0;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .code-block-pre {
    font-size: 12px;
    padding: 14px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .diagram-pre {
    font-size: 11px;
    padding: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* ==========================================================================
   MOBILE READABILITY FIXES (phones & small tablets)
   Collapse desktop two-column rows so text no longer squeezes into a
   narrow strip or clips at the viewport edge.
   ========================================================================== */
@media (max-width: 820px) {
  /* Blog featured post + list rows: stack content over meta */
  .featured {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .content-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .content-row .row-meta,
  .featured .row-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    text-align: left;
    gap: 6px 14px;
  }
  .featured h2 {
    font-size: 19px;
  }

  /* Journey timeline: single readable column */
  .timeline-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 26px 0;
  }
  .timeline-meta-col {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
  }
  .timeline-row h2,
  .timeline-row h3 {
    overflow-wrap: anywhere;
  }

  /* Project cards: thumb on top, then text, then meta */
  .project-row-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .project-row-card .thumb {
    width: 100%;
    max-width: 100%;
  }
  .project-row-card .row-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    text-align: left;
    gap: 6px 14px;
  }
}

@media (max-width: 520px) {
  .featured h2 {
    font-size: 18px;
  }
  .row-main h2,
  .row-main h3 {
    font-size: 17px;
  }
}


/* ==========================================================================
   AI UGC VIDEOS & TIKTOK-STYLE REEL SHOWCASE
   ========================================================================== */

/* Index Showcase Section */
.ugc-index-grid {
  display: flex;
  gap: 20px;
  margin-top: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  padding-top: 4px;
  padding-left: 2px;
  padding-right: 2px;
  scroll-padding: 0 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

.ugc-index-grid::-webkit-scrollbar {
  height: 6px;
}

.ugc-index-grid::-webkit-scrollbar-track {
  background: transparent;
}

.ugc-index-grid::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}

.ugc-index-card {
  flex: 0 0 clamp(240px, 32vw, 340px);
  scroll-snap-align: start;
}

@media (max-width: 768px) {
  .ugc-index-grid {
    gap: 14px;
    scroll-padding: 0 12px;
  }
  .ugc-index-card {
    flex: 0 0 clamp(220px, 55vw, 280px);
    scroll-snap-align: start;
  }
}

@media (max-width: 480px) {
  .ugc-index-grid {
    gap: 12px;
    scroll-padding: 0 12px;
  }
  .ugc-index-card {
    flex: 0 0 78vw;
    scroll-snap-align: start;
  }
}

.ugc-index-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out), border-color 320ms;
}

.ugc-index-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--line-strong);
}

.ugc-video-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 19px;
  background: var(--skeleton-base);
  background-image: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
}

.ugc-index-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 19px;
  display: block;
  pointer-events: none;
}

.ugc-card-top-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ugc-play-pause-btn,
.ugc-sound-toggle-btn {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.ugc-play-pause-btn:hover,
.ugc-sound-toggle-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
}

.ugc-play-pause-btn:active,
.ugc-sound-toggle-btn:active {
  transform: scale(0.88);
}

.ugc-play-pause-btn svg,
.ugc-sound-toggle-btn svg {
  width: 16px;
  height: 16px;
  stroke: #ffffff;
  fill: none;
}

.ugc-play-pause-btn svg.fill-icon {
  fill: #ffffff;
}

.ugc-card-client-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 64px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ugc-client-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.ugc-card-bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.68) 60%, transparent 100%);
  border-bottom-left-radius: 19px;
  border-bottom-right-radius: 19px;
  color: #fff;
  z-index: 4;
}

.ugc-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin-bottom: 6px;
}

.ugc-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================================
   AI UGC DEDICATED PAGE (ai-ugc.html)
   ========================================================================== */

/* Client Selector Hub */
.client-hub-container {
  margin-top: 32px;
  margin-bottom: 30px;
}

/* Centered Brand Selector Hub (All Brands Visible on Grid) */
.client-hub-container {
  margin-top: 28px;
  margin-bottom: 28px;
  width: 100%;
}

.client-hub-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.brand-hub-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1024px) {
  .brand-hub-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .brand-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .brand-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}

/* Video Portfolio Category Rail on gallery.html */
.vp-category-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
  margin-bottom: 24px;
}

.vp-category-rail .brand-badge-btn {
  flex: 1 1 calc(20% - 10px);
  min-width: 120px;
  padding: 12px 10px 10px;
  max-width: calc(20% - 10px);
}

@media (max-width: 1024px) {
  .vp-category-rail .brand-badge-btn {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 110px;
    max-width: calc(33.333% - 10px);
    padding: 10px 8px;
  }
}

@media (max-width: 768px) {
  .vp-category-rail .brand-badge-btn {
    flex: 1 1 calc(50% - 10px);
    min-width: 100px;
    max-width: calc(50% - 10px);
    padding: 9px 7px;
  }
}

@media (max-width: 480px) {
  .vp-category-rail .brand-badge-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 90px;
    max-width: calc(50% - 8px);
    padding: 8px 6px;
    font-size: 11px;
  }
}


/* Centered & Comfortable Clickable Brand Badges */
.brand-badge-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px 10px;
  border-radius: 16px;
  border: 1.5px solid var(--line-strong);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: transform 250ms var(--ease-out), border-color 250ms, box-shadow 250ms, background 250ms;
  user-select: none;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.brand-badge-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--text-strong);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.18);
}

.brand-badge-btn:active {
  transform: translateY(0) scale(0.96);
}

.brand-badge-btn.is-active {
  background: var(--text-strong);
  color: var(--bg);
  border-color: var(--text-strong);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.35);
}

.brand-logo-frame {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 4px;
  margin-bottom: 7px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 260ms ease;
}

.brand-badge-btn:hover .brand-logo-frame {
  transform: rotate(-5deg) scale(1.1);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-meta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.brand-name-text {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.brand-subtitle-text {
  font-size: 9.5px;
  opacity: 0.68;
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.brand-count-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.16);
  margin-top: 4px;
}

.brand-badge-btn.is-active .brand-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}

/* Feed Status Toolbar */
.ugc-feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.ugc-feed-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ugc-feed-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* High-Performance 3-Column Video Feed Grid */
.ugc-tiktok-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  position: relative;
}

@media (min-width: 1100px) {
  .ugc-tiktok-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .ugc-tiktok-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .ugc-tiktok-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* Highly Optimized, GPU-Accelerated Video Reel Card (Lag-Free & Zero Blank Void) */
.ugc-reel-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: #090a0f;
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out), border-color 250ms, opacity 280ms var(--ease-out);
}

.ugc-reel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.35);
  border-color: var(--text-strong);
}

.ugc-reel-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card Rearranging Fluid Shuffle Animation */
@keyframes cardRearrangeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ugc-reel-card.is-rearranging {
  animation: cardRearrangeIn 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ugc-reel-card.is-hidden-reel {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Play Center Overlay Indicator */
.ugc-reel-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(10, 12, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  transition: all 220ms var(--ease-out);
  pointer-events: none;
  z-index: 3;
}

.ugc-reel-card:hover .ugc-reel-play-indicator {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px), (pointer: coarse) {
  .ugc-reel-play-indicator {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

/* Card Top Pill Bar - Solid High-Performance (No GPU blur lag) */
.ugc-card-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
}

.ugc-client-tag {
  background: rgba(10, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
}

.ugc-inline-logo {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
  margin-right: 5px;
  flex-shrink: 0;
}

.ugc-format-badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 12px;
}

/* TikTok Floating Side Actions - Lag-Free */
.ugc-side-actions {
  position: absolute;
  right: 10px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 4;
}

.ugc-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 12, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: transform 180ms ease, color 180ms ease;
}

.ugc-action-btn:hover {
  transform: scale(1.14);
}

.ugc-action-btn.is-liked {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.8);
}

.ugc-action-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  margin-top: -6px;
}

/* Card Bottom Info Overlay */
.ugc-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.72) 65%, transparent 100%);
  color: #fff;
  z-index: 3;
}

.ugc-reel-caption {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.32;
  color: #fff;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ugc-tools-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.ugc-tool-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

/* 3-Column Mobile Scaling */
@media (max-width: 768px) {
  .ugc-reel-card {
    border-radius: 13px;
  }
  .ugc-card-top {
    top: 7px;
    left: 7px;
    right: 7px;
  }
  .ugc-client-tag {
    font-size: 9px;
    padding: 2px 5px;
  }
  .ugc-format-badge {
    font-size: 8px;
    padding: 1px 5px;
  }
  .ugc-side-actions {
    bottom: 52px;
    right: 6px;
    gap: 6px;
  }
  .ugc-action-btn {
    width: 27px;
    height: 27px;
    font-size: 11.5px;
  }
  .ugc-action-label {
    font-size: 8px;
  }
  .ugc-card-info {
    padding: 14px 7px 7px;
  }
  .ugc-reel-caption {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 3px;
  }
  .ugc-tool-tag {
    font-size: 8px;
    padding: 1px 4px;
  }
}

@media (max-width: 480px) {
  .ugc-card-top {
    top: 5px;
    left: 5px;
    right: 5px;
  }
  .ugc-client-tag {
    font-size: 8px;
    padding: 1px 4px;
    max-width: 65%;
  }
  .ugc-inline-logo {
    width: 11px;
    height: 11px;
  }
  .ugc-format-badge {
    font-size: 7.5px;
    padding: 1px 4px;
  }
  .ugc-reel-caption {
    font-size: 9.5px;
    line-height: 1.2;
    margin-bottom: 2px;
  }
  .ugc-action-btn {
    width: 23px;
    height: 23px;
    font-size: 9.5px;
  }
  .ugc-side-actions {
    bottom: 42px;
    right: 4px;
    gap: 4px;
  }
}

/* ==========================================================================
   ONE-TIME FIRST-VISITOR SCROLL TUTORIAL
   ========================================================================== */
.ugc-scroll-hint-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  animation: tutorialFloat 3s ease-in-out infinite;
  transition: opacity 350ms var(--ease-out), transform 350ms var(--ease-out);
  pointer-events: auto;
}

/* Gallery reel gesture cue: matches same minimal aesthetic */
.vp-swipe-hint {
  width: fit-content;
  max-width: 100%;
  margin: -6px auto 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-strong);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font: 11px var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: opacity 350ms var(--ease-out), transform 350ms var(--ease-out);
}

.vp-swipe-hint.is-dismissed {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.vp-swipe-hint .hint-dismiss-btn {
  color: var(--muted);
  background: color-mix(in srgb, var(--text-strong) 10%, transparent);
}

.tiktok-drag-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  background: var(--black, #000);
}

.tiktok-drag-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tiktok-drag-preview .ugc-client-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
}

@media (max-width: 600px) {
  .vp-swipe-hint,
  .ugc-scroll-hint-banner {
    padding: 7px 14px;
    font-size: 10.5px;
  }
}

.ugc-scroll-hint-banner.is-dismissed {
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
}

@keyframes tutorialFloat {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -4px);
  }
}

.scroll-hand-anim {
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  animation: swipeNudge 1.8s ease-in-out infinite;
}

@keyframes swipeNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.hint-dismiss-btn {
  background: color-mix(in srgb, var(--text-strong) 8%, transparent);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-left: 2px;
  transition: background 160ms ease, color 160ms ease;
}

.hint-dismiss-btn:hover {
  background: color-mix(in srgb, var(--text-strong) 18%, transparent);
  color: var(--text-strong);
}

/* Modal In-Player Swipe Tutorial / FYI Guidance (Non-overlapping, positioned comfortably below loading screen) */
.tiktok-swipe-tutorial {
  position: absolute;
  top: calc(50% + 115px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 15;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  white-space: nowrap;
  animation: fadeOutTutorial 6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tiktok-swipe-tutorial .fyi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ffffff;
  color: #000000;
  line-height: 1.2;
}

.tiktok-swipe-tutorial .fyi-text {
  color: rgba(255, 255, 255, 0.92);
}

@keyframes fadeOutTutorial {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  7% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -6px);
    visibility: hidden;
  }
}

@media (max-width: 600px) {
  .tiktok-swipe-tutorial {
    top: auto;
    bottom: max(calc(env(safe-area-inset-bottom, 0px) + 125px), 125px);
    font-size: 10.5px;
    padding: 7px 14px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

.tiktok-phone-stage.is-landscape-video .tiktok-swipe-tutorial {
  top: auto;
  bottom: 24px;
  left: 50%;
}

/* ==========================================================================
   TIKTOK IMMERSIVE REEL MODAL
   ========================================================================== */
.tiktok-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.tiktok-modal.is-open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto;
}

.tiktok-modal-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  height: 98vh;
  max-width: 1200px;
  position: relative;
  padding: 16px;
}

/* The 9:16 Vertical Phone Frame — Natural portrait, breathable desktop proportions, never stretched */
.tiktok-phone-stage {
  position: relative;
  height: min(86vh, 760px);
  width: auto;
  aspect-ratio: 9 / 16;
  max-width: calc(min(86vh, 760px) * 9 / 16);
  background: #000;
  border-radius: 28px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 30px 90px -15px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  margin: 0 auto;
  transition: transform 320ms cubic-bezier(0.25, 1, 0.5, 1);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 1200px) {
  .tiktok-phone-stage {
    height: min(88vh, 800px);
    max-width: calc(min(88vh, 800px) * 9 / 16);
    border-radius: 32px;
  }
}

@media (min-width: 1600px) {
  .tiktok-phone-stage {
    height: min(90vh, 860px);
    max-width: calc(min(90vh, 860px) * 9 / 16);
    border-radius: 36px;
  }
}

/* Material Design Smooth Circular Opening & Closing for All Devices (Mobile, Tablet, Desktop) */
#tiktok-reel-modal {
  --circle-x: 50vw;
  --circle-y: 50vh;
  --circle-max-r: 160vmax;
}

#tiktok-reel-modal.is-material-circle-opening {
  animation: modalMaterialCircleExpand 440ms cubic-bezier(0.12, 0.9, 0.2, 1) forwards !important;
  will-change: clip-path;
}

#tiktok-reel-modal.is-material-circle-closing {
  animation: modalMaterialCircleCollapse 320ms cubic-bezier(0.3, 0, 0.8, 0.15) forwards !important;
  will-change: clip-path;
}

@keyframes modalMaterialCircleExpand {
  0% {
    clip-path: circle(0px at var(--circle-x, 50vw) var(--circle-y, 50vh));
  }
  100% {
    clip-path: circle(var(--circle-max-r, 160vmax) at var(--circle-x, 50vw) var(--circle-y, 50vh));
  }
}

@keyframes modalMaterialCircleCollapse {
  0% {
    clip-path: circle(var(--circle-max-r, 160vmax) at var(--circle-x, 50vw) var(--circle-y, 50vh));
  }
  100% {
    clip-path: circle(0px at var(--circle-x, 50vw) var(--circle-y, 50vh));
  }
}

/* Material Design Expanding Luminous Ripple Ring */
.tiktok-material-circle-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10006;
  box-sizing: border-box;
  border: 3.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.8), inset 0 0 16px rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
  display: none;
  will-change: width, height, opacity;
}

/* ==========================================================================
   TIKTOK REEL MODAL CLOSE CONTROLS
   Desktop mode (1025px+): Noticeable floating circular X button only
   Mobile & Tablet mode (<= 1024px): Down arrow button only (slides down smoothly)
   ========================================================================== */

.tiktok-desktop-close-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.tiktok-header-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-icon-desktop,
.close-icon-mobile {
  width: 17px;
  height: 17px;
  stroke: #ffffff;
}

/* Desktop View (min-width: 1025px): X button in top-left corner ONLY */
@media (min-width: 1025px) {
  #tiktok-desktop-close,
  .tiktok-desktop-close-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  #tiktok-modal-close,
  .tiktok-header-close-btn {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .close-icon-mobile {
    display: none !important;
  }
  .close-icon-desktop {
    display: inline-flex !important;
  }
}

/* Mobile & Tablet View (max-width: 1024px): Down arrow in top-left corner ONLY */
@media (max-width: 1024px) {
  #tiktok-desktop-close,
  .tiktok-desktop-close-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  #tiktok-modal-close,
  .tiktok-header-close-btn {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .close-icon-desktop {
    display: none !important;
  }
  .close-icon-mobile {
    display: inline-flex !important;
  }

  .tiktok-modal-wrapper {
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    gap: 0 !important;
  }
  .tiktok-phone-stage {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    top: 0 !important;
    left: 0 !important;
    inset: 0 !important;
    margin: 0 !important;
  }
  .tiktok-reel-nav {
    display: none !important;
  }
  .tiktok-stage-header {
    top: max(calc(env(safe-area-inset-top, 0px) + 16px), 38px) !important;
    left: max(env(safe-area-inset-left, 0px) + 12px, 12px) !important;
    right: max(env(safe-area-inset-right, 0px) + 12px, 12px) !important;
    padding: 0 4px;
    gap: 6px !important;
  }
  .tiktok-stage-header .tiktok-header-right {
    gap: 5px !important;
  }
  .tiktok-stage-header .tiktok-back-btn {
    width: 34px !important;
    height: 34px !important;
  }
  .tiktok-stage-header .tiktok-counter {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
  .tiktok-stage-header .tiktok-client-pill {
    display: none !important;
  }
  .tiktok-stage-actions {
    right: max(env(safe-area-inset-right, 0px) + 14px, 14px) !important;
    bottom: max(calc(env(safe-area-inset-bottom, 0px) + 115px), 115px) !important;
  }
  .tiktok-stage-caption {
    padding-bottom: max(calc(env(safe-area-inset-bottom, 0px) + 18px), 24px) !important;
    padding-left: max(calc(env(safe-area-inset-left, 0px) + 14px), 14px) !important;
    padding-right: max(calc(env(safe-area-inset-right, 0px) + 72px), 72px) !important;
  }
}

.tiktok-player-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--skeleton-base);
  background-image: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
}

.tiktok-player-container video,
.tiktok-player-container iframe {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  background: transparent;
  border: 0;
  display: block;
  touch-action: none;
  pointer-events: auto;
}

/* Landscape Video Mode — Widescreen 16:9 adaptive cinema layout for Kasimba, Gaming & all landscape reels */
.tiktok-phone-stage.is-landscape-video {
  width: min(92vw, 1080px) !important;
  max-width: min(92vw, 1080px) !important;
  height: auto !important;
  max-height: min(86vh, 680px) !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 20px !important;
  transition: width 280ms cubic-bezier(0.16, 1, 0.3, 1), max-width 280ms cubic-bezier(0.16, 1, 0.3, 1), aspect-ratio 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ensure ALL landscape videos NEVER zoom to crop portrait — always preserve native ratio with contain */
.tiktok-phone-stage.is-landscape-video .tiktok-player-container video,
.tiktok-phone-stage.is-landscape-video .tiktok-player-container iframe,
.tiktok-phone-stage.is-landscape-video .tiktok-slide-video,
.tiktok-slide-video.is-landscape,
.tiktok-reel-slide.is-landscape-slide video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: var(--skeleton-base) !important;
}

.tiktok-phone-stage.is-landscape-video .tiktok-stage-caption {
  max-width: 60% !important;
  bottom: 20px !important;
  padding-left: 20px !important;
  padding-bottom: 8px !important;
}

.tiktok-phone-stage.is-landscape-video .tiktok-stage-actions {
  bottom: 20px !important;
  right: 20px !important;
}

@media (max-width: 1024px) {
  .tiktok-phone-stage.is-landscape-video {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
  }
}

/* Landscape orientation on mobile devices */
@media (max-width: 1024px) and (orientation: landscape) {
  .tiktok-phone-stage.is-landscape-video {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
  .tiktok-phone-stage.is-landscape-video .tiktok-landscape-nav-bar {
    display: none !important; /* Already enjoying full landscape screen */
  }
  .tiktok-phone-stage.is-landscape-video .tiktok-stage-caption {
    max-width: 70% !important;
    bottom: 14px !important;
    padding-left: 16px !important;
    padding-bottom: 4px !important;
  }
  .tiktok-phone-stage.is-landscape-video .tiktok-stage-actions {
    right: 14px !important;
    bottom: 14px !important;
  }
}

/* ==========================================================================
   LANDSCAPE STREAM FULL SCREEN ACTION (Positioned below landscape video)
   Encercicled area: Centers directly below the video, above caption
   ========================================================================== */
.tiktok-landscape-fs-action-container {
  position: absolute;
  z-index: 15;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

/* Only display when the slide is landscape or stage is landscape */
.is-landscape-slide .tiktok-landscape-fs-action-container,
.tiktok-phone-stage.is-landscape-video .tiktok-landscape-fs-action-container,
.tiktok-slide-video.is-landscape ~ .tiktok-landscape-fs-action-container {
  display: flex !important;
}

.tiktok-landscape-fs-action-container[hidden] {
  display: none !important;
}

/* Position on Mobile: Centered horizontally in the empty space below video, above @johnbenser */
@media (max-width: 1024px) {
  .tiktok-landscape-fs-action-container {
    top: calc(50% + min(30vw, 160px));
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    max-width: calc(100vw - 32px);
  }
}

/* Position on Desktop: bottom right inside cinema frame */
@media (min-width: 1025px) {
  .tiktok-landscape-fs-action-container {
    bottom: 24px;
    right: 24px;
  }
}

.tiktok-landscape-fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(14, 16, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  transition: background 180ms ease, border-color 180ms ease, transform 140ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}

.tiktok-landscape-fs-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85);
}

.tiktok-landscape-fs-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.3);
}

.tiktok-landscape-fs-btn svg {
  stroke: #ffffff;
  flex-shrink: 0;
}

.tiktok-landscape-fullscreen {
  position: absolute;
  z-index: 11;
  right: 14px;
  bottom: 92px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font: 17px/1 var(--font-mono);
  cursor: pointer;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: transform 180ms ease, background 180ms ease;
}

.tiktok-landscape-fullscreen[hidden] {
  display: none !important;
}

.tiktok-landscape-fullscreen:hover {
  background: rgba(0, 0, 0, 0.82);
  transform: scale(1.06);
}

@media (max-width: 1024px) {
  .tiktok-landscape-fullscreen {
    right: max(env(safe-area-inset-right, 0px) + 14px, 14px);
    bottom: max(calc(env(safe-area-inset-bottom, 0px) + 112px), 112px);
  }
}

/* Transparent gesture capture shield over embeds to ensure swipes never get intercepted */
.tiktok-touch-shield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}

/* Persistent Random Thumbnail Cover Overlay during Buffering */
.tiktok-reel-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tiktok-reel-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.tiktok-cover-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  display: block;
}

/* Minimalist Theme-Based 1-100% Loading Widget */
.tiktok-loader-widget {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 16, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 18px 24px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  min-width: 136px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.tiktok-loader-widget.is-hidden {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.tiktok-loader-spinner {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.tiktok-loader-svg {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}

.tiktok-loader-circle-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.tiktok-loader-circle-fg {
  stroke: #ffffff;
  stroke-linecap: round;
  transition: stroke-dashoffset 90ms cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.tiktok-loader-pct {
  position: absolute;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.tiktok-loader-track {
  width: 90px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.tiktok-loader-fill {
  width: 0%;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  transition: width 90ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tiktok-loader-label {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

/* YouTube-Style Dual Buffer & Playback Timeline */
.tiktok-yt-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  display: flex;
  align-items: flex-end;
  z-index: 15;
  cursor: pointer;
  padding: 0 0 1px 0;
  transition: height 160ms ease;
}

.tiktok-yt-progress-container:hover {
  height: 24px;
}

.tiktok-yt-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  transition: height 140ms ease;
}

.tiktok-yt-progress-container:hover .tiktok-yt-track {
  height: 5px;
}

/* Gray buffer bar loading ahead of playhead */
.tiktok-yt-buffer-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
  transition: width 150ms linear;
  pointer-events: none;
}

/* Solid white playhead line */
.tiktok-yt-play-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

/* Subtle YouTube Central Buffering Spinner */
.tiktok-yt-buffering-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  z-index: 14;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.tiktok-yt-buffering-spinner.is-visible {
  opacity: 1;
}

.tiktok-yt-spinner-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffffff;
  animation: tiktok-yt-spin 700ms linear infinite;
}

@keyframes tiktok-yt-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Micro Timestamp indicator */
.tiktok-yt-timestamp {
  position: absolute;
  bottom: 22px;
  left: 16px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  letter-spacing: 0.3px;
  z-index: 15;
}

.tiktok-phone-stage:hover .tiktok-yt-timestamp,
.tiktok-phone-stage.is-scrubbing .tiktok-yt-timestamp {
  opacity: 1;
}


/* Top bar in phone frame */
.tiktok-stage-header {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 12;
  pointer-events: none;
}

.tiktok-stage-header > * {
  pointer-events: auto;
}

.tiktok-stage-header .tiktok-header-close-btn {
  flex-shrink: 0;
}

.tiktok-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tiktok-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(12, 14, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 140ms ease, background-color 140ms ease;
  pointer-events: auto;
  padding: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.tiktok-back-btn:hover {
  transform: scale(1.08);
  background: rgba(18, 22, 30, 0.9);
}

.tiktok-back-btn:active {
  transform: scale(0.88);
}

.tiktok-back-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
}

.tiktok-play-toggle-btn svg {
  width: 15px;
  height: 15px;
  fill: #ffffff;
}

.tiktok-counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(12, 14, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.tiktok-header-route-btn,
.tiktok-stage-header a[href*="ai-ugc.html"],
.tiktok-stage-header .tiktok-route-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.tiktok-stage-see-more {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #151824 0%, #08090d 100%);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: #ffffff;
  position: relative;
  z-index: 5;
}

.tiktok-stage-see-more .ugc-see-more-icon-circle {
  width: 72px;
  height: 72px;
  font-size: 28px;
  margin-bottom: 6px;
}

.tiktok-stage-see-more .ugc-see-more-title {
  color: #ffffff;
  font-size: 24px;
}

.tiktok-stage-see-more .ugc-see-more-sub {
  color: rgba(255, 255, 255, 0.75);
}

.tiktok-stage-see-more-btn {
  display: none !important;
}

/* Header Brand Pill hidden from top of video to prevent overlapping video subjects/faces */
.tiktok-stage-header .tiktok-client-pill {
  display: none !important;
}

/* Bottom Author Row Client Brand Tag (clean TikTok-style metadata) */
.tiktok-author-row .tiktok-client-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.tiktok-author-row .tiktok-client-pill .ugc-inline-logo {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
  background: #ffffff;
  padding: 1px;
}

/* ==========================================================================
   TIKTOK PLAY/PAUSE OVERLAY & CENTER SOUND CONTROL
   With smooth fade-out and scale-up resume animation
   ========================================================================== */
.tiktok-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease;
}

.tiktok-pause-overlay.is-visible {
  display: flex !important;
  opacity: 1;
}

.tiktok-pause-overlay.is-resuming {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.tiktok-pause-center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.92);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tiktok-pause-overlay.is-visible .tiktok-pause-center-content {
  transform: scale(1);
}

.tiktok-pause-overlay.is-resuming .tiktok-center-play-btn {
  transform: scale(1.22) !important;
  opacity: 0 !important;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease !important;
}

.tiktok-pause-overlay.is-resuming .tiktok-pause-sound-btn {
  transform: translateY(8px) !important;
  opacity: 0 !important;
  transition: transform 220ms ease, opacity 220ms ease !important;
}

.tiktok-center-play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(255, 255, 255, 0.75);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding-left: 6px; /* visually center play triangle */
  transition: transform 150ms ease, background-color 150ms ease;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
}

.tiktok-center-play-btn:hover {
  transform: scale(1.06);
  background: rgba(16, 20, 28, 0.85);
}

.tiktok-center-play-btn:active {
  transform: scale(0.92);
}

.tiktok-center-play-btn svg {
  width: 36px;
  height: 36px;
  fill: #ffffff;
}

.tiktok-pause-sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 16, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: transform 120ms ease, background-color 160ms ease;
}

.tiktok-pause-sound-btn:active {
  transform: scale(0.9);
}

.tiktok-pause-sound-btn svg {
  width: 15px;
  height: 15px;
  stroke: #ffffff;
}

/* Phone Floating Action Column */
.tiktok-stage-actions {
  position: absolute;
  right: 14px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 10;
}

.tiktok-stage-action-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: transform 180ms ease, background 180ms ease;
}

.tiktok-stage-action-btn:hover {
  transform: scale(1.12);
  background: rgba(0, 0, 0, 0.9);
}

@media (hover: none) {
  .tiktok-stage-action-btn:hover { transform: none; background: rgba(0, 0, 0, 0.65); }
}

.tiktok-stage-action-btn,
.tiktok-back-btn,
.tiktok-fs-header-btn,
.ugc-sound-toggle-btn,
.ugc-action-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tiktok-stage-action-btn:active,
.tiktok-back-btn:active,
.tiktok-fs-header-btn:active {
  transform: scale(0.94);
}

.tiktok-stage-action-btn:focus-visible,
.tiktok-back-btn:focus-visible,
.tiktok-fs-header-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.tiktok-stage-action-btn.is-liked {
  color: #ef4444;
}

.tiktok-stage-action-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  margin-top: -10px;
}

/* Phone Bottom Caption & Details */
.tiktok-stage-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 16px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.72) 65%, transparent 100%);
  color: #fff;
  z-index: 9;
}

/* Reel media and metadata are one gesture surface, like a native short-video app. */
.tiktok-reel-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.tiktok-header-identity {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: min(52%, 240px);
  text-align: center;
  pointer-events: none !important;
}

.tiktok-stage-header .tiktok-header-identity .tiktok-client-pill {
  display: block !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .48);
  color: #fff;
  font: 700 12px/1.25 var(--font-mono);
  letter-spacing: .04em;
  text-shadow: 0 1px 4px #000;
}

.tiktok-stage-header .tiktok-header-identity .tiktok-counter {
  display: block;
  padding: 2px 7px;
  border: 0;
  background: rgba(0, 0, 0, .32);
  font-size: 11px;
  line-height: 1.2;
}

.tiktok-stage-header.is-see-more .tiktok-header-identity .tiktok-client-pill {
  display: none !important;
}

.tiktok-author-row #tiktok-caption-client-pill,
.tiktok-landscape-fs-action-container,
#tiktok-fullscreen-btn {
  display: none !important;
}

@media (max-width: 1024px) {
  .tiktok-stage-header .tiktok-header-identity .tiktok-client-pill {
    display: block !important;
  }
  .tiktok-header-identity { width: 38%; }
}

.tiktok-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.tiktok-author-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.tiktok-verified-badge {
  color: #38bdf8;
  font-size: 13px;
}

.tiktok-client-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
}

.tiktok-full-desc {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 8px;
}

.tiktok-tools-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Reel Nav Controls (Desktop Floating Next/Prev) */
.tiktok-reel-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}

@media (max-width: 600px) {
  .tiktok-reel-nav {
    display: none; /* Mobile uses swipe and on-screen arrows */
  }
}

.tiktok-nav-arrow-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 200ms ease;
}

.tiktok-nav-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}


/* See More Portrait Card (Matching 9:16 Video Reel Dimensions) */
.ugc-see-more-card {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: var(--text) !important;
  background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-soft) 100%);
  border: 2px dashed var(--line-strong);
  border-radius: 20px;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 300ms var(--ease-out), border-color 300ms, box-shadow 300ms, background 300ms;
  cursor: pointer;
  z-index: 2;
}

.ugc-see-more-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--text-strong);
  border-style: solid;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.25);
  background: var(--card-bg);
}

.ugc-see-more-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
  gap: 18px;
}

@keyframes encourageArrowPulse {
  0%, 100% {
    transform: translateX(0) scale(1);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35);
  }
  50% {
    transform: translateX(8px) scale(1.08);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.5);
  }
}

.ugc-see-more-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--text-strong);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35);
  animation: encourageArrowPulse 2.2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  transition: transform 300ms var(--ease-out), background 300ms;
}

.ugc-see-more-arrow {
  display: inline-block;
  transition: transform 240ms ease;
}

.ugc-see-more-card:hover .ugc-see-more-icon-circle {
  animation-play-state: paused;
  transform: translateX(10px) scale(1.12);
}

.ugc-see-more-text-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ugc-see-more-kicker {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

.ugc-see-more-title {
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 700;
  color: var(--text-strong);
}

.ugc-see-more-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 220px;
}

.ugc-see-more-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.12);
  color: var(--text);
  margin-top: 10px;
  transition: background 250ms, color 250ms;
}

.ugc-see-more-card:hover .ugc-see-more-badge {
  background: var(--text-strong);
  color: var(--bg);
}

/* ==========================================================================
   NAV PROJECT ONLY: ATTACHED FILE CAROUSEL SLIDER (Top of Project Title)
   Display at top of each project card, auto-slides every three seconds, stops on touch/drag
   ========================================================================== */

.project-row-card.has-peek-slider {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 24px !important;
  padding: 38px 0 !important;
  border-bottom: 1px solid var(--line) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  cursor: pointer;
}

.project-row-card.has-peek-slider .project-row-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 740px !important;
  margin: 0 auto !important;
  gap: 14px !important;
}

.project-row-card.has-peek-slider .row-main {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
}

.project-row-card.has-peek-slider .row-main h2 {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 8px;
  text-align: center;
}

.project-row-card.has-peek-slider .row-main p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  max-width: 660px;
  margin: 0 auto;
}

.project-row-card.has-peek-slider .row-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
}

.project-row-card.has-peek-slider .tag-pill-stack {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

.project-peek-slider {
  position: relative;
  width: 100%;
  max-width: 780px;
  height: 380px;
  margin: 0 auto;
  background: #08090d;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  user-select: none;
  touch-action: pan-y;
}

.peek-slider-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Box-shaped Slide (Aspect ratio ~ 4:3 box layout) */
.peek-slide {
  position: absolute;
  top: 50%;
  height: 86%;
  width: 58%;
  max-width: 480px;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0f17;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 480ms ease, filter 480ms ease, box-shadow 480ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
  will-change: transform, opacity;
}

.peek-slide img,
.peek-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #08090d;
  transition: transform 550ms cubic-bezier(0.22, 1, 0.36, 1), opacity 550ms ease, filter 550ms ease;
  will-change: transform, opacity, filter;
}

.peek-slide.is-center img,
.peek-slide.is-center video {
  transform: scale(1);
  filter: brightness(1);
  opacity: 1;
}

.peek-slide.is-left img,
.peek-slide.is-right img,
.peek-slide.is-left video,
.peek-slide.is-right video {
  transform: scale(0.93);
  filter: brightness(0.65);
  opacity: 0.85;
}

.peek-slide.is-far-left img,
.peek-slide.is-far-right img,
.peek-slide.is-far-left video,
.peek-slide.is-far-right video {
  transform: scale(0.82);
  filter: brightness(0.3);
  opacity: 0;
}

/* Center Box (Active Focus) */
.peek-slide.is-center {
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  filter: brightness(1);
  z-index: 3;
  height: 90%;
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75);
}

/* Left Box (Peeking Left) */
.peek-slide.is-left {
  left: 50%;
  transform: translate(-128%, -50%) scale(0.86);
  opacity: 0.45;
  filter: brightness(0.55);
  z-index: 2;
}

/* Right Box (Peeking Right) */
.peek-slide.is-right {
  left: 50%;
  transform: translate(28%, -50%) scale(0.86);
  opacity: 0.45;
  filter: brightness(0.55);
  z-index: 2;
}

/* Far Left Box (Exiting Left or Entering from Far Left) */
.peek-slide.is-far-left {
  left: 50%;
  transform: translate(-205%, -50%) scale(0.72);
  opacity: 0;
  filter: brightness(0.3);
  pointer-events: none;
  z-index: 1;
}

/* Far Right Box (Exiting Right or Entering from Far Right) */
.peek-slide.is-far-right {
  left: 50%;
  transform: translate(105%, -50%) scale(0.72);
  opacity: 0;
  filter: brightness(0.3);
  pointer-events: none;
  z-index: 1;
}

/* Hidden slides */
.peek-slide.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 1;
}

/* Nav Controls */
.peek-slider-nav {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 4;
  pointer-events: none;
}

.peek-slider-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.peek-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 200ms ease, transform 200ms ease;
  cursor: pointer;
  pointer-events: auto;
}

.peek-dot.is-active {
  background: #ffffff;
  transform: scale(1.3);
}

.peek-slider-btn {
  pointer-events: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(14, 16, 22, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 180ms ease, background 180ms ease, transform 180ms ease;
}

.peek-slider-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

/* ==========================================================================
   AI UGC VIDEO CONTAINER (Preview Cards)
   Clicking opens fullscreen modal — no tap-to-pause on preview
   ========================================================================== */
.ugc-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 19px;
  overflow: hidden;
  cursor: pointer;
  background: var(--skeleton-base);
  background-image: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
}

.ugc-video-container .ugc-index-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Sleek centered play badge for preview cards when paused / before autoplay */
.ugc-video-container::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.88);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(14, 16, 22, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpolygon points='7 4 20 12 7 20 7 4'%3E%3C/polygon%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 56% 50%;
  background-size: 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

.ugc-video-container.is-paused::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ugc-video-pause-indicator {
  display: none !important;
}

.ugc-pause-circle {
  display: none !important;
}

/* Responsive queries */
@media (max-width: 1024px) {
  .project-peek-slider {
    height: 330px;
    max-width: 680px;
  }
  .peek-slide {
    width: 62%;
  }
}

@media (max-width: 768px) {
  .project-row-card.has-peek-slider {
    gap: 18px !important;
    padding: 26px 0 !important;
  }
  .project-row-card.has-peek-slider .project-row-body {
    padding: 0 10px;
    gap: 12px;
  }
  .project-peek-slider {
    height: 250px;
    max-width: 100%;
    border-radius: 12px;
  }
  .peek-slide {
    width: 72%;
    height: 84%;
  }
  .peek-slide.is-center {
    height: 88%;
  }
  .peek-slide.is-left {
    transform: translate(-122%, -50%) scale(0.86);
  }
  .peek-slide.is-right {
    transform: translate(22%, -50%) scale(0.86);
  }
}

/* Brief, index-only terminal intro */
.portfolio-intro-loader {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: hidden;
  background: var(--bg); color: var(--text-strong);
  opacity: 1;
  transition: opacity 260ms cubic-bezier(0.16, 1, 0.3, 1), transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-intro-loader.is-dismissing { opacity: 0; transform: scale(1.015); pointer-events: none; }
.terminal-intro { width: min(100%, 440px); }
.terminal-intro-bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0;
  background: var(--bg-soft); color: var(--muted); font-size: 11px;
}
.terminal-intro-lights { display: flex; gap: 5px; }
.terminal-intro-lights i { width: 7px; height: 7px; border-radius: 50%; background: #ec6a5e; }
.terminal-intro-lights i:nth-child(2) { background: #f4bf4f; }
.terminal-intro-lights i:nth-child(3) { background: #61c554; }
.terminal-intro-body {
  padding: 22px 18px 18px; border: 1px solid var(--line); border-radius: 0 0 12px 12px;
  background: var(--bg-soft); font-size: 12px;
}
.terminal-binary { margin: 0 0 17px; color: #269b62; opacity: .65; line-height: 1.65; letter-spacing: .12em; animation: terminal-binary-flicker 1s steps(2, end) infinite; }
.terminal-command { margin: 0 0 13px; color: var(--text); }
.terminal-command > span:first-child, .terminal-connected > span { color: #269b62; }
.terminal-cursor { display: inline-block; margin-left: 3px; color: #269b62; animation: terminal-cursor-blink .7s steps(2, start) infinite; }
.terminal-progress { height: 3px; overflow: hidden; border-radius: 3px; background: var(--line); }
.terminal-progress span { display: block; width: 100%; height: 100%; background: #269b62; transform: scaleX(0); transform-origin: left; animation: terminal-progress-fill 1.35s cubic-bezier(.2,.75,.25,1) forwards; }
.terminal-connected { margin: 13px 0 0; color: #269b62; opacity: 0; animation: terminal-connected-in 200ms 1.38s ease forwards; }
.terminal-intro-tagline { margin: 20px 0 0; text-align: center; font: 600 clamp(20px, 5vw, 26px)/1.1 var(--font-display); letter-spacing: -.04em; color: var(--text-strong); }
@keyframes terminal-binary-flicker { 50% { opacity: .32; } }
@keyframes terminal-cursor-blink { to { visibility: hidden; } }
@keyframes terminal-progress-fill { to { transform: scaleX(1); } }
@keyframes terminal-connected-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .terminal-binary, .terminal-cursor, .terminal-progress span, .terminal-connected { animation-duration: 1ms; animation-delay: 0ms; }
}

/* ==========================================================================
   10.5. LIVE VISITOR HEARTBEAT & TELEMETRY INDICATORS
   ========================================================================== */
@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.live-pulse-dot {
  animation: livePulse 2s infinite;
}
.badge-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-soft, rgba(0, 0, 0, 0.05));
  color: var(--muted);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
}
.badge-ios {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 122, 255, 0.12);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   11. BRYL-MINIMAL COOKIE CONSENT CARD (PORTABLE & RESPONSIVE)
   ========================================================================== */
.cookie-consent-card {
  position: fixed;
  bottom: 24px;
  right: 28px;
  width: 320px;
  max-width: calc(100vw - 32px);
  z-index: 9998;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--line-strong, rgba(0, 0, 0, 0.14));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--text, #1a1a1a);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), opacity 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .cookie-consent-card {
  background: #111217;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #f4f4f5;
}

.cookie-consent-card.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent-card.is-leaving {
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
}

.cookie-card-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #666666);
}

[data-theme="dark"] .cookie-card-tag {
  color: #8a8a92;
}

.cookie-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.cookie-close-btn {
  background: transparent;
  border: none;
  color: var(--muted, #666666);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background-color 150ms ease;
}

.cookie-close-btn:hover {
  color: var(--text-strong, #0a0a0a);
  background: var(--hover, rgba(0, 0, 0, 0.05));
}

[data-theme="dark"] .cookie-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.cookie-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cookie-card-title {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-strong, #0a0a0a);
}

[data-theme="dark"] .cookie-card-title {
  color: #f4f4f5;
}

.cookie-card-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #666666);
  margin: 0;
}

[data-theme="dark"] .cookie-card-desc {
  color: #a0a0a8;
}

.cookie-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.cookie-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

/* Reject all: ghost / outline button */
.cookie-reject-btn {
  background: transparent;
  border: 1px solid var(--line-strong, rgba(0, 0, 0, 0.16));
  color: var(--text, #1a1a1a);
}

.cookie-reject-btn:hover {
  background: var(--hover, rgba(0, 0, 0, 0.04));
  border-color: var(--text-strong, #0a0a0a);
}

[data-theme="dark"] .cookie-reject-btn {
  border-color: rgba(255, 255, 255, 0.16);
  color: #f4f4f5;
}

/* Cookie Countdown Timer Pill */
.cookie-countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--muted, #666);
  background: var(--bg-alt, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
[data-theme="dark"] .cookie-countdown-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #a0a0a8;
}

/* Manage Data Button */
.cookie-manage-btn {
  background: transparent;
  border: 1px solid var(--line-strong, rgba(0, 0, 0, 0.16));
  color: var(--text, #1a1a1a);
}
.cookie-manage-btn:hover {
  background: var(--hover, rgba(0, 0, 0, 0.04));
  border-color: var(--text-strong, #0a0a0a);
}
[data-theme="dark"] .cookie-manage-btn {
  border-color: rgba(255, 255, 255, 0.16);
  color: #f4f4f5;
}
[data-theme="dark"] .cookie-manage-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Accept all: Bryl-minimal inverted chip */
.cookie-accept-btn {
  flex: 1;
  background: var(--text-strong, #0a0a0a);
  border: 1px solid var(--text-strong, #0a0a0a);
  color: var(--bg, #ffffff);
}

.cookie-accept-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .cookie-accept-btn {
  background: #f4f4f5;
  border-color: #f4f4f5;
  color: #0c0c0f;
}

[data-theme="dark"] .cookie-accept-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.18);
}

/* RESPONSIVE DEVICE ADJUSTMENTS */
@media (max-width: 1024px) and (min-width: 641px) {
  /* Tablet */
  .cookie-consent-card {
    bottom: 20px;
    right: 20px;
    width: 300px;
  }
}

@media (max-width: 640px) {
  /* Mobile Phone */
  .cookie-consent-card {
    bottom: 12px;
    left: 14px;
    right: 14px;
    width: calc(100% - 28px);
    max-width: 360px;
    margin: 0 auto;
    padding: 14px 16px;
    border-radius: 12px;
  }
  .cookie-btn {
    padding: 7px 12px;
    font-size: 10.5px;
  }
}


/* Projects page uses the index project card as a spaced, centered list. */
section[aria-labelledby="projects-page-title"] .content-list { border: 0; }
.projects-page-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  gap: 16px;
  padding: 20px 0 32px;
}
.projects-page-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 0;
}
.projects-filter-btn {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 15px;
  background: var(--card-bg);
  color: var(--muted);
  font: 500 12px var(--font-mono);
  cursor: pointer;
  transition: color 200ms var(--ease-out), background 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.projects-filter-btn:hover { transform: translateY(-2px); color: var(--text-strong); border-color: var(--text-strong); }
.projects-filter-btn.is-active {
  background: var(--text-strong);
  color: var(--bg);
  border-color: var(--text-strong);
  box-shadow: var(--card-shadow);
}
.projects-filter-btn:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 3px; }
.projects-page-card.is-hidden-project { display: none !important; }
.projects-page-card.is-rearranging { animation: cardRearrangeIn 340ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.projects-page-card {
  position: relative;
  inset: auto;
  width: min(100%, 680px);
  margin: 0;
  transform: none;
  transform-style: preserve-3d;
  opacity: 1;
  visibility: visible;
  will-change: transform;
  box-shadow: var(--card-shadow);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 22px 24px;
}
.projects-page-card:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 4px; }
@media (hover: hover) {
  .projects-page-card:hover {
    z-index: 2;
    transform: perspective(900px) translateY(-3px) rotateX(1deg) rotateY(-1deg) scale(1.01);
  }
}
.projects-page-card:hover,
.projects-page-card:focus-visible {
  box-shadow: var(--card-shadow-hover);
}
.projects-page-card:focus-visible {
  transform: perspective(900px) translateY(-2px);
}
.projects-page-card .deck-media-preview {
  aspect-ratio: 16 / 10;
  height: auto;
  flex: 0 0 auto;
}
.projects-page-card .deck-desc {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}
.deck-media-preview.is-portrait img,
.deck-media-preview.is-portrait video {
  object-fit: contain;
  background: var(--bg-soft);
}
@media (max-width: 639px) {
  .projects-page-card { padding: 16px 16px 18px; }
}
@media (min-width: 640px) {
  .projects-page-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.project-technical-workflow {
  margin: 12px 0 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font: 12px/1.7 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Intrinsic card heights prevent feedback from grid row sizing. */
.projects-page-list.is-packed { grid-auto-rows: 1px; row-gap: 0; }
.projects-page-list.is-packed > .projects-page-card { align-self: start; }

/* Destination skeletons retain the actual page's responsive card geometry. */
main.is-skeleton-loading :is(.badge-inverted, .badge-outline, .projects-filter-btn, .deck-cert-lens, .mono, .tag, .deck-verify-btn) {
  color: transparent !important;
  text-shadow: none !important;
  background: var(--skeleton-base) !important;
  border-color: transparent !important;
}
main.is-skeleton-loading :is(.deck-cert-preview, .hero-avatar, .cert-cinema-card, .gallery-card, .vp-video-card) {
  background: var(--skeleton-base) !important;
}
main.is-skeleton-loading :is(a, span) { color: transparent !important; }
@media (prefers-reduced-motion: reduce) {
  main.is-skeleton-loading * { animation: none !important; }
}
