/* voodoofx.tv site styles (on top of shared/base.css).
   Type: mathematic.tv uses Avalon (FontSite Inc.). Until its webfont is licensed and added to shared/fonts,
   Inter Tight stands in; the stack picks Avalon up automatically once an @font-face for it exists. */
:root {
  --bg: #000;
  --fg: #eee;
  --white: #fff;
  --grey: #8a8a8a;
  --edge: clamp(20px, 6vw, 80px);
  --gap: clamp(12px, 2.4vw, 32px);
  --content: min(100vw - 2 * var(--edge), 1166px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-menu: cubic-bezier(0.26, 1.04, 0.54, 1);
  --font: "Avalon", "Inter Tight", Helvetica, Arial, sans-serif;
  /* horizontal scanlines: a 1 px dark line every 2 px */
  --scan: repeating-linear-gradient(to bottom, #000 0 1px, transparent 1px 2px);
}

html { background: var(--bg); }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 18px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
body.menu-open { overflow: hidden; }

/* Scanline overlay on every video surface */
.scan { position: relative; }
.scan::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: var(--scan); opacity: .3;
}

.section-label {
  margin: 0 0 clamp(20px, 3vw, 36px); font-size: 14px; font-weight: 400;
  letter-spacing: .02em; color: var(--grey);
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(16px, 2.6vw, 30px) var(--edge);
  background: rgba(0, 0, 0, 0);
  transition: background-color .35s ease, padding .35s var(--ease-out), backdrop-filter .35s ease;
}
.site-header.is-scrolled {
  background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  padding-top: 14px; padding-bottom: 14px;
}
.logo { display: block; line-height: 0; }
.logo img { height: clamp(22px, 2.4vw, 32px); width: auto; }
.header-right { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }
.menu-btn, .menu-close { width: 32px; height: 32px; display: grid; place-items: center; color: var(--white); }
.menu-btn svg, .menu-close svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.5; fill: none; }

