/* ================================================
   MAURO MARTINO - Design System v2
   "Data as Poetry" - Visual AI Lab
   ================================================ */

/* -------------------- CSS Variables -------------------- */
:root {
  /* Colors - Void & Darkness */
  --bg-void: #050508;
  --bg-primary: #0a0a0f;
  --bg-surface: #12121a;
  --bg-elevated: #1a1a24;
  --bg-hover: #22222e;

  /* Colors - Text (Enhanced contrast inspired by Apple) */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #8e8e93;

  /* Colors - Accent (Indigo) */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-subtle: rgba(99, 102, 241, 0.08);

  /* Gradient */
  --gradient-network: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-text: linear-gradient(135deg, #f5f5f7 0%, #a1a1a6 100%);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Animation */
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1280px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-void);
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

::selection {
  background: var(--accent);
  color: var(--text-primary);
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* -------------------- Focus States (Accessibility) -------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to main content link for screen readers */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: 4px;
  z-index: 10000;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-2);
}

/* -------------------- Typography -------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-display {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.text-title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.text-heading {
  font-size: 1.5rem;
}

.text-body {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.text-small {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.text-gradient {
  background: var(--gradient-network);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* -------------------- Layout -------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* -------------------- Header -------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  transition: background var(--duration-base) var(--ease-out),
              backdrop-filter var(--duration-base) var(--ease-out);
}

.header.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-elevated);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  position: relative;
}

.logo-icon canvas {
  width: 100%;
  height: 100%;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--duration-base) var(--ease-out);
}

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

.nav-link:hover::after {
  width: 100%;
}

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

.menu-toggle {
  display: none;
  width: 24px;
  height: 24px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
}

.menu-toggle.active span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle.active span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* -------------------- Hero -------------------- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Hero Video Background */
.hero-video-container {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
}

/* Placeholder slideshow */
.hero-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: opacity 1s ease-out;
}

.hero-placeholder.hidden {
  opacity: 0;
  pointer-events: none;
}

.placeholder-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.placeholder-frame.active {
  opacity: 1;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.hero-video.ready {
  opacity: 1;
}

.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 8, 0.4) 0%,
    rgba(5, 5, 8, 0.6) 50%,
    rgba(5, 5, 8, 0.95) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

#network-canvas {
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  padding-top: var(--header-height);
}

.hero-text {
  max-width: 600px;
}

.hero-text .name,
.hero-text .hero-statement {
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 0, 0, 0.4);
}

.hero-title {
  margin-bottom: var(--space-4);
}

.hero-title .name {
  display: block;
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-title .role {
  display: block;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: var(--space-4);
  font-family: var(--font-mono);
}

.hero-statement {
  font-size: 1.375rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 520px;
  line-height: 1.6;
}

.hero-statement strong {
  color: white;
  font-weight: 600;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 500;
  color: white;
  text-decoration: none;
  position: relative;
  padding: 0;
  background: none;
  border: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-link-text {
  position: relative;
}

.hero-link-text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-link:hover .hero-link-text::after {
  width: 100%;
}

.hero-link-arrow {
  opacity: 0.6;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-link:hover .hero-link-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.hero-links-separator {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
  font-size: 20px;
  margin: 0 var(--space-4);
}

.hero-link.primary {
  color: white;
}

.hero-link.secondary {
  color: rgba(255, 255, 255, 0.5);
}

.hero-link.secondary:hover {
  color: rgba(255, 255, 255, 0.8);
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  animation: bounce 2s infinite;
}

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

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* -------------------- Featured Works -------------------- */
.featured {
  background: var(--bg-primary);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.work-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  transition: all var(--duration-base) var(--ease-out);
}

.work-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.work-card:hover::after {
  opacity: 1;
}

.work-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}

/* Loading spinner for images */
.work-card-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
  opacity: 1;
  transition: opacity var(--duration-fast);
  z-index: 1;
}

.work-card-image.loaded::before {
  opacity: 0;
  pointer-events: none;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

.work-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
  transition: transform var(--duration-slow) var(--ease-out),
              filter var(--duration-slow) var(--ease-out),
              opacity var(--duration-fast) ease-out;
  opacity: 0;
}

.work-card-image.loaded img {
  opacity: 1;
}

.work-card:hover .work-card-image img {
  filter: saturate(1);
  transform: scale(1.05);
}

.work-card-content {
  padding: var(--space-6);
}

.work-card-title {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.work-card-meta {
  display: flex;
  gap: var(--space-3);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.work-card-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.work-card-category {
  color: var(--accent);
}

/* -------------------- Research Highlight -------------------- */
.research-highlight {
  background: var(--bg-surface);
  border-top: 1px solid var(--bg-elevated);
  border-bottom: 1px solid var(--bg-elevated);
}

.research-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-8);
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--bg-elevated);
  transition: border-color var(--duration-base) var(--ease-out);
}

.research-card:hover {
  border-color: var(--accent);
}

.research-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border-radius: 12px;
  color: var(--accent);
}

.research-icon svg {
  width: 32px;
  height: 32px;
}

.research-content h3 {
  font-size: 1.3125rem;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.research-content p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.research-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--duration-base) var(--ease-out);
}

.research-link:hover {
  background: var(--accent);
}

