/* ============================================
   HOME V2 — restrained neo-brutalism
   Loaded after home.css; only overrides & new blocks.
   Idea: playful shell (hero, about, CTA), quiet stage for the work.
   ============================================ */

/* ---------- Hero avatar (own illustration) ---------- */
.hero-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  border: var(--border-width) solid #2B2B2B;
  border-radius: 50%;
  background: var(--label-yellow);
  box-shadow: var(--shadow);
  overflow: visible;
  margin-bottom: 4px;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-avatar-note {
  position: absolute;
  left: calc(100% + 10px);
  top: 6px;
  font-family: var(--font-hand);
  font-size: 22px;
  white-space: nowrap;
  transform: rotate(-6deg);
}

/* ---------- Featured works: one bordered grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 40px;
  background: #fff;
  border: var(--border-width) solid #2B2B2B;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.work-cell {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-right: var(--border-width) solid #2B2B2B;
  border-bottom: var(--border-width) solid #2B2B2B;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s ease;
}

.work-cell:nth-child(2n) { border-right: none; }
.work-cell:nth-last-child(-n + 2) { border-bottom: none; }

.work-cell:hover { background: #F7F7F7; }

.work-cell-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-cell-num {
  padding: 4px 10px;
  background: var(--num-bg, var(--label-yellow));
  border: 2px solid #2B2B2B;
  border-radius: 6px;
}

.work-cell-year { color: var(--ink-muted); }

/* Image frame with Figma-style selection on hover */
.work-cell-frame {
  position: relative;
  border-radius: 12px;
  outline: 2px solid transparent;
  outline-offset: 5px;
  transition: outline-color 0.2s ease;
}

.work-cell-media {
  aspect-ratio: 4 / 3;
  border: var(--border-width) solid #2B2B2B;
  border-radius: 12px;
  overflow: hidden;
  background: #F2F2F0;
}

.work-cell-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.frame-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 2px solid var(--selection-blue);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.frame-handle--tl { top: -10px; left: -10px; }
.frame-handle--tr { top: -10px; right: -10px; }
.frame-handle--bl { bottom: -10px; left: -10px; }
.frame-handle--br { bottom: -10px; right: -10px; }

.work-cell:hover .work-cell-frame,
.work-cell:focus-visible .work-cell-frame { outline-color: var(--selection-blue); }
.work-cell:hover .frame-handle,
.work-cell:focus-visible .frame-handle { opacity: 1; }
.work-cell:hover .work-cell-media img { transform: scale(1.03); }

.work-cell-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #F7F7F4;
  background-image: radial-gradient(circle, #D8D8D2 1px, transparent 1px);
  background-size: 16px 16px;
}
.work-cell-placeholder span {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.work-cell-placeholder small {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.work-cell-title {
  margin-top: 24px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.work-cell-desc {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-light);
}

.work-cell-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 20px;
}

.work-cell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-cell-tag {
  padding: 4px 10px;
  border: 1.5px solid #2B2B2B;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.work-cell-link {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid #2B2B2B;
  padding-bottom: 2px;
}

.work-cell:hover .work-cell-link { color: var(--accent-blue); border-color: var(--accent-blue); }

/* ---------- More projects: white cards, real covers ---------- */
.more-card {
  width: 280px;
  background: #fff;
}

.more-card-image {
  aspect-ratio: 4 / 3;
  border-bottom: none;
}

.more-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-card-info { text-align: left; }

.carousel-track { animation-name: carousel-scroll-v2; animation-duration: 40s; }

@keyframes carousel-scroll-v2 {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-6 * (280px + 20px))); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-cell { padding: 24px; border-right: none; }
  .work-cell:nth-last-child(-n + 2) { border-bottom: var(--border-width) solid #2B2B2B; }
  .work-cell:last-child { border-bottom: none; }
  .work-cell-footer { flex-direction: column; align-items: flex-start; }

  .hero-avatar { width: 88px; height: 88px; }

  .more-card { width: 200px; }
  @keyframes carousel-scroll-v2 {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-6 * (200px + 20px))); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-cell-media img,
  .frame-handle,
  .work-cell-frame { transition: none; }
  .carousel-track { animation: none; }
}