/* Menu overlay: white page, black diagonal corner, huge type */
.menu {
  position: fixed; inset: 0; z-index: 200; background: #fff; color: #000;
  padding: clamp(90px, 12vw, 150px) var(--edge) 48px; overflow-y: auto;
  clip-path: polygon(100% 0, 100% 0, 100% 0); transition: clip-path .5s var(--ease-menu);
}
.menu.is-open { clip-path: polygon(-200% 0, 100% 0, 100% 300%); }
.menu-tri {
  position: absolute; top: 0; right: 0; width: min(42vw, 520px); height: min(42vw, 520px);
  background: #000; clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.menu-close { position: absolute; z-index: 2; top: clamp(16px, 2.6vw, 30px); right: var(--edge); }
.menu-cols { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px var(--gap); max-width: 1166px; }
.menu-nav a, .menu-side a { display: block; color: #000; line-height: .98; letter-spacing: -0.03em; }
.menu-nav a { font-size: clamp(40px, 5.4vw, 72px); font-weight: 800; }
.menu-side a { font-size: clamp(22px, 2.6vw, 36px); font-weight: 300; margin-bottom: .15em; overflow-wrap: anywhere; }
.menu-nav a:hover, .menu-side a:hover { opacity: .55; }
.menu-label { display: block; font-size: 12px; color: #666; margin: 0 0 8px; }
.menu-side .menu-label:not(:first-child) { margin-top: 28px; }

/* Hero */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #000; touch-action: pan-y; }
.hero-slide { position: absolute; inset: 0; will-change: transform; }
.hero-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease; }
.hero-slide.is-leaving video { opacity: 0; }
.hero-slide::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 12% 50%, rgba(0,0,0,.45), rgba(0,0,0,0) 70%),
    linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 78%, rgba(0,0,0,.35));
}
.hero-info { position: absolute; z-index: 2; left: var(--edge); right: var(--edge); top: 50%; transform: translateY(-50%); color: var(--white); }
.hero-info a { display: inline-block; }
.hero-client { margin: 0; font-weight: 300; font-size: clamp(28px, 4.25vw, 56px); line-height: .9; letter-spacing: -0.015em; }
.hero-title { margin: 0; font-weight: 800; font-size: clamp(42px, 6.1vw, 80px); line-height: .86; letter-spacing: -0.05em; }
.hero-credit { display: block; margin-top: clamp(12px, 1.5vw, 20px); font-weight: 400; font-size: clamp(15px, 1.8vw, 24px); letter-spacing: -0.01em; }
.hero-diagonal { position: absolute; inset: 0; z-index: 3; pointer-events: none; width: 100%; height: 100%; }
.hero-diagonal line { stroke: rgba(255,255,255,.28); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hero-nav { position: absolute; z-index: 4; left: var(--edge); right: var(--edge); bottom: clamp(24px, 6vw, 64px); display: flex; justify-content: space-between; align-items: center; }
.hero-arrows { display: flex; gap: 18px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; color: var(--white); opacity: .85; transition: opacity .25s, transform .25s var(--ease-out); }
.icon-btn:hover { opacity: 1; }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.hero-prev:hover { transform: translateX(-3px); }
.hero-next:hover { transform: translateX(3px); }
.hero-down:hover { transform: translateY(3px); }
.hero-count { font-size: 13px; letter-spacing: .08em; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; margin-right: 10px; align-self: center; }

/* Intro */
.intro { padding: clamp(80px, 12vw, 160px) var(--edge); display: flex; justify-content: center; }
.intro p { margin: 0; max-width: 900px; font-size: clamp(22px, 2.45vw, 32px); line-height: .98; letter-spacing: -0.015em; font-weight: 300; }
.intro p strong { font-weight: 700; color: var(--white); }

/* Works mosaic */
.works, .reel, .services, .legacy { padding: 0 var(--edge) clamp(80px, 10vw, 140px); }
.works .section-label, .reel .section-label { width: var(--content); margin-left: auto; margin-right: auto; }
.works-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); width: var(--content); margin: 0 auto; align-items: start; }
/* each tile is half the size of the mathematic layout: two blocks per row */
.block { --g: calc(var(--gap) / 2); --bw: calc((var(--content) - var(--gap)) / 2); --cell: calc((var(--bw) - 3 * var(--g)) / 4); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: var(--cell); gap: var(--g); }
.block-g6a .t1 { grid-column: 1 / 3; grid-row: 1; }
.block-g6a .t2 { grid-column: 2 / 3; grid-row: 2; }
.block-g6a .t3 { grid-column: 3 / 5; grid-row: 1 / 3; }
.block-g6a .t4 { grid-column: 1 / 2; grid-row: 2 / 4; }
.block-g6a .t5 { grid-column: 2 / 4; grid-row: 3; }
.block-g6a .t6 { grid-column: 4 / 5; grid-row: 3; }
.block-g3b .t1 { grid-column: 1 / 3; grid-row: 1; }
.block-g3b .t2 { grid-column: 1 / 3; grid-row: 2; }
.block-g3b .t3 { grid-column: 3 / 5; grid-row: 1 / 3; }
.block-g3a .t1 { grid-column: 1 / 4; grid-row: 1 / 3; }
.block-g3a .t2 { grid-column: 4 / 5; grid-row: 1; }
.block-g3a .t3 { grid-column: 4 / 5; grid-row: 2; }
.block-strip { grid-column: 1 / -1; grid-auto-rows: auto; }
.block-strip .t1 { grid-column: 3 / 5; aspect-ratio: 16 / 5; }

