/* ============================================================
   VISUALaiZERS — monochrome manga / editorial
   ============================================================ */
:root {
  --ink: #f4f4f4;
  --ink-dim: #9a9a9a;
  --paper: #050505;
  --paper-2: #0c0c0c;
  --line: #262626;
  --display: "Archivo Black", sans-serif;
  --body: "Space Grotesk", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

/* ============ HEADER ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  transition: background 0.35s ease, border-color 0.35s ease,
              opacity 0.5s ease, transform 0.5s ease;
  border-bottom: 1px solid transparent;
  mix-blend-mode: difference; /* inverts over the white katakana shot */
  /* hidden on the opening screen — slides in on first scroll */
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}
.site-header.shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.site-header.scrolled { mix-blend-mode: normal; }
.site-header.scrolled {
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.brand-logo { height: 34px; display: block; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.site-nav a:hover { opacity: 1; }
.site-nav .nav-cta {
  border: 1px solid var(--ink);
  padding: 8px 16px;
  opacity: 1;
  transition: background 0.2s, color 0.2s;
}
.site-nav .nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ============ HERO SCRUB ============ */
.cinematic { height: 680vh; position: relative; }
.cinematic .sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #000;
}
#frame-canvas { width: 100%; height: 100%; display: block; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.5));
}
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---- glitch logo intro ---- */
.logo-intro {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: #000;
  pointer-events: none;
}
.glitch {
  position: relative;
  width: min(500px, 72vw);
  aspect-ratio: 515.78 / 173;
  animation: g-flicker 4.2s steps(1) infinite;
}
.g {
  position: absolute;
  inset: 0;
  -webkit-mask: url("assets/logo.svg") center / contain no-repeat;
  mask: url("assets/logo.svg") center / contain no-repeat;
}
.g-base { background: #f4f4f4; }
/* monochrome ghost copies — gray echoes instead of RGB split */
.g-ghost-a { background: #6f6f6f; mix-blend-mode: screen; animation: g-shift-r 2.9s steps(1) infinite; }
.g-ghost-b { background: #3c3c3c; mix-blend-mode: screen; animation: g-shift-c 2.9s steps(1) infinite; }
/* static / particle bursts inside the letterforms */
.g-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='discrete' tableValues='0 1'/%3E%3CfeFuncG type='discrete' tableValues='0 1'/%3E%3CfeFuncB type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 90px 90px;
  opacity: 0;
  animation: g-noise 2.9s steps(1) infinite;
}
.g-slice { background: #fff; opacity: 0; animation: g-slice 3.6s steps(1) infinite; }

@keyframes g-shift-r {
  0%, 6%, 12%, 45%, 52%, 74%, 82%, 100% { transform: none; }
  7%  { transform: translate(12px, -3px); }
  9%  { transform: translate(-14px, 3px); }
  46% { transform: translate(18px, 0); }
  49% { transform: translate(-9px, 0); }
  76% { transform: translate(13px, 5px); }
}
@keyframes g-shift-c {
  0%, 6%, 12%, 45%, 52%, 74%, 82%, 100% { transform: none; }
  7%  { transform: translate(-12px, 3px); }
  9%  { transform: translate(14px, -3px); }
  46% { transform: translate(-18px, 0); }
  49% { transform: translate(9px, 0); }
  76% { transform: translate(-13px, -5px); }
}
@keyframes g-slice {
  0%, 100% { opacity: 0; }
  8%  { opacity: 1; clip-path: inset(16% 0 72% 0); transform: translateX(-24px); }
  10% { opacity: 0; }
  47% { opacity: 1; clip-path: inset(60% 0 26% 0); transform: translateX(28px); }
  49% { opacity: 0; }
  77% { opacity: 1; clip-path: inset(38% 0 50% 0); transform: translateX(-20px); }
  79% { opacity: 0; }
}
@keyframes g-noise {
  0%, 100% { opacity: 0; }
  7%  { opacity: 0.55; background-position: 12px 30px; }
  9%  { opacity: 0.85; background-position: -40px 8px; }
  11% { opacity: 0; }
  46% { opacity: 0.7; background-position: 60px -22px; }
  48% { opacity: 0.4; background-position: -15px 45px; }
  50% { opacity: 0; }
  76% { opacity: 0.6; background-position: -55px -10px; }
  78% { opacity: 0; }
}
@keyframes g-flicker {
  0%, 100% { opacity: 1; }
  8.5%  { opacity: 0.65; }
  9%    { opacity: 1; }
  47.5% { opacity: 0.75; }
  48%   { opacity: 1; }
  77.5% { opacity: 0.7; }
  78%   { opacity: 1; }
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
  padding: 0 6vw;
}
.overlay .reveal-line {
  grid-area: 1 / 1;
  opacity: 0;
  font-family: var(--display);
  font-size: clamp(30px, 5.6vw, 78px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.7);
}
.overlay .kicker {
  align-self: start;
  margin-top: 22vh;
  font-family: var(--body);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

.scroll-hint {
  position: absolute;
  z-index: 4;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  opacity: 1;
  transition: opacity 0.4s;
  animation: hint-bob 1.6s ease-in-out infinite;
}
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 7px); }
}

/* ---- sound toggle (hero only) ---- */
.sound-btn {
  position: absolute;
  z-index: 4;
  right: 28px;
  bottom: 24px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s, border-color 0.2s, background 0.2s;
}
/* only offered once the film is actually rolling */
.sound-btn.visible { opacity: 0.65; visibility: visible; }
.sound-btn.visible:hover { opacity: 1; border-color: rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.6); }
.sound-btn svg { width: 100%; height: 100%; display: block; }
.sound-btn .icon-waves { display: none; }
.sound-btn.on .icon-waves { display: block; }
.sound-btn.on .icon-slash { display: none; }
@media (max-width: 600px) {
  .sound-btn { right: 16px; bottom: 20px; width: 34px; height: 34px; padding: 7px; }
}

