/* ===== Theme — change these to restyle the whole site ===== */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #77736b;
  --line: rgba(17, 17, 17, 0.9);
  --soft: rgba(17, 17, 17, 0.1);
  --accent: #ff4b1f;
  --card: #f2f2f2;
  --pad: clamp(20px, 4vw, 56px);
  --max: 1680px;
  --display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--muted); }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--soft);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 60px; }
.nav-name { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.nav-links { display: flex; gap: clamp(14px, 2vw, 28px); font-size: 14px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { white-space: nowrap; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }

/* ===== Hero ===== */
.hero { padding-top: clamp(56px, 10vw, 150px); }
.hero-name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(60px, 14.5vw, 260px);
  line-height: 0.84; letter-spacing: -0.06em;
  margin-left: -0.04em;
}
.hero-sub {
  display: flex; flex-wrap: wrap; gap: 8px 32px;
  margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(15px, 1.3vw, 19px);
}
.hero-sub .dot::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 10px; vertical-align: middle; position: relative; top: -1px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

/* ===== Sections ===== */
.section { padding-top: clamp(80px, 11vw, 160px); }
.section-head {
  display: flex; align-items: baseline; gap: clamp(12px, 2vw, 28px);
  border-top: 1px solid var(--line); padding-top: 14px;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.section-num { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2ch; }
.section-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(38px, 6vw, 96px); line-height: 0.95; letter-spacing: -0.045em;
}
.section-count { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== About ===== */
.about { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 3vw, 40px); }
.about-photo { grid-column: 1 / span 3; align-self: start; }
.about-photo { max-width: 320px; }
.about-text { grid-column: 5 / span 8; }
.about-text p { max-width: 62ch; color: var(--muted); margin-bottom: 1.1em; }
.about-text p.lead {
  font-family: var(--display); color: var(--ink);
  font-size: clamp(22px, 2.3vw, 36px); line-height: 1.18; letter-spacing: -0.025em; max-width: 30ch;
  margin-bottom: 1em;
}
.about-list { margin-top: 36px; border-top: 1px solid var(--soft); padding-top: 16px; }
.about-list h3 { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.about-list ul { list-style: none; columns: 2; column-gap: 24px; }
.about-list li { font-size: 17px; padding: 4px 0; break-inside: avoid; }

/* ===== Cards (projects & typefaces) ===== */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 3vw, 44px) clamp(16px, 2vw, 28px); }
.typefaces { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: clamp(28px, 3vw, 44px) clamp(16px, 2vw, 28px); }
.card { display: block; }
.card-media { overflow: hidden; background: var(--card); aspect-ratio: 4 / 3; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-media img { transform: scale(1.035); }
.card-info { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 14px; }
.card-info h3 { font-family: var(--display); font-weight: 500; font-size: clamp(18px, 1.6vw, 24px); letter-spacing: -0.02em; }
.card-info span { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card:hover .card-info .ext { color: var(--accent); }
.card-tags { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ===== Clients logo wall ===== */
.clients {
  display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr);
  border-top: 1px solid var(--soft); border-left: 1px solid var(--soft);
}
.client {
  position: relative; aspect-ratio: 3 / 2;
  display: grid; place-items: center;
  border-right: 1px solid var(--soft); border-bottom: 1px solid var(--soft);
  transition: background .35s;
  overflow: hidden;
}
/* logos are shown in black & white */
.client .client-logo {
  width: 52%; height: 40%; object-fit: contain;
  filter: grayscale(1) brightness(0);
  transition: filter .35s, transform .5s cubic-bezier(.2,.7,.2,1);
}
.client-hover, .client-soon {
  position: absolute; left: 16px; bottom: 12px; font-size: 13px;
}
.client-hover { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; color: var(--bg); }
.client-soon { color: var(--muted); }
a.client:hover { background: var(--ink); }
a.client:hover .client-logo { filter: grayscale(1) brightness(0) invert(1); transform: scale(1.05); }
a.client:hover .client-hover { opacity: 1; transform: none; }
.client.is-static { cursor: default; }

/* ===== "Also worked with" scrolling strip ===== */
.marquee { margin-top: clamp(40px, 5vw, 64px); overflow: hidden; }
.marquee-label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 20px; }
.marquee-track {
  display: flex; width: max-content;
  animation: marquee var(--dur, 60s) linear infinite reverse; /* reverse = moves left → right */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: clamp(48px, 6vw, 96px); padding-right: clamp(48px, 6vw, 96px); }
.marquee-group img { height: clamp(36px, 4vw, 60px); width: auto; max-width: 200px; object-fit: contain; filter: grayscale(1) brightness(0); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

.work.work-tight { margin-top: clamp(20px, 2.5vw, 36px); }
.detail--video .back { margin-bottom: clamp(20px, 3vw, 36px); }
.detail--video .detail-head { display: block; }
.detail--video .detail-logo { height: clamp(36px, 4vw, 56px); margin-bottom: 14px; }
.detail--video .detail-title { font-size: clamp(36px, 5vw, 80px); }
.detail--video .media video { max-height: calc(100vh - 120px); width: 100%; background: #000; object-fit: contain; }

/* ===== Posters — 3D slider ===== */
.coverflow { position: relative; --h: clamp(320px, 56vh, 620px); --step: clamp(110px, 16vw, 280px); }
.cf-stage {
  position: relative; height: var(--h);
  perspective: 2200px; perspective-origin: 50% 50%;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.cf-item {
  position: absolute; left: 50%; top: 0; height: 100%;
  transform-style: preserve-3d; backface-visibility: hidden;
  transform: translateX(-50%);
  will-change: transform, filter;
  visibility: hidden;
}
.js .cf-stage { cursor: grab; }
.coverflow.is-dragging .cf-stage { cursor: grabbing; }
html:not(.js) .cf-item { visibility: visible; }
.cf-hint { display: block; margin-top: 10px; font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.cf-item img {
  height: 100%; width: auto; max-width: none;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35), 0 10px 20px -10px rgba(0,0,0,.2);
  background: var(--card);
  pointer-events: none;
}
.cf-fallback-cap { display: none; }

.cf-arrow {
  position: absolute; top: calc(var(--h) / 2); transform: translateY(-50%);
  z-index: 200; width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-size: 22px;
  display: grid; place-items: center;
  transition: background .25s, transform .25s;
}
.cf-arrow:hover { background: var(--accent); color: #fff; }
.cf-arrow:active { transform: translateY(-50%) scale(.94); }
.cf-prev { left: 0; }
.cf-next { right: 0; }

.cf-caption { text-align: center; margin-top: clamp(22px, 3vw, 36px); min-height: 60px; }
.cf-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 3.2vw, 48px); line-height: 1.05; letter-spacing: -0.035em;
  transition: opacity .35s, transform .35s;
}
.cf-caption.is-changing .cf-title { opacity: 0; transform: translateY(8px); }

/* Without JavaScript: simple horizontal row */
html:not(.js) .cf-stage { display: flex; gap: 16px; overflow-x: auto; perspective: none; height: auto; }
html:not(.js) .cf-item img[data-src] { display: none; }
html:not(.js) .cf-item { position: static; transform: none; filter: none; height: var(--h); flex: none; }
html:not(.js) .cf-arrow, html:not(.js) .cf-caption { display: none; }
html:not(.js) .cf-fallback-cap { display: block; font-weight: 700; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .cf-item, .cf-title { transition: none; }
}

/* ===== Contact ===== */
.contact { padding-bottom: clamp(60px, 8vw, 120px); }
.contact-line { font-size: clamp(18px, 1.6vw, 24px); color: var(--muted); }
.contact-email {
  display: inline-block; margin-top: 10px;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(34px, 7.5vw, 130px); line-height: 1; letter-spacing: -0.05em;
  border-bottom: 2px solid transparent; transition: color .25s, border-color .25s;
  word-break: break-word;
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 40px; font-size: 16px; }
.contact-links a:hover { color: var(--accent); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--soft); font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px; padding-bottom: 22px; }
.footer-links { display: flex; gap: 20px; }
.footer a:hover { color: var(--ink); }

/* ===== Detail pages (client / project) ===== */
.detail-head { padding-top: clamp(28px, 4vw, 48px); }
.back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: clamp(40px, 7vw, 100px); transition: color .2s; }
.back:hover { color: var(--ink); }
.detail-logo { height: clamp(48px, 6vw, 84px); margin-bottom: 28px; }
.detail-logo img { height: 100%; width: auto; max-width: 280px; object-fit: contain; object-position: left; }
.detail-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(48px, 10vw, 180px); line-height: 0.88; letter-spacing: -0.055em;
  margin-left: -0.03em;
}
.detail-intro {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(24px, 3vw, 40px);
  margin-top: clamp(36px, 5vw, 72px); padding-top: 18px; border-top: 1px solid var(--line);
}
.detail-text { grid-column: 1 / span 7; }
.detail-text p { color: var(--muted); max-width: 62ch; margin-bottom: 1em; }
.detail-text p.lead {
  font-family: var(--display); color: var(--ink);
  font-size: clamp(21px, 2vw, 32px); line-height: 1.2; letter-spacing: -0.022em; max-width: 30ch;
}
.detail-meta { grid-column: 9 / span 4; display: grid; gap: 22px; align-content: start; }
.detail-meta dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.detail-meta dd { font-size: 16px; }
.detail-meta a { border-bottom: 1px solid var(--soft); transition: border-color .2s, color .2s; }
.detail-meta a:hover { color: var(--accent); border-color: var(--accent); }
.team-row { display: block; padding: 2px 0; }
.team-row .muted { display: inline-block; min-width: 0; margin-right: 6px; }

