/* =========================================================
   Ong Yi Sheng — Portfolio
   Minimal design system
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg: #f3f2ee;
  --bg-elevated: #ffffff;
  --ink: #16150f;
  --ink-soft: #4a4842;
  --ink-faint: #6d6a5f;
  --line: #dedcd4;
  --line-strong: #c9c6bb;
  --accent: #16150f;
  --pill-bg: rgba(22, 21, 15, 0.04);

  --serif: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  --bg: #141310;
  --bg-elevated: #1f1d18;
  --ink: #f4f2ec;
  --ink-soft: #b6b2a8;
  --ink-faint: #837f76;
  --line: #302d27;
  --line-strong: #46423a;
  --accent: #f4f2ec;
  --pill-bg: rgba(244, 242, 236, 0.06);
}

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

html { -webkit-font-smoothing: antialiased; }
/* Native smooth scroll as a fallback; Lenis (class .lenis) takes over when JS runs. */
html:not(.lenis) { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(72px, 10vw, 140px); }

/* Available to screen readers, hidden visually */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 68px;
}

.nav__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  gap: 4px;
  justify-self: center;
  background: var(--pill-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 7px 16px;
  border-radius: 999px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--bg-elevated); }
.nav__links a.active { color: var(--ink); background: var(--bg-elevated); }

.nav__right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--pill-bg);
  padding: 0;
  cursor: pointer;
  flex: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink-faint); }
.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease);
}
.theme-toggle[aria-checked="true"] .theme-toggle__thumb { transform: translateX(22px); }
.theme-toggle__thumb svg { width: 14px; height: 14px; display: block; }

.nav__burger { display: none; }