/* ============ PANELS ============ */
.panel {
  position: relative;
  padding: 16vh 6vw 12vh;
  background: var(--paper);
}
.panel-head { max-width: 980px; }
.index-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 7px 14px;
  margin-bottom: 34px;
}
.panel h2 {
  font-family: var(--display);
  font-size: clamp(44px, 8vw, 118px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.lede {
  margin-top: 28px;
  max-width: 560px;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--ink-dim);
}

/* ============ REELS ============ */
.reel-carousel { position: relative; margin-top: 9vh; }
.reel-grid {
  display: grid;
  grid-auto-flow: column;
  /* four across on desktop — three gaps between four columns */
  grid-auto-columns: calc((100% - 3 * 22px) / 4);
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.reel-grid::-webkit-scrollbar { display: none; }
.reel-card { scroll-snap-align: start; }

.reel-arrow {
  position: absolute;
  /* vertically centered on the VIDEO, not the whole card (set via JS var) */
  top: var(--reel-arrow-top, 50%);
  transform: translateY(-50%);
  z-index: 5;
  width: 34px;
  height: 52px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s, transform 0.2s;
}
.reel-arrow svg { width: 100%; height: 100%; display: block; }
.reel-arrow:hover { color: var(--ink); }
.reel-arrow.next:hover { transform: translateY(-50%) translateX(3px); }
.reel-arrow.prev:hover { transform: translateY(-50%) translateX(-3px); }
/* fully outside the reel frame, tucked into the panel gutter */
.reel-arrow.next { right: -60px; }
.reel-arrow.prev { left: -60px; }
.reel-arrow[hidden] { display: none; }
.reel-card { position: relative; }
.reel-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.reel-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.06);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.45s ease;
}
.reel-card:hover .reel-media video { transform: scale(1.045); filter: none; }
.reel-card figcaption { padding: 18px 2px 0; }
.reel-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
}
.reel-card h3 {
  font-family: var(--display);
  font-size: 22px;
  margin: 8px 0 6px;
  letter-spacing: 0.02em;
}
.reel-card p { font-size: 14px; line-height: 1.55; color: var(--ink-dim); }
/* each card carries both a full and a short description — only one is ever shown */
.reel-card .desc-short { display: none; }

/* ============ SPEED-LINE DIVIDERS ============ */
.speedlines {
  height: 130px;
  background: repeating-linear-gradient(
    100deg,
    var(--paper) 0px,
    var(--paper) 26px,
    var(--ink) 26px,
    var(--ink) 27.5px
  );
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
  opacity: 0.22;
}
.speedlines.flip { transform: scaleX(-1); }

/* ============ STUDIO ============ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 9vh;
}
.service {
  background: var(--paper);
  padding: 42px 36px 48px;
  transition: background 0.25s;
}
.service:hover { background: var(--paper-2); }
.service-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
}
.service h3 {
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 28px);
  margin: 16px 0 12px;
  letter-spacing: 0.02em;
}
.service p { font-size: 15px; line-height: 1.6; color: var(--ink-dim); max-width: 40ch; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 10vh;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
}
.stat-label {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ============ CONTACT ============ */
.contact { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; }
.cta {
  display: inline-block;
  margin-top: 46px;
  font-family: var(--display);
  font-size: clamp(17px, 2vw, 24px);
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  padding: 20px 38px;
  letter-spacing: 0.03em;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
.cta:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--ink-dim);
}

.site-footer {
  margin-top: 14vh;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  max-width: calc(100% - 150px);
  display: flex;
  align-items: center;
  gap: 18px;
}
.footer-logo { height: 26px; opacity: 0.9; }
.footer-legal {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.social-link svg { width: 20px; height: 20px; }
.social-link:hover { opacity: 1; }
/* accounts that don't exist yet: visible, dimmed, and not clickable */
.social-link.is-inactive { opacity: 0.3; cursor: default; pointer-events: none; }

/* ============ SCROLL REVEALS ============ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }
.reel-card.reveal:nth-child(2) { transition-delay: 0.12s; }
.reel-card.reveal:nth-child(3) { transition-delay: 0.24s; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  /* two across on mobile */
  .reel-grid { grid-auto-columns: calc((100% - 14px) / 2); gap: 14px; }
  .reel-card h3 { font-size: 17px; }
  /* two narrow columns turn the full copy into a wall — swap in the short
     descriptions, which are written to fit two lines whole */
  .reel-card p { font-size: 12.5px; line-height: 1.5; }
  .reel-card .desc-full { display: none; }
  .reel-card .desc-short { display: block; }
  .reel-arrow.next { right: 4px; }
  .reel-arrow.prev { left: 4px; }
  .service-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; gap: 48px; }
  .brand-logo { height: 26px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 12px; }
  .cinematic { height: 560vh; }
}

