/* ========================================
   Clay-inspired Design System
   Based on DESIGN.md
   ======================================== */

:root {
  /* Canvas */
  --cream: #faf9f7;
  --cream-alt: #f5f3ef;
  --white: #ffffff;
  --black: #000000;

  /* Warm Neutrals */
  --silver: #9f9b93;
  --charcoal: #55534e;
  --dark-charcoal: #333333;

  /* Borders */
  --oat: #dad4c8;
  --oat-light: #eee9df;
  --input-border: #717989;

  /* Swatch Palette */
  --matcha-300: #84e7a5;
  --matcha-600: #078a52;
  --matcha-800: #02492a;
  --slushie-500: #3bd3fd;
  --slushie-800: #0089ad;
  --lemon-400: #f8cc65;
  --lemon-500: #fbbd41;
  --ube-300: #c1b0ff;
  --ube-800: #43089f;
  --pomegranate-400: #fc7981;
  --dragonfruit: #e040a0;

  /* Focus */
  --focus-ring: rgb(20, 110, 245);

  /* Shadows */
  --shadow-clay: rgba(0,0,0,0.1) 0px 1px 1px, rgba(0,0,0,0.04) 0px -1px 1px inset, rgba(0,0,0,0.05) 0px -0.5px 1px;
  --shadow-hard: rgb(0,0,0) -7px 7px;

  /* Font */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.50;
  color: var(--black);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--dark-charcoal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========================================
   HERO BANNER
   ======================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--matcha-800);
}

/* Backdrop image layer (loaded via TMDB) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 0;
}

.hero--has-backdrop::before {
  opacity: 0.7;
}

/* Darken overlay for text readability */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2, 73, 42, 0.15) 0%,
    rgba(2, 73, 42, 0.4) 50%,
    rgba(2, 73, 42, 0.75) 100%
  );
  z-index: 0;
}

/* Movie caption */
.hero-caption {
  position: absolute;
  bottom: 16px;
  right: 20px;
  z-index: 1;
  font-size: 0.6875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.3px;
}

/* TMDB footer attribution */
.tmdb-attribution {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Floating shapes background */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  will-change: transform;
}

.hero-shape--1 {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: var(--slushie-500);
  top: -10%;
  right: -8%;
  animation: heroFloat1 18s ease-in-out infinite;
}

.hero-shape--2 {
  width: 30vw;
  height: 30vw;
  max-width: 380px;
  max-height: 380px;
  background: var(--lemon-500);
  bottom: -5%;
  left: -6%;
  animation: heroFloat2 22s ease-in-out infinite;
}

.hero-shape--3 {
  width: 20vw;
  height: 20vw;
  max-width: 260px;
  max-height: 260px;
  background: var(--ube-300);
  top: 20%;
  left: 10%;
  animation: heroFloat3 16s ease-in-out infinite;
}

.hero-shape--4 {
  width: 15vw;
  height: 15vw;
  max-width: 200px;
  max-height: 200px;
  background: var(--pomegranate-400);
  bottom: 20%;
  right: 12%;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: heroFloat4 20s ease-in-out infinite;
}

.hero-shape--5 {
  width: 12vw;
  height: 12vw;
  max-width: 160px;
  max-height: 160px;
  background: var(--matcha-300);
  top: 60%;
  left: 35%;
  border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
  animation: heroFloat5 14s ease-in-out infinite;
}

.hero-shape--6 {
  width: 8vw;
  height: 8vw;
  max-width: 120px;
  max-height: 120px;
  background: var(--dragonfruit);
  top: 12%;
  left: 55%;
  animation: heroFloat6 12s ease-in-out infinite;
}

@keyframes heroFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.05); }
  66% { transform: translate(20px, -20px) scale(0.97); }
}

@keyframes heroFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(40px, -30px) scale(1.08) rotate(15deg); }
}

@keyframes heroFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(25px, 35px) scale(1.1); }
  80% { transform: translate(-15px, 10px) scale(0.95); }
}

@keyframes heroFloat4 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-20px, -40px) rotate(30deg); }
}

@keyframes heroFloat5 {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(20px, -15px) rotate(-20deg) scale(1.1); }
  66% { transform: translate(-10px, 25px) rotate(10deg) scale(0.9); }
}

