/* Shared by every page that uses the full site chrome (index.html, work.html). */

/* ============ Fonts ============ */
@font-face {
  font-family: "New Vision";
  src: url("../brand_assets/New%20Vision/NewVision-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "New Vision";
  src: url("../brand_assets/New%20Vision/NewVision-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "New Vision";
  src: url("../brand_assets/New%20Vision/NewVision-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "New Vision";
  src: url("../brand_assets/New%20Vision/NewVision-ExtraBold.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "New Vision";
  src: url("../brand_assets/New%20Vision/NewVision-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ============ Tokens ============ */
:root {
  --ink: #14120f;
  --ink-2: #1c1a15;
  --ink-3: #262319;
  --paper: #f5f1e8;
  --paper-2: #ece5d3;
  --paper-dim: #cdc6b3;
  --gold: #fdbd18;
  --blue: #2173b9;
  --coral: #f38183;
  --green: #009961;
  --green-bright: #1fc686;
  --red: #cc3438;
  --line-dark: rgba(245, 241, 232, 0.14);
  --line-light: rgba(20, 18, 15, 0.12);

  --font-display: "New Vision", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.4, 0, 0.6, 1);

  --container: 1320px;
  --pad-inline: clamp(1.25rem, 5vw, 3rem);
  --section-pad: clamp(4.5rem, 11vw, 9rem);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad-inline); }

:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 999;
  background: var(--green); color: var(--ink); padding: 0.75rem 1.25rem;
  font-weight: 700; border-radius: 4px; transition: top 0.3s var(--ease-spring);
}
.skip-link:focus { top: 1rem; }

/* ============ Grain overlay ============ */
.grain {
  position: fixed; inset: 0; z-index: 300; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-transparency: reduce) { .grain { display: none; } }

/* ============ Nav noise (static burst on menu clicks) ============ */
/* Plain alpha compositing, not a blend mode. Overlay and screen nearly vanish
   against the site's near-black sections, and this needs to actually read. */
.nav-noise {
  position: fixed; inset: 0; z-index: 500; pointer-events: none; opacity: 0;
  background-size: 180px 180px; background-repeat: repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.nav-noise.is-active { animation: navNoise 550ms steps(1, end); }
@keyframes navNoise {
  0% { opacity: 0.75; background-position: 0 0; }
  10% { opacity: 0.8; background-position: 37px 91px; }
  22% { opacity: 0.25; background-position: 112px 12px; }
  34% { opacity: 0.6; background-position: 8px 143px; }
  48% { opacity: 0.2; background-position: 150px 66px; }
  62% { opacity: 0.45; background-position: 63px 5px; }
  78% { opacity: 0.15; background-position: 20px 120px; }
  100% { opacity: 0; background-position: 90px 40px; }
}

/* ============ CRT scanlines (persistent, faint) ============ */
.scanlines {
  position: fixed; inset: 0; z-index: 302; pointer-events: none; opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,0.9) 0px, rgba(255,255,255,0.9) 1px, transparent 1px, transparent 3px);
}
@media (prefers-reduced-transparency: reduce) { .scanlines { display: none; } }

/* ============ CRT boot sequence (once, on load) ============ */
.crt-boot {
  position: fixed; inset: 0; z-index: 600; background: var(--ink);
  clip-path: inset(0 0 0 0); pointer-events: none;
}
.crt-boot__line {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scaleX(0);
  width: 100%; height: 2px; background: var(--paper);
  box-shadow: 0 0 16px 2px rgba(245, 241, 232, 0.7);
  opacity: 0; transition: transform 260ms var(--ease-press), opacity 200ms linear;
}
.crt-boot.is-lit .crt-boot__line { opacity: 1; transform: translate(-50%, -50%) scaleX(1); }
.crt-boot.is-open {
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 480ms var(--ease-spring);
}
.crt-boot.is-open .crt-boot__line { opacity: 0; transition: opacity 150ms linear; }
.crt-boot.is-done { display: none; }
@media (prefers-reduced-motion: reduce) {
  .crt-boot { transition: opacity 250ms linear !important; clip-path: none !important; }
  .crt-boot.is-open { opacity: 0; clip-path: none; }
  .crt-boot__line { display: none; }
}

/* ============ Tape strip (signature motif) ============ */
.tape-strip { display: flex; width: 100%; height: 5px; }
.tape-strip span { flex: 1; }
.tape-strip .c-gold { background: var(--gold); }
.tape-strip .c-blue { background: var(--blue); }
.tape-strip .c-coral { background: var(--coral); }
.tape-strip .c-green { background: var(--green); }
.tape-strip .c-red { background: var(--red); }
.tape-strip--top { position: fixed; top: 0; left: 0; z-index: 400; }

/* ============ Type scale ============ */
/* Channel tag: a dial position, not a decorative eyebrow. The hero photo already
   shows "01" glowing on the CRT, so the rest of the page counts up from there. */
.chan {
  display: inline-flex; align-items: center; gap: 0.65em;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 500; color: var(--paper);
}
/* Styled like a mechanical tape counter window: a lit little display, not a plain label. */
.chan__num {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; padding: 0.2em 0.45em; border: 1.5px solid currentColor; border-radius: 3px;
  font-weight: 700; font-size: 0.95em; letter-spacing: 0.06em;
  background: color-mix(in srgb, currentColor 12%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent), 0 0 8px color-mix(in srgb, currentColor 35%, transparent);
  overflow: hidden;
}
.chan__num::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.16;
  background-image: repeating-linear-gradient(to bottom, currentColor 0px, currentColor 1px, transparent 1px, transparent 2px);
}

/* Fixed, viewport-scaled gap from the channel tag above, the same in every
   section regardless of how big that section's own heading happens to be. */
h1.h-section, h2.h-section, .manifesto__lead, .contact__title {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}
h1.h-section, h2.h-section {
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.02;
  font-size: clamp(2.25rem, 5.2vw, 4.25rem);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.9em 1.7em; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  border-radius: 100px; transition: transform 0.5s var(--ease-spring), background-color 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring), box-shadow 0.4s var(--ease-spring);
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); transition: transform 0.15s var(--ease-press); }
.btn-gold, .nav__link.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: color-mix(in srgb, var(--gold) 85%, white); box-shadow: 0 10px 30px -8px rgba(253, 189, 24, 0.55); }
.btn-ghost { border: 1.5px solid rgba(245, 241, 232, 0.35); color: var(--paper); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(245, 241, 232, 0.12); border-color: rgba(245, 241, 232, 0.6); }

