:root {
  color-scheme: dark;
  --canvas: #09090b;
  --card: #121215;
  --elevated: #18181b;
  --hairline: rgba(255, 255, 255, 0.08);
  --hover-border: rgba(255, 255, 255, 0.18);
  --amber-glow: rgba(245, 158, 11, 0.22);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
}
body {
  background: var(--canvas);
  color: #fafafa;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
}

main,
section,
.marquee-container,
.marquee-track {
  overflow-x: clip !important;
  max-width: 100% !important;
}

body.menu-open { overflow: hidden !important; }

[data-navbar] {
  position: fixed;
  top: 1rem;
  left: 50%;
  width: calc(100% - 2rem);
  max-width: 72rem;
  transform: translate(-50%, 0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-navbar].navbar-hidden { transform: translate(-50%, -130%); }

#mobile-menu {
  display: none;
  opacity: 0;
  transform: translateY(-1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-menu.is-open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-toggle span {
  display: block;
  width: 0.85rem;
  height: 1px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.8);
}

footer a:not(.btn-pill),
.text-link {
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

footer a:not(.btn-pill):hover,
.text-link:hover {
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.bg-grid-pattern {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
}

.glass-pill {
  background: rgba(18, 18, 21, 0.7);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ========================================================
   ACETERNITY OPTICAL SPOTLIGHT & AMBIENT LIGHT LEAK
   ======================================================== */

.spotlight-card {
  position: relative;
  background: #121215;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: 
    border-color 0.3s ease, 
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease;
}

.spotlight-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
}

/* Layer 1: Ambient Optical Light Leak (Warm Amber Bleed) */
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    380px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(245, 158, 11, 0.14) 0%,
    rgba(245, 158, 11, 0.04) 35%,
    transparent 70%
  );
  filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

/* Layer 2: Sharp Edge Border Illumination */
.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    500px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(255, 255, 255, 0.06),
    transparent 50%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.spotlight-card:hover::before,
.spotlight-card:hover::after {
  opacity: 1;
}

/* Ensure all text, buttons, and badges stay crisp above the light flare */
.spotlight-card > * {
  position: relative;
  z-index: 2;
}

.hero-glow {
  background: radial-gradient(circle, var(--amber-glow) 0%, rgba(245, 158, 11, 0) 68%);
  filter: blur(16px);
}

.metallic-text {
  background: linear-gradient(180deg, #fff 10%, #d4d4d8 52%, #71717a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.showreel-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

.marquee-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  max-width: 100% !important;
  animation: scroll 34s linear infinite;
}

.marquee-track.reverse { animation-direction: reverse; animation-duration: 38s; }
.marquee-viewport:hover .marquee-track { animation-play-state: paused; }

.marquee-logo {
  color: #71717a;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.marquee-logo:hover {
  color: #fff;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.22);
}

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

.comparison-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 360px;
  background: #121215;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  touch-action: none;
  user-select: none;
}

.comparison-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.comparison-frame.raw {
  background:
    radial-gradient(circle at 30% 34%, rgba(113, 113, 122, 0.28), transparent 22%),
    linear-gradient(135deg, #27272a, #09090b 58%, #18181b);
}

.comparison-frame.graded {
  background:
    radial-gradient(circle at 70% 32%, rgba(245, 158, 11, 0.45), transparent 24%),
    radial-gradient(circle at 30% 75%, rgba(6, 182, 212, 0.35), transparent 28%),
    linear-gradient(135deg, #082f49, #18181b 48%, #451a03);
}

.comparison-frame::after {
  content: '';
  position: absolute;
  inset: 18% 9% 20%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, 0.08) 46%, transparent 47%);
  transform: skewY(-8deg);
  opacity: 0.65;
}

.comparison-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: inset(0 0 0 50%);
}

.comparison-divider {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.3);
  transform: translateX(-50%);
  pointer-events: none;
}