/* ---------- Page surface: faint dot grid, home only ---------- */
body {
  background-image: radial-gradient(circle, #E8E8E8 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ============================================
   HOME V2.1 — positioning-led, content first
   ============================================ */
.hero {
  min-height: auto;
  padding-top: calc(var(--nav-height) + 88px);
  padding-bottom: 56px;
}

.hero-statement-block { gap: 20px; }

.hero-statement-text {
  max-width: 880px;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-highlight {
  background: linear-gradient(var(--label-yellow), var(--label-yellow)) no-repeat 0 85% / 100% 0.38em;
  padding: 0 4px;
}

.hero-sub {
  max-width: 640px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-light);
}

.hero-keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-keywords li {
  padding: 6px 14px;
  background: #fff;
  border: 1.5px solid #2B2B2B;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-cta-block {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

/* Proof strip: what a recruiter should get in 10 seconds */
.proof { position: relative; z-index: 1; }

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: var(--border-width) solid #2B2B2B;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.proof-strip > div { padding: 20px 24px; }
.proof-strip > div + div { border-left: var(--border-width) solid #2B2B2B; }

.proof-strip dt {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.proof-strip dd {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-light);
}

#work { scroll-margin-top: var(--nav-height); }

.works-note {
  max-width: 460px;
  margin: 16px auto 0;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  text-transform: none;
  line-height: 1.5;
}

/* Scope / outcome facts on each card */
.work-cell-facts {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px dashed #2B2B2B;
}

.work-cell-facts > div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.work-cell-facts dt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.work-cell-facts dd {
  font-size: 14px;
  line-height: 1.5;
  color: #2B2B2B;
}

/* In-progress list */
.in-progress {
  margin-top: 32px;
  background: #fff;
  border: var(--border-width) solid #2B2B2B;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.in-progress-label {
  display: block;
  padding: 12px 24px;
  background: #F2F2EE;
  border-bottom: var(--border-width) solid #2B2B2B;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.in-progress-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
}

.in-progress-row + .in-progress-row { border-top: 1.5px solid #2B2B2B; }

.in-progress-row img {
  width: 88px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid #2B2B2B;
  border-radius: 8px;
  background: #F2F2F0;
}

.in-progress-row strong { display: block; font-size: 17px; }
.in-progress-row span { font-size: 14px; color: var(--ink-light); }

.in-progress-row .in-progress-tag {
  padding: 4px 10px;
  border: 1.5px dashed #2B2B2B;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2B2B2B;
}

/* Playground teaser */
.playground-teaser-text {
  margin: -32px 0 40px;
  font-size: 16px;
  color: var(--ink-light);
}

.playground-link { margin-top: 40px; }

.more-card-image .work-cell-placeholder span { font-family: var(--font-mono); font-size: 28px; }

@media (max-width: 768px) {
  .hero { padding-top: calc(var(--nav-height) + 48px); }
  .proof-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-strip > div:nth-child(3) { border-left: none; }
  .proof-strip > div:nth-child(n + 3) { border-top: var(--border-width) solid #2B2B2B; }
  .work-cell-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .in-progress-row { grid-template-columns: 64px minmax(0, 1fr); }
  .in-progress-row img { width: 64px; }
  .in-progress-row .in-progress-tag { grid-column: 2; justify-self: start; }
}

/* ---------- Figma-style selection on hover (fix) ----------
   Square selection box (like Figma selecting a rounded image),
   handles centred exactly on its corners. */
.work-cell-frame {
  --sel-gap: 6px;      /* distance between image and selection line */
  --sel-line: 2px;     /* selection line width */
  --handle: 9px;       /* handle size, incl. its border */
  outline: none;
  border-radius: 12px;
}

.work-cell-frame::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--sel-gap));
  border: var(--sel-line) solid var(--selection-blue);
  border-radius: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.frame-handle {
  width: var(--handle);
  height: var(--handle);
  box-sizing: border-box;
  border-radius: 0;
}

/* Centre of each handle = centre of the selection line at that corner */
.frame-handle--tl { top: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); left: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); }
.frame-handle--tr { top: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); right: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); }
.frame-handle--bl { bottom: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); left: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); }
.frame-handle--br { bottom: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); right: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2); }

