/* ==========================================================================
   MANFRINATO — portfolio
   brutalist / experimental
   ========================================================================== */

:root{
  --bg: #0a0a0a;
  --bg-2: #111111;
  --fg: #f4f2ec;
  --fg-dim: #8a8a84;
  --accent: #a259ff;
  --line: #2a2a26;
  --line-strong: #f4f2ec;

  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --edge: clamp(16px, 3vw, 48px);
}

*, *::before, *::after{ box-sizing: border-box; }

html{
  background: var(--bg);
  scroll-behavior: smooth;
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video{ max-width: 100%; display: block; }

a{ color: inherit; text-decoration: none; }

ul{ list-style: none; margin: 0; padding: 0; }

::selection{ background: var(--accent); color: #0a0a0a; }

/* thin scrollbar, webkit only, cosmetic */
::-webkit-scrollbar{ width: 10px; }
::-webkit-scrollbar-track{ background: var(--bg); }
::-webkit-scrollbar-thumb{ background: var(--line); border: 2px solid var(--bg); }

/* ---------- noise overlay ---------- */
.noise{
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- custom cursor ---------- */
.cursor{
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, background-color .25s ease;
}
.cursor-label{
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #0a0a0a;
  background: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  opacity: 0;
  white-space: nowrap;
  transition: opacity .2s ease, transform .2s ease;
}
.cursor-label.is-active{ opacity: 1; }
.cursor.is-view{ width: 64px; height: 64px; background: transparent; border: 1px solid var(--accent); mix-blend-mode: normal; }

@media (hover: none), (pointer: coarse){
  .cursor, .cursor-label{ display: none; }
}

/* ---------- reveal on scroll ---------- */
[data-reveal]{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
[data-reveal].is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   header
   ========================================================================== */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--edge);
  mix-blend-mode: difference;
}
.brand{
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.site-header nav{
  display: flex;
  gap: clamp(16px, 3vw, 40px);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.site-header nav a{
  position: relative;
  padding-bottom: 2px;
}
.site-header nav a::after{
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.site-header nav a:hover::after{ transform: scaleX(1); transform-origin: left; }

/* ==========================================================================
   hero
   ========================================================================== */
.hero{
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}
.hero video{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .55;
  filter: grayscale(.15) contrast(1.05);
}
.hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,10,.35) 0%, rgba(10,10,10,.15) 40%, rgba(10,10,10,.85) 100%);
  z-index: 1;
}
.hero-logo{
  position: relative;
  z-index: 2;
  width: min(78vw, 720px);
  animation: logo-in 1.4s cubic-bezier(.16,1,.3,1) both .2s;
}
@keyframes logo-in{
  from{ opacity: 0; transform: translateY(18px) scale(.98); letter-spacing: -.02em; }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
.hero-scroll{
  position: absolute;
  left: var(--edge);
  bottom: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero-scroll .line{
  width: 1px; height: 40px;
  background: var(--fg-dim);
  position: relative;
  overflow: hidden;
}
.hero-scroll .line::after{
  content: "";
  position: absolute;
  left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scroll-line 1.8s ease-in-out infinite;
}
@keyframes scroll-line{
  0%{ top: -100%; }
  60%{ top: 100%; }
  100%{ top: 100%; }
}
.hero-index{
  position: absolute;
  right: var(--edge);
  bottom: 28px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--fg-dim);
  text-align: right;
}

/* ==========================================================================
   marquee
   ========================================================================== */
.marquee{
  background: var(--accent);
  color: #0a0a0a;
  overflow: hidden;
  border-top: 1px solid #0a0a0a;
  border-bottom: 1px solid #0a0a0a;
  padding: 14px 0;
}
.marquee-track{
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-track span{
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(14px, 2.2vw, 22px);
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
  padding: 0 24px;
}
.marquee-track span::after{ content: "◆"; margin-left: 24px; font-size: .6em; vertical-align: middle; }
@keyframes marquee{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ==========================================================================
   section labels (shared)
   ========================================================================== */
.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--edge);
  margin-bottom: clamp(28px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.section-head .tag{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-head h2{
  font-size: clamp(32px, 6vw, 64px);
  line-height: .95;
  margin: 8px 0 0;
  text-transform: uppercase;
}
.section-head .meta{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  text-align: right;
  letter-spacing: .05em;
}

/* ==========================================================================
   intro
   ========================================================================== */
.intro{
  padding: clamp(90px, 14vw, 160px) 0 clamp(60px, 10vw, 100px);
}
.intro-body{
  padding: 0 var(--edge);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.intro-body p{
  grid-column: 4 / 13;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(20px, 2.6vw, 34px);
  line-height: 1.35;
  color: var(--fg);
  margin: 0;
}
.intro-body p .dim{ color: var(--fg-dim); }
@media (max-width: 800px){
  .intro-body p{ grid-column: 1 / 13; }
}

/* ==========================================================================
   work / mosaic
   ========================================================================== */
.work{ padding: clamp(40px, 8vw, 80px) 0 clamp(80px, 10vw, 140px); }

.mosaic{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 2px;
  padding: 0 var(--edge);
  background: var(--line);
  border-top: 1px solid var(--line);
}
.card{
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}
.card.big{ grid-column: span 2; grid-row: span 2; }
.card img{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.85);
  transform: scale(1.06);
  transition: transform .7s cubic-bezier(.16,1,.3,1), filter .5s ease;
}
.card:hover img{
  filter: grayscale(0) contrast(1.05) brightness(.95);
  transform: scale(1.12);
}
.card::before{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 40%, rgba(10,10,10,.9) 100%);
  z-index: 1;
}
.card-num{
  position: absolute;
  top: 16px; left: 16px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--fg);
  mix-blend-mode: difference;
}
.card-info{
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(8px);
  opacity: .85;
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .4s ease;
}
.card:hover .card-info{ transform: translateY(0); opacity: 1; }
.card-name{
  font-size: clamp(18px, 2vw, 26px);
  text-transform: uppercase;
  line-height: 1;
}
.card-tag{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.card-arrow{
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--fg);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-45deg) scale(.8);
  opacity: 0;
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .4s ease, background .3s ease, color .3s ease;
}
.card:hover .card-arrow{
  transform: rotate(0deg) scale(1);
  opacity: 1;
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

@media (max-width: 900px){
  .mosaic{ grid-template-columns: repeat(2, 1fr); }
  .card.big{ grid-column: span 2; grid-row: span 1; aspect-ratio: 16/10; }
}
@media (max-width: 560px){
  .mosaic{ grid-template-columns: 1fr; }
  .card.big{ grid-column: span 1; }
}

/* ==========================================================================
   footer
   ========================================================================== */
.site-footer{
  padding: clamp(60px, 10vw, 120px) var(--edge) 40px;
  border-top: 1px solid var(--line);
}
.footer-cta{
  font-size: clamp(36px, 8vw, 100px);
  line-height: .95;
  text-transform: uppercase;
  margin: 0 0 clamp(28px, 5vw, 48px);
  max-width: 16ch;
}
.footer-cta a{
  position: relative;
  display: inline-block;
}
.footer-cta a::after{
  content: "";
  position: absolute;
  left: 0; bottom: 4%;
  width: 100%; height: 6%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
  z-index: -1;
}
.footer-cta a:hover::after{ transform: scaleX(1); }

.footer-grid{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.footer-grid a{ color: var(--fg); }
.footer-social{ display: flex; gap: 20px; }
.footer-social a{ position: relative; }
.footer-social a::after{
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s ease;
}
.footer-social a:hover::after{ transform: scaleX(1); transform-origin: left; }

/* ==========================================================================
   client page
   ========================================================================== */
.client-hero{
  padding: clamp(120px, 18vw, 200px) var(--edge) clamp(40px, 6vw, 70px);
  border-bottom: 1px solid var(--line);
}
.back-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: clamp(24px, 4vw, 48px);
}
.back-link:hover{ color: var(--accent); }
.client-hero h1{
  font-size: clamp(40px, 9vw, 140px);
  line-height: .92;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.client-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.client-meta span b{ color: var(--fg); font-weight: 700; }

.client-description{
  max-width: 62ch;
  margin-top: clamp(24px, 4vw, 40px);
}
.client-description p{
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--fg-dim);
  margin: 0;
}

/* ---------- about page ---------- */
.about-hero{
  padding: clamp(120px, 18vw, 200px) var(--edge) clamp(40px, 6vw, 70px);
  border-bottom: 1px solid var(--line);
}
.about-hero-grid{
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  margin-top: clamp(20px, 4vw, 40px);
}
.about-hero-text h1{
  font-size: clamp(40px, 9vw, 140px);
  line-height: .92;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.about-meta span b{ color: var(--accent); }
.about-photo{
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--bg-2);
}
.about-photo img{
  width: 100%; height: 100%;
  object-fit: cover;
}
@media (max-width: 800px){
  .about-hero-grid{ grid-template-columns: 1fr; }
  .about-photo{ max-width: 320px; }
}

.about-body{
  padding: clamp(50px, 8vw, 90px) var(--edge) clamp(90px, 12vw, 150px);
}
.about-body-inner{ max-width: 68ch; }
.about-body-inner p{
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.6;
  color: var(--fg-dim);
  margin: 0 0 clamp(24px, 4vw, 36px);
}
.about-body-inner p:last-child{ margin-bottom: 0; }

.about-tools{
  margin-top: clamp(50px, 8vw, 80px);
  padding-top: clamp(32px, 5vw, 48px);
  border-top: 1px solid var(--line);
}
.about-tools-label{
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(20px, 3vw, 28px);
}
.about-tools-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.tool-icon{
  width: clamp(48px, 6vw, 64px);
  height: clamp(48px, 6vw, 64px);
  flex: 0 0 auto;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-icon img{
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ---------- multi-section client galleries (e.g. Key Visuals / campaign) ---------- */
.gallery-section{
  border-top: 1px solid var(--line);
}
.gallery-section-head{
  padding: clamp(32px, 5vw, 56px) var(--edge) clamp(20px, 3vw, 28px);
}
.gallery-section-head .tag{
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.gallery-section-head h2{
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.gallery-section-head p{
  max-width: 62ch;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
  color: var(--fg-dim);
  margin: 0;
}

.gallery{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 2px var(--edge) 0;
  background: var(--line);
}
.gallery-item{
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--bg-2);
  cursor: zoom-in;
}
.gallery-item.wide{ grid-column: span 2; aspect-ratio: 16/9; }
.gallery-item img, .gallery-item video{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}
.gallery-item:hover img, .gallery-item:hover video{ transform: scale(1.05); }
.gallery-item .play{
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(10,10,10,.55);
  border: 1px solid var(--fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* image items show the full frame instead of a cropped square/portrait crop */
.gallery-item.is-image{
  grid-column: 1 / -1;
  aspect-ratio: auto;
  background: var(--bg-2);
}
.gallery-item.is-image img{
  position: static;
  width: 100%;
  height: auto;
  display: block;
}

/* videos inside a mixed image+video gallery: full width, real aspect
   ratio (set inline per item) so nothing crops and no gap is left
   beside a full-width image. */
.gallery-item.is-full{ grid-column: 1 / -1; }

/* smaller, evenly sized tiles for a sectioned gallery: shows the full
   frame (no crop) inside a box sized to the item's own real ratio,
   instead of running the image edge-to-edge at full size. */
.gallery-item.is-boxed{ aspect-ratio: 16/9; }
.gallery-item.is-boxed img{ object-fit: contain; }

/* mosaic (masonry) layout: each item keeps its own natural aspect ratio;
   items are pre-sorted server-side into whichever column is shortest so
   far (classic masonry bin-packing), so an odd count or a mix of
   portrait and landscape tiles never leaves a dangling gap the way a
   fixed-row grid does — the browser's own column-balance heuristic can
   still misjudge badly when one tile is a big outlier, so the balancing
   is done at generation time instead of left to the browser. */
.gallery.is-mosaic{
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: 2px var(--edge) 0;
  background: var(--line);
}
.mosaic-col{
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gallery.is-mosaic .gallery-item{ width: 100%; }

/* featured row: a handful of stand-out items (e.g. launch posters, a
   3-episode series) shown smaller, side by side, ahead of the mosaic —
   rather than left in it, where being a size outlier throws the column
   balance off. */
.gallery.is-featured{
  display: flex;
  gap: 2px;
  padding: 2px var(--edge) 0;
  background: var(--line);
}
.gallery.is-featured .gallery-item{ flex: 1 1 0; min-width: 0; width: auto; }

@media (max-width: 700px){
  .gallery{ grid-template-columns: 1fr; }
  .gallery-item.wide{ grid-column: span 1; aspect-ratio: 4/5; }
  .gallery-item.is-boxed{ aspect-ratio: 16/9; }
  .gallery.is-mosaic{ flex-direction: column; align-items: stretch; }
  .gallery.is-featured{ flex-direction: column; }
}

.project-nav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(40px, 8vw, 80px) var(--edge);
  border-top: 1px solid var(--line);
  margin-top: clamp(40px, 6vw, 60px);
}
.project-nav a{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-nav a span{ font-family: var(--sans); font-size: clamp(20px, 3vw, 34px); color: var(--fg); text-transform: uppercase; }
.project-nav a:hover span{ color: var(--accent); }
.project-nav .next{ text-align: right; align-items: flex-end; }

/* ---------- lightbox ---------- */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10,10,10,.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--edge);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.is-open{ opacity: 1; pointer-events: auto; }
.lightbox-inner{
  max-width: 1100px;
  max-height: 90vh;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 28px);
}
.lightbox-media{ width: 100%; flex: 0 0 auto; }
.lightbox-inner img, .lightbox-inner video{
  width: 100%; height: 100%;
  max-height: 72vh;
  object-fit: contain;
}
.lightbox-caption{
  flex: 0 0 auto;
  padding: 0 4px;
}
.lightbox-caption .tag{
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.lightbox-caption p{
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--fg-dim);
  max-width: 70ch;
  margin: 0;
}
.lightbox-close{
  position: absolute;
  top: 24px; right: var(--edge);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  padding: 10px 16px;
  border-radius: 999px;
}
.lightbox-close:hover{ background: var(--accent); color: #0a0a0a; border-color: var(--accent); }

/* utility */
.sr-only{
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
