/* Self-hosted fonts (latin subset) */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/dm-mono-normal-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/dm-mono-normal-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/dm-sans-normal-400-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/syne-normal-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/syne-normal-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* Premium Editorial Media Agency Theme */
  --bg-obsidian: #0D040A;
  --bg-surface: #190614;
  --bg-surface-elevated: #240A1D;
  --bg-surface-highlight: #330F29;
 
  /* Brand Accents (Prompt design tokens) */
  --accent-cyan: #00D8F5;
  --accent-cyan-glow: rgba(0, 216, 245, 0.25);
  --accent-blue: #3B82F6;
  --accent-magenta: #E72B88;
  --accent-gold: #FFD32A;
  --accent-yellow: #FFD32A;
  --accent-yellow-glow: rgba(255, 211, 42, 0.3);
  --accent-wine: #180E20;
  --accent-wine-glow: rgba(231, 43, 136, 0.25);
  
  --border-subtle: rgba(255,255,255,0.10);
  --border-hover: rgba(0, 216, 245, 0.4);
  --text-primary: #F8F7FC;
  --text-secondary: #B5AFC0;
  --text-muted: #81798C;
  --scrollbar-track: #06020c;
  --scrollbar-thumb: #241432;
  --scrollbar-thumb-hover: #3b1d54;

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-offset: 5.5rem;
  --touch-target: 44px;

  caret-color: var(--accent-cyan);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
  font-family: var(--font-body);
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  caret-color: var(--accent-cyan);
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  caret-color: var(--accent-cyan);
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  hyphens: manual;
  -webkit-hyphens: manual;
  word-break: normal;
}

h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.3;
}

h1, h2, h3, h4 {
  text-wrap: balance;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
}

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

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

/* Reading measure utility (68ch keeps prose in the 45-75ch comfort band) */
.measure,
.prose-limit {
  max-width: 68ch;
}

/*
 * Weight safety net. Syne 800/900 is an extended (wide) face, which reads as
 * "stretched" on uppercase headings; DM Mono only ships 400/500.
 * Tailwind CDN injects its stylesheet after this file, so selectors below use
 * extra specificity (html body + compound classes) instead of !important.
 */
html body .font-display.font-extrabold,
html body .font-display.font-black,
html body .font-display[class*="font-[8"],
html body .font-display[class*="font-[9"],
html body .font-display .font-extrabold,
html body .font-display .font-black,
html body .font-display.font-bold,
html body .font-display b,
html body .font-display strong {
  font-weight: 700;
}

html body .font-mono.font-semibold,
html body .font-mono.font-bold,
html body .font-mono.font-extrabold,
html body .font-mono.font-black,
html body .font-mono[class*="font-[6"],
html body .font-mono[class*="font-[7"],
html body .font-mono[class*="font-[8"],
html body .font-mono[class*="font-[9"],
html body .font-mono .font-semibold,
html body .font-mono .font-bold,
html body .font-mono .font-extrabold,
html body .font-mono .font-black,
html body .font-mono b,
html body .font-mono strong {
  font-weight: 500;
}

/* Uppercase Syne headings: tighten slightly instead of stretching */
html body :is(h1, h2, h3, h4).font-display.uppercase {
  letter-spacing: -0.015em;
}

html body .font-display.uppercase:not(:is(h1, h2, h3, h4)):not([class*="tracking-"]) {
  letter-spacing: -0.01em;
}

/* Uppercase mono labels: sane default tracking when none is declared */
html body .font-mono.uppercase:not([class*="tracking-"]) {
  letter-spacing: 0.06em;
}

/*
 * Tracking guard. letter-spacing inherits as a computed LENGTH, so small
 * children of a heavily tracked parent end up with 0.2em+ ratios. Cap the
 * heavy values and re-express tracking in em on descendants.
 */
html body .tracking-widest {
  letter-spacing: 0.1em;
}

html body [class*="tracking-[0.15"],
html body [class*="tracking-[0.16"],
html body [class*="tracking-[0.17"],
html body [class*="tracking-[0.18"],
html body [class*="tracking-[0.19"],
html body [class*="tracking-[0.2"],
html body [class*="tracking-[0.3"],
html body [class*="tracking-[0.4"],
html body [class*="tracking-[0.5"] {
  letter-spacing: 0.14em;
}

