@font-face {
  font-family: "SF Display Light";
  src: url("fonts/SFProDisplay-Light.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "SF Pro Text";
  src: url("fonts/SFProText-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "SF Pro Text Light";
  src: url("fonts/SFProText-Light.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}

:root {
  --bg: #000000;
  --fg: #ffffff;
  --pad: 32px;
  --gap: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "SF Pro Text Light", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* ── Fixed stage; the page scrolls underneath it ───────────────── */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overflow: clip; /* can't be scrolled sideways by focus */
}

.spacer { width: 1px; }

/* ── Intro: same text and type as the current site ─────────────── */
.intro {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 28px var(--pad) 0;
  z-index: 2;
}

/* One text block, no headline: every paragraph the same size */
.bio {
  font-size: clamp(14px, calc(1.45vw - 2px), 19px);
  line-height: 1.35;
  max-width: 37em; /* wide enough that the first paragraph stays within four lines on desktop */
}
.bio p + p { margin-top: 0.7em; }

/* ── Counter + hint ────────────────────────────────────────────── */
.meta {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--pad) - 14px);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  z-index: 3;
}
.hint { transition: opacity .6s ease; }
.hint::after { content: " →"; }

/* ── Cards ─────────────────────────────────────────────────────── */
.track { position: absolute; inset: 0; z-index: 1; }

.card {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  visibility: hidden;
}
.card img, .card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}
.card img.loaded, .card video.loaded { opacity: 1; }

/* ── Captions: separate from the cards so the type never scales ─── */
.label {
  position: absolute;
  left: 0;
  top: 0;
  height: 0;              /* anchored at its bottom edge; content grows upward */
  will-change: transform, opacity;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
}
.label-box { position: absolute; left: 0; right: 0; bottom: 0; }
.label-title {
  font-size: 20px;
  line-height: 24px;
  white-space: nowrap;
}
.label-credits {
  font-size: 12px;
  line-height: 18px;
  text-transform: uppercase;
}

/* Option A — type outside, above the image, in the page's text color */
.stage[data-caption="outside"] .label-title {
  position: absolute; left: 0; bottom: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  will-change: transform;
}
.stage[data-caption="outside"] .label-credits {
  position: absolute; left: 0; bottom: 3px;
  width: 50%;
  padding-left: 0;
  will-change: transform, opacity;
}

/* Option B — frosted pill over the image, like the current site */
.stage[data-caption="inside"] .label-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.24);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.stage[data-caption="inside"] .label-credits { width: 50%; min-width: 0; }

/* ── One-line caption (layouts without type on the cards) ──────── */
.meta-left { display: flex; gap: 24px; min-width: 0; }
.now {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}
.now b { font-weight: inherit; margin-right: 14px; }
.stage:not([data-layout="row"]):not([data-layout="spectrum"]) .now { display: block; }

/* ── Spectrum bar ──────────────────────────────────────────────── */
.spectrum {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--pad) + 12px);
  height: 4px;
  display: none;
  z-index: 3;
}
.stage[data-layout="spectrum"] .spectrum { display: flex; }
.spectrum span { flex: 1; }
.spectrum-mark {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background: var(--fg);
}

/* ── Layout-specific card styles ───────────────────────────────── */
.stage[data-layout="stack"] .card,
.stage[data-layout="tunnel"] .card { transform-origin: 50% 50%; }
.stage[data-layout="stack"] .card {
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.stage[data-layout="moodboard"] .card { border-radius: 3px; }

.sheet {
  position: absolute;
  overflow: hidden;
  overflow: clip;
  display: none;
  z-index: 1;
}
.stage[data-layout="sheet"] .sheet { display: block; }
.sheet-grid { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sheet .card { border-radius: 2px; visibility: visible; }

/* ── Dock: V2-style labels above the cards ─────────────────────── */
.label-num, .label-cat { display: none; }
.stage[data-layout="dock"] .label-box { display: flex; flex-direction: column; gap: 2px; }
.stage[data-layout="dock"] .label-num,
.stage[data-layout="dock"] .label-cat { display: block; }
.stage[data-layout="dock"] .label-credits { display: none; }
.stage[data-layout="dock"] .label-num {
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.06em;
  opacity: 0.45;
  margin-bottom: 2px;
}
.stage[data-layout="dock"] .label-title {
  position: static;
  max-width: 100%;
  transform: none !important;
  font-size: 14px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage[data-layout="dock"] .label-cat {
  font-size: 11px;
  line-height: 15px;
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage[data-layout="dock"] { cursor: grab; }
.stage[data-layout="dock"].dragging { cursor: grabbing; }

/* Hover: the image blurs and the full info sits on top of it */
.card-info { display: none; }
.stage[data-layout="dock"] .card-info {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Sizes as before; order and the dimmed role follow the "Claud" frame in Figma */
.card-info-inner {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px 26px;
  font-family: "SF Pro Text", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  color: #fff;
  opacity: 0;
  transition: opacity .35s ease;
}
.card-info-title {
  font-size: 27px;
  line-height: 32px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.card-info-credits { font-size: 15px; line-height: 21px; max-width: 30em; }
.card-info-credits:empty { display: none; }
.card-info-role { font-size: 15px; line-height: 21px; opacity: 0.5; }
.card.is-light .card-info-inner { color: #000; }
.stage[data-layout="dock"] .card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.stage[data-layout="dock"] .card.is-light::after { background: rgba(255, 255, 255, 0.22); }
.stage[data-layout="dock"] .card img { transition: opacity .5s ease, filter .45s ease, transform .6s ease; }
.stage[data-layout="dock"] .card:hover img,
.stage[data-layout="dock"] .card.is-open img { filter: blur(18px); transform: scale(1.08); }
.stage[data-layout="dock"] .card:hover::after,
.stage[data-layout="dock"] .card.is-open::after,
.stage[data-layout="dock"] .card:hover .card-info-inner,
.stage[data-layout="dock"] .card.is-open .card-info-inner { opacity: 1; }
.stage[data-layout="dock"].dragging .card:hover img { filter: none; transform: none; }
.stage[data-layout="dock"].dragging .card:hover::after,
.stage[data-layout="dock"].dragging .card:hover .card-info-inner { opacity: 0; }

/* ── Temporary panel for comparing options ─────────────────────── */
.lab {
  position: absolute;
  right: var(--pad);
  bottom: calc(var(--pad) + 30px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.stage:not([data-layout="row"]):not([data-layout="spectrum"]) .switch-captions { display: none; }
.stage[data-layout="dock"] .now { display: none !important; }
.switch { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.switch button {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
}
.switch button.active { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

/* ── Phones ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  :root { --pad: 16px; --gap: 10px; }
  .lab { left: var(--pad); right: var(--pad); align-items: stretch; }
  .switch { justify-content: flex-start; }
  .now { display: none !important; }
  .intro { padding-top: 20px; }
  .bio { font-size: 13px; line-height: 1.4; }
  .label-title { font-size: 16px; line-height: 20px; }
  .label-credits { font-size: 10px; line-height: 14px; }
  .stage[data-caption="outside"] .label-credits { width: 100%; bottom: 0; }
  .stage[data-caption="inside"] .label-box { flex-direction: column; gap: 6px; padding: 10px 12px; }
  .stage[data-caption="inside"] .label-title { white-space: normal; }
  .stage[data-caption="inside"] .label-credits { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .card img { transition: none; }
}
