/* 3D & Retouching page.
   Same page system as the case studies: a narrow label column and a wide content column, on quiet grey stages. */

:root {
  --bg: #f7f7f6;
  --fg: #151515;
  --muted: #6c6c6a;
  --line: #e3e3e0;
  --stage: #f0f0ee;
  --stage-2: #e7e7e4;
  --raised: #ffffff;
  --dot: rgba(20, 20, 20, .28);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.wrap { max-width: 1320px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* ---------- top bar ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top-in { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.top-link { text-decoration: none; font-size: 14px; }
.top-link.dim { color: var(--muted); }
.top-link:hover { color: var(--fg); }

/* ---------- intro ---------- */
.intro { padding-top: 72px; padding-bottom: 48px; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 56px; max-width: 900px; }
.meta dt { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.meta dd { font-family: var(--mono); font-size: 13px; }
h1 { font-size: clamp(40px, 6.4vw, 80px); line-height: 1.02; font-weight: 500; letter-spacing: -.035em; max-width: 13ch; text-wrap: balance; }
.lede { margin-top: 24px; font-size: clamp(18px, 1.9vw, 21px); line-height: 1.45; color: var(--muted); max-width: 46ch; }

/* ---------- stages ---------- */
.stage { background: var(--stage); border-radius: var(--r); position: relative; overflow: hidden; overflow: clip; }
.stage-hero { padding: 56px 24px 48px; display: flex; justify-content: center; }
.figcap { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 12px; max-width: 70ch; }

/* ---------- numbers ---------- */
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 88px; padding-bottom: 24px; }
.num b { display: block; font-size: clamp(40px, 5vw, 64px); font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.num span { display: block; margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); max-width: 24ch; line-height: 1.5; }

/* ---------- sections ---------- */
.sec { padding-top: 104px; padding-bottom: 0; }
.sec + .sec { padding-top: 88px; }
.row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 48px; }
.lab { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); padding-top: 8px; letter-spacing: 0; }
.body { min-width: 0; }
.title { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; font-weight: 500; letter-spacing: -.03em; max-width: 20ch; text-wrap: balance; }
.lead p { font-size: clamp(20px, 2.1vw, 25px); line-height: 1.42; letter-spacing: -.01em; max-width: 720px; }
.lead p + p { margin-top: 20px; }
.muted { color: var(--muted); }
.prose { margin-top: 28px; max-width: 700px; }
.prose p { font-size: 18px; line-height: 1.6; }
.prose p + p { margin-top: 16px; }
.intro-p { margin-top: 16px; font-size: 18px; color: var(--muted); max-width: 56ch; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.facts > div { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 24px; }
.fico { width: 40px; height: 40px; border-radius: 10px; background: var(--stage); display: grid; place-items: center; margin-bottom: 18px; }
.fico svg { width: 20px; height: 20px; }
.facts h4, .principles h4, .learn h4 { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.facts p, .principles p, .learn p { margin-top: 6px; font-size: 15px; color: var(--muted); line-height: 1.55; max-width: 46ch; }

.principles { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 44px; }
.principles li { padding-top: 18px; border-top: 1px solid var(--line); }

.learn { margin-top: 36px; }
.learn article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px; padding: 22px 0 24px; border-top: 1px solid var(--line); }
.learn article p { margin-top: 0; font-size: 16px; }

/* feature grid */
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 24px; margin-top: 44px; }
.feat { margin: 0; min-width: 0; }
.fx { aspect-ratio: 6 / 5; max-width: 100%; }
.feat figcaption { margin-top: 14px; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 52ch; }
.feat figcaption b { font-weight: 500; color: var(--fg); margin-right: 6px; }

/* try it */
.tools { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.tool { font-size: 14px; border: 1px solid var(--line); background: var(--raised); border-radius: 999px; padding: 7px 14px; }
.tool:hover { border-color: var(--fg); }
.stage-try { margin-top: 36px; padding: 48px 24px; display: flex; justify-content: center; }

/* footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 120px; padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
.foot a { text-decoration: none; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.02em; }
.foot a:hover { color: var(--muted); }

/* progress pill */
.prog { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; }
.prog-btn { display: flex; align-items: center; gap: 9px; background: var(--raised); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 7px; font-family: var(--mono); font-size: 12px; white-space: nowrap; box-shadow: 0 6px 24px -10px rgba(0, 0, 0, .35); }
.ring { width: 20px; height: 20px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.5; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--fg); stroke-linecap: round; }
.pct { display: none; }
.prog-menu { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px); background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 6px; min-width: 190px; opacity: 0; pointer-events: none; transition: .18s; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .3); }
.prog.open .prog-menu { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
.prog-menu a { display: block; text-decoration: none; font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 8px 10px; border-radius: 9px; }
.prog-menu a:hover, .prog-menu a.on { background: var(--stage); color: var(--fg); }
/* ---------- responsive ---------- */
@media (max-width: 1100px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; gap: 14px; }
  .lab { padding-top: 0; }
  .principles { grid-template-columns: 1fr; gap: 0; }
  .principles li { padding: 18px 0 20px; }
  .learn article { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 640px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  body { font-size: 16px; }
  .intro { padding-top: 40px; padding-bottom: 32px; }
  .meta { grid-template-columns: 1fr 1fr; row-gap: 16px; margin-bottom: 36px; }
  .numbers { grid-template-columns: 1fr; gap: 32px; padding-top: 64px; }
  .sec { padding-top: 80px; }
  .sec + .sec { padding-top: 64px; }
  .facts { grid-template-columns: 1fr; }
  .feats { grid-template-columns: 1fr; gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}



/* ---------- project rows: the name on the left, the images on the right ---------- */
.pj { margin-top: 44px; }
.pj-r { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 48px; padding: 28px 0 44px; border-top: 1px solid var(--line); }
.pj-l { align-self: start; position: sticky; top: 72px; }
.pj-l h4 { font-size: 17px; line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
.pj-l p { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.pg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; overflow: clip; border-radius: var(--r); background: var(--stage); }
.tile img, .tile video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- before / after: drag the handle, or use the arrow keys ---------- */
.cmps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cmp { --x: 50%; position: relative; aspect-ratio: 1; overflow: hidden; overflow: clip; border-radius: var(--r); background: var(--stage); touch-action: pan-y; }
.cmp > div { position: absolute; inset: 0; }
.cmp > div img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cmp-b { clip-path: inset(0 0 0 var(--x)); }
/* square crops of wider photos: the device centered, and the goalkeeper in focus */
.cmp.front img { object-position: 42.5% 50%; }
.cmp.keeper img { object-position: 100% 50%; }
.cmp-tag { position: absolute; bottom: 14px; z-index: 2; padding: 2px 10px; border-radius: 999px; background: rgba(20, 20, 20, .7); color: #fff; font-family: var(--mono); font-size: 12px; line-height: 18px; }
.cmp-tag.a { left: 14px; }
.cmp-tag.b { right: 14px; }
.cmp-h { position: absolute; left: var(--x); top: 0; bottom: 0; z-index: 3; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(20, 20, 20, .08); pointer-events: none; }
.cmp-h::after { content: '‹ ›'; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: #fff; color: #151515; font-family: var(--font); font-size: 15px; line-height: 36px; text-align: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.cmp input { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp input:focus-visible ~ .cmp-h::after { outline: 2px solid var(--fg); outline-offset: 2px; }

@media (max-width: 900px) {
  .pj-r { grid-template-columns: 1fr; gap: 16px; padding: 24px 0 36px; }
  .pj-l { position: static; }
}
@media (max-width: 640px) {
  .pj { margin-top: 28px; }
  /* three images: the first one leads, so no gap is left over */
  .pg { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pg .tile:first-child { grid-column: 1 / -1; }
  .cmps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