/* ---------- Clock (standalone live Singapore time + scene) ---------- */
.clock {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 16px 18px 14px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 18px 36px -18px rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #4fb3ff 0%, #bfe6ff 100%); /* default: day */
  transition: box-shadow 0.35s var(--ease);
}
.clock:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 30px 52px -22px rgba(0, 0, 0, 0.6);
}
.clock:hover .clock__sun,
.clock:hover .clock__moon { transform: scale(1.14); }
.clock:hover .clock__dot { box-shadow: 0 0 0 5px rgba(53, 192, 122, 0.4); }
.clock[data-time="dawn"]  { background: linear-gradient(180deg, #2b3a67 0%, #f6a56b 65%, #ffd9a0 100%); }
.clock[data-time="day"]   { background: linear-gradient(180deg, #4fb3ff 0%, #bfe6ff 100%); }
.clock[data-time="dusk"]  { background: linear-gradient(180deg, #2e2657 0%, #e8734a 60%, #ffb26b 100%); }
.clock[data-time="night"] { background: linear-gradient(180deg, #0a0e2a 0%, #1b2145 100%); }

.clock__scene { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.clock[data-time="night"] .clock__scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.5px 1.5px at 28% 35%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 46% 15%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 64% 28%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 82% 18%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 94% 38%, rgba(255, 255, 255, 0.5), transparent);
}

/* Sun — visible dawn/day/dusk, moves and changes colour with the time of day */
.clock__sun {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  opacity: 0;
  transition: top 0.8s var(--ease), left 0.8s var(--ease), background 0.8s var(--ease), opacity 0.4s var(--ease), transform 0.3s var(--ease);
}
.clock[data-time="dawn"] .clock__sun {
  opacity: 1;
  top: 56%; left: 12%;
  background: radial-gradient(circle at 35% 35%, #fff3d6, #ffb26b);
  box-shadow: 0 0 22px 6px rgba(255, 178, 107, 0.55);
}
.clock[data-time="day"] .clock__sun {
  opacity: 1;
  top: 12%; left: 66%;
  background: radial-gradient(circle at 35% 35%, #fffef0, #ffe89a);
  box-shadow: 0 0 26px 8px rgba(255, 232, 154, 0.6);
}
.clock[data-time="dusk"] .clock__sun {
  opacity: 1;
  top: 52%; left: 70%;
  background: radial-gradient(circle at 35% 35%, #ffd9a0, #e8734a);
  box-shadow: 0 0 24px 7px rgba(232, 115, 74, 0.55);
}

/* Moon — night only, crescent carved out with an inset shadow */
.clock__moon {
  position: absolute;
  top: 14%; left: 68%;
  width: 26px; height: 26px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 35% 35%, #fdfdf8, #d9d6c9);
  box-shadow: 0 0 16px 3px rgba(255, 255, 255, 0.35), inset -7px -3px 0 0 #12173a;
  transition: opacity 0.4s var(--ease), transform 0.3s var(--ease);
}
.clock[data-time="night"] .clock__moon { opacity: 1; }

/* Clouds — shown for cloudy/rain/fog/storm, tinted a little warmer at dawn/dusk */
.clock__clouds { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s var(--ease); }
.clock[data-weather="cloudy"] .clock__clouds,
.clock[data-weather="rain"] .clock__clouds,
.clock[data-weather="fog"] .clock__clouds,
.clock[data-weather="storm"] .clock__clouds { opacity: 1; }
.clock__clouds::before {
  content: '';
  position: absolute;
  top: 22%; left: 8%;
  width: 34px; height: 13px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 15px -6px 0 -2px rgba(255, 255, 255, 0.65), -13px 3px 0 -3px rgba(255, 255, 255, 0.55);
}
.clock__clouds::after {
  content: '';
  position: absolute;
  top: 38%; left: 50%;
  width: 28px; height: 11px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 12px -5px 0 -2px rgba(255, 255, 255, 0.5);
}
.clock[data-time="night"] .clock__clouds::before,
.clock[data-time="night"] .clock__clouds::after { background: rgba(200, 200, 215, 0.35); box-shadow: none; }

/* Content layer sits above the scene — targeted explicitly so .clock__scene
   itself (position: absolute; z-index: 0) is never caught by this rule. */
.clock__row, .clock__time, .clock__hours, .clock__ticks { position: relative; z-index: 1; }

.clock__row { display: flex; align-items: center; gap: 8px; }
.clock__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #35c07a;
  box-shadow: 0 0 0 3px rgba(53, 192, 122, 0.3);
  flex: none;
  transition: box-shadow 0.3s var(--ease);
}
.clock__place { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.clock__weather { margin-left: auto; display: inline-flex; width: 15px; height: 15px; flex: none; }
.clock__weather svg { width: 100%; height: 100%; display: block; }

.clock__time {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 16px;
}

.clock__hours {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.clock__hour {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0.68;
  padding: 4px 6px;
  border-radius: 6px;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.clock__hour--now { opacity: 1; font-weight: 700; background: rgba(255, 255, 255, 0.2); }

.clock__ticks {
  position: relative;
  height: 6px;
  margin-top: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 6' preserveAspectRatio='none'%3E%3Cline x1='0' y1='0' x2='280' y2='0' stroke='white' stroke-width='1' stroke-opacity='0.35'/%3E%3Cline x1='0' y1='0' x2='0' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.4'/%3E%3Cline x1='40' y1='2' x2='40' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.3'/%3E%3Cline x1='80' y1='2' x2='80' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.3'/%3E%3Cline x1='120' y1='2' x2='120' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.3'/%3E%3Cline x1='140' y1='0' x2='140' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.4'/%3E%3Cline x1='160' y1='2' x2='160' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.3'/%3E%3Cline x1='200' y1='2' x2='200' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.3'/%3E%3Cline x1='240' y1='2' x2='240' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.3'/%3E%3Cline x1='279' y1='0' x2='279' y2='6' stroke='white' stroke-width='1' stroke-opacity='0.4'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
.clock__ticks-marker {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 2px;
  height: 10px;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
  transition: left 0.6s var(--ease);
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 9vw, 110px); padding-bottom: clamp(56px, 8vw, 96px); }
.hero__intro {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 20ch;
  margin-top: 34px;
}
.hero__sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: 30px;
}
.hero__actions { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn__arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn__arrow { transform: translate(2px, -2px); }

/* ---------- Section heading ---------- */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.sec-head--no-rule { border-top: none; padding-top: 0; }
.sec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.5vw, 40px);
  letter-spacing: -0.01em;
  line-height: 1.05;
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(22px, 3vw, 40px);
}
.project {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project:hover { transform: translateY(-6px); box-shadow: 0 26px 60px -30px rgba(22, 21, 15, 0.35); }

.project__media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: linear-gradient(135deg, #e9e7e0, #d9d6cc);
  display: grid;
  place-items: center;
}
.project__media--nhg { background: linear-gradient(135deg, #dfeaf3, #c3d8ec); }
.project__media--hh { background: linear-gradient(135deg, #dcefe4, #bfe3d0); }
.project__media--sgcm-a { background: linear-gradient(135deg, #f5e2dc, #ecc4b6); }
.project__media--sgcm-b { background: linear-gradient(135deg, #f3e6d6, #e9cfa6); }
.project__media--dbs { background: linear-gradient(135deg, #f4dede, #e6b6b6); }
.project__media--bif { background: linear-gradient(135deg, #f5e6c8, #e8b96b); }
.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.project:hover .project__media img { transform: scale(1.03); }
.project__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 28px;
}
.project__title {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.22;
  /* Keep every title exactly two lines so all cards align regardless of title length */
  min-height: 2.44em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project__meta { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.project__tags .tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--pill-bg);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}
.about__text { color: var(--ink-soft); font-size: 16px; margin-top: 24px; max-width: 52ch; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.col h3 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 14px;
}
.col ul { list-style: none; }
.col li {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  color: var(--ink);
}
.col li:last-child { border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 8vw, 100px); }
.footer__cta {
  font-family: var(--serif);
  font-size: clamp(30px, 6vw, 66px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.footer__cta a { border-bottom: 2px solid var(--line-strong); transition: border-color 0.25s var(--ease); }
.footer__cta a:hover { border-color: var(--ink); }
.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: clamp(48px, 7vw, 88px);
}
.footer__links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer__links a { font-size: 15px; color: var(--ink-soft); transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--ink); }
.footer__meta { font-size: 13px; color: var(--ink-faint); }

/* =========================================================
   Case study pages
   ========================================================= */
.cs-hero { padding-top: clamp(48px, 7vw, 84px); padding-bottom: clamp(40px, 6vw, 72px); }
.cs-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-soft); margin-bottom: 40px;
  transition: gap 0.2s var(--ease), color 0.2s;
}
.cs-back:hover { color: var(--ink); gap: 12px; }
.cs-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 16ch;
}
.cs-tagline { font-size: clamp(17px, 2vw, 21px); color: var(--ink-soft); max-width: 60ch; margin-top: 26px; }

.cs-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(40px, 6vw, 64px);
}
.fact { background: var(--bg); padding: 22px 24px; }
.fact dt { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; }
.fact dd { font-size: 16px; margin-top: 8px; font-weight: 500; line-height: 1.35; }

.cs-figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #e9e7e0, #d9d6cc);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  margin-block: clamp(28px, 4vw, 48px);
}
/* Used when a cs-figcap follows — caption's own margin provides the bottom spacing */
.cs-figure--capped { margin-bottom: 0; }
.cs-figure--tall { aspect-ratio: 4 / 3; }
.cs-figure--nhg { background: linear-gradient(135deg, #dfeaf3, #c3d8ec); }
.cs-figure--hh { background: linear-gradient(135deg, #dcefe4, #bfe3d0); }
.cs-figure--sgcm-a { background: linear-gradient(135deg, #f5e2dc, #ecc4b6); }
.cs-figure img, .cs-figure video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Natural-aspect figure — image keeps its own ratio (no crop), e.g. ultrawide strips */
.cs-figure--auto { aspect-ratio: auto; display: block; place-items: initial; }
.cs-figure--auto img { height: auto; object-fit: unset; }

/* Video showcase — keeps the clip's native aspect ratio (no crop) */
.cs-video { margin-block: clamp(28px, 4vw, 48px); }
.cs-video video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #0d0d0c;
}
.cs-video figcaption { font-size: 14px; color: var(--ink-faint); margin-top: 14px; text-align: center; }
/* Video nested inside a .cs-frame — frame supplies the chrome, video sits flush */
.cs-frame .video-wrap video { border: none; border-radius: 0; }

/* Full-page screenshot inside a scrollable browser frame */
.cs-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  margin-top: clamp(28px, 4vw, 48px);
}
.cs-frame__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.cs-frame__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.cs-frame__view { max-height: 620px; overflow-y: auto; }
.cs-frame__view img { width: 100%; display: block; }
.cs-frame--mobile { max-width: 340px; margin-inline: auto; }
.cs-frame--mobile .cs-frame__view { max-height: 660px; }
.cs-figcap { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 14px; margin-bottom: clamp(28px, 4vw, 48px); }

/* Video grid (step-by-step clips) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  margin-block: clamp(28px, 4vw, 48px);
}
.video-grid figure { margin: 0; }
.video-grid video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0d0d0c;
}
.video-grid figcaption { font-size: 13px; color: var(--ink-faint); margin-top: 10px; }
@media (max-width: 640px) { .video-grid { grid-template-columns: 1fr; } }

.cs-block { max-width: 720px; }
.cs-block + .cs-block { margin-top: clamp(48px, 7vw, 88px); }
.cs-block--wide { max-width: none; }
.cs-block h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.5vw, 42px);
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin-bottom: 20px;
}
.cs-block h3 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
.cs-block p { color: var(--ink-soft); font-size: 17px; margin-bottom: 16px; }
.cs-block p strong { color: var(--ink); font-weight: 600; }
.cs-block ul { margin: 8px 0 16px; padding-left: 0; list-style: none; }

/* Job-to-be-done cards */
.jtbd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3.5vw, 40px);
  margin-top: clamp(24px, 3vw, 36px);
  max-width: 900px;
}
.jtbd-card { border-top: 2px solid var(--ink); padding-top: 20px; }
.jtbd-card__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.jtbd-card__quote {
  font-family: var(--serif);
  font-size: clamp(19px, 2.1vw, 23px);
  font-weight: 400;
  line-height: 1.44;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 14px;
}

/* Process steps */
.steps { margin-top: 8px; }
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: none; padding-top: 8px; }
.step__num {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Insight cards (reusable callout grid — findings, patterns, etc.) */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3.5vw, 40px);
  margin-top: clamp(24px, 3vw, 36px);
}
.insight-card { border-top: 2px solid var(--ink); padding-top: 20px; }
.insight-card__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.insight-card__text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-top: 12px;
}
.insight-card__quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-faint);
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
}

/* Stat cards (big-number callouts for quantitative findings) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3.5vw, 40px);
  margin-top: clamp(24px, 3vw, 36px);
}
.stat-card { border-top: 2px solid var(--ink); padding-top: 20px; }
.stat-card__num {
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-card__label {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* Data table (task performance, etc.) — scrolls horizontally on narrow screens */
.table-scroll {
  overflow-x: auto;
  margin-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line-strong);
}
.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 15px 18px 15px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-faint);
  white-space: nowrap;
  padding-top: 18px;
  padding-bottom: 14px;
}
.data-table td { color: var(--ink-soft); }
.data-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tbody tr { transition: background 0.2s var(--ease); }
.data-table tbody tr:hover { background: var(--pill-bg); }
.data-table td.next--yes { color: var(--ink); font-weight: 600; }
.data-table td.next--no { color: var(--ink-faint); }

/* Video with a custom centred play button */
.video-wrap { position: relative; }
.video-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #16150f;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.video-play svg { margin-left: 3px; }
.video-play:hover { transform: translate(-50%, -50%) scale(1.08); }
.video-wrap.is-playing .video-play { display: none; }
.step__body h3 { margin: 0 0 10px; }
.step__body p { margin-bottom: 0; }
.cs-block li {
  position: relative;
  padding-left: 24px;
  color: var(--ink-soft);
  font-size: 17px;
  margin-bottom: 12px;
}
.cs-block li::before {
  content: "";
  position: absolute; left: 4px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink);
}

/* Metric strip */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(20px, 3vw, 36px);
  margin-block: clamp(32px, 5vw, 56px);
}
.metric { border-top: 2px solid var(--ink); padding-top: 18px; }
.metric__num { font-family: var(--serif); font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: -0.02em; }
.metric__label { font-size: 14.5px; color: var(--ink-soft); margin-top: 12px; }

/* Next project */
.cs-next {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 7vw, 90px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cs-next__label { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; }
.cs-next__title {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin-top: 8px;
  transition: opacity 0.2s var(--ease);
}
.cs-next:hover .cs-next__title { opacity: 0.6; }

/* =========================================================
   About page
   ========================================================= */
.about-hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(40px, 6vw, 80px); }
.about-hero__intro {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 20ch;
}
.about-hero__text {
  max-width: 60ch;
  margin-top: clamp(28px, 4vw, 44px);
  display: grid;
  gap: 18px;
}
.about-hero__text p { font-size: clamp(16px, 1.7vw, 19px); color: var(--ink-soft); }
.about-hero__text a { border-bottom: 1px solid var(--line-strong); transition: border-color 0.2s var(--ease); }
.about-hero__text a:hover { border-color: var(--ink); }

/* Experience / list rows */
.list-rows { border-top: 1px solid var(--line-strong); }
.list-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
  padding: 24px 20px;
  margin-inline: -20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}
.list-row:hover { background: var(--pill-bg); }
.list-row__year { font-size: 14px; color: var(--ink-faint); font-variant-numeric: tabular-nums; padding-top: 2px; }
.list-row__title { font-size: clamp(18px, 2vw, 22px); font-weight: 600; letter-spacing: -0.01em; }
.list-row__body { display: flex; align-items: flex-start; gap: 14px; }
.list-row__logo {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 5px;
  flex: none;
}
.list-row__role { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.list-row__desc { font-size: 14.5px; line-height: 1.62; color: var(--ink-soft); margin-top: 12px; max-width: 62ch; }
.list-row__tag { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }

/* Simple award/cert rows (2 cols) */
.list-simple { border-top: 1px solid var(--line-strong); }
.list-simple .list-row { grid-template-columns: 1fr auto; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Cascade: hero elements and work-grid cards fade in as a sequence, not a block */
.hero.wrap .reveal:nth-child(1) { transition-delay: 0s; }
.hero.wrap .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero.wrap .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero.wrap .reveal:nth-child(4) { transition-delay: 0.24s; }

.work-grid .project:nth-child(odd) { transition-delay: 0s; }
.work-grid .project:nth-child(even) { transition-delay: 0.12s; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .work-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .cs-facts { grid-template-columns: repeat(2, 1fr); }
  .jtbd-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .step { grid-template-columns: 40px 1fr; gap: 14px; }
  .nav__links {
    position: fixed;
    top: 68px; left: var(--gutter); right: var(--gutter);
    justify-self: stretch;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: 0 24px 60px -24px rgba(0,0,0,0.35);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { text-align: center; padding: 14px; }
  .nav__inner { grid-template-columns: 1fr auto auto; column-gap: 10px; }
  .nav__right { display: flex; }
  .nav__burger {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    justify-self: end;
    background: none; border: none; cursor: pointer;
    padding: 8px;
  }
  .nav__burger span { width: 22px; height: 2px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 640px) {
  .list-row { grid-template-columns: 1fr; gap: 6px; }
  .list-simple .list-row { grid-template-columns: 1fr; gap: 4px; }
  .list-simple .list-row__title { order: 0; }
  .list-simple .list-row__tag { order: 1; text-align: left; }
}

@media (max-width: 520px) {
  .cs-facts { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Password gate (login page) ---------- */
.gate-wrap {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate__card { width: 100%; max-width: 430px; text-align: center; }
.gate__icon { display: block; width: 42px; height: 42px; margin: 0 auto 22px; color: var(--ink-faint); }
.gate__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 12px 0 12px;
}
.gate__text { color: var(--ink-soft); font-size: 16px; margin-bottom: 26px; }
.gate__form { display: flex; gap: 10px; }
.gate__input {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink);
}
.gate__input:focus { outline: none; border-color: var(--ink); }
.gate__form .btn { white-space: nowrap; border: none; cursor: pointer; }
.gate__form .btn:disabled { opacity: 0.6; cursor: default; }
.gate__form .btn:disabled:hover { transform: none; }
.gate__error { color: #d64545; font-size: 14px; margin-top: 16px; }
.gate__back { display: inline-block; margin-top: 26px; font-size: 14px; color: var(--ink-faint); }
.gate__back:hover { color: var(--ink); }
@media (max-width: 480px) { .gate__form { flex-direction: column; } }

/* ---------- Case study: side-by-side figures & A/B comparison ---------- */
.cs-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
  margin-block: clamp(28px, 4vw, 48px);
}
.cs-duo figure { margin: 0; }
.cs-duo .cs-figure { margin-block: 0; }
.cs-duo .cs-frame--mobile { max-width: none; }
.cs-ab {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  margin-block: clamp(28px, 4vw, 48px);
}
.cs-ab figure { margin: 0; }
.cs-ab img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}
@media (max-width: 720px) {
  .cs-duo { grid-template-columns: 1fr; }
  .cs-duo .cs-frame--mobile { max-width: 340px; margin-inline: auto; }
}

/* Case study: blocks that hold card grids / steps use the full width,
   while running text keeps a readable measure */
.cs-block--grid { max-width: none; }
.cs-block--grid > p,
.cs-block--grid > h3 { max-width: 720px; }
.cs-block--grid .step { max-width: none; }
.cs-block--grid .step__body { max-width: 760px; }
.cs-block--grid .insight-grid { max-width: none; }
.insight-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .insight-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .insight-grid--3 { grid-template-columns: 1fr; } }

/* Side-by-side device frames: equal height so the pair lines up */
.cs-duo .cs-frame__view { max-height: 640px; }
.cs-duo--match { align-items: stretch; }
.cs-duo--match > figure { display: flex; flex-direction: column; }
.cs-duo--match > figure > .cs-figcap { margin-top: 14px; }
.cs-duo--match .cs-frame { position: relative; flex: 1; min-height: 420px; margin-top: 0; }
.cs-duo--match .cs-frame__bar { position: absolute; inset: 0 0 auto 0; }
.cs-duo--match .cs-frame__view { position: absolute; inset: 40px 0 0 0; max-height: none; overflow-y: auto; }
@media (max-width: 720px) {
  .cs-duo--match .cs-frame { min-height: 0; height: 560px; flex: none; }
}
.cs-duo--match .cs-frame { width: 100%; margin-inline: 0; max-width: none; }
@media (max-width: 720px) {
  .cs-duo--match .cs-frame { max-width: 340px; margin-inline: auto; }
}
@media (max-width: 720px) {
  .cs-ab figure { overflow-x: auto; }
  .cs-ab img { min-width: 560px; }
}

/* Case study: before / after comparison rows.
   Each crop is a window into the full-length image (object-position is the
   scroll position as a percentage), so swapping in a sharper export of the same
   frame keeps every crop in place. */
.cs-compare { margin-top: clamp(28px, 4vw, 44px); display: grid; gap: clamp(36px, 5vw, 60px); }
.cs-compare__title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.cs-compare__note { font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); max-width: 720px; margin: 0 0 18px; }
.cs-compare__pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2.5vw, 28px); }
.cs-compare__pair figure { margin: 0; }
.cs-compare__tag {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 10px;
}
.cs-compare__tag--after { color: var(--ink); }
.cs-compare__crop {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}
.cs-compare__crop img { width: 100%; height: 100%; object-fit: cover; object-position: 50% var(--pos, 0%); display: block; }
.cs-compare__crop--empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  border-style: dashed;
  background: transparent;
  color: var(--ink-faint);
  font-size: 15px;
}
.cs-compare__pair figcaption { font-size: 13.5px; color: var(--ink-faint); margin-top: 10px; line-height: 1.5; }
@media (max-width: 720px) { .cs-compare__pair { grid-template-columns: 1fr; } }

/* Case study: one-line summary under the tagline */
.cs-oneline {
  max-width: 720px;
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-left: 14px;
  border-left: 2px solid var(--ink);
}
.cs-oneline strong { color: var(--ink); font-weight: 600; }


/* Case study: three mobile frames side by side (before, after, after expanded) */
.cs-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.5vw, 28px);
  align-items: start;
  margin-block: clamp(28px, 4vw, 48px);
}
.cs-trio figure { margin: 0; }
.cs-trio .cs-frame { margin-top: 0; }
.cs-trio .cs-frame--mobile { max-width: none; }
.cs-trio .cs-frame__view { max-height: 620px; }
@media (max-width: 900px) {
  .cs-trio { grid-template-columns: 1fr; }
  .cs-trio .cs-frame--mobile { max-width: 340px; margin-inline: auto; }
  .cs-trio figure > .cs-compare__tag { max-width: 340px; margin-inline: auto; }
}