@keyframes heroFloat6 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-15px, 20px) scale(1.15); }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px 24px;
  max-width: 800px;
  animation: heroContentIn 0.8s ease both;
}

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

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  color: var(--matcha-300);
  margin-bottom: 20px;
}

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: nowrap;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 600;
  line-height: 1.00;
  letter-spacing: -3.2px;
  color: var(--white);
  margin-bottom: 24px;
}

.hero-logo {
  height: 2em;
  width: 2em;
  flex-shrink: 0;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.60;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 40px;
}

/* Stats row */
.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 16px 32px;
  margin-bottom: 40px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: heroContentIn 0.8s ease 0.2s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--white);
}

.hero-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
}

/* CTA button */
.hero-cta {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.16px;
  padding: 14px 32px;
  background: var(--white);
  color: var(--matcha-800);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: var(--shadow-clay);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.15s;
  animation: heroContentIn 0.8s ease 0.35s both;
}

.hero-cta:hover {
  text-decoration: none;
  transform: rotateZ(-8deg) translateY(-4px);
  box-shadow: rgba(0, 0, 0, 0.35) -5px 5px 12px;
  background: var(--lemon-400);
  color: var(--black);
}

/* ========================================
   FILTERS BAR
   ======================================== */

.filters-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 16px 24px;
  background: var(--white);
  border: 1px solid var(--oat);
  border-radius: 24px;
  box-shadow: var(--shadow-clay);
  transition: box-shadow 0.2s ease;
  scroll-margin-top: 0;
}

.filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}


.filter-group--search {
  flex: 1;
  min-width: 180px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.20;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  color: var(--charcoal);
}

.filter-select,
.filter-input {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px rgba(20, 110, 245, 0.25);
}

.filter-select--active {
  border-color: var(--matcha-600);
  background: #f0faf4;
}

.filters-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--oat);
}

.filters-meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-count {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.20;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  color: var(--silver);
}

/* ---- Clear Button ---- */
.btn-clear {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  background: transparent;
  color: var(--pomegranate-400);
  border: 1px solid var(--pomegranate-400);
  border-radius: 1584px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-clear:hover {
  background: var(--pomegranate-400);
  color: var(--white);
}

/* ---- Export Button (Clay hover) ---- */
.btn-export {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.14px;
  padding: 8px 20px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--oat);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-clay);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-export:hover {
  background: var(--matcha-800);
  color: var(--white);
  border-color: var(--matcha-800);
  transform: rotateZ(-8deg) translateY(-4px);
  box-shadow: var(--shadow-hard);
}

.btn-export:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ========================================
   INTRO SECTION
   ======================================== */

.intro-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.intro-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-charcoal);
  margin-bottom: 8px;
}

.intro-section p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--charcoal);
}

.intro-section a {
  color: var(--matcha-600);
}

.noscript-notice {
  max-width: 1200px;
  margin: 24px auto;
  padding: 24px;
  background: var(--cream-alt);
  border: 1px solid var(--oat);
  border-radius: 12px;
  text-align: center;
}

.noscript-notice h2 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.noscript-notice a {
  color: var(--matcha-600);
}

/* ========================================
   TABLE
   ======================================== */

.table-container {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

/* Responsive scroll wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 24px;
  border: 1px solid var(--oat);
  box-shadow: var(--shadow-clay);
}

.studios-table {
  width: 100%;
  min-width: 740px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
}

.studios-table thead {
  background: var(--cream);
}

.studios-table th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  color: var(--charcoal);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--oat);
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 2;
}

/* Sortable columns */
.sortable {
  cursor: pointer;
  transition: color 0.15s;
}

.sortable:hover {
  color: var(--black);
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.625rem;
  opacity: 0.3;
  transition: opacity 0.15s;
}

.sort-icon::after {
  content: "\2195";
}

.sortable:hover .sort-icon { opacity: 0.6; }
.sortable.sort-asc .sort-icon { opacity: 1; }
.sortable.sort-asc .sort-icon::after { content: "\2191"; }
.sortable.sort-desc .sort-icon { opacity: 1; }
.sortable.sort-desc .sort-icon::after { content: "\2193"; }

/* Table rows */
.studios-table td {
  font-size: 0.875rem;
  font-weight: 400;
  padding: 12px 16px;
  border-bottom: 1px solid var(--oat-light);
  vertical-align: middle;
  color: var(--black);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Zebra striping */
.studios-table tbody tr:nth-child(even) td {
  background: var(--cream-alt);
}

.studios-table tbody tr:nth-child(odd) td {
  background: var(--white);
}

/* Row hover */
.studios-table tbody tr {
  transition: transform 0.2s ease;
  position: relative;
}

.studios-table tbody tr:hover td {
  background: #f0ede6;
}

.studios-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--matcha-600);
}

