/* ===============================================================
   PORTFOLIO — grunge / streetwear build
   Structure: filterable work index (grid|list) + case study + info
   Palette pulled off the garment: black shell, red side panel.
   =============================================================== */

:root {
  --black:  #0b0b0c;
  --off:    #151517;
  --bone:   #e8e4dc;
  --ash:    #8c8880;
  --red:    #d81e34;
  --line:   #2a2a2d;
  --maxw:   1480px;
  --gut:    clamp(16px, 4vw, 54px);
  --mono:   "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp:   "Archivo Black", Impact, "Haettenschweiler", sans-serif;
  --body:   Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--bone);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* --- film grain over everything -------------------------------- */

.grain {
  position: fixed; inset: -150%; z-index: 9000; pointer-events: none;
  opacity: .19; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grainshift 700ms steps(1) infinite;
}
@keyframes grainshift {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(3%, 1%); }
}

/* --- type ------------------------------------------------------- */

h1, h2, h3 { margin: 0; font-weight: 400; line-height: .92; }

.disp {
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

.mono {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.ash { color: var(--ash); }
.red { color: var(--red); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: .9rem; margin-bottom: clamp(26px, 4vw, 56px);
}
.section-head h2 { font-family: var(--disp); text-transform: uppercase; font-size: clamp(1.4rem, 3.4vw, 2.5rem); letter-spacing: -.02em; }

.lede { font-size: clamp(1rem, 1.9vw, 1.3rem); line-height: 1.5; max-width: 60ch; color: var(--bone); }

/* fill-in slot — deliberately loud so nothing ships half-written */
.todo {
  color: #ffd84d;
  border-bottom: 1px dashed #ffd84d;
  padding: 0 .18em;
}

/* --- layout ----------------------------------------------------- */

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
section { padding-block: clamp(60px, 9vw, 130px); }

/* --- marquee ---------------------------------------------------- */

.marquee {
  display: flex; overflow: hidden; gap: 0;
  border-block: 1px solid var(--line);
  background: var(--off);
  padding-block: .62rem;
  user-select: none;
}
.marquee > div {
  display: flex; gap: 2.4rem; padding-right: 2.4rem;
  flex: 0 0 auto;
  animation: slide 34s linear infinite;
}
.marquee span { white-space: nowrap; }
.marquee .dot { color: var(--red); }
@keyframes slide { to { transform: translateX(-100%); } }
.marquee:hover > div { animation-play-state: paused; }

/* --- nav -------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--gut);
  background: color-mix(in srgb, var(--black) 86%, transparent);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.nav .mark { font-family: var(--disp); text-transform: uppercase; font-size: .95rem; letter-spacing: -.01em; }
.nav .mark b { color: var(--red); }
.nav ul { display: flex; gap: clamp(.9rem, 2.4vw, 2rem); list-style: none; margin: 0; padding: 0; }
.nav ul a { position: relative; padding-bottom: 3px; }
.nav ul a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--red);
  transition: width .25s ease;
}
.nav ul a:hover::after, .nav ul a[aria-current="page"]::after { width: 100%; }

/* --- hero ------------------------------------------------------- */

.hero { position: relative; min-height: min(92vh, 860px); display: grid; align-items: end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.55) contrast(1.22) brightness(.62);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.26) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(11,11,12,.55) 0%, rgba(11,11,12,.1) 40%, rgba(11,11,12,.96) 100%);
}
.hero-inner { position: relative; z-index: 3; padding: var(--gut); width: 100%; }

.hero h1 {
  font-family: var(--disp); text-transform: uppercase;
  font-size: clamp(3rem, 15vw, 13rem);
  letter-spacing: -.045em; line-height: .8;
}
.hero h1 .out {
  -webkit-text-stroke: 1.5px var(--bone); color: transparent;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: .8rem 2rem;
  margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid rgba(232,228,220,.22);
}
.hero-sub { max-width: 44ch; color: var(--bone); opacity: .9; }