.tile { position: relative; display: block; overflow: hidden; background: #0b0b0b; color: var(--white); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.tile:hover video { transform: scale(1.03); }
.tile-info {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: clamp(14px, 2vw, 24px);
  font-size: clamp(13px, 1.25vw, 18px); line-height: 1.05; letter-spacing: -0.02em;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.tile-info b { display: block; font-weight: 700; }
.tile-info span { font-weight: 300; }
.tile:hover .tile-info, .tile:focus-visible .tile-info { opacity: 1; transform: none; }
@media (hover: none) { .tile-info { opacity: 1; transform: none; } }

/* Client logos (white) used in place of brand names */
.client-logos { display: inline-flex; align-items: center; gap: .45em; vertical-align: middle; }
.client-logos img { height: calc(.82em * var(--s, 1)); width: auto; display: block; filter: brightness(0) invert(1); }
.hero-client .client-logos, .work-client .client-logos { margin-bottom: .14em; }
.tile-info .client-logos { margin-bottom: 4px; }
.tile-info .client-logos img { height: calc(1em * var(--s, 1)); }

/* Showreel */
.reel-player { width: var(--content); margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.reel-more { width: var(--content); margin: 18px auto 0; font-size: 15px; }
.reel-more a { color: var(--grey); border-bottom: 1px solid rgba(255,255,255,.25); }
.reel-more a:hover { color: var(--white); }

/* YouTube facade */
.yt { position: relative; overflow: hidden; background: #000; }
.yt video, .yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt-play {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; gap: 16px;
  padding: clamp(16px, 3vw, 40px); color: var(--white); text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,.5), rgba(0,0,0,0) 45%);
}
.yt-play-icon { width: clamp(48px, 5vw, 72px); height: clamp(48px, 5vw, 72px); flex: none; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; transition: background .25s, transform .4s var(--ease-out); }
.yt-play-icon svg { width: 40%; height: 40%; fill: currentColor; margin-left: 6%; }
.yt-play:hover .yt-play-icon { background: rgba(255,255,255,.15); transform: scale(1.06); }
.yt-play-text { font-size: clamp(18px, 2.4vw, 32px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.yt-play-text em { display: block; font-style: normal; font-weight: 300; }
.yt.is-playing .yt-play, .yt.is-playing::after { display: none; }
.yt iframe { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; border: 0; }

/* Services */
.services { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--gap); width: calc(var(--content) + 2 * var(--edge)); margin: 0 auto; }
.services-h { margin: 0; font-size: clamp(40px, 5.4vw, 72px); font-weight: 800; letter-spacing: -0.05em; line-height: .9; color: var(--white); }
.services-list { list-style: none; margin: 0; padding: 0; }
.services-list li { padding: clamp(18px, 2vw, 26px) 0; border-top: 1px solid rgba(255,255,255,.18); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.services-list li:last-child { border-bottom: 1px solid rgba(255,255,255,.18); }
.services-list h3 { display: flex; align-items: flex-start; gap: 16px; margin: 0; font-size: clamp(22px, 2.45vw, 32px); font-weight: 700; letter-spacing: -0.03em; line-height: .98; color: var(--white); }
.services-list p { margin: 0; font-size: clamp(16px, 1.4vw, 19px); font-weight: 300; line-height: 1.3; color: #cfcfcf; }

/* Service icons */
.svc-icon { flex: none; width: clamp(28px, 2.6vw, 40px); height: auto; margin-top: .05em; opacity: .95; }

/* Legacy row */
.legacy-head { width: var(--content); margin: 0 auto clamp(20px, 3vw, 36px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--gap); align-items: start; }
.legacy-head .section-label { margin: 0; }
.legacy-head p { margin: 0; font-size: clamp(18px, 1.8vw, 24px); font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; }
.brand-marquee { width: 100%; overflow: hidden; margin: -6px 0 clamp(28px, 4vw, 48px); padding: 6px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.brand-track { display: flex; width: max-content; will-change: transform; }
.brand-set { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex: none; }
.brand-set li { flex: none; margin-right: clamp(40px, 4.2vw, 72px); }
.brand-set img { height: calc(30px * var(--s, 1)); width: auto; display: block; filter: brightness(0) invert(1); opacity: .88; }
.brand-set .brand-text { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: #fff; opacity: .88; }
.legacy-row { width: var(--content); margin: 0 auto; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.legacy-item { min-width: 0; }
.legacy-logo { height: 48px; display: flex; align-items: center; justify-content: center; margin-top: 10px; font-size: 14px; font-weight: 700; color: #fff; text-align: center; }
.legacy-logo .client-logos img { height: calc(24px * var(--s, 1)); max-width: 100%; }
.tile-legacy { aspect-ratio: 3 / 4; }
.tile-legacy .tile-info { font-size: 15px; padding: 12px; }

/* Project page */
.work-player { width: 100%; height: 100vh; height: 100svh; max-height: 56.25vw; min-height: 320px; }
.work-info { width: var(--content); margin: 0 auto; padding: clamp(36px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }
.work-client { margin: 0; font-weight: 300; font-size: clamp(28px, 4.25vw, 56px); line-height: .9; letter-spacing: -0.015em; color: var(--white); }
.title-logo img { display: block; height: clamp(56px, 8.2vw, 108px); width: auto; margin: .1em 0 .14em; }
.work-title { margin: 0; font-weight: 800; font-size: clamp(42px, 6.1vw, 80px); line-height: .86; letter-spacing: -0.05em; color: var(--white); }
.work-credit { margin: clamp(12px, 1.5vw, 20px) 0 0; font-size: clamp(15px, 1.8vw, 24px); }
.work-share { margin: 28px 0 0; font-size: 14px; color: var(--grey); }
.work-share a { color: var(--fg); border-bottom: 1px solid rgba(255,255,255,.3); margin-left: 8px; }
.work-related { width: var(--content); margin: 0 auto; padding-bottom: clamp(50px, 7vw, 90px); }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.related-official { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.related-item { margin: 0; }
.related-item .yt { aspect-ratio: 16 / 9; }
.related-item .yt-play { align-items: center; justify-content: center; background: rgba(0,0,0,.2); }
.related-item figcaption { margin-top: 12px; font-size: 16px; font-weight: 300; }
.related-tile { aspect-ratio: 16 / 9; }
.work-next { border-top: 1px solid rgba(255,255,255,.18); }
.work-next a { display: block; width: var(--content); margin: 0 auto; padding: clamp(40px, 6vw, 80px) 0; color: var(--white); }
.work-next-label { display: block; font-size: 14px; color: var(--grey); margin-bottom: 14px; }
.work-next-client { display: block; font-weight: 300; font-size: clamp(24px, 3.4vw, 44px); line-height: .9; }
.work-next-title { display: block; font-weight: 800; font-size: clamp(34px, 5vw, 64px); line-height: .88; letter-spacing: -0.05em; transition: transform .4s var(--ease-out); }
.work-next a:hover .work-next-title { transform: translateX(10px); }
.page-work .site-header:not(.is-scrolled) { background: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0)); }

/* Footer */
.site-footer { padding: clamp(60px, 8vw, 110px) var(--edge) 40px; border-top: 1px solid rgba(255,255,255,.12); }
.footer-top, .footer-grid, .footer-legal { width: var(--content); margin-left: auto; margin-right: auto; }
.footer-logo { --w: min(640px, 86vw); display: block; width: var(--w); aspect-ratio: 1920 / 600; height: auto; margin-left: calc(var(--w) * -0.0833); object-fit: contain; background: #000; }
.footer-tag { margin: 10px 0 clamp(40px, 6vw, 70px); color: var(--grey); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px var(--gap); font-size: 15px; line-height: 1.4; }
.footer-grid > div > * { display: block; }
.footer-grid a { color: var(--fg); overflow-wrap: anywhere; }
.footer-grid a:hover { color: var(--white); text-decoration: underline; }
.footer-label { font-weight: 700; color: var(--white); margin-bottom: 4px; }
.footer-legal { margin-top: 48px; font-size: 13px; color: #666; }

@media (max-width: 800px) {
  .works-blocks { grid-template-columns: minmax(0, 1fr); }
  .block { --g: var(--gap); --cell: calc((var(--content) - var(--gap)) / 2); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .brand-set img { height: calc(24px * var(--s, 1)); }
  .block .tile { grid-column: auto !important; grid-row: auto !important; }
  .block .t1, .block-g6a .t3, .block-g3b .t3 { grid-column: span 2 !important; grid-row: span 2 !important; }
  .block-strip .t1 { grid-row: auto !important; aspect-ratio: 16 / 9; }
  .services, .legacy-head { grid-template-columns: minmax(0, 1fr); }
  .services-list li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .legacy-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .legacy-item { flex: 0 0 42vw; scroll-snap-align: start; }
  .related-grid, .related-official { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-cols { grid-template-columns: minmax(0, 1fr); }
  .work-player { height: auto; max-height: none; aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 640px) {
  .hero-info { top: auto; bottom: 110px; transform: none; }
  .hero-slide::before { background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 55%), linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0) 22%); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