/* ============ Nav ============ */
.nav {
  position: fixed; top: 5px; left: 0; right: 0; z-index: 350;
  padding: 1.35rem var(--pad-inline);
  display: flex; align-items: center; justify-content: space-between;
  transition: padding 0.5s var(--ease-spring), background-color 0.5s var(--ease-spring), backdrop-filter 0.5s var(--ease-spring), border-color 0.5s var(--ease-spring);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-block: 0.9rem;
  background: rgba(20, 18, 15, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--line-dark);
}
@media (prefers-reduced-transparency: reduce) {
  .nav.is-scrolled { background: var(--ink); backdrop-filter: none; }
}
.nav__logo { font-weight: 900; font-size: 1.4rem; color: var(--paper); letter-spacing: -0.02em; }
.nav__links { display: flex; align-items: center; gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.nav__link {
  position: relative; font-weight: 500; font-size: 0.9rem; color: var(--paper);
  padding-block: 0.3rem;
  transition: color 0.25s var(--ease-spring);
}
/* An invisible bold copy reserves the wider width up front, so the real
   text going bold on hover never pushes its neighbors sideways. */
.nav__link:not(.btn)::before {
  content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden;
  font-weight: 800;
}
/* Each item lights up its own color on hover, no underline */
.nav__link[data-label="Work"]:hover, .nav__link[data-label="Work"]:focus-visible { color: var(--blue); font-weight: 800; }
.nav__link[data-label="Services"]:hover, .nav__link[data-label="Services"]:focus-visible { color: var(--red); font-weight: 800; }
.nav__link[data-label="About"]:hover, .nav__link[data-label="About"]:focus-visible { color: var(--gold); font-weight: 800; }
.nav__link[data-label="Team"]:hover, .nav__link[data-label="Team"]:focus-visible { color: var(--coral); font-weight: 800; }
.nav__link[aria-current="page"] { color: var(--blue); font-weight: 800; }
.nav__cta { margin-left: 0.5rem; }
.nav__toggle { display: none; }

@media (max-width: 880px) {
  .nav__links { position: fixed; inset: 0; z-index: 340; background: var(--ink);
    flex-direction: column; justify-content: center; gap: 2rem;
    transform: translateY(-100%); opacity: 0; transition: transform 0.5s var(--ease-spring), opacity 0.4s var(--ease-spring);
    pointer-events: none;
  }
  .nav__links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__link { font-size: 1.6rem; }
  .nav__cta { margin-left: 0; }
  .nav__toggle {
    display: flex; flex-direction: column; gap: 5px; z-index: 341; padding: 0.5rem;
    position: relative;
  }
  .nav__toggle span { width: 22px; height: 2px; background: var(--paper); transition: transform 0.35s var(--ease-spring), opacity 0.3s; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============ Sections ============ */
section { position: relative; padding-block: var(--section-pad); }
section.on-ink { background: var(--ink); color: var(--paper); }

/* ============ Work / Case studies ============ */
.case {
  margin-top: clamp(3rem, 7vw, 5rem); padding-top: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line-light);
}
.case:first-of-type { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: none; padding-top: 0; }
.case__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.case__tag {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.35em 0.8em; border-radius: 100px; border: 1px solid var(--line-dark); color: var(--paper-dim);
}
.case h3 { font-weight: 800; letter-spacing: -0.02em; font-size: clamp(1.8rem, 3.4vw, 2.75rem); line-height: 1.08; max-width: 42ch; }
.case p.case__desc { margin-top: 1rem; max-width: 60ch; font-size: 1.05rem; color: var(--paper-dim); line-height: 1.7; }
.case__media { margin-top: 2.25rem; }

.video-embed {
  position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden;
  background: var(--ink); cursor: pointer; box-shadow: 0 30px 60px -25px rgba(20,18,15,0.4);
}
.video-embed img { width: 100%; height: 100%; object-fit: cover; opacity: 0.78; transition: opacity 0.4s var(--ease-spring), transform 0.6s var(--ease-spring); }
.video-embed:hover img { opacity: 0.9; transform: scale(1.03); }
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  padding: 0.9rem 1.3rem; border-radius: 4px; border: 1px solid rgba(245, 241, 232, 0.3);
  background: rgba(20, 18, 15, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.4s var(--ease-spring), border-color 0.35s, background-color 0.35s;
}
.video-embed:hover .play-btn { transform: translate(-50%, -50%) scale(1.06); border-color: rgba(204, 52, 56, 0.7); background: rgba(41, 18, 18, 0.6); }
.play-btn__pixel {
  display: block; width: 118px; height: 30px; image-rendering: pixelated;
}
.play-btn__pixel--hover {
  position: absolute; inset: 0.9rem 1.3rem; opacity: 0;
  transition: opacity 0.15s steps(3, end);
}
.video-embed:hover .play-btn__pixel--hover { opacity: 1; }
.video-embed__tag {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper); background: rgba(20, 18, 15, 0.55); backdrop-filter: blur(4px);
  padding: 0.4em 0.7em; border-radius: 4px; border: 1px solid rgba(245, 241, 232, 0.25);
}
.video-embed__glitch {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 3px);
}
.video-embed.is-tracking .video-embed__glitch { opacity: 0.5; animation: trackingJitter 220ms steps(3, end); }
@keyframes trackingJitter {
  0% { transform: translateY(0); }
  33% { transform: translateY(-6px); }
  66% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .video-embed.is-tracking .video-embed__glitch { animation: none; opacity: 0.3; } }

