/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --fg: oklch(0.145 0 0);
  --fg-40: color-mix(in oklab, var(--fg) 40%, transparent);
  --fg-10: color-mix(in oklab, var(--fg) 10%, transparent);
  --dark: #1C1B1B;
  --mono: 'Space Mono', ui-monospace, monospace;
  --sans: 'Manrope', ui-sans-serif, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .01em;
}
body:has(#info:target) { overflow: hidden; }
h1, p, ul { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.page { min-height: 100dvh; background: var(--bg); color: var(--fg); }

/* ---------- Links and buttons ---------- */
.logo-link {
  color: var(--fg);
  font-weight: 400;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size .3s ease;
}
@media (hover: hover) { .logo-link:hover { background-size: 100% 1px; } }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background-color .22s ease, color .22s ease, border-color .18s ease, transform .26s var(--ease);
}
.btn-pill:hover { background: transparent; color: var(--fg); }
.btn-pill:active { transform: scale(.95); }
.btn-label { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.btn-pill.btn-secondary { background: transparent; color: var(--fg); }
.btn-pill.btn-secondary:hover { background: var(--fg); color: var(--bg); }

/* Per-character roll: text-shadow is the incoming ghost, clipped by .btn-roll */
.btn-roll { display: inline-block; vertical-align: middle; overflow: hidden; height: 1.1em; }
.btn-roll__track { display: flex; text-shadow: 0 1.1em 0 currentColor; }
.btn-roll__char {
  display: block;
  white-space: pre;
  backface-visibility: hidden;
  transform: translateY(0) translateZ(0);
  transition: transform .25s ease;
}
.btn-pill:hover .btn-roll__char { transform: translateY(-1.1em) translateZ(0); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: #fff; }
.nav-row { display: flex; align-items: center; gap: 8px; height: 60px; }
.nav-logo { display: none; margin-right: auto; font-family: var(--mono); font-size: 16px; line-height: 1; }
.nav-spacer { margin-right: auto; }
.back-btn { width: 35px; height: 35px; padding: 0; justify-content: center; margin-right: auto; flex-shrink: 0; }
@media (min-width: 640px) {
  .nav-logo { display: block; }
  .nav-spacer { display: none; }
}

/* ---------- Shared labels ---------- */
.mono-label { font-family: var(--mono); font-size: 11px; letter-spacing: .044em; text-transform: uppercase; opacity: .4; }
.field-label { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-40); margin-bottom: 6px; }

/* ---------- Motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.fx-load { animation: fadeUp .55s var(--ease) both; animation-delay: var(--d, 0s); }
@supports (animation-timeline: view()) {
  .fx-view {
    animation: fadeIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fx-load, .fx-view { animation: none; }
}

/* ---------- Home ---------- */
.home { padding-bottom: 80px; }
.bio { padding: 42px 0 40px; }
.bio-inner { max-width: 560px; }
.bio-text { font-size: 22px; line-height: 1.45; letter-spacing: .01em; }
.contact-trio { display: flex; flex-direction: column; gap: 24px; padding-top: 32px; }
.contact-trio > div { display: flex; flex-direction: column; gap: 5px; }
.contact-trio a { font-size: 14px; }
@media (min-width: 640px) { .contact-trio { flex-direction: row; gap: 56px; } }

.cards { display: flex; flex-direction: column; gap: 16px; }
.card { display: flex; flex-direction: column; width: 100%; text-decoration: none; color: inherit; border-radius: 8px; }
@media (min-width: 640px) { .card { flex-direction: row; } }
.card-img, .card-text { flex: 1; min-width: 0; aspect-ratio: 3 / 2; position: relative; overflow: hidden; }
.card-img { background: #ececf0; border-radius: 0.625rem 0 0 0.625rem; }
.card-img img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 0.625rem 0 0 0.625rem;
  transition: filter .7s var(--ease), transform .7s var(--ease);
}
.card-text {
  background: #dfdfdf; display: flex; align-items: center;
  border-radius: 0 0.625rem 0.625rem 0;
  transition: filter .7s var(--ease);
}
.card-text-inner { display: flex; flex-direction: column; width: 100%; padding: 0 33px; }
.card-title { font-family: var(--mono); font-size: 14px; letter-spacing: .044em; text-transform: uppercase; line-height: 1.4; }
.card-sub { font-size: 18px; line-height: 32px; margin-top: 8px; }
.card-arrow { margin: 8px 0 0; padding-top: 8px; transition: transform .42s var(--ease); }
.arrow-pill { display: block; }
.card:hover .card-img img { filter: brightness(1.03); }
.card:hover .card-text { filter: brightness(1.05); }
.card:hover .card-arrow { transform: translateX(3px); }
.card:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.kind { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--fg-10); }
.kind-list { margin-top: 32px; display: flex; flex-direction: column; gap: 48px; }
.quote { max-width: 720px; }
.quote-text { line-height: 1.75; font-style: italic; }
.quote-by { margin-top: 12px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; opacity: .4; }

/* ---------- Info overlay (CSS only, driven by #info:target) ---------- */
.info-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  overflow-y: auto;
}
.info-overlay:target { display: block; }
.info-overlay .nav { background: color-mix(in oklab, var(--bg) 95%, transparent); backdrop-filter: blur(4px); }
.info-body { padding-bottom: 80px; }
.info-spacer { height: 96px; }
.info-grid { display: flex; flex-direction: column; }
.portrait { width: 280px; aspect-ratio: 3 / 4; border-radius: 8px; background: #f1f1f1; overflow: hidden; flex-shrink: 0; margin: 40px 0 32px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.info-text { display: flex; flex-direction: column; gap: 24px; flex: 1; line-height: 1.75; }
.info-trio { padding-top: 0; margin-top: 8px; gap: 32px; }
.info-trio .field-label { margin-bottom: 6px; }
@media (min-width: 640px) { .info-trio { flex-direction: row; gap: 64px; } }
@media (min-width: 768px) {
  .info-grid { flex-direction: row; align-items: flex-start; gap: 64px; }
  .portrait { margin: 0; }
}

/* ---------- Case study ---------- */
.case { padding-bottom: 80px; }
.case-next { margin-top: 32px; }
.case-head { padding: 42px 0; display: flex; flex-direction: column; gap: 12px; }
.case-type { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: rgba(10,10,10,.4); line-height: 1.5; }
.case-title { font-family: var(--mono); font-size: clamp(24px, 3.5vw, 42px); line-height: 1.15; letter-spacing: -.02em; color: #0a0a0a; max-width: 800px; }
.case-intro { margin-top: 8px; padding-top: 16px; display: flex; flex-direction: column; gap: 32px; }
.case-desc { min-width: 0; }
.case-desc p { font-size: clamp(16px, 1.4vw, 22px); line-height: 1.6; letter-spacing: .005em; color: #0a0a0a; }
.case-meta { display: grid; grid-template-columns: 1fr; gap: 16px; }
.meta-label { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: rgba(10,10,10,.4); line-height: 1.4; }
.meta-value { font-size: 14px; letter-spacing: .01em; line-height: 1.8; color: #0a0a0a; margin-top: 6px; }
@media (min-width: 640px) { .case-meta { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) {
  .case-intro { flex-direction: row; align-items: flex-start; }
  .case-desc, .case-meta { width: 50%; flex-shrink: 0; }
}

.frame { width: 100%; overflow: hidden; border-radius: 8px; background: #f1f1f1; }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.frame.is-video video { object-fit: contain; object-position: center; }

.impact-block { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.impacts { background: var(--dark); border-radius: 8px; padding: 32px; display: flex; flex-direction: column; gap: 7px; }
.impacts ul { display: flex; flex-direction: column; gap: 10.5px; }
.impacts li { font-size: 18px; line-height: 32px; color: #fff; letter-spacing: .005em; }
.sect-head { font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: .025em; text-transform: uppercase; color: #0a0a0a; }
.sect-head.light { color: #fff; padding-bottom: 8px; }

.stats { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .stats.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .stats.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .stats.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .stat { aspect-ratio: 1 / 1; }
}
@media (min-width: 1024px) { .stats.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--dark); border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; gap: 20px; color: #fff; text-align: center; }
.stat-value { font-family: var(--mono); font-size: clamp(28px, 4vw, 42px); letter-spacing: -.02em; line-height: 1.15; }
.stat-arrow { opacity: 0; transition: opacity .18s ease; }
.stat-arrow.is-visible { opacity: 1; }
.stat-value .pre { margin-right: 4px; }
.stat-value .suf { margin-left: 4px; }
.stat-value .arrow-gap { margin: 0 4px 0 -4px; }
.stat-label { font-size: 16px; font-weight: 300; letter-spacing: .005em; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .stat-arrow { opacity: 1; transition: none; } }

.longform { display: flex; flex-direction: column; margin-top: 8px; }
.section { }
.section .sect-head { padding: 32px 0 8px; }
.paras { display: flex; flex-direction: column; gap: 16px; }
.paras p { font-size: 18px; line-height: 32px; letter-spacing: .005em; color: #0a0a0a; }

.gallery { margin-top: 32px; display: flex; flex-direction: column; gap: 7px; }
.pair { display: grid; grid-template-columns: 1fr; gap: 7px; }
@media (min-width: 640px) { .pair { grid-template-columns: 1fr 1fr; } }