/* glitch on the big title */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  clip-path: inset(0 0 0 0); opacity: 0;
}
.glitch::before { color: var(--red); }
.glitch::after  { color: #26d3d3; }
.glitch:hover::before { opacity: .9; animation: gl1 .4s steps(2) infinite; }
.glitch:hover::after  { opacity: .9; animation: gl2 .4s steps(2) infinite; }
@keyframes gl1 {
  0%   { transform: translate(-3px, 1px); clip-path: inset(12% 0 58% 0); }
  50%  { transform: translate(3px, -1px); clip-path: inset(64% 0 14% 0); }
  100% { transform: translate(-2px, 0);   clip-path: inset(32% 0 42% 0); }
}
@keyframes gl2 {
  0%   { transform: translate(3px, -1px); clip-path: inset(70% 0 8% 0); }
  50%  { transform: translate(-3px, 1px); clip-path: inset(18% 0 60% 0); }
  100% { transform: translate(2px, 0);    clip-path: inset(46% 0 30% 0); }
}

/* --- work index: controls --------------------------------------- */

.controls { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between; }
.filters, .views { display: flex; gap: .4rem; flex-wrap: wrap; }
.filters button, .views button {
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  padding: .42rem .8rem; transition: background .2s, border-color .2s, color .2s;
}
.filters button:hover, .views button:hover { border-color: var(--bone); }
.filters button[aria-pressed="true"], .views button[aria-pressed="true"] {
  background: var(--red); border-color: var(--red); color: #fff;
}
.count { white-space: nowrap; }

/* --- work index: grid ------------------------------------------- */

.index { margin-top: clamp(26px, 4vw, 50px); }

.index.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(18px, 2.4vw, 38px); }

.item { display: block; position: relative; }
.item[hidden] { display: none; }

.item .frame {
  position: relative; overflow: hidden; background: var(--off);
  aspect-ratio: 4 / 5; border: 1px solid var(--line);
}
.item .frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.4) contrast(1.1);
  transition: transform .8s cubic-bezier(.19,.8,.25,1), filter .5s ease;
}
.item:hover .frame img { transform: scale(1.06); filter: grayscale(0) contrast(1.04); }
.item .frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.3) 0 1px, transparent 1px 3px);
  opacity: 0; transition: opacity .4s;
}
.item:hover .frame::after { opacity: .5; }

.item .no {
  position: absolute; top: 0; left: 0; z-index: 2;
  background: var(--red); color: #fff; padding: .28rem .6rem;
}
.item .row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-top: .85rem; }
.item h3 { font-family: var(--disp); text-transform: uppercase; font-size: 1.15rem; letter-spacing: -.015em; }
.item .tags { margin-top: .35rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.item .tags em {
  font-family: var(--mono); font-style: normal; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--line); padding: .14rem .42rem; color: var(--ash);
}

/* --- work index: list view -------------------------------------- */

.index.is-list { display: block; border-top: 1px solid var(--line); }
.index.is-list .item { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.index.is-list .frame { display: none; }
.index.is-list .row { margin-top: 0; align-items: center; }
.index.is-list .no { position: static; display: inline-block; margin-right: .8rem; }
.index.is-list h3 { font-size: clamp(1.3rem, 4vw, 2.6rem); transition: transform .35s cubic-bezier(.19,.8,.25,1), color .25s; display: inline-block; }
.index.is-list .item:hover h3 { transform: translateX(14px); color: var(--red); }
.index.is-list .tags { margin-top: .5rem; }

/* placeholder slots for the next projects */
.item.empty { pointer-events: none; opacity: .5; }
.item.empty .frame {
  display: grid; place-items: center; border-style: dashed; background: transparent; text-align: center; padding: 1rem;
}
.index.is-list .item.empty { opacity: .42; }

/* --- case study ------------------------------------------------- */

.back { display: inline-block; margin-bottom: 1.6rem; }
.back:hover { color: var(--red); }

.cs-head { padding-top: clamp(40px, 7vw, 90px); }
.cs-head h1 { font-family: var(--disp); text-transform: uppercase; font-size: clamp(2.4rem, 11vw, 9rem); letter-spacing: -.04em; line-height: .84; }

.two-col { display: grid; grid-template-columns: 1fr; gap: clamp(26px, 4vw, 64px); }
@media (min-width: 880px) { .two-col { grid-template-columns: .85fr 1.15fr; } }

.spec { width: 100%; border-collapse: collapse; }
.spec th, .spec td { text-align: left; padding: .68rem 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
.spec th {
  font-family: var(--mono); font-weight: 400; color: var(--ash);
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; width: 40%; padding-top: .85rem;
}

.step { border-top: 1px solid var(--line); padding-top: 1.1rem; margin-bottom: 2.6rem; }
.step h3 { font-family: var(--disp); text-transform: uppercase; font-size: 1.25rem; margin: .5rem 0 .6rem; }

.wide { border: 1px solid var(--line); background: var(--off); }
.wide img { width: 100%; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: clamp(12px, 1.8vw, 24px); }
.gallery figure { margin: 0; }
.gallery button {
  padding: 0; border: 1px solid var(--line); background: var(--off); cursor: zoom-in;
  display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
}
.gallery button img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.35) contrast(1.08);
  transition: transform .7s cubic-bezier(.19,.8,.25,1), filter .45s;
}
.gallery button:hover img { transform: scale(1.06); filter: grayscale(0); }
.gallery figcaption { margin-top: .5rem; }