.comparison-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  height: 48px;
  width: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
  background: rgba(18, 18, 21, 0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.comparison-thumb::before,
.comparison-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.comparison-thumb::before { left: 12px; transform: translateY(-50%) rotate(-135deg); }
.comparison-thumb::after { right: 12px; transform: translateY(-50%) rotate(45deg); }

.comparison-label {
  position: relative;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  background: rgba(9, 9, 11, 0.58);
  padding: 0.45rem 0.65rem;
  font: 500 9px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.comparison-frame.graded .comparison-label {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
}

.comparison-frame.raw .comparison-label {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
}

.project-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background:
    radial-gradient(circle at 72% 30%, var(--cover-glow, rgba(245, 158, 11, 0.35)), transparent 28%),
    linear-gradient(135deg, var(--cover-start, #27272a), var(--cover-end, #09090b));
}

.project-cover::after {
  content: '';
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.08) 41%, transparent 42%);
  transform: skewY(-8deg);
}

.project-cover-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.projects-list .project-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 0.62fr);
  gap: 1.5rem;
  align-items: center;
}

.projects-list .project-item .project-cover {
  aspect-ratio: 16 / 8;
}

.project-item {
  min-height: 28rem;
  padding: 0 !important;
}

.project-item .project-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  transition: transform 0.5s ease;
}

.project-item:hover .project-cover { transform: scale(1.05); }

.project-item::after,
.case-study-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 25%, rgba(9, 9, 11, 0.4) 55%, rgba(9, 9, 11, 0.9) 100%);
  pointer-events: none;
}

.project-item > div:last-child {
  position: absolute;
  inset: auto 1.5rem 1.5rem;
  z-index: 2;
  padding: 0;
}

.case-study-card {
  position: relative;
  min-height: 25rem;
  overflow: hidden;
}

.case-study-card > * { position: relative; z-index: 2; }

.case-study-card::before {
  z-index: 0;
  opacity: 1;
  filter: blur(0);
  background: linear-gradient(135deg, var(--case-start, #422006), var(--case-end, #09090b));
}

.projects-list .project-item {
  min-height: 0;
  padding: 1rem !important;
}

.projects-list .project-item .project-cover {
  position: relative;
  inset: auto;
  z-index: auto;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.projects-list .project-item::after,
.projects-list .project-item > div:last-child {
  position: static;
  inset: auto;
}

.projects-list .project-item::after {
  display: none;
}

.projects-list .project-item > div:last-child {
  padding: 0;
}

.department-bento {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.department-bento > article {
  background: #121215;
  padding: 2rem;
  transition: background 0.25s ease;
}

.department-bento > article:hover { background: #18181b; }

@media (min-width: 768px) {
  .department-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.article-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.article-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transform-origin: left;
}

.article-prose {
  color: #a1a1aa;
  font-size: 1.125rem;
  line-height: 1.9;
}

.article-prose h2,
.article-prose h3 {
  color: #fafafa;
  font-family: 'Inter Tight', sans-serif;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.article-prose h2 { margin: 3.5rem 0 1.25rem; font-size: 2.25rem; }
.article-prose h3 { margin: 2.5rem 0 1rem; font-size: 1.5rem; }
.article-prose p { margin: 1.25rem 0; }
.article-prose ul { margin: 1.5rem 0; padding-left: 1.5rem; }
.article-prose li { margin: 0.75rem 0; }
.article-prose li::marker { color: #f59e0b; }
.article-prose blockquote {
  margin: 2.5rem 0;
  border-left: 2px solid #f59e0b;
  padding-left: 1.5rem;
  color: #fafafa;
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.switcher-callout {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  background: #0c0c0f;
  padding: 1.25rem;
  color: #fbbf24;
  font: 500 0.8rem/1.7 'JetBrains Mono', monospace;
}

@media (max-width: 640px) {
  .projects-list .project-item { grid-template-columns: 1fr; }
  .project-item { min-height: 32rem; }
}

@media (max-width: 767px) {
  [data-navbar] {
    top: 1rem;
  }

  [data-navbar] .desktop-nav,
  [data-navbar] .desktop-cta {
    display: none;
  }

  [data-navbar] {
    padding: 0.65rem 0.75rem;
  }
}

.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

.magnetic-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #fff;
  pointer-events: none;
  z-index: 99999999;
  will-change: transform, width, height, border-radius, background, border;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.25s ease, background-color 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.magnetic-cursor.is-snapped {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  /* Remove backdrop-filter so text remains 100% crystal clear! */
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
}

/* Ensure all link and button text stays crisp and readable on top */
a, button, [role="button"], .btn {
  position: relative;
  z-index: 1;
}

@media (pointer: fine) {
  html, body, a, button, input, [role="button"], .btn { cursor: none !important; }
}

@media (pointer: coarse) {
  .magnetic-cursor { display: none !important; }
  html, body, a, button { cursor: auto !important; }
}