.work {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 1.4vw, 20px);
  margin-top: clamp(56px, 8vw, 110px);
}
.media.full { grid-column: 1 / -1; }
.media img, .media video { width: 100%; height: auto; background: var(--card); }
.media figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.video { position: relative; width: 100%; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-ph {
  width: 100%; background: var(--ink); color: rgba(255,255,255,.55);
  display: grid; place-items: center; font-size: 14px;
}
.video-ph span::before { content: "▶"; display: block; text-align: center; font-size: 34px; margin-bottom: 10px; color: #fff; }

.next { margin-top: clamp(80px, 10vw, 150px); padding-bottom: clamp(60px, 8vw, 110px); }
.next a { display: block; border-top: 1px solid var(--line); padding-top: 16px; }
.next .muted { font-size: 14px; }
.next-name {
  display: block; margin-top: 8px;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(40px, 7vw, 120px); line-height: 1; letter-spacing: -0.05em;
  transition: color .25s;
}
.next a:hover .next-name { color: var(--accent); }

/* ===== Reveal on scroll (only when JS is on) ===== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .clients { grid-template-columns: repeat(3, 1fr) !important; }
  .typefaces { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 800px) {
  .nav-links a:not(:last-child) { display: none; }
  .about-photo, .about-text, .detail-text, .detail-meta { grid-column: 1 / -1; }
  .about-photo { max-width: 220px; }
  .projects, .typefaces { grid-template-columns: 1fr !important; }
  .clients { grid-template-columns: repeat(2, 1fr) !important; }
  .client-hover { display: none; }
  .work { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .coverflow { --h: clamp(300px, 48vh, 430px); }
  .cf-arrow { width: 44px; height: 44px; font-size: 18px; top: calc(var(--h) + 24px); transform: none; }
  .cf-arrow:active { transform: scale(.94); }
  .cf-caption { padding: 0 54px; }
  .about-list ul { columns: 1; }
  .contact-email { font-size: 7.2vw; letter-spacing: -0.04em; }
}
.card-media.type-media { aspect-ratio: 808 / 632; }


/* ===== Split text reveals ===== */
.is-split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.is-split .wi { display: inline-block; }
.js .is-split:not(.split-scrub) .wi {
  transform: translateY(108%) rotate(4deg); transform-origin: 0 100%;
  transition: transform 1s cubic-bezier(.19,1,.22,1) calc(var(--i) * 55ms);
}
.js .split-chars .wi { transition-delay: calc(var(--i) * 32ms + .1s); }
.js .is-split.in:not(.split-scrub) .wi { transform: none; }
.split-scrub .w { display: inline; overflow: visible; padding: 0; margin: 0; }
.js .split-scrub .wi { color: rgba(17,17,17,.14); transition: color .35s ease; }
.js .split-scrub .w.lit .wi { color: rgba(17,17,17,.78); }
@media (prefers-reduced-motion: reduce) {
  .js .is-split .wi { transform: none !important; transition: none !important; }
}

/* ===== Client previews ===== */
.client-preview {
  position: absolute; inset: 0; z-index: 1; background: #111;
  opacity: 0; transform: scale(1.08);
  transition: opacity .45s ease, transform .9s cubic-bezier(.19,1,.22,1);
}
.client-preview video, .client-preview img { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.client-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.6)); }
.client .client-logo { position: relative; z-index: 2; }
.client .client-hover { z-index: 3; color: #fff; }
.client.is-previewing .client-preview { opacity: 1; transform: none; }
.client.is-previewing .client-logo { opacity: 0; transform: scale(.9); }
.client.is-previewing .client-hover { opacity: 1; transform: none; }
.client:has(.client-preview):hover { background: transparent; }

/* ===== Doodle photo ===== */
.doodle {
  position: relative; touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg transform='rotate(-35 16 16)'%3E%3Crect x='12' y='2' width='8' height='24' rx='2' fill='%23f6f3ea' stroke='%23111' stroke-width='1.5'/%3E%3Crect x='12' y='20' width='8' height='6' fill='%23ff7ab6' stroke='%23111' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E") 4 28, crosshair;
}
.doodle img { width: 100%; max-width: none !important; display: block; pointer-events: none; }
.doodle canvas, .doodle .auto-doodles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auto-doodles .dd { fill: none; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; filter: url(#chalk); opacity: 0; transition: opacity .2s; }
.auto-doodles .dd.on { opacity: .96; }
.doodle-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.doodle-hint { margin-right: auto; }
.doodle-colors { display: flex; gap: 6px; }
.chalk-color { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 1.5px solid rgba(0,0,0,.25); transition: transform .2s; }
.chalk-color.on { transform: scale(1.25); border-color: var(--ink); }
.doodle-clear { font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--soft); padding: 0; }
.doodle-clear:hover { color: var(--accent); }

/* ===== 3D letters ===== */
.hero3d { position: fixed; inset: 0; pointer-events: none; z-index: 45; opacity: 0; transition: opacity .2s; }
.hero3d.on { opacity: 1; }
.hero-name .wi { transition-property: transform, opacity; }
.hero-name .wi.is-3d { opacity: 0; transition: opacity .12s; }
.js .hero-name .wi { cursor: default; }