.research-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-base) var(--ease-out);
}

.research-link:hover svg {
  transform: translateX(4px);
}

/* -------------------- View All Link -------------------- */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
  transition: gap var(--duration-base) var(--ease-out);
}

.view-all:hover {
  gap: var(--space-3);
}

.view-all svg {
  width: 16px;
  height: 16px;
}

/* -------------------- Footer -------------------- */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--bg-elevated);
  padding: var(--space-16) 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-brand .logo {
  margin-bottom: var(--space-2);
}

.footer-tagline {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: var(--space-8);
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-col a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--bg-elevated);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: var(--space-4);
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all var(--duration-base) var(--ease-out);
}

.social-link:hover {
  background: var(--accent);
  color: white;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* -------------------- Page Header -------------------- */
.page-header {
  padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-16);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-elevated);
}

.page-header h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.6;
}

/* -------------------- Works Page -------------------- */
.works-filters {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

@media (max-width: 580px) {
  .works-filters {
    justify-content: center;
  }
}

.filter-btn {
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: all var(--duration-base) var(--ease-out);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-muted);
}

.filter-btn.active {
  background: transparent;
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.works-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

/* -------------------- Responsive -------------------- */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-statement {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-links {
    justify-content: center;
  }

  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .research-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .research-icon {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--bg-elevated);
    padding: var(--space-4) 0;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    padding: var(--space-3) var(--space-6);
    width: 100%;
    text-align: center;
  }

  .menu-toggle {
    display: flex;
    cursor: pointer;
    background: none;
    border: none;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
  }

  .section {
    padding: var(--space-16) 0;
  }
}

/* -------------------- Animations -------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }

/* -------------------- Cursor Trail (optional) -------------------- */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}

body:hover .cursor-dot {
  opacity: 1;
}

/* -------------------- Gallery Loading Spinner -------------------- */
.gallery-item {
  position: relative;
  background: var(--bg-surface);
  min-height: 100px;
}

.gallery-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gallery-spin 0.8s linear infinite;
  z-index: 1;
  pointer-events: none;
}

.gallery-item img {
  position: relative;
  z-index: 2;
}

@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

/* -------------------- Skeleton Screens -------------------- */
/* Base skeleton styles */
.skeleton {
  background: var(--bg-elevated);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Skeleton variations */
.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 70%;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 1em;
  border-radius: 4px;
}

.skeleton-image {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
}

.skeleton-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.skeleton-card {
  border-radius: 12px;
  overflow: hidden;
}

.skeleton-card .skeleton-image {
  border-radius: 0;
}

.skeleton-card-content {
  padding: var(--space-6);
}

/* Work card skeleton */
.work-card-skeleton {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: 12px;
  overflow: hidden;
}

.work-card-skeleton .skeleton-image {
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.work-card-skeleton .skeleton-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

.work-card-skeleton .skeleton-content {
  padding: var(--space-6);
}

.work-card-skeleton .skeleton-title {
  height: 1.25rem;
  width: 75%;
  background: var(--bg-elevated);
  margin-bottom: var(--space-3);
}

.work-card-skeleton .skeleton-meta {
  height: 0.875rem;
  width: 50%;
  background: var(--bg-elevated);
}

/* Book card skeleton */
.book-card-skeleton {
  display: flex;
  flex-direction: column;
}

.book-card-skeleton .skeleton-cover {
  aspect-ratio: 2 / 3;
  background: var(--bg-elevated);
  border-radius: 8px;
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}

.book-card-skeleton .skeleton-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

.book-card-skeleton .skeleton-book-title {
  height: 0.875rem;
  width: 80%;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: var(--space-2);
}

.book-card-skeleton .skeleton-book-author {
  height: 0.75rem;
  width: 60%;
  background: var(--bg-elevated);
  border-radius: 4px;
}

/* Paper item skeleton */
.paper-skeleton {
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: 8px;
  margin-bottom: var(--space-4);
}

.paper-skeleton .skeleton-paper-title {
  height: 1rem;
  width: 85%;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: var(--space-3);
  position: relative;
  overflow: hidden;
}

.paper-skeleton .skeleton-paper-title::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

.paper-skeleton .skeleton-paper-meta {
  height: 0.875rem;
  width: 55%;
  background: var(--bg-elevated);
  border-radius: 4px;
}

/* Hero skeleton */
.hero-skeleton {
  min-height: 80vh;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
}

.hero-skeleton-content {
  max-width: 600px;
}

.hero-skeleton .skeleton-name {
  height: 4rem;
  width: 300px;
  background: var(--bg-elevated);
  border-radius: 8px;
  margin-bottom: var(--space-4);
}

.hero-skeleton .skeleton-role {
  height: 1.25rem;
  width: 200px;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: var(--space-8);
}

.hero-skeleton .skeleton-statement {
  height: 1rem;
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: var(--space-2);
}

/* Pulse animation alternative */
.skeleton-pulse {
  animation: skeleton-pulse 2s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Loading state for images */
.img-loading {
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.img-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

.img-loading img {
  opacity: 0;
  transition: opacity var(--duration-base) ease-out;
}

.img-loading.loaded img {
  opacity: 1;
}

.img-loading.loaded::before {
  display: none;
}
