/* NVO Studio — design system
   ---------------------------------------------------------------------------
   Direction: Frosted Glass — chosen via /ui-ux-pro-max's Glassmorphism style
   match against a deep indigo-navy base (real backdrop-filter blur on every
   card, not flat panels — "modern SaaS/high-end corporate" per the tool's own
   best-for list, which fits an internal creative-production tool). One cool
   blue accent is the sole interactive color; amber stays reserved strictly
   for the product-shot warning, unchanged across every candidate this was
   picked from.
   --------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* surfaces */
  --bg: #0a0e1f;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-raised: rgba(255, 255, 255, 0.1);
  --surface-hover: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);

  /* text */
  --text: #f1f5ff;
  --text-muted: #93a0c4;
  --text-faint: #5c6690;

  /* accent — cool blue, the one interactive color */
  --accent: #4c8dff;
  --accent-strong: #7fadff;
  --accent-wash: rgba(76, 141, 255, 0.16);

  /* semantic */
  --amber: #d99a3d;
  --amber-strong: #f0b25b;
  --amber-wash: rgba(217, 154, 61, 0.14);
  --danger: #c2604a;

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

  /* rhythm */
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Author rules like `.panel { display: flex }` tie the UA [hidden] rule on
   specificity, and author beats UA on ties — so any hidden-toggled element
   with its own display rule silently stays visible without this. */
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  font-size: 15px;
  line-height: 1.55;
  position: relative;
  /* Ambient color bloom is what the glass cards need to actually read as
     glass — backdrop-filter blur has nothing to reveal depth in if the page
     behind it is a flat fill. */
  background-image:
    radial-gradient(ellipse 1100px 650px at 14% -8%, rgba(76, 141, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 800px 550px at 100% 28%, rgba(139, 92, 246, 0.16), transparent 55%);
  background-repeat: no-repeat;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.02 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

a { color: inherit; }

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

button:focus-visible,
[tabindex]:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- layout */

.page {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 32px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 4px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 6px;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.top-bar h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(100deg, var(--text) 40%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-bar .mono-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-bottom: 4px;
}

/* ----------------------------------------------------------------- grid */

.grid {
  display: grid;
  /* True 9:16 cards sized from column width (not viewport height) — 3 even
     columns, height follows from aspect-ratio. That means 3 rows of full
     portrait cards almost never fit one viewport, so the page scrolls
     normally instead of clamping everything into 100vh. */
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------- card */

.card {
  --card-accent: var(--accent);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 420ms var(--ease) forwards;
  animation-delay: var(--stagger, 0ms);
  transition: border-color 220ms var(--ease), transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.card::before {
  /* top edge stripe — each format's own color, a real contact-sheet/reel
     convention (color-coded edge markers), not a swatch */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent);
  z-index: 3;
  opacity: 0.85;
}

.card:hover, .card:focus-visible {
  border-color: var(--card-accent);
  transform: scale(1.01);
  box-shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px color-mix(in srgb, var(--card-accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card:hover .frame video {
  filter: brightness(1.08) saturate(1.08);
}

.card:active { transform: scale(0.99); }

.card.locking {
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.95);
}

.overlay-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 12px 14px 14px;
  /* frosted glass over the footage — real blur, not a solid card underneath */
  background: linear-gradient(to top, rgba(10, 14, 31, 0.9) 0%, rgba(10, 14, 31, 0.68) 65%, rgba(10, 14, 31, 0) 100%);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-panel .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.card-index {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--card-accent);
  background: rgba(10, 14, 31, 0.6);
  backdrop-filter: blur(6px);
  padding: 2px 6px;
  border-radius: 999px;
  z-index: 2;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.required-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  color: #1c1408;
  background: var(--amber-strong);
  box-shadow: 0 0 0 3px rgba(10, 14, 31, 0.5);
}

.frame video {
  transition: filter 300ms var(--ease);
}

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #05070f;
  overflow: hidden;
}

.frame video, .frame img.poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame .poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-faint);
  text-align: center;
  padding: 24px;
}

.frame::after {
  /* light top scrim, just enough for the index badge / play-hint to stay
     legible over bright footage — the bottom text now lives on its own
     frosted panel below, not on this gradient */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.32) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 60%);
  pointer-events: none;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}

.tag[data-tone="amber"] {
  color: var(--amber-strong);
  border-color: rgba(217, 154, 61, 0.35);
  background: var(--amber-wash);
  font-weight: 600;
}

.tag[data-tone="subtle"] {
  color: var(--text-faint);
  border-style: dashed;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  color: var(--text-faint);
  border: 1px solid currentColor;
  cursor: help;
  flex: none;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.info-icon:hover, .info-icon:focus-visible {
  color: var(--accent-strong);
}

.tooltip-bubble {
  position: fixed;
  z-index: 80;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}

.tooltip-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-bubble::after {
  content: '';
  position: absolute;
  left: var(--arrow-x, 50%);
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-top: none;
  border-left: none;
  transform: translateX(-50%) rotate(45deg);
}

.tag-sublabel {
  font-size: 12px;
  color: var(--amber-strong);
  opacity: 0.9;
  margin-top: -4px;
}

/* -------------------------------------------------------------- skeletons */

.skeleton .frame {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-raised) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

/* ------------------------------------------------------------- error state */

.error-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
  max-width: 480px;
}

.error-state .msg {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}

.btn:hover { background: var(--surface-hover); border-color: var(--accent); }

.btn-accent {
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 16%, transparent);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 45%, transparent);
  color: var(--card-accent, var(--accent));
}

.btn-accent:hover { background: color-mix(in srgb, var(--card-accent, var(--accent)) 26%, transparent); }

/* -------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 16, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  display: flex;
  gap: 28px;
  max-width: 920px;
  width: calc(100% - 64px);
  max-height: calc(100vh - 80px);
  background: rgba(10, 14, 31, 0.72);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--border-strong)) 30%, var(--border-strong));
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 24px 64px -20px rgba(0, 0, 0, 0.7), 0 0 60px -24px var(--card-accent, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(8px) scale(0.98);
  transition: transform 220ms var(--ease);
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-video {
  flex: 0 0 300px;
  aspect-ratio: 9 / 16;
  background: #0b0b08;
  border-radius: var(--radius);
  overflow: hidden;
}

.modal-video video { width: 100%; height: 100%; object-fit: cover; }

.modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.modal-info .key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.modal-info h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.modal-info .desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--surface-hover); }

.modal-wrap { position: relative; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