html body .font-mono.uppercase.tracking-widest,
html body .font-mono.uppercase[class*="tracking-[0.15"],
html body .font-mono.uppercase[class*="tracking-[0.16"],
html body .font-mono.uppercase[class*="tracking-[0.17"],
html body .font-mono.uppercase[class*="tracking-[0.18"],
html body .font-mono.uppercase[class*="tracking-[0.19"],
html body .font-mono.uppercase[class*="tracking-[0.2"],
html body .font-mono.uppercase[class*="tracking-[0.3"],
html body .font-mono.uppercase[class*="tracking-[0.4"],
html body .font-mono.uppercase[class*="tracking-[0.5"] {
  letter-spacing: 0.1em;
}

.tracking-widest :not([class*="tracking-"]),
.tracking-wider :not([class*="tracking-"]),
[class*="tracking-[0."] :not([class*="tracking-"]) {
  letter-spacing: 0.06em;
}

/* Type floor: nothing below 12px */
html body [class*="text-[8px]"],
html body [class*="text-[9px]"],
html body [class*="text-[10px]"],
html body [class*="text-[11px]"] {
  font-size: 0.75rem;
}

/* Long emails/URLs must wrap inside cards instead of overflowing */
.media-card a,
.glass-panel a,
.glass-panel-elevated a,
a[href^="mailto:"],
a[href^="tel:"],
footer a {
  overflow-wrap: anywhere;
}

.media-card p,
.glass-panel p,
.glass-panel-elevated p {
  overflow-wrap: break-word;
}


/* Styled Browser Surfaces */
::selection {
  background: var(--accent-cyan);
  color: var(--bg-obsidian);
}

::-moz-selection {
  background: var(--accent-cyan);
  color: var(--bg-obsidian);
}

input, textarea, select {
  caret-color: var(--accent-cyan);
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Subtle Film Grain Overlay */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Ambient Studio Light Flares */
.studio-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 768px) {
  .studio-glow {
    max-width: 75vw !important;
    max-height: 75vw !important;
    filter: blur(80px) !important;
  }
}

/* Partner Footprint Rail */
.partner-badge-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Dynamic Cyan-Blue-Yellow Shimmer */
.studio-shimmer {
  background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.4), rgba(255, 230, 0, 0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s infinite linear;
}

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

/* Audio Waveform Bars with Smooth Exponential Motion */
@keyframes wave-motion {
  0%, 100% { height: 6px; }
  50% { height: 28px; }
}

.wave-bar {
  display: inline-block;
  width: 3.5px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px;
  animation: wave-motion 1.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0.1s; }
.wave-bar:nth-child(2) { animation-delay: 0.4s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.6s; }
.wave-bar:nth-child(5) { animation-delay: 0.3s; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; }
.wave-bar:nth-child(7) { animation-delay: 0.25s; }
.wave-bar:nth-child(8) { animation-delay: 0.45s; }

.wave-bar.paused {
  animation-play-state: paused;
  height: 6px !important;
}

/* Card Hover Elevation */
.media-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 8px 24px -4px rgba(0, 0, 0, 0.6);
}