.work-cell:hover .work-cell-frame,
.work-cell:focus-visible .work-cell-frame { outline: none; }
.work-cell:hover .work-cell-frame::after,
.work-cell:focus-visible .work-cell-frame::after { opacity: 1; }

/* ---------- "Under NDA" badge on work cards ---------- */
.work-cell-meta-right { display: inline-flex; align-items: center; gap: 10px; }
.work-cell-nda {
  padding: 3px 8px;
  border: 1.5px dashed #2B2B2B;
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #2B2B2B;
}

/* ============================================
   HOME V2.2 — calmer hero, one strong CTA, more colour
   Rule: buttons + clickable text = DM Sans; mono = small labels only.
   ============================================ */
.hero { padding-bottom: 64px; }
.hero-statement-block { gap: 22px; }

/* Primary CTA: the only large solid-colour button on the page */
.eye-button {
  background: var(--card-blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 14px 30px 14px 22px;
  border-radius: 12px;
}
.eye-button:hover { box-shadow: 6px 6px 0 #2B2B2B; }
.eye-button .eye-white { background: #fff; }

.hero-cta-block { margin-top: 40px; gap: 32px; }

.hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: #2B2B2B;
  border-bottom: 2px solid #2B2B2B;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.hero-secondary:hover { color: var(--card-blue); border-color: var(--card-blue); }

/* Proof strip: each number gets its own highlighter colour */
.proof-strip dt {
  display: inline;
  padding: 0 4px;
  background: no-repeat 0 88% / 100% 0.42em;
}
.proof-strip > div:nth-child(1) dt { background-image: linear-gradient(var(--label-yellow), var(--label-yellow)); }
.proof-strip > div:nth-child(2) dt { background-image: linear-gradient(var(--label-cyan), var(--label-cyan)); }
.proof-strip > div:nth-child(3) dt { background-image: linear-gradient(var(--label-orange), var(--label-orange)); }
.proof-strip > div:nth-child(4) dt { background-image: linear-gradient(var(--label-pink), var(--label-pink)); }
.proof-strip dd { margin-top: 8px; }

/* Text links elsewhere on the home page follow the same button type */
.playground-link,
.playground-link .text-arrow-label {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Closing CTA: less empty space now the about teaser is gone */
.cta-section { padding-top: 48px; }

/* Softer highlighter tints so black numbers stay crisp */
.proof-strip > div:nth-child(1) dt { background-image: linear-gradient(color-mix(in srgb, var(--label-yellow) 85%, #fff), color-mix(in srgb, var(--label-yellow) 85%, #fff)); }
.proof-strip > div:nth-child(2) dt { background-image: linear-gradient(color-mix(in srgb, var(--label-cyan) 40%, #fff), color-mix(in srgb, var(--label-cyan) 40%, #fff)); }
.proof-strip > div:nth-child(3) dt { background-image: linear-gradient(color-mix(in srgb, var(--label-orange) 60%, #fff), color-mix(in srgb, var(--label-orange) 60%, #fff)); }
.proof-strip > div:nth-child(4) dt { background-image: linear-gradient(color-mix(in srgb, var(--label-pink) 40%, #fff), color-mix(in srgb, var(--label-pink) 40%, #fff)); }

/* Primary CTA v2: near-black with a yellow hard shadow */
.eye-button {
  background: var(--card-black);
  color: #fff;
  border-color: #2B2B2B;
  box-shadow: 4px 4px 0 var(--label-yellow), 4px 4px 0 2px #2B2B2B;
}
.eye-button:hover {
  box-shadow: 6px 6px 0 var(--label-yellow), 6px 6px 0 2px #2B2B2B;
}
.eye-button:active {
  box-shadow: 1px 1px 0 var(--label-yellow), 1px 1px 0 2px #2B2B2B;
}
.hero-secondary:hover { color: #2B2B2B; border-color: var(--label-orange); }

/* Primary CTA v3: dark grey so the black hard shadow stays visible */
.eye-button {
  background: #3A3A3A;
  color: #fff;
  border-color: #2B2B2B;
  box-shadow: 4px 4px 0 #2B2B2B;
}
.eye-button:hover { background: #2E2E2E; box-shadow: 6px 6px 0 #2B2B2B; }
.eye-button:active { box-shadow: 1px 1px 0 #2B2B2B; }

/* CTA grey lifted so it separates from the #2B2B2B shadow/border */
.eye-button { background: #4A4A4A; }
.eye-button:hover { background: #404040; }

/* ---------- Also shipped (GMIC.ai) ---------- */
.also-shipped { margin-top: 40px; }
.also-label {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.also-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  background: #fff;
  border: var(--border-width) solid #2B2B2B;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.also-media {
  display: block;
  border-right: var(--border-width) solid #2B2B2B;
  background: #F2F2F0;
  overflow: hidden;
}
.also-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.5s var(--ease); }
.also-media:hover img { transform: scale(1.03); }
.also-body { display: flex; flex-direction: column; padding: 28px 32px; }
.also-body .work-cell-meta { margin-bottom: 14px; }
.also-body h3 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.also-body p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-light); }
.also-link {
  align-self: flex-start;
  margin-top: 20px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #2B2B2B;
  padding-bottom: 2px;
}
.also-link:hover { border-color: var(--label-orange); }
@media (max-width: 768px) {
  .also-card { grid-template-columns: 1fr; }
  .also-media { border-right: none; border-bottom: var(--border-width) solid #2B2B2B; aspect-ratio: 16 / 10; }
}

/* Stats strip removed: give the hero a little more room before Selected Work */
.hero { padding-bottom: 40px; }

/* Playground carousel now has 5 cards (This Website removed): scroll exactly one set. */
.carousel-track { animation-name: carousel-scroll-5; animation-duration: 34s; }
@keyframes carousel-scroll-5 {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-5 * (280px + 20px))); }
}
@media (max-width: 768px) {
  @keyframes carousel-scroll-5 {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-5 * (200px + 20px))); }
  }
}

/* ---------- Playground carousel: JS-driven with prev/next buttons ---------- */
.carousel-track.is-js { animation: none !important; will-change: transform; }
.carousel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}
.carousel-footer .playground-link { margin-top: 0; }
.carousel-controls { display: flex; gap: 12px; }
.carousel-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #2B2B2B;
  font: 600 20px/1 var(--font-body);
  border: var(--border-width) solid #2B2B2B;
  border-radius: 999px;
  box-shadow: 3px 3px 0 #2B2B2B;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.carousel-btn:hover { box-shadow: 5px 5px 0 #2B2B2B; transform: translate(-1px, -1px); }
.carousel-btn:active { box-shadow: 1px 1px 0 #2B2B2B; transform: translate(2px, 2px); }
.carousel-btn:focus-visible { outline: 3px solid var(--label-cyan); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .carousel-btn { transition: none; }
  .carousel-track.is-js { overflow: visible; scroll-snap-type: none; }
}

/* Lighter dot grid on the new neutral background */
body { background-image: radial-gradient(circle, #EAEAEA 1px, transparent 1px); }

/* Hero highlighter uses the lighter tint of the logo yellow so the big text stays crisp */
.hero-highlight { background-image: linear-gradient(var(--highlight-yellow), var(--highlight-yellow)); }

/* Hero tail: the domain sits after the main promise, quieter than the headline */
.hero-tail {
  display: block;
  margin-top: 14px;
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0;
  color: #5F5E5A;
}

/* Work cards: Scope/Outcome removed; an award line shows only where there is one */
.work-cell-award {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #2B2B2B;
}
.work-cell-award-label {
  padding: 2px 8px;
  background: var(--label-yellow);
  border: 2px solid #2B2B2B;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Section titles (SELECTED WORK, PLAYGROUND): smaller, so the work itself leads */
.works-title {
  font-size: clamp(28px, 4.2vw, 44px);
  margin-top: 8px;
}
.more-projects .works-title { margin-bottom: 32px; }

/* ============================================
   FOLDER STACK — Selected work (2026-11-17)
   White folders with a coloured tab. On desktop the folders stick under the
   nav and pile up; earlier tabs stay visible. Clicking a tab brings that
   folder to the front (js/folders-v2.js); the folder body opens the case.
   Alignment: tab and body share one box and an integer border (--fb). The tab
   is --fb taller than the space above the body, so it covers the body's top
   border exactly. Tabs are inset by the corner radius so they never sit on a
   rounded corner.
   ============================================ */
.folder-stack {
  --fb: 3px;
  --radius: 16px;
  --tab-h: 46px;
  --tab-gap: 10px;
  --tab-inset: var(--radius);
  --tab-w: calc((100% - 2 * var(--tab-inset) - 3 * var(--tab-gap)) / 4);
  --stick-top: calc(var(--nav-height) + 16px);
  --body-h: clamp(380px, calc(100vh - var(--stick-top) - var(--tab-h) - 40px), 460px);
  display: flex;
  flex-direction: column;
  gap: 88px;
  margin-top: 8px;
}

.folder {
  position: sticky;
  top: var(--stick-top);
  padding-top: var(--tab-h);
  color: #2B2B2B;
}

/* Extra scroll room after the last folder, so it stays in view before the page moves on */
.folder-stack-end { height: 45vh; margin-top: -88px; }

.folder-tab {
  position: absolute;
  top: 0;
  left: calc(var(--tab-inset) + var(--tab-i) * (var(--tab-w) + var(--tab-gap)));
  z-index: 2;
  box-sizing: border-box;
  width: var(--tab-w);
  height: calc(var(--tab-h) + var(--fb));
  margin: 0;
  padding: 0 0 var(--fb);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--folder-bg);
  color: #fff;
  border: var(--fb) solid #2B2B2B;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.folder-tab:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.folder-tab:focus-visible { outline: 3px solid var(--selection-blue); outline-offset: 2px; }

.folder-body {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 44px;
  height: var(--body-h);
  padding: 32px 40px;
  background: #fff;
  border: var(--fb) solid #2B2B2B;
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 #2B2B2B;
  color: inherit;
  text-decoration: none;
}

.folder-text { display: flex; flex-direction: column; align-items: flex-start; min-height: 0; }
.folder-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.folder-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--folder-bg); }
.folder-title {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.folder-desc { margin: 0; font-size: 16px; line-height: 1.55; max-width: 34ch; }
.folder .work-cell-award { margin-top: 16px; }
.folder-link {
  margin-top: 22px;
  padding-bottom: 2px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-bottom: 2px solid #2B2B2B;
  transition: border-color 0.2s ease;
}
.folder-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 24px; }
.folder-tag {
  padding: 5px 10px;
  background: #2B2B2B;
  color: #fff;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Cover on a soft tint of the project colour */
.folder-frame {
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 20px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--folder-bg) 16%, #fff);
}
.folder-frame .work-cell-media { width: 100%; max-height: 100%; aspect-ratio: 4 / 3; background: #fff; }

/* Hover: Figma-style selection around the whole folder, square handles centred on its corners */
.folder {
  --sel-gap: 10px;
  --sel-line: 2px;
  --handle: 10px;
}
.folder::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--sel-gap));
  z-index: 3;
  border: var(--sel-line) solid var(--selection-blue);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.folder-handle {
  position: absolute;
  z-index: 4;
  box-sizing: border-box;
  width: var(--handle);
  height: var(--handle);
  background: #fff;
  border: 2px solid var(--selection-blue);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  --o: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2);
}
.folder-handle--tl { top: var(--o); left: var(--o); }
.folder-handle--tr { top: var(--o); right: var(--o); }
.folder-handle--bl { bottom: var(--o); left: var(--o); }
.folder-handle--br { bottom: var(--o); right: var(--o); }
.folder:has(.folder-body:hover)::after,
.folder:has(.folder-body:focus-visible)::after,
.folder:has(.folder-body:hover) .folder-handle,
.folder:has(.folder-body:focus-visible) .folder-handle { opacity: 1; }
.folder-body:hover .work-cell-media img { transform: scale(1.03); }
.folder-body:hover .folder-link { border-color: var(--label-orange); }
.folder-body:focus-visible { outline: none; }

@media (max-width: 1024px) {
  .folder-stack { --tab-gap: 8px; }
  .folder-tab { font-size: 12px; }
  .folder-body { gap: 28px; padding: 28px; }
}

/* Phone and reduced motion: plain list, no stacking */
@media (max-width: 768px) {
  .folder-stack { --tab-w: 50%; --tab-h: 42px; gap: 40px; }
  .folder { position: relative; top: auto; }
  .folder-tab { left: var(--tab-inset); }
  .folder-body { grid-template-columns: 1fr; height: auto; padding: 24px; }
  .folder-frame { order: -1; padding: 14px; }
  .folder-stack-end { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .folder { position: relative; top: auto; }
  .folder-stack-end { display: none; }
}

/* Folder hover v2: selection box only on the cover image, not the whole folder */
.folder::after, .folder-handle { display: none; }
.folder-tab { color: var(--tab-ink, #fff); }
.folder-shot {
  position: relative;
  width: 100%;
  --sel-gap: 6px;
  --sel-line: 2px;
  --handle: 9px;
}
.folder-shot::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--sel-gap));
  z-index: 1;
  border: var(--sel-line) solid var(--selection-blue);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.folder-shot .frame-handle {
  width: var(--handle);
  height: var(--handle);
  box-sizing: border-box;
  border-radius: 0;
  --o: calc(-1 * var(--sel-gap) + var(--sel-line) / 2 - var(--handle) / 2);
}
.folder-shot .frame-handle--tl { top: var(--o); left: var(--o); }
.folder-shot .frame-handle--tr { top: var(--o); right: var(--o); }
.folder-shot .frame-handle--bl { bottom: var(--o); left: var(--o); }
.folder-shot .frame-handle--br { bottom: var(--o); right: var(--o); }
.folder-body:hover .folder-shot::after,
.folder-body:focus-visible .folder-shot::after,
.folder-body:hover .folder-shot .frame-handle,
.folder-body:focus-visible .folder-shot .frame-handle { opacity: 1; }
/* Cover fits inside the tint panel (height-led, 4:3), centred */
.folder-frame { justify-content: center; }
.folder-shot { width: auto; height: 100%; max-width: 100%; aspect-ratio: 4 / 3; }
.folder-shot .work-cell-media { width: 100%; height: 100%; aspect-ratio: auto; max-height: none; }
@media (max-width: 768px) {
  .folder-shot { width: 100%; height: auto; }
}

/* Folder v3: 16:9 covers, even tint margin, longer stay on the last folder */
.folder-stack-end { height: 100vh; }
.folder-body { height: auto; min-height: var(--body-h); align-items: center; }
.folder-text { align-self: stretch; }
.folder-frame {
  display: block;
  align-self: center;
  padding: 18px;
  min-height: 0;
}
.folder-shot {
  width: 100%;
  height: auto;
  max-width: none;
  aspect-ratio: 16 / 9;
}
.folder-shot .work-cell-media { width: 100%; height: 100%; aspect-ratio: auto; }
@media (max-width: 768px) {
  .folder-frame { padding: 12px; }
}

/* Folder v4: more breathing room inside the card; cover top lines up with the text top */
.folder-body {
  padding: 48px 56px;
  gap: 56px;
  align-items: start;
}
.folder-text { align-self: stretch; }
.folder-frame { align-self: start; }
@media (max-width: 1024px) {
  .folder-body { padding: 36px 40px; gap: 32px; }
}
@media (max-width: 768px) {
  .folder-body { padding: 28px 24px; }
}
/* Card height follows the cover, so top and bottom margins match and the tags line up with the cover's bottom */
.folder-body { min-height: 0; }

/* Folder v5: taller cards via a bigger cover (text 1/3, cover 2/3) */
.folder-body {
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  padding: 52px 56px;
}
.folder-frame { padding: 22px; }
.folder-title { font-size: clamp(28px, 3vw, 38px); }

/* ---------- Cover flip on hover (2026-11-17) ----------
   Two faces: the cover (front) and a second image (back). Hovering the folder
   turns the card 180° around its vertical axis. The blue selection box and
   handles stay still outside the flip, like a selected layer turning over.
   Only on devices with a real hover; reduced motion gets a crossfade. */
.folder-shot { perspective: 1400px; }
.flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-back { transform: rotateY(180deg); }
.folder-body:hover .work-cell-media img { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .folder-body:hover .flip,
  .folder-body:focus-visible .flip { transform: rotateY(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .flip { transform: none !important; transition: none; }
  .flip-back { transform: none; opacity: 0; transition: opacity 0.25s linear; }
  .folder-body:hover .flip-back,
  .folder-body:focus-visible .flip-back { opacity: 1; }
}

/* Cover flip v2: flip top-to-bottom (around the horizontal axis) */
.flip-back { transform: rotateX(180deg); }
@media (hover: hover) and (pointer: fine) {
  .folder-body:hover .flip,
  .folder-body:focus-visible .flip { transform: rotateX(-180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .flip-back { transform: none; }
}

/* Hero headline in the display face: bigger, tighter, balanced lines (no lone last word) */
.hero-statement-text {
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.04;
  max-width: 15ch;
  margin-left: auto;
  margin-right: auto;
}
.hero-tail { font-family: var(--font-body); font-size: clamp(18px, 1.6vw, 22px); letter-spacing: 0; margin-top: 18px; }
.works-title { letter-spacing: 0; }
.folder-title { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.08; }

/* Hero: spinning badge on the avatar, and the role label that gives a little wiggle now and then */
.hero-avatar { position: relative; }
.spin-badge {
  position: absolute;
  top: -34px;
  right: -92px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--label-yellow);
  border: 2.5px solid #2B2B2B;
  box-shadow: 3px 3px 0 #2B2B2B;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.spin-badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: mk-spin 16s linear infinite;
}
.spin-badge text {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  fill: #2B2B2B;
}
.spin-badge-core { font-size: 22px; line-height: 1; color: #2B2B2B; }
.hero-role-label {
  display: inline-block;
  transform: rotate(-4deg);
  animation: mk-idle-wiggle 5s ease-in-out infinite;
}
@media (max-width: 768px) {
  .spin-badge { width: 78px; height: 78px; top: -24px; right: -66px; }
  .spin-badge text { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .spin-badge svg, .hero-role-label { animation: none; }
}
/* home.css loads after base-v2.css and resets the hero font; restate it here (home-v2.css loads last) */
.hero-statement-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: 1.06;
  max-width: 19ch;
}
.hero-statement-block .hero-avatar { margin-bottom: 10px; }
/* Hero headline: wider measure so it sits on three lines on desktop */
.hero-statement-text { max-width: 25ch; }

/* ============================================
   HERO v3 (2026-11-17): portrait left, copy right, left-aligned.
   Bigger avatar; the spinning badge is smaller and sits on the avatar's
   lower-right like a stamp. Headline gets room for 2–3 lines.
   ============================================ */
.hero { padding-top: calc(var(--nav-height) + 64px); padding-bottom: 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  max-width: 1120px;
  margin: 0 auto;
}
.hero-portrait { position: relative; justify-self: center; }
.hero-portrait .hero-avatar {
  width: 220px;
  height: 220px;
  margin: 0;
  box-shadow: 6px 6px 0 #2B2B2B;
}
.hero-portrait .spin-badge {
  top: auto;
  right: -26px;
  bottom: -18px;
  width: 92px;
  height: 92px;
}
.hero-portrait .spin-badge text { font-size: 9.5px; }
.hero-portrait .spin-badge-core { font-size: 18px; }

.hero-copy .hero-statement-block {
  align-items: flex-start;
  text-align: left;
  gap: 18px;
}
.hero-copy .hero-statement-text {
  max-width: none;
  margin: 0;
  font-size: clamp(36px, 4.2vw, 58px);
  line-height: 1.06;
  text-wrap: balance;
}
.hero-copy .hero-tail { text-align: left; }
.hero-copy .hero-cta-block { justify-content: flex-start; margin-top: 32px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-portrait .hero-avatar { width: 160px; height: 160px; }
  .hero-portrait .spin-badge { width: 76px; height: 76px; right: -20px; bottom: -12px; }
  .hero-portrait { justify-self: start; }
}
/* Hero copy is left-aligned (home.css centres the headline) */
.hero-copy .hero-statement-text,
.hero-copy .hero-statement-block { text-align: left; }
/* Folder titles in the display face (an earlier rule set DM Sans) */
.folder .folder-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
}
/* The new covers carry their own project-colour background, so drop the tint panel around them */
.folder .folder-frame { padding: 0; background: none; }
/* Section headings follow the hero: left-aligned with the cards below */
.works-header,
.more-projects { text-align: left; }
.more-projects .playground-teaser-text { margin-left: 0; }
/* Hero: copy on the left, portrait on the right (desktop). Phones: portrait stays on top. */
@media (min-width: 901px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-portrait { order: 2; margin-right: 26px; }
  .hero-copy { order: 1; }
}
/* Stacked folders: each folder's box also covers the tab row above its body, which is
   transparent but used to swallow clicks on the earlier folders' tabs. Let clicks pass
   through the box; only the tab and the body take the pointer. */
.folder { pointer-events: none; }
.folder-tab,
.folder-body { pointer-events: auto; }

/* Folder index (2026-11-17): a sticky row of "ghost" tabs behind the folders, so every
   project's tab is always there to click. Real tabs cover their own spot; tabs of
   folders that haven't arrived yet show as white ghosts. It sits first in the stack,
   takes no height, and stays under the folders (earlier in the DOM, z-index 0). */
.folder-index {
  position: sticky;
  top: var(--stick-top);
  z-index: 0;
  height: 0;
  margin-bottom: -88px;   /* cancel the stack gap after this zero-height row */
}
.folder-ghost {
  background: #fff;
  color: #2B2B2B;
  gap: 8px;
}
.folder-ghost-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--folder-bg);
  border: 2px solid #2B2B2B;
}
.folder-ghost:hover { background: color-mix(in srgb, var(--folder-bg) 18%, #fff); }
@media (max-width: 768px) { .folder-index { display: none; } }
@media (prefers-reduced-motion: reduce) { .folder-index { display: none; } }
/* Tabs show the project title; keep it on one line, trim with an ellipsis if a screen is very narrow */
.folder-tab {
  padding-left: 14px;
  padding-right: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: calc(var(--tab-h) - var(--fb));
  text-align: center;
}
@media (max-width: 1100px) {
  .folder-tab { font-size: 12px; letter-spacing: 0.02em; padding-left: 10px; padding-right: 10px; }
}

/* Playground carousel: the wrapper clips to slide cards in and out, but it also clipped
   the cards' hard shadow (bottom) and the hover lift (top). Give it room above and
   below; the negative margins keep the section's spacing unchanged. */
.carousel-track-wrapper {
  padding: 14px 0 18px;
  margin: -14px 0 -18px;
}

/* Hero v4 (2026-11-17): no avatar on the home page (it lives on About). The headline
   takes the width (two lines on desktop); the spinning badge stays on the right as a stamp. */
.hero-stamp { justify-self: end; align-self: center; margin-right: 0; }
.hero-stamp .spin-badge {
  position: relative;
  top: auto; right: auto; bottom: auto;
  width: 150px;
  height: 150px;
  box-shadow: 5px 5px 0 #2B2B2B;
  transform: rotate(-8deg);
}
.hero-stamp .spin-badge text { font-size: 10px; }
.hero-stamp .spin-badge-core { font-size: 30px; }
.hero-copy .hero-statement-text { font-size: clamp(40px, 4.9vw, 70px); max-width: 17ch; }
@media (min-width: 901px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 40px; }
  .hero-stamp { order: 2; margin-right: 0; }
}
@media (max-width: 900px) {
  .hero-stamp { justify-self: start; }
  .hero-stamp .spin-badge { width: 104px; height: 104px; }
}
/* Hero v4 fixes: copy column starts on the page's left edge; headline 2–3 lines */
.hero-copy .hero-statement-block,
.hero-copy .hero-cta-block { max-width: none; margin-left: 0; margin-right: 0; }
.hero-copy .hero-statement-text { max-width: none; font-size: clamp(38px, 4.3vw, 62px); }
.hero-grid { justify-items: stretch; }
.hero-copy { justify-self: stretch; min-width: 0; }
/* Hero grid uses the full container width, like the sections below */
.hero-grid { max-width: none; }