.case__gallery {
  margin-top: 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem;
}
.case__gallery img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; }
@media (max-width: 700px) { .case__gallery { grid-template-columns: 1fr 1fr; } .case__gallery img:first-child { grid-column: 1 / -1; aspect-ratio: 16/9; } }

/* Link from the homepage cases to /work */
.work-more { margin-top: clamp(3rem, 7vw, 5rem); }

/* Project index on /work: one capsule per project, wrapping onto new lines */
.work-index { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(2rem, 4vw, 2.75rem); }

/* ============ Contact / Footer ============ */
.contact { overflow: hidden; padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.contact__mark {
  position: absolute; right: -6%; top: 50%; transform: translateY(-50%);
  width: min(60vw, 640px); opacity: 0.05; pointer-events: none; z-index: 0;
}
.contact__inner { position: relative; z-index: 1; }
.contact__title {
  font-weight: 900; letter-spacing: -0.035em; line-height: 0.98; color: var(--paper);
  font-size: clamp(2.75rem, 7.5vw, 6rem); max-width: 14ch;
}
.contact__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1.25rem 2rem; margin-top: 1.75rem; }
.contact__email {
  font-weight: 700; font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: var(--paper);
  transition: color 0.3s;
}
.contact__email:hover { color: var(--gold); }