/* --- board content: note cards, swatches, pull-quotes ------------ */

.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: clamp(14px, 2vw, 24px); }
.notecard { border: 1px solid var(--line); padding: 1.1rem 1.2rem 1.3rem; background: var(--off); }
.notecard .k { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.notecard h4 { font-family: var(--disp); text-transform: uppercase; font-size: 1.05rem; letter-spacing: -.01em; margin: .5rem 0 .55rem; line-height: 1.08; }
.notecard p { font-size: .88rem; color: var(--bone); opacity: .88; margin: 0; }

.pull {
  font-family: var(--disp); text-transform: uppercase; letter-spacing: -.015em;
  font-size: clamp(1.3rem, 3vw, 2.1rem); line-height: 1.12;
  border-left: 3px solid var(--red); padding-left: 1.1rem; margin: 0;
}
.pull cite { display: block; font-family: var(--mono); font-style: normal; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ash); margin-top: .7rem; }

.swatches { display: flex; flex-wrap: wrap; gap: .9rem; }
.swatch { width: 92px; }
.swatch .chip { aspect-ratio: 1; border: 1px solid var(--line); }
.swatch .lbl { margin-top: .4rem; font-family: var(--mono); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ash); line-height: 1.3; }

.detail-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem 1.6rem; }
.detail-list li { display: flex; gap: .8rem; align-items: baseline; }
.detail-list .n {
  flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-size: .68rem;
}
.detail-list b { font-weight: 600; }
.detail-list span { font-size: .88rem; color: var(--bone); opacity: .85; }

.ref-credit { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; color: var(--ash); margin-top: .6rem; }

/* --- lightbox ---------------------------------------------------- */

.lb { position: fixed; inset: 0; z-index: 9500; display: none; background: rgba(6,6,7,.96); padding: clamp(12px, 4vw, 46px); place-items: center; }
.lb.open { display: grid; }
.lb figure { margin: 0; display: grid; justify-items: center; }
.lb img { max-width: 100%; max-height: 84vh; object-fit: contain; }
.lb figcaption { margin-top: .9rem; }
.lb button { position: absolute; background: none; border: 0; cursor: pointer; color: var(--bone); }
.lb .x { top: clamp(8px, 2vw, 22px); right: clamp(8px, 2vw, 22px); font-size: 1.7rem; padding: .3rem .6rem; }
.lb .arrow { top: 50%; transform: translateY(-50%); font-size: 2.2rem; padding: .4rem .7rem; opacity: .65; }
.lb .arrow:hover { opacity: 1; color: var(--red); }
.lb .prev { left: clamp(2px, 1vw, 14px); }
.lb .next { right: clamp(2px, 1vw, 14px); }

/* --- contact ----------------------------------------------------- */

.contact-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.05rem 0; transition: color .25s, padding-left .3s; }
.contact-list a:hover { color: var(--red); padding-left: 12px; }
.contact-list .val { font-family: var(--disp); text-transform: uppercase; font-size: clamp(1.1rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }

footer { border-top: 1px solid var(--line); padding: 2rem var(--gut); display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: space-between; }

/* --- scroll reveal ------------------------------------------------ */

.rv { opacity: 0; transform: translateY(26px); transition: opacity .75s ease, transform .75s cubic-bezier(.19,.8,.25,1); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
  .grain, .marquee > div, .glitch::before, .glitch::after { animation: none !important; }
  * { transition-duration: .01ms !important; }
}