/* Glassmorphism Classes with Impeccable Generous Insets */
.glass-panel {
  background: rgba(25, 6, 20, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
}

.glass-panel-elevated {
  background: rgba(36, 10, 29, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 1.75rem;
}

/* Inset & Padding Utilities (Guarantees zero cramped borders) */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.p-12 { padding: 3rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* Modal Transitions */
.modal-overlay {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-content {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-hidden .modal-content {
  transform: scale(0.95) translateY(15px);
  opacity: 0;
}

/* Scanlines Effect */
.scanlines {
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(0, 210, 255, 0.03),
    rgba(255, 230, 0, 0.02),
    rgba(37, 99, 235, 0.03)
  );
  background-size: 100% 3px, 3px 100%;
  pointer-events: none;
}

/* Status Indicator Dot */
.pulse-cyan {
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Presenter Cutout Hero Elevation */
.presenter-glow {
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.85)) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

/* Fade the cropped bottom edge of the cutout into the page background */
.presenter-fade {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0.55) 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0.55) 80%, transparent 100%);
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Touch Targets (WCAG 2.5.8 / 44px comfort). :where() keeps display at zero
   specificity so Tailwind hidden/flex/block utilities still win. */
:where(header nav a),
:where(#mobile-menu a) {
  display: inline-flex;
  align-items: center;
}

header nav a,
#mobile-menu a {
  min-height: var(--touch-target);
  padding-block: 0.75rem;
}

:where(footer a) {
  display: inline-block;
}

footer a {
  padding-block: 0.5rem;
}

:where(a:has(> svg:only-child)),
:where(a[aria-label]:has(> svg)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a:has(> svg:only-child),
a[aria-label]:has(> svg),
#mobile-menu-btn,
#showreel-prev,
#showreel-next,
#showreel-play-toggle,
#modal-close-btn,
button:has(> svg:only-child) {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}

button:has(> svg:only-child) {
  align-items: center;
  justify-content: center;
}

@media (pointer: coarse) {
  button[data-filter],
  [role="tab"],
  [role="button"],
  footer a,
  header a {
    min-height: var(--touch-target);
  }

  button[data-filter] {
    padding-block: 0.75rem;
  }

  footer a {
    display: inline-flex;
    align-items: center;
  }
}

/* Skip Link (markup supplied separately: class="skip-link") */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: 0.5rem 1.25rem;
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0.5rem;
  transform: translateY(-200%);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Reduced Motion: drop travel, loops and smooth scroll; keep short fades so
   state changes remain perceivable. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
    transition-property: opacity, color, background-color, border-color, box-shadow !important;
    transition-duration: 0.15s !important;
    transition-delay: 0s !important;
  }

  [class*="animate-"],
  .studio-shimmer {
    animation: none !important;
  }

  .studio-shimmer {
    background-position: 50% 0;
    opacity: 0.6;
  }

  .wave-bar {
    animation: none !important;
    height: 14px;
  }

  .wave-bar:nth-child(1) { height: 8px; }
  .wave-bar:nth-child(2) { height: 18px; }
  .wave-bar:nth-child(3) { height: 12px; }
  .wave-bar:nth-child(4) { height: 22px; }
  .wave-bar:nth-child(5) { height: 14px; }
  .wave-bar:nth-child(6) { height: 20px; }
  .wave-bar:nth-child(7) { height: 10px; }
  .wave-bar:nth-child(8) { height: 16px; }

  .media-card:hover,
  [class*="hover:-translate"]:hover,
  [class*="hover:scale"]:hover,
  [class*="active:scale"]:active {
    transform: none !important;
  }

  .modal-hidden .modal-content {
    transform: none;
  }

  .skip-link {
    transition: none;
  }
}


/* Final typography & chrome refinements (audit pass 2) */
html body h1.font-display,
html body h2.font-display {
  font-weight: 600;
}
html body h1.font-display { line-height: 1.04; }
html body th,
html body th.font-mono { font-weight: 500; }
html body .font-serif { font-family: var(--font-body); }
header.glass-panel { padding: 0; }
html body .font-mono.uppercase { letter-spacing: 0.06em; }

/* Heading weight override beats the .font-display.font-bold cap above */
html body h1.font-display.font-bold,
html body h2.font-display.font-bold { font-weight: 600; }

/* Standalone text links & compact controls: comfortable hit areas */
html body main a:is([class*="underline"], [class*="font-mono"]):not(.rounded-full):not([class*="rounded-xl"]):not([class*="rounded-lg"]),
html body footer li a,
html body footer a[href^="tel:"],
html body footer a[href^="mailto:"],
html body main a[href^="tel:"],
html body main a[href^="mailto:"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
html body #sound-toggle-btn,
html body header a[href="#brief"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* Inquiry form */
.field-label { display:block; margin-bottom:0.5rem; font-family:'DM Mono',ui-monospace,monospace; font-size:0.75rem; letter-spacing:0.05em; text-transform:uppercase; color:#94a3b8; }
.field-input { width:100%; padding:0.875rem 1rem; border-radius:0.75rem; background:rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.12); color:#fff; font-size:0.875rem; transition:border-color .15s, box-shadow .15s; }
.field-input::placeholder { color:rgba(148,163,184,0.7); }
.field-input:focus-visible { outline:2px solid var(--accent-cyan); outline-offset:2px; border-color:#00d2ff; box-shadow:0 0 0 3px rgba(0,210,255,0.25); }
.field-input:user-invalid { border-color:#f87171; }
.chip { min-height:44px; padding:0.5rem 1rem; border-radius:9999px; border:1px solid rgba(255,255,255,0.12); background:rgba(0,0,0,0.4); color:#cbd5e1; font-size:0.75rem; font-weight:700; transition:background .15s, border-color .15s, color .15s; }
.chip:hover { border-color:rgba(255,255,255,0.35); }
.chip[aria-pressed="true"] { background:#22d3ee; border-color:#22d3ee; color:#020617; }