.contact__grid {
  margin-top: clamp(3.5rem, 8vw, 6rem); padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line-dark);
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
}
@media (min-width: 780px) { .contact__grid { grid-template-columns: 1.1fr 0.9fr 0.9fr; gap: 2rem; } }
.contact__block h4 {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-dim); margin-bottom: 0.9rem;
}
.contact__block address, .contact__block p { font-style: normal; font-size: 0.98rem; line-height: 1.7; color: var(--paper); }
.contact__address { color: var(--paper); transition: color 0.3s; }
.contact__address:hover { color: var(--green-bright); }
/* Follows the cursor while hovering the address text; positioned via JS. */
.contact__map {
  position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none;
  width: 220px; opacity: 0; transform: scale(0.96); transform-origin: top left;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line-dark);
  box-shadow: 0 24px 48px -14px rgba(0,0,0,0.6);
  transition: opacity 0.25s var(--ease-spring), transform 0.25s var(--ease-spring);
}
.contact__map.is-visible { opacity: 1; transform: scale(1); }
.social-list { display: flex; flex-direction: column; gap: 0.6rem; }
.social-list a { font-size: 0.98rem; color: var(--paper); transition: color 0.3s; display: inline-flex; align-items: center; gap: 0.5rem; }
.social-list a[href*="youtube"]:hover { color: var(--red); }
.social-list a[href*="instagram"]:hover { color: var(--gold); }
.social-list a[href*="linkedin"]:hover { color: var(--blue); }
.social-list a[href*="tiktok"]:hover { color: var(--coral); }
.social-list a::after { content: "→"; opacity: 0; transform: translateX(-4px); transition: 0.3s var(--ease-spring); }
.social-list a:hover::after { opacity: 1; transform: translateX(0); }

.footer-bottom {
  margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.75rem; border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-size: 0.8rem; color: var(--paper-dim); font-family: var(--font-mono); letter-spacing: 0.02em;
}

.sticker {
  position: absolute; width: 218px; right: 9%; top: 1.75rem; transform: rotate(-9deg); z-index: 3;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,0.35)); transition: transform 0.5s var(--ease-spring);
}
.sticker:hover { transform: rotate(-4deg) scale(1.05); }
@media (max-width: 700px) { .sticker { display: none; } }

/* ============ Reveal on scroll ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-spring), transform 0.9s var(--ease-spring); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-group .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-group .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-group .reveal:nth-child(4) { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity 0.6s linear; }
}

::selection { background: var(--green); color: var(--ink); }