.studios-table tbody tr:last-child td {
  border-bottom: none;
}

/* Row entrance animation */
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.studios-table tbody tr {
  animation: rowFadeIn 0.3s ease both;
}

/* Name column */
.studio-name {
  font-weight: 500;
  letter-spacing: -0.16px;
  white-space: nowrap;
}

/* Links */
.studio-link {
  color: var(--slushie-800);
  font-size: 0.8125rem;
  transition: color 0.15s;
}

.studio-link:hover { color: var(--matcha-600); }

.studio-email {
  color: var(--charcoal);
  font-size: 0.8125rem;
  transition: color 0.15s;
}

.studio-email:hover { color: var(--black); }
.cell-empty { color: var(--oat); }

.type-tag {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--silver);
  display: block;
  margin-top: 2px;
}

.studio-projects {
  font-size: 0.8125rem;
  color: var(--charcoal);
  max-width: 260px;
}

.studio-country {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.country-flag { margin-right: 4px; }

/* ---- Size Badges ---- */
.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 1584px;
  white-space: nowrap;
  text-transform: uppercase;
  transition: transform 0.15s ease;
}

.badge:hover { transform: scale(1.08); }
.badge--large { background: var(--matcha-600); color: var(--white); }
.badge--medium { background: var(--slushie-500); color: var(--black); }
.badge--small { background: var(--lemon-500); color: var(--black); }
.badge--micro { background: var(--ube-300); color: var(--black); }
.badge--unknown { background: var(--oat-light); color: var(--charcoal); }

/* ---- No Results ---- */
.no-results {
  text-align: center;
  padding: 48px 24px;
  font-size: 1.125rem;
  color: var(--silver);
  animation: rowFadeIn 0.3s ease both;
}

/* ---- Footer ---- */
.site-footer {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.footer-inner {
  background: var(--white);
  border: 1px dashed var(--oat);
  border-radius: 40px;
  padding: 32px 40px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--silver);
  line-height: 1.80;
}

.footer-inner a {
  color: var(--charcoal);
  text-decoration: underline;
  transition: color 0.15s;
}

.footer-inner a:hover { color: var(--black); }

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet */
@media (max-width: 991px) {
  .hero-title {
    letter-spacing: -2px;
  }

  .hero-stats {
    gap: 16px;
    padding: 12px 24px;
  }

  .hero-stat-number {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .hero {
    min-height: 90vh;
    min-height: 90dvh;
  }

  .hero-content {
    padding: 32px 20px;
  }

  .hero-title {
    letter-spacing: -1.5px;
  }

  .hero-subtitle br {
    display: none;
  }

  .hero-stats {
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
  }

  .hero-stat-divider {
    width: 40px;
    height: 1px;
  }

  .hero-cta {
    width: 100%;
    text-align: center;
  }

  .filters-bar {
    margin-left: 16px;
    margin-right: 16px;
    padding: 12px 16px;
    border-radius: 16px;
  }

  .filters-row {
    flex-direction: column;
    gap: 8px;
  }

  .filter-group {
    min-width: 100%;
  }

  .filters-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .table-container {
    padding: 0 16px;
  }

  .table-scroll {
    border-radius: 16px;
  }

  .site-footer {
    padding: 0 16px;
  }

  .footer-inner {
    border-radius: 24px;
    padding: 24px 20px;
  }
}

/* Small mobile */
@media (max-width: 479px) {
  .hero-eyebrow {
    font-size: 0.6875rem;
  }

  .hero-stats {
    width: 100%;
  }
}
