
:root {
  --cv-bg: #231f20;
  --pf-bg: #0f0f0f;
  --fg: #fff;
  --dim: rgba(255, 255, 255, .45);
  --tile-bg: #181818;
  --ratio: 4 / 3;            /* source videos are 1440x1080; use 16 / 9 for a wider crop */
  --font: "Helvetica Neue", "Neue Haas Grotesk Text Pro", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #fff;
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- view switching ---------- */
.view { display: none; opacity: 0; transition: opacity .45s ease; }
.view.is-active { display: block; }
.view.is-visible { opacity: 1; }
body.on-detail { background: var(--pf-bg); }

/* ---------- Home ---------- */
#portfolio { background: #fff; color: #000; min-height: 100vh; font-size: max(9.6px, .6vw); line-height: 1.3; letter-spacing: -.045em; font-weight: 300; }
#portfolio .dim { color: #a8a8a8; }
.top { padding: 1.6vw 3.5vw 0; position: relative; }
.clock { position: absolute; top: 1.6vw; right: 3.5vw; text-align: right; font-variant-numeric: tabular-nums; }
.intro { margin-top: 2.2vw; max-width: 12vw; min-width: 150px; }
.intro a { text-decoration: none; border-bottom: 1px dotted #000; padding-bottom: 1px; transition: opacity .2s; }
.intro a:hover { opacity: .55; }
.intro p + p { margin-top: 1.25em; }
.list { margin: 17.2vw 3.5vw 0; padding: 1.8vw 0 0; border-top: 1px solid #d9d9d9; display: flex; flex-direction: column; gap: 2vw; }
.tile { display: flex; align-items: flex-end; gap: 1.6vw; }
.lead { flex: 1; border-bottom: 1px dotted #000; margin-bottom: .45em; min-width: 20px; }
.media {
  position: relative; flex: none; width: 24.9vw; aspect-ratio: 497 / 343;
  overflow: hidden; background: #d9d9d9;
}
.media video, .media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.media video { opacity: 0; transition: opacity .6s ease; }
.media video.is-ready { opacity: 1; }
.cap { flex: none; white-space: nowrap; text-align: right; }

@media (hover: hover) { .tile:hover .cap { opacity: .55; } .cap { transition: opacity .2s; } }
/* footer: nested rectangles that follow the cursor */
.foot { position: relative; overflow: hidden; margin-top: 8vw; height: 46vw; min-height: 300px; background: #f6e611; }
.sq { position: absolute; left: 50%; top: 50%; display: block; will-change: transform; }
.sq1 { width: 36vw; height: 36vw; background: #fdb913; }
.sq2 { width: 24.5vw; height: 24.5vw; background: #ff9a08; }
.sq3 { width: 16vw; height: 16vw; background: #fe7000; }
.sq { min-width: 150px; min-height: 150px; }

@media (max-width: 720px) {
  #portfolio { font-size: 13px; }
  .top { padding: 28px 16px 0; }
  .intro { max-width: none; margin-top: 40px; }
  .list { margin: 56px 16px 0; padding-top: 20px; gap: 28px; }
  .lead { display: none; }
  .cap { white-space: normal; text-align: left; }
  .clock { top: 28px; right: 16px; }
  .tile { flex-direction: column; align-items: stretch; gap: 8px; }
  .media { width: 100%; }
  .foot { margin-top: 56px; }
  .foot { height: 110vw; }
  .sq1 { width: 84vw; height: 84vw; }
  .sq2 { width: 57vw; height: 57vw; }
  .sq3 { width: 37vw; height: 37vw; }
}

@media (prefers-reduced-motion: reduce) {
  .view, .media video { transition: none; }
}

/* =====================================================================
   Project detail — modelled on willphan.com/clients/*
   fixed text sidebar (left) + scrolling column of cells (right)
   ===================================================================== */
#detail {
  position: fixed; inset: 0; z-index: 20;
  background: var(--pf-bg);
  font-size: 13px; line-height: 18px; letter-spacing: -.005em; font-weight: 400;
}
#detail.is-active { display: flex; }
body.on-detail { overflow: hidden; }

.d-side {
  flex: 0 0 clamp(300px, 28vw, 440px);
  display: flex; flex-direction: column;
  padding: 28px 20px 20px;
  overflow-y: auto; scrollbar-width: none;
}
.d-side::-webkit-scrollbar { display: none; }
.dim { color: rgba(255, 255, 255, .6); }
.d-side p { margin: 0; }
.d-side a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; transition: opacity .2s; }
.d-side a:hover { opacity: .55; }

.d-title { font-size: 14.857px; line-height: 22px; }
.d-meta {
  display: grid; grid-template-columns: 80px 1fr; row-gap: 0;
  margin-top: 22px; line-height: 22px;
}
.d-meta dt { color: rgba(255, 255, 255, .6); }
.d-meta dd { margin: 0; }
.d-meta dd span { display: block; }
.d-meta dt, .d-meta dd { padding: 4px 0; }
.d-side hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .1); margin: 24px 0 20px; }
.d-side section { margin-bottom: 28px; }
.d-side h3 { font-size: 13px; font-weight: 400; margin-bottom: 14px; }
.d-side section > p + p { margin-top: 12px; }
.credit { margin-bottom: 12px; }

.d-close {
  margin-top: auto; flex: none;
  display: block; text-align: center; text-decoration: none;
  padding: 6px 0; line-height: 22px;
  background: rgba(255, 255, 255, .07); border-radius: 6px;
  color: rgba(255, 255, 255, .8); transition: background .2s, color .2s;
}
.d-close:hover { background: rgba(255, 255, 255, .13); color: #fff; }
/* sidebar's Close button lives inside the flex column visually */
#detail > .d-close { position: absolute; left: 20px; bottom: 20px; width: calc(clamp(300px, 28vw, 440px) - 40px); margin: 0; }

.d-x {
  position: absolute; top: 14px; right: 16px; z-index: 6;
  width: 28px; height: 28px; display: grid; place-items: center;
  color: rgba(255, 255, 255, .55); mix-blend-mode: difference; transition: color .2s;
}
.d-x:hover { color: #fff; }

.d-feed {
  flex: 1; min-width: 0; overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 4px;
}
.d-feed::-webkit-scrollbar { display: none; }

.cell { position: relative; margin: 0; background: #1a1a1a; overflow: hidden; flex: none; }
.cell img { display: block; width: 100%; height: auto; opacity: 0; filter: blur(14px); transition: opacity .6s ease, filter .8s ease; }
.cell img.is-ready { opacity: 1; filter: blur(0); }
.row { display: flex; gap: 4px; flex: none; }
.row .cell { flex: 1; min-width: 0; }

/* ---- the ripped Gradient MGMT home page, as a cell ---- */
.cell--home { background: #000; }
.gm {
  position: relative; container-type: inline-size;
  aspect-ratio: 16 / 9; min-height: 340px; overflow: hidden; background: #000;
  font-family: "Geist Sans", "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.gm-stage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gm-hero {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4.4cqw; padding-bottom: 5%;
}
.gm-lockup { width: min(66cqw, 760px); margin: 0; opacity: 0; animation: gm-rise 1.8s cubic-bezier(.22, 1, .36, 1) .2s forwards; }
.gm-lockup img { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 44px rgba(0, 0, 0, .6)); }

.gm-pill {
  display: flex; align-items: stretch; gap: 8px;
  width: min(40cqw, 420px); min-width: 250px; height: 38px; padding: 4px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  opacity: 0; animation: gm-fade 1.6s cubic-bezier(.22, 1, .36, 1) .75s forwards;
}
.gm-pill a {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; isolation: isolate;
}
.gm-pill i {
  position: absolute; inset: 0; z-index: 0; background: #fff; border-radius: 999px;
  opacity: 0; transform: scale(.72);
  transition: opacity .45s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1);
}
.gm-pill span { position: relative; z-index: 1; font-size: 12px; letter-spacing: .04em; line-height: 1; transition: color .4s cubic-bezier(.22, 1, .36, 1); }
.gm-pill a:hover i { opacity: 1; transform: scale(1); }
.gm-pill a:hover span { color: #111; }

@keyframes gm-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes gm-fade { to { opacity: 1; } }

.pp {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  width: 26px; height: 26px; border: 0; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .05); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pp:hover { background: rgba(255, 255, 255, .14); }

@media (max-width: 900px) {
  #detail.is-active { display: block; overflow-y: auto; }
  .d-side { padding: 56px 16px 24px; overflow: visible; }
  #detail > .d-close { position: static; width: auto; margin: 0 16px 16px; }
  .d-close { order: 3; }
  .d-feed { overflow: visible; }
  .d-x { position: fixed; }
  .gm { aspect-ratio: 1 / 1; min-height: 0; width: 100%; }
  .gm-pill { width: min(88cqw, 340px); gap: 4px; }
  .gm-pill span { font-size: 11px; letter-spacing: .02em; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .gm-lockup, .gm-pill { animation: none; opacity: 1; }
}

/* video cells in the project feed */
.cell--video video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(14px); opacity: 0; transition: opacity .6s ease, filter .8s ease;
}
.cell--video video.is-ready { opacity: 1; filter: none; }

/* image tile on the portfolio grid */
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* poster + stacked artwork block (Williams Racing) */
.block { display: grid; grid-template-columns: 1fr .625fr; gap: 4px; flex: none; }
.block > .cell { align-self: start; }
.block > * { min-width: 0; }
.stack .cell { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.stack .cell { flex: 1; min-height: 0; }
.stack .cell img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .block:not(.split) { grid-template-columns: 1fr; } .block:not(.split) .stack .cell { flex: none; aspect-ratio: 3 / 2; } }

/* ---- Clyx cells ---- */
.cell--swatch { display: grid; place-items: center; }
.cell--swatch img { height: auto; opacity: 1; filter: none; }
.stack .cell--swatch { aspect-ratio: auto; }
.stack .cell--video { aspect-ratio: auto !important; }
.stack .cell--swatch img { position: static; height: auto; object-fit: contain; }
.split > .cell { align-self: stretch; }
.split > .cell { width: 100%; min-width: 0; }
#detail, .d-feed, .d-side { overflow-anchor: none; }