/* ============================================================
   V1 OVERRIDES — self-playing hero film + APC branding
   ============================================================ */
.cinematic.v1 { height: 220vh; }
#hero-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* time-synced headlines (same look as the scrub lines) */
.overlay .timed-line {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: var(--display);
  font-size: clamp(30px, 5.6vw, 78px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.7);
}
.overlay .timed-line.on { opacity: 1; transform: none; }
.overlay .timed-line.kicker {
  align-self: start;
  margin-top: 22vh;
  font-family: var(--body);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

/* glitch logo hands over to the film */
.logo-intro { transition: opacity 0.9s ease; }
.logo-intro.gone { opacity: 0; visibility: hidden; }
/* used when the intro is rewound off-screen — the logo must be back instantly */
.logo-intro.no-fade { transition: none; }

/* header tagline */
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.header-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--ink-dim);
  border-left: 1px solid var(--line);
  padding-left: 16px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .header-tag { display: none; }
  .cinematic.v1 { height: 200vh; }
}

/* ============ MOBILE PASS ============ */
@media (max-width: 600px) {
  /* compact header: logo + contact button only */
  .site-header { padding: 14px 18px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .site-nav .nav-cta { padding: 7px 13px; font-size: 11px; }

  /* footer: brand row on top, legal stacked below */
  .site-footer { max-width: 100%; flex-wrap: wrap; gap: 16px; }
  .footer-legal { margin-left: 0; flex-basis: 100%; font-size: 11px; line-height: 1.6; }

  /* hero copy breathing room on small screens */
  .overlay { padding: 0 8vw; }
  .overlay .timed-line { font-size: clamp(24px, 7.4vw, 36px); }
  .overlay .timed-line.kicker { font-size: 11px; margin-top: 18vh; }

  .panel { padding: 12vh 7vw 10vh; }
  .cta { width: 100%; text-align: center; padding: 18px 20px; box-sizing: border-box; }
}

/* ============ COMPACT SPACING ============ */
.panel { padding: 100px 6vw 90px; }
.index-tag { margin-bottom: 22px; }
.lede { margin-top: 20px; }
.reel-carousel { margin-top: 50px; }
.service-grid { margin-top: 50px; }
.stat-row { margin-top: 70px; }
.contact .cta { margin-top: 36px; }
.site-footer { margin-top: 90px; }

/* ============ HEADER BRAND — subtle glitch on the logo ============ */
.brand-glitch {
  position: relative;
  display: block;
  height: 34px;
  aspect-ratio: 515.78 / 173;
}
.bg-l {
  position: absolute;
  inset: 0;
  -webkit-mask: url("assets/logo.svg") center / contain no-repeat;
  mask: url("assets/logo.svg") center / contain no-repeat;
}
.bg-base { background: #fff; animation: bg-flick 7s steps(1) infinite; }
.bg-ghost { background: #8d8d8d; mix-blend-mode: screen; opacity: 0; animation: bg-ghost 7s steps(1) infinite; }
@keyframes bg-ghost {
  0%, 100% { opacity: 0; transform: none; }
  41%   { opacity: 1; transform: translateX(2px); }
  42.2% { opacity: 1; transform: translateX(-2.5px); }
  43%   { opacity: 0; transform: none; }
  86%   { opacity: 1; transform: translate(2px, 1px); }
  87%   { opacity: 0; transform: none; }
}
@keyframes bg-flick {
  0%, 100% { opacity: 1; }
  41.6% { opacity: 0.75; }
  42.2% { opacity: 1; }
  86.4% { opacity: 0.8; }
  86.8% { opacity: 1; }
}

/* ============ MOBILE HAMBURGER MENU ============ */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(5, 5, 5, 0.97);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 38px; text-align: center; }
.mobile-menu a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 30px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .menu-btn { display: flex; }
  .site-nav { display: none; }
  .panel { padding: 70px 7vw 60px; }
  .site-footer { margin-top: 70px; }
}

/* hamburger menu items — hover/tap feedback */
.mobile-menu a {
  color: var(--ink-dim);
  transition: color 0.25s ease, letter-spacing 0.25s ease, transform 0.25s ease;
}
.mobile-menu a:hover,
.mobile-menu a:active {
  color: #fff;
  letter-spacing: 0.06em;
  transform: translateX(6px);
}

/* mobile: contact section shouldn't stretch to fill the viewport */
@media (max-width: 600px) {
  .contact { min-height: 0; display: block; }
  .contact .site-footer { margin-top: 60px; }
}

/* web: contact no longer stretches full-height — footer sits under the CTA */
.contact { min-height: 0; display: block; }
.contact .site-footer { margin-top: 80px; }
