/* ==========================================================
   Kevin Ling portfolio
   Colours, fonts and sizes live here so they are easy to tweak.
   ========================================================== */
:root {
  --bg: #f5f5f5;
  --text: #1a1a1a;
  --text-soft: #444;
  --line: #d6d6d6;
  --accent: #3fa9e0;          /* the blue used for the active nav link */
  --band-pink: #fde5e5;
  --band-lavender: #f2f2fa;

  --font-body: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-logo: "Ultra", "Rockwell Extra Bold", Georgia, serif;

  --sidebar-w: 240px;
  --text-w: 720px;
  --media-w: 900px;
  --band-w: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 56px 32px 32px 48px;
  overflow-y: auto;
}
.logo {
  display: inline-block;
  text-decoration: none;
  color: #000;
}
.logo-face { width: 26px; height: 26px; margin: 0 0 -4px 2px; }
.logo-name {
  font-family: var(--font-logo);
  font-size: 34px;
  line-height: 0.82;
  letter-spacing: -0.5px;
  margin: 0;
}
.wave {
  display: inline-block;
  font-size: 26px;
  margin: 26px 0 22px;
  transform-origin: 70% 70%;
  animation: wave 2.4s ease-in-out 0.6s 2;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.nav { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0 0 10px; }
.nav a, .nav span {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  text-decoration: none;
  display: inline-block;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .soon { color: #9a9a9a; cursor: default; }
.nav .soon small { display: block; font-size: 10px; }

/* ---------- Main column ---------- */
main {
  margin-left: var(--sidebar-w);
  padding: 64px 40px 0;
}
.text {
  max-width: var(--text-w);
  margin: 0 auto;
}
.text p { margin: 0 0 1.2em; }
.text strong { font-weight: 800; }
.media {
  max-width: var(--media-w);
  margin: 0 auto;
}
.block { margin: 72px auto; }
.block.tight { margin: 40px auto; }

/* Hero */
.hero {
  max-width: 1000px;
  margin: 0 auto 72px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.hero img { width: 100%; }

/* Workflow diagram sits on a dark card */
.dark-card {
  background: #333;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
}

/* Coloured bands behind groups of screens */
.band {
  max-width: var(--band-w);
  margin: 0 auto;
  padding: 0 40px 72px;
  position: relative;
}
.band.pink { --band: var(--band-pink); }
.band.lavender { --band: var(--band-lavender); }
.band { background: var(--band); }
/* The first image in a band sits half on the page, half on the band */
.band-top {
  max-width: var(--band-w);
  margin: 72px auto 0;
  padding: 0 40px;
  background: linear-gradient(to bottom, transparent 50%, var(--band) 50%);
}
.band-top.pink { --band: var(--band-pink); }
.band-top.lavender { --band: var(--band-lavender); }
/* The last image in a band hangs off the bottom edge */
.band-bottom {
  max-width: var(--band-w);
  margin: 0 auto 72px;
  padding: 0 40px;
  background: linear-gradient(to bottom, var(--band) 50%, transparent 50%);
}
.band-bottom.pink { --band: var(--band-pink); }
.band-bottom.lavender { --band: var(--band-lavender); }
.band > .block:first-child { margin-top: 0; padding-top: 56px; }

.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.narrower { max-width: 480px; margin-left: auto; margin-right: auto; }

.text ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.text li { margin-bottom: 0.9em; }

/* ---------- Footer email ticker ---------- */
.ticker {
  margin: 120px -40px 0;
  padding: 56px 0 72px;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  animation: ticker 40s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a, .ticker button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-right: 64px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.ticker a:hover, .ticker button:hover { color: var(--accent); }
.ticker button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.ticker svg { width: 18px; height: 18px; color: #6a8fd8; }
@keyframes ticker { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .wave { animation: none; }
}

/* ---------- Resume ---------- */
.resume { max-width: 820px; margin: 0 auto; font-size: 14.5px; }
.resume-head { text-align: center; margin: 24px 0 80px; }
.resume-head h1 { font-size: 30px; font-weight: 600; margin: 0 0 20px; }
.resume-head p { margin: 0 0 8px; }
.resume-head a { text-decoration: none; }
.resume-head a:hover { color: var(--accent); }
.resume h2 { font-size: 22px; font-weight: 700; margin: 0 0 32px; }
.job {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 0 0 40px;
  margin: 0 0 40px;
  border-bottom: 1px solid var(--line);
}
.job:last-of-type { border-bottom: 0; }
.job-meta p { margin: 0; }
.job-meta .company { font-weight: 800; }
.job-meta .role { margin-top: 16px; color: var(--text-soft); }
.job ul, .edu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.job li, .edu li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 2px;
}
.job li::before, .edu li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  background: currentColor;
}
.edu-section { margin-top: 64px; padding-bottom: 120px; }
.edu {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-bottom: 10px;
}
.edu strong { font-weight: 800; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 24px 20px 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 20px;
  }
  .wave { margin: 0; font-size: 22px; }
  .logo-name { font-size: 28px; }
  .nav { flex-basis: 100%; display: grid; gap: 6px; margin-top: 8px; }   /* one link per line on phones */
  .nav li { margin: 0; }
  .nav .soon small { display: inline; }
  main { margin-left: 0; padding: 24px 16px 0; }
  .band, .band-top, .band-bottom { padding-left: 16px; padding-right: 16px; }
  .band { padding-bottom: 48px; }
  .block { margin: 48px auto; }
  .hero { margin-bottom: 48px; }
  .ticker { margin: 72px -16px 0; }
  .job, .edu { grid-template-columns: 1fr; gap: 12px; }
  .edu { gap: 0; margin-bottom: 16px; }
  .resume-head { margin-bottom: 56px; }
}

/* ---------- Full size image viewer ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 20, 0.88);
  cursor: zoom-out;
  overflow: auto;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 900px) {
  /* On phones let the image be wider than the screen so details are readable */
  .lightbox { padding: 12px; align-items: flex-start; }
  .lightbox img { max-width: none; width: 200%; max-height: none; }
}

/* ---------- Placeholders (case studies in progress) ---------- */
.placeholder { color: #8a8a8a; font-style: italic; margin: 0 0 1.2em; }
.job .placeholder { margin: 0; }
.wip-note {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
}
.placeholder-hero {
  aspect-ratio: 2000 / 1426;
  max-width: 1000px;
  margin-top: 0;
  background: #e9ecf3;
  border: 1px dashed #b9c0cf;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 5vw, 56px);
}
.ph-title { font-size: clamp(24px, 4vw, 40px); font-weight: 800; color: #5b6477; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 16px 48px; margin: 0; }
.ph-meta dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #5b6477; }
.ph-meta dd { margin: 0; font-size: 14px; color: #5b6477; }
.ph-image {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  border: 1px dashed #c4c4c4;
  border-radius: 6px;
  color: #8a8a8a;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- Loopio case study ---------- */
.rounded { border-radius: 8px; overflow: hidden; }

/* Problem statement card */
.statement {
  max-width: var(--media-w);
  margin: 72px auto;
  padding: clamp(28px, 6vw, 56px) clamp(20px, 12vw, 148px);
  background: #efeefb;
  border-radius: 8px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a98b8;
  margin: 0 0 10px;
}
.statement p.big {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.5;
  font-weight: 800;
  color: #3a3760;
  text-wrap: balance;
}

/* Two-column card grids: user types, problems and solutions */
.pair-grid {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pair-grid > * { min-width: 0; }
.pair-head {
  margin: 0;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
}
.head-teal { background: #dcebea; color: #1f6f6a; }
.head-lavender { background: #e3e2ee; color: #4a4778; }
.head-red { background: #f6dede; color: #d6455a; font-size: 17px; padding: 10px 14px; }
.head-green { background: #dce8e0; color: #2e7d4f; font-size: 17px; padding: 10px 14px; }
.card {
  background: #fff;
  border-radius: 4px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.card ul { margin: 0; padding-left: 26px; }
.card p { margin: 0; }
.pair-grid.problems { max-width: 680px; gap: 8px 14px; }
.pair-grid.problems .card { color: #444; }
.m-label { display: none; }
@media (max-width: 560px) { .m-label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; } .m-label.red { color: #d6455a; } .m-label.green { color: #2e7d4f; } }
.lead-in { text-align: center; margin: 72px auto 20px; max-width: var(--text-w); }

/* Recreated "horizontal scroll" table */
.table-demo {
  max-width: var(--media-w);
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(40, 36, 90, 0.08);
  overflow: hidden;
}
.table-scroll { overflow: auto; max-height: 360px; overscroll-behavior: contain; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table-demo table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  min-width: 900px;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.table-demo th, .table-demo td {
  text-align: left;
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 1px solid #eeeef3;
}
.table-demo th { font-weight: 600; color: #333; background: #fff; }
.table-demo tbody tr.alt td { background: #f8f8fb; }
.table-demo td:first-child, .table-demo th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: normal;
  min-width: 200px;
  max-width: 220px;
  background: #fff;
  box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.18);
}
.table-demo tbody tr.alt td:first-child { background: #f8f8fb; }
.table-demo td:first-child a { color: #2d2a6e; font-size: 12px; }
.table-caption {
  text-align: center;
  font-size: 12px;
  color: #7c7a99;
  margin: 14px 0 0;
}

/* Yellow "what's next" area that runs into the footer */
.next-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 30px 20px;
  background: #fff;
  border-radius: 8px;
  position: relative;
}
.next-card h2 { font-size: 18px; margin: 0 0 12px; }
.next-card ul { margin: 0; padding-left: 22px; }
.next-card li { margin-bottom: 8px; }
.yellow-zone { margin: 96px -40px 0; padding: 0 40px 24px; }   /* closing cards, no yellow band */
.yellow-zone + .ticker { margin-top: 0; }   /* email strip follows the closing cards */

/* Dashed boxes for screens still to be exported */
.ph-screen {
  max-width: var(--media-w);
  margin: 0 auto;
  aspect-ratio: 16 / 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 16px;
  border: 1px dashed #b5b3d0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: #6d6a93;
  font-size: 14px;
}
.ph-screen strong { font-weight: 800; color: #3a3760; }
.ph-screen code { font-family: var(--font-mono); font-size: 11px; color: #8d8ab0; }
.ph-screen.short { aspect-ratio: 16 / 4; }

@media (max-width: 900px) {
  .yellow-zone { margin: 64px -16px 0; padding: 0 16px 16px; }
  .ticker { margin-left: -16px; margin-right: -16px; }
}
@media (max-width: 560px) {
  .pair-grid { grid-template-columns: 1fr; }
  .pair-grid.users .u1 { order: 1; }
  .pair-grid.users .u2 { order: 2; }
  .pair-grid.users .head-lavender { margin-top: 14px; }
  /* stacked: drop the column headers, label each card instead */
  .pair-grid.problems .pair-head { display: none; }
  .pair-grid.problems .card:nth-of-type(even) { margin-bottom: 14px; }
  .ph-screen, .ph-screen.short { aspect-ratio: 16 / 9; }
}

/* Final screens: framed like app windows */
.screen img { border-radius: 8px; box-shadow: 0 4px 24px rgba(40, 36, 90, 0.14); }
.screen.plain img { border-radius: 0; box-shadow: none; }

/* ---------- More band colours (Rise page) ---------- */
.band.sky, .band-top.sky, .band-bottom.sky, .box-band.sky { --band: #e8eef8; }
.band.butter, .band-top.butter, .band-bottom.butter, .box-band.butter { --band: #faf0cf; }
.band.mint, .band-top.mint, .band-bottom.mint, .box-band.mint { --band: #eef8ef; }
.band.slate, .band-top.slate, .band-bottom.slate, .box-band.slate { --band: #e8ecf5; }
/* A self-contained coloured box around one image, like the old site's tinted cards */
.box-band {
  max-width: var(--band-w);
  margin: 72px auto;
  padding: clamp(24px, 6vw, 64px) clamp(16px, 8vw, 96px) clamp(20px, 4vw, 40px);
  background: var(--band);
  border-radius: 6px;
}
.caption {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6b7488;
  margin: 18px 0 0;
}
.footnote { font-size: 13px; color: #777; }

/* Result cards at the end of a case study */
.result-grid {
  max-width: var(--band-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  position: relative;
}
.result-grid > * { min-width: 0; }
.result-card {
  background: #fff;
  border-radius: 8px;
  padding: 26px 28px 20px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 12px;
  align-content: start; /* keep the list under its heading when the card next to it is taller */
}
.result-card .icon { font-size: 22px; line-height: 1.2; }
.result-card h2 { font-size: 16px; line-height: 1.45; margin: 0 0 8px; font-weight: 800; color: #333; }
.result-card ul { grid-column: 2; margin: 0; padding-left: 14px; font-size: 14px; color: #444; }
.result-card li { margin-bottom: 6px; }
@media (max-width: 700px) { .result-grid { grid-template-columns: 1fr; } }

/* ---------- Home ("Hello there!") ---------- */
.hello {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: clamp(56px, 11vw, 132px);
  line-height: 0.82;
  letter-spacing: -1px;
  margin: 0 0 64px;
  text-wrap: balance;
}
.home { max-width: 920px; margin: 0 auto; }
.home .intro { max-width: 800px; margin: 0 0 72px 16px; font-size: 16px; }
.home .intro p { margin: 0 0 1.4em; }
.home .intro .wave-inline { display: inline-block; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 0 0 16px;
}
.photo-grid > * { min-width: 0; }
.photo-grid img, .photo-grid video, .ph-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
}
.ph-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border: 1px dashed #c4c4c4;
  background: #ececec;
  color: #8a8a8a;
  font-family: var(--font-mono);
  font-size: 12px;
}
@media (max-width: 900px) {
  .home .intro, .photo-grid { margin-left: 0; }
  .hello { margin-bottom: 40px; }
}
@media (max-width: 560px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.soft-shadow { border-radius: 6px; box-shadow: 0 6px 30px rgba(60, 50, 10, 0.12); }

/* Wave emoji: waves while hovered, and once per tap on phones */
.wave { cursor: default; user-select: none; }
.wave.intro-done { animation: none; }
.wave:hover { animation: wave-again 1.2s ease-in-out infinite; }
.wave.waving { animation: wave-again 1.2s ease-in-out 1; }
@keyframes wave-again {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wave:hover, .wave.waving { animation: none; }
}

/* Timeframe line under each case study header */
.timeframe {
  max-width: 1000px;
  margin: -56px auto 64px;
  text-align: right;
  font-size: 14px;
  color: var(--text-soft);
}
.timeframe span {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--text);
  margin-right: 8px;
}
@media (max-width: 900px) { .timeframe { margin: -36px auto 40px; text-align: left; } }

/* Case study videos (Insightly page): same framing as images */
figure video { display: block; width: 100%; height: auto; }
.screen video { border-radius: 8px; box-shadow: 0 4px 24px rgba(40, 36, 90, 0.14); }
.media video { border-radius: 8px; }

/* ---------- Research tables (Insightly page) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-head { font-size: 20px; line-height: 1.3; font-weight: 800; margin: 0 0 10px; text-wrap: balance; }
.text.block + .data-table { margin-top: -40px; }
.data-table {
  max-width: var(--media-w);
  margin: 0 auto 72px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}
.data-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid #eeeef3; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table thead th {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6f80;
  background: #fafafc;
}
.data-table tbody th { font-weight: 800; white-space: nowrap; }
.data-table strong { font-weight: 800; }
/* Hats: highlight the small-business column where one person does it all */
.hats table { min-width: 520px; }
.hats td.same { background: #f3f0fd; color: #4a3aa8; font-weight: 700; }
/* Findings: the design response column gets a soft tint */
.findings th:nth-child(1), .findings td:nth-child(1) { width: 24%; color: #555; }
.findings th:nth-child(2), .findings td:nth-child(2) { width: 44%; }
.findings th:nth-child(3), .findings td:nth-child(3) { width: 32%; }
.findings td:nth-child(3) { background: #f6f4fd; }
.findings thead th:nth-child(3) { background: #efebfb; color: #4a3aa8; }

@media (max-width: 700px) {
  .text.block + .data-table { margin-top: -24px; }
  .data-table { margin-bottom: 48px; }
  /* Findings stack into one card per row on phones */
  .findings { overflow: visible; background: none; box-shadow: none; }
  .findings table, .findings tbody, .findings tr, .findings td { display: block; width: auto !important; }
  .findings thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .findings tr { background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
  .findings td { border-bottom: 1px solid #eeeef3; padding: 12px 16px; }
  .findings tr td:last-child { border-bottom: 0; }
  .findings td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b6f80;
    margin-bottom: 2px;
  }
  .findings td:nth-child(3)::before { color: #4a3aa8; }
  /* Hats stack into one card per role on phones */
  .hats { overflow: visible; background: none; box-shadow: none; }
  .hats table { min-width: 0; }
  .hats table, .hats tbody, .hats tr, .hats th, .hats td { display: block; }
  .hats thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hats tr { background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
  .hats tbody th { padding: 12px 16px 8px; border-bottom: 1px solid #eeeef3; }
  .hats td { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid #f3f3f6; }
  .hats td::before { content: attr(data-label); color: #6b6f80; font-weight: 400; }
  .hats td.same::before { color: #6b6a99; }
}

/* Project year in the side menu */
.nav .year { color: #9a9a9a; font-size: 11px; margin-left: 4px; white-space: nowrap; }
.nav a:hover .year, .nav a[aria-current="page"] .year { color: inherit; opacity: 0.7; }

.photo-grid video { display: block; height: auto; }

/* ---------- Printing (also used to make the resume PDF) ---------- */
@page { size: Letter; margin: 0.55in 0.6in; }
@media print {
  body { background: #fff; color: #111; font-size: 10pt; line-height: 1.45; }
  .sidebar, .ticker, .lightbox, .wip-note { display: none !important; }
  main { margin: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }

  .resume { max-width: none; font-size: 9.6pt; }
  .resume-head { margin: 0 0 18pt; }
  .resume-head h1 { font-size: 22pt; margin: 0 0 4pt; }
  .resume-head p { display: inline; margin: 0; }
  .resume-head p:first-of-type { display: block; font-size: 11pt; margin-bottom: 3pt; }
  .resume-head p:nth-of-type(3)::before { content: "· "; }
  .resume h2 { font-size: 12.5pt; margin: 0 0 9pt; padding-bottom: 4pt; border-bottom: 1.5px solid #111; }
  .job, .edu { grid-template-columns: 1.85in 1fr; gap: 0 0.2in; }
  .job { padding: 0 0 8pt; margin: 0 0 8pt; border-bottom: 1px solid #ddd; break-inside: avoid; }
  .job-meta .role { margin-top: 3pt; }
  .job-meta p { white-space: nowrap; }
  .job li, .edu li { margin-bottom: 1.5pt; }
  .job li::before, .edu li::before { width: 4px; height: 4px; top: 0.6em; }
  .edu-section { margin-top: 14pt; padding-bottom: 0; break-inside: avoid; }
  .edu { margin-bottom: 4pt; }
}

/* ---------- Case study summary (problem, role, outcome) ---------- */
.summary {
  max-width: var(--text-w);
  margin: -24px auto 64px;
  padding: 20px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: grid;
  gap: 12px;
}
.summary > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.summary dt {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6f80;
  padding-top: 3px;
}
.summary dd { margin: 0; font-size: 15px; line-height: 1.6; }
@media (max-width: 600px) {
  .summary { margin-top: -12px; padding: 16px 18px; }
  .summary > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Links to the work ---------- */
.home .intro a { font-weight: 800; text-decoration: none; }   /* bold instead of underlined */
.home .intro a:hover { color: var(--accent); }
.home .intro .cta { margin-top: 1.6em; }
.home .intro .cta a { font-weight: 800; text-decoration: none; color: var(--accent); }
.home .intro .cta a:hover { text-decoration: underline; }
.side-links { margin: 22px 0 0; }
.side-links a { font-family: var(--font-mono); font-size: 12px; text-decoration: none; }
.side-links a:hover { color: var(--accent); }
@media (max-width: 900px) { .side-links { margin: 6px 0 0; flex-basis: 100%; } }
@media print {
  .resume-head p:nth-of-type(n+3)::before { content: "· "; }
  .summary { box-shadow: none; border: 1px solid #ddd; }
}

/* "Email address copied" message */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* A picture that already includes its own coloured band and caption */
.band-image { max-width: var(--band-w); margin: 72px auto; border-radius: 6px; overflow: hidden; }
.band-image img { width: 100%; }

/* Reading progress bar (case studies) */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: calc(3px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
@media print { .read-progress { display: none; } }

/* Captions under the home page photos */
.photo-grid figure { margin: 0; }
.photo-grid figcaption { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--text-soft); }

/* Loopio table: pinned header row, sortable columns, row hover */
.table-demo thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 #e4e4ec; }
.table-demo thead th:first-child { z-index: 3; }
.table-demo th button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer;
}
.table-demo th:hover, .table-demo th:hover button { color: #2d2a6e; }
.table-demo th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.table-demo .sort-arrow { color: #a3a2bd; font-size: 11px; }
.table-demo th[aria-sort] .sort-arrow { color: #2d2a6e; }
.table-demo tbody tr:hover td { background: #eeedf9 !important; }

/* Loopio tables: filter panel beside the table (stacks on top on small screens) */
.table-figure { max-width: 1060px; margin-left: auto; margin-right: auto; }
.table-figure + .table-figure, .media + .table-figure { margin-top: 40px; }
.table-app {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px;
  height: 560px;                       /* panel and table share this height */
  transition: grid-template-columns .2s ease;
}
.table-app.collapsed { grid-template-columns: 46px minmax(0, 1fr); }
.table-app .table-demo { max-width: none; margin: 0; display: flex; flex-direction: column; min-height: 0; }
.table-app .table-scroll { flex: 1; min-height: 0; max-height: none; }
.table-bar {
  margin: 0; padding: 10px 16px; font-size: 12px; color: #7c7a99;
  border-bottom: 1px solid #eeeef3; display: flex; justify-content: flex-end;
}

.filter-panel {
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 10px rgba(40, 36, 90, 0.08);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  font-size: 12.5px;
}
.filter-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 12px 12px 16px; border-bottom: 1px solid #eeeef3;
}
.filter-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: #1f1d3d; white-space: nowrap; }
.filter-title .ico { width: 13px; height: 13px; }
.filter-toggle {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0; flex: none;
  border: 0; border-radius: 5px; background: none; color: #4b4880; cursor: pointer;
}
.filter-toggle svg { width: 18px; height: 18px; transition: transform .2s ease; }
.filter-toggle:hover { background: #f0eff8; }
.filter-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.collapsed .filter-head { padding: 12px 10px; border-bottom: 0; justify-content: center; }
.collapsed .filter-title, .collapsed .filter-body, .collapsed .filter-foot { display: none; }
.collapsed .filter-toggle svg { transform: scaleX(-1); }

.filter-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; display: grid; align-content: start; gap: 13px; }
.filter-field { display: grid; gap: 5px; min-width: 0; }
.filter-field[hidden], .filter-dates[hidden] { display: none; }
.filter-field > span:first-child { font-weight: 700; color: #1f1d3d; }
.filter-rule { border: 0; border-top: 1px solid #eeeef3; margin: 4px -16px; }
.filter-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-field input, .filter-field select {
  font: inherit; color: #1a1a1a;
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid #d8d7e6; border-radius: 4px;
  background: #fff;
}
.filter-field input[type="date"] { padding: 6px 6px; font-size: 12px; }
.filter-field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 28px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%231f1d3d'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.filter-field select:disabled {
  color: #9b9ab0; font-style: italic; cursor: not-allowed; background-color: #f4f4f8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23b9b8cc'/%3E%3C/svg%3E");
}
.filter-field input::placeholder { color: #8a89a3; font-style: italic; }
.filter-field input:focus-visible, .filter-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.filter-field select.on { border-color: #3b3486; box-shadow: inset 0 0 0 1px #3b3486; }
.search-wrap { position: relative; display: block; }
.search-wrap input { padding-right: 30px; }
.search-wrap svg { position: absolute; right: 9px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: #1f1d3d; pointer-events: none; }
.filter-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid #eeeef3; }
.filter-foot button {
  font: inherit; font-weight: 600; font-size: 12.5px; white-space: nowrap;
  border: 0; border-radius: 4px; padding: 8px 12px; cursor: pointer;
}
.btn-clear { background: #eceaf6; color: #4b4880; }
.btn-clear:hover { background: #e2dff2; }
.btn-clear:disabled { background: #f6f5fb; color: #c5c4d6; cursor: default; }
.btn-see { background: #3b3486; color: #fff; }
.btn-see:hover { background: #2d2870; }
.btn-see.pending { box-shadow: 0 0 0 3px rgba(59, 52, 134, 0.22); }
.filter-foot button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-empty {
  position: sticky; left: 0;
  margin: 0; padding: 28px 16px;
  width: min(100%, 400px); box-sizing: border-box;
  color: #7c7a99; font-size: 12.5px;
}
.lib-table td:nth-child(n+2) { white-space: nowrap; }
@media (max-width: 760px) {
  .table-app, .table-app.collapsed { grid-template-columns: 1fr; height: auto; }
  .table-app .table-scroll { flex: none; max-height: 360px; }
  .filter-body { overflow: visible; grid-template-columns: 1fr 1fr; gap: 12px; }
  .filter-body > :not(.filter-field), .filter-body > [data-field="q"], .filter-body > [data-field="level"], .filter-body > [data-field="basis"] { grid-column: 1 / -1; }
  .collapsed .filter-head { justify-content: space-between; padding: 12px 12px 12px 16px; }
  .collapsed .filter-title { display: inline-flex; }
  .filter-toggle svg { transform: rotate(90deg); }
  .collapsed .filter-toggle svg { transform: rotate(-90deg); }
}

/* Little icons beside the contact links on the resume */
.resume-head .contact a { display: inline-flex; align-items: center; gap: 7px; }
.resume-head .ico { width: 16px; height: 16px; flex: none; color: var(--accent); }
@media print {
  .resume-head .contact a { gap: 4pt; vertical-align: middle; }
  .resume-head .ico { width: 10pt; height: 10pt; color: #111; }
  .resume-head p:nth-of-type(n+3)::before { content: "· "; white-space: pre; margin: 0 3pt 0 2pt; }
  .resume-download { display: none !important; }
}

/* ---------- Home: fits on one screen ---------- */
body.home-page main:not([hidden]) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-top: clamp(20px, 4vh, 56px); box-sizing: border-box; }
body.home-page .home { flex: 1; width: 100%; }
body.home-page .ticker { margin-top: clamp(20px, 3vh, 40px); padding: 18px 0 22px; }
.home .hello { font-size: clamp(48px, min(7vw, 9.5vh), 104px); margin: 0 0 clamp(14px, 2.6vh, 32px); }
.home .intro { max-width: 880px; margin-bottom: clamp(18px, 3vh, 36px); font-size: 15.5px; line-height: 1.6; }
.home .intro p { margin: 0 0 0.9em; }
.home .intro p:last-child { margin-bottom: 0; }

/* Underlined words that show a photo */
.peek {
  text-decoration: underline dotted;
  text-decoration-color: #e0789f;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: default;
  border-radius: 3px;
}
.peek:hover, .peek.on { color: #c2456f; text-decoration-style: solid; }
.peek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.peek-pop {
  position: fixed; left: 0; top: 0; z-index: 50;
  width: clamp(160px, 18vw, 230px); aspect-ratio: 1 / 1;
  margin: 0; padding: 6px; background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(30, 25, 60, 0.22);
  pointer-events: none;
  opacity: 0; transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(-3deg) scale(0.92);
  transition: opacity .15s ease, transform .15s ease;
  will-change: transform;
}
.peek-pop.show { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(-3deg) scale(1); }
.peek-pop img, .peek-pop video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: #eee; }
@media (prefers-reduced-motion: reduce) { .peek-pop { transition: opacity .1s; } }

/* Project cards */
.work-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 880px; }
.work-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: #fff; border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 2px 10px rgba(40, 36, 90, 0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.work-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(40, 36, 90, 0.14); }
.work-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wc-thumb { display: block; width: 100%; height: clamp(120px, 19vh, 210px); object-fit: cover; object-position: center 65%; }   /* grows with the screen height */
.wc-ph { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #ecebf3 0 10px, #f4f3f9 10px 20px); }
.wc-ph span { font-family: var(--font-mono); font-size: 12px; color: #8a89a3; }
.wc-tag {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: #fff; color: #1a1a1a; padding: 3px 8px; border-radius: 999px;
}
.wc-text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 11px 16px 12px; }
.wc-title { font-weight: 800; font-size: 15px; line-height: 1.3; }
.wc-meta { font-family: var(--font-mono); font-size: 11.5px; color: #6c6a85; }
@media (max-width: 1100px) { .work-cards { gap: 12px; } }
@media (max-width: 700px) {
  .work-cards { gap: 10px; }
  .wc-thumb { height: auto; aspect-ratio: 2 / 1; }
  .wc-text { flex-direction: column; padding: 10px 11px 11px; }
  .wc-title { font-size: 13.5px; }
  .wc-meta { font-size: 11px; }
  body.home-page main { min-height: 0; }
}
@media (max-width: 420px) { .work-cards { grid-template-columns: 1fr; } }
@media (min-width: 901px) { .home .work-cards { margin-left: 16px; } }
