/* ============================================================
   Jamie Denke — Portfolio
   Tokens from the Portfolio Design System skill. Do not invent values.
   ============================================================ */

:root {
  /* Typography */
  --sds-typography-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sds-typography-family-serif: 'Noto Serif', Georgia, serif;
  --sds-typography-family-mono: 'Roboto Mono', monospace;
  --sds-typography-scale-01: 12px;
  --sds-typography-scale-02: 14px;
  --sds-typography-scale-03: 16px;
  --sds-typography-scale-04: 20px;
  --sds-typography-scale-05: 24px;
  --sds-typography-scale-06: 32px;
  --sds-typography-scale-07: 40px;
  --sds-typography-scale-08: 48px;
  --sds-typography-scale-09: 64px;
  --sds-typography-scale-10: 72px;
  --sds-typography-weight-regular: 400;
  --sds-typography-weight-medium: 500;
  --sds-typography-weight-semibold: 600;
  --sds-typography-weight-bold: 700;

  /* Spacing */
  --sds-size-space-0: 0;
  --sds-size-space-050: 2px;
  --sds-size-space-100: 4px;
  --sds-size-space-150: 6px;
  --sds-size-space-200: 8px;
  --sds-size-space-300: 12px;
  --sds-size-space-400: 16px;
  --sds-size-space-600: 24px;
  --sds-size-space-800: 32px;
  --sds-size-space-1200: 48px;
  --sds-size-space-1600: 64px;
  --sds-size-space-2400: 96px;
  --sds-size-space-4000: 160px;

  /* Radius */
  --sds-size-radius-100: 4px;
  --sds-size-radius-200: 8px;
  --sds-size-radius-400: 16px;
  --sds-size-radius-full: 9999px;

  /* Stroke */
  --sds-size-stroke-border: 1px;
  --sds-size-stroke-focus-ring: 2px;

  /* Icon */
  --sds-size-icon-small: 16px;
  --sds-size-icon-medium: 24px;
  --sds-size-icon-large: 32px;
}

/* ---------- Dark mode (default) ---------- */
:root,
[data-theme="dark"] {
  --bg-page: #1C1C1C;
  --bg-100: #252526;
  --bg-200: #2D2E2E;
  --bg-300: #3E3E3E;
  --text-default: #E4E5E5;
  --text-secondary: #B2B2B2;
  --text-hero: #F7F7F7;
  --text-link: #6FDCFC;         /* ocean blue 200, dark */
  --text-link-hover: #97E5FC;   /* ocean blue 100, dark */
  --icon-default: #E4E5E5;
  --icon-bubble: #97E5FC;
  --accent: #6FDCFC;            /* ocean blue 200, dark */
  --accent-hover: #97E5FC;
  --accent-strong: #039FCD;     /* ocean blue 400, for large shapes only */
  --accent-on: #1C1C1C;         /* text on accent */
  --btn-text: #FFFFFF;          /* primary button text, dark mode */
  --btn-stroke: #1C1C1C;        /* primary button dark stroke */
  --text-success: #1CBA66;      /* success secondary, dark */
  --accent-ocean: #6FDCFC;
  --accent-gold: #FDDC85;
  --accent-emerald: #3BF4C1;
  --border-color: #3E3E3E;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --ph-a: #2D2E2E;              /* placeholder gradient stops */
  --ph-b: #3E3E3E;
}

/* ---------- Light mode ---------- */
[data-theme="light"] {
  --bg-page: #FFFFFF;
  --bg-100: #F7F7F7;
  --bg-200: #E4E5E5;
  --bg-300: #C6C9CA;
  --text-default: #2D2E2E;
  --text-secondary: #5A5A5A;    /* darkened from #676666 so chips pass AA on #E4E5E5 */
  --text-hero: #252526;
  --text-link: #CA3055;         /* passes AA on white; brand is for shapes */
  --text-link-hover: #A72040;
  --icon-default: #2D2E2E;
  --icon-bubble: #EF476F;
  --accent: #CA3055;            /* passes AA with white text and as text on white */
  --accent-hover: #A72040;
  --accent-strong: #EF476F;     /* brand pink, for large decorative shapes only */
  --accent-on: #FFFFFF;
  --btn-text: #252526;          /* primary button text, light mode */
  --btn-stroke: #2D2E2E;        /* primary button dark stroke */
  --text-success: #0B8F49;      /* success secondary, light */
  --accent-ocean: #008DB6;
  --accent-gold: #D6A625;
  --accent-emerald: #03A477;
  --border-color: #E4E5E5;
  --shadow-card: 0 8px 32px rgba(45, 46, 46, 0.12);
  --ph-a: #F7F7F7;
  --ph-b: #E4E5E5;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sds-typography-family-sans);
  font-size: var(--sds-typography-scale-03);
  font-weight: var(--sds-typography-weight-regular);
  line-height: 1.6;
  color: var(--text-default);
  background: var(--bg-page);
  transition: background-color .35s ease, color .35s ease;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--text-link); }
a:hover { color: var(--text-link-hover); }

:focus-visible {
  outline: var(--sds-size-stroke-focus-ring) solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--sds-size-radius-100);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sds-size-space-600);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-on);
  padding: var(--sds-size-space-200) var(--sds-size-space-400);
  border-radius: var(--sds-size-radius-200); z-index: 200;
}
.skip-link:focus { left: var(--sds-size-space-400); top: var(--sds-size-space-400); }

/* ============ Typography helpers ============ */
.title-hero {
  font-size: var(--sds-typography-scale-10);
  font-weight: var(--sds-typography-weight-bold);
  line-height: 1.05;
  color: var(--text-hero);
  letter-spacing: -0.02em;
}
.title-page {
  font-size: var(--sds-typography-scale-08);
  font-weight: var(--sds-typography-weight-bold);
  line-height: 1.1;
  color: var(--text-hero);
  letter-spacing: -0.01em;
}
.title-page--sm { font-size: var(--sds-typography-scale-07); }
.subtitle {
  font-size: var(--sds-typography-scale-05);
  font-weight: var(--sds-typography-weight-regular);
  color: var(--text-secondary);
  line-height: 1.45;
}
.heading {
  font-size: var(--sds-typography-scale-05);
  font-weight: var(--sds-typography-weight-semibold);
  color: var(--text-hero);
}
.heading--lg { font-size: var(--sds-typography-scale-06); }
.subheading {
  font-size: var(--sds-typography-scale-04);
  color: var(--text-secondary);
}
.body-sm { font-size: var(--sds-typography-scale-02); }
.eyebrow {
  font-size: var(--sds-typography-scale-02);
  font-weight: var(--sds-typography-weight-semibold);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: var(--sds-size-space-200);
  font-family: inherit;
  font-size: var(--sds-typography-scale-03);
  font-weight: var(--sds-typography-weight-semibold);
  padding: var(--sds-size-space-300) var(--sds-size-space-600);
  border-radius: var(--sds-size-radius-full);
  border: var(--sds-size-stroke-border) solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--btn-text);
  border-color: var(--btn-stroke);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  color: var(--btn-text);
}
.btn--ghost {
  background: transparent; color: var(--text-default);
  border-color: var(--border-color);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--text-default); }
.btn .btn-arrow { transition: transform .25s ease; }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ============ Navigation ============ */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-page) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--sds-size-stroke-border) solid var(--border-color);
  transition: background-color .35s ease, border-color .35s ease;
}
.site-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  font-weight: var(--sds-typography-weight-bold);
  font-size: var(--sds-typography-scale-04);
  letter-spacing: .28em;
  text-decoration: none;
  color: var(--text-hero);
  text-transform: uppercase;
  transition: letter-spacing .35s ease, color .2s ease;
}
.brand:hover { letter-spacing: .36em; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: var(--sds-size-space-600); list-style: none; }
.nav-links a:not(.btn) {
  position: relative;
  text-decoration: none;
  color: var(--text-default);
  font-weight: var(--sds-typography-weight-medium);
  font-size: var(--sds-typography-scale-02);
  padding: var(--sds-size-space-100) 0;
}
.nav-links a:not(.btn)::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .3s ease;
}
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn)[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-links a:not(.btn):hover { color: var(--text-hero); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--sds-size-radius-full);
  border: 0;
  background: transparent; color: var(--icon-default);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(18deg) scale(1.06); }
.theme-toggle img { width: 32px; height: 32px; transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .3s ease; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav */
.nav-burger { display: none; }

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--sds-size-space-2400) 0;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .32;
  will-change: transform;
}
.hero-blob--1 { width: 480px; height: 480px; background: var(--accent-strong); top: -140px; right: -80px; animation: drift1 18s ease-in-out infinite alternate; }
.hero-blob--2 { width: 400px; height: 400px; background: var(--accent-ocean); bottom: -160px; left: -100px; animation: drift2 22s ease-in-out infinite alternate; }
.hero-blob--3 { width: 280px; height: 280px; background: var(--accent-gold); top: 30%; left: 42%; animation: drift3 26s ease-in-out infinite alternate; opacity: .18; }
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(-90px, 70px) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(110px, -60px) scale(1.1); } }
@keyframes drift3 { from { transform: translate(0,0) rotate(0deg); } to { transform: translate(60px, 50px) rotate(40deg); } }

.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 5fr 6fr;
  gap: var(--sds-size-space-1600);
  align-items: center;
}
.hero-copy .subtitle { margin-top: var(--sds-size-space-600); max-width: 34ch; color: var(--text-hero); }
.hero-copy .btn { margin-top: var(--sds-size-space-800); }
.hero-kicker { margin-top: var(--sds-size-space-300); font-size: var(--sds-typography-scale-06); font-weight: var(--sds-typography-weight-semibold); color: var(--text-hero); }

.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease .6s 2; }
.title-hero:hover .wave { animation: wave 1.6s ease infinite; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

/* ============ Placeholders ============ */
.ph {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ph-a), var(--ph-b));
  border: var(--sds-size-stroke-border) dashed var(--border-color);
  border-radius: var(--sds-size-radius-400);
  color: var(--text-secondary);
  font-size: var(--sds-typography-scale-02);
  text-align: center;
  overflow: hidden;
  min-height: 120px;
}
.ph::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, color-mix(in srgb, var(--text-hero) 5%, transparent) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 3.2s linear infinite;
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
.ph span { position: relative; padding: var(--sds-size-space-400); }
.ph--hero { aspect-ratio: 5 / 4; }
.ph--wide { aspect-ratio: 16 / 9; }
.ph--square { aspect-ratio: 1; }

/* ============ Sections ============ */
.section { padding: var(--sds-size-space-2400) 0; }
.section--tint { background: var(--bg-100); transition: background-color .35s ease; }
.section-head { max-width: 640px; margin-bottom: var(--sds-size-space-1200); }
.section-head .subheading { margin-top: var(--sds-size-space-300); }

/* ============ Case study cards (home) ============ */
.work-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sds-size-space-800);
}
.work-card {
  position: relative;
  display: block;
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-radius: var(--sds-size-radius-400);
  padding: var(--sds-size-space-600);
  text-decoration: none;
  color: var(--text-default);
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, border-color .35s ease, background-color .35s ease;
}
.work-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
}
.work-card-media {
  border-radius: var(--sds-size-radius-200);
  overflow: hidden;
  margin-bottom: var(--sds-size-space-600);
}
.work-card-media .ph { border-radius: var(--sds-size-radius-200); transition: transform .5s cubic-bezier(.22,1,.36,1); aspect-ratio: 16/10; border-style: solid; }
.work-card:hover .work-card-media .ph { transform: scale(1.04); }
.work-card-tags { display: flex; gap: var(--sds-size-space-200); flex-wrap: wrap; margin-bottom: var(--sds-size-space-300); }
.chip {
  display: inline-block;
  font-size: var(--sds-typography-scale-01);
  font-weight: var(--sds-typography-weight-semibold);
  padding: var(--sds-size-space-100) var(--sds-size-space-300);
  border-radius: var(--sds-size-radius-full);
  background: var(--bg-200);
  color: var(--text-secondary);
  transition: background-color .35s ease;
}
/* Text stops 16px short of the arrow button (button is 40px wide, 24px from the card edge) */
.work-card .heading { margin-bottom: var(--sds-size-space-200); padding-right: calc(40px + var(--sds-size-space-400)); }
.work-card p { color: var(--text-secondary); font-size: var(--sds-typography-scale-02); max-width: 46ch; padding-right: calc(40px + var(--sds-size-space-400)); }
.work-card-arrow {
  position: absolute; right: var(--sds-size-space-600); bottom: var(--sds-size-space-600);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--sds-size-radius-full);
  background: var(--accent); color: var(--accent-on);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.work-card:hover .work-card-arrow { transform: translate(4px, -4px) rotate(-8deg); }

/* ============ Kudos (Slack-style) ============ */
.kudos-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--sds-size-space-600);
  align-items: start;
}
.kudos-card {
  background: var(--bg-page);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-radius: var(--sds-size-radius-200);
  padding: var(--sds-size-space-600);
  transition: transform .3s ease, box-shadow .3s ease, background-color .35s ease;
}
[data-theme="dark"] .kudos-card { background: var(--bg-200); }
.kudos-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.kudos-head { display: flex; gap: var(--sds-size-space-300); align-items: center; margin-bottom: var(--sds-size-space-300); }
.kudos-avatar {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--sds-size-radius-200);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--sds-typography-weight-bold);
  font-size: var(--sds-typography-scale-02);
  color: #FFFFFF;
}
.kudos-name { font-weight: var(--sds-typography-weight-bold); font-size: var(--sds-typography-scale-02); color: var(--text-hero); line-height: 1.3; }
.kudos-name .kudos-time { font-weight: var(--sds-typography-weight-regular); color: var(--text-secondary); font-size: var(--sds-typography-scale-01); margin-left: var(--sds-size-space-200); }
.kudos-role { font-size: var(--sds-typography-scale-01); color: var(--text-secondary); }
.kudos-body { font-size: var(--sds-typography-scale-02); color: var(--text-default); }
.kudos-reactions { display: flex; gap: var(--sds-size-space-200); margin-top: var(--sds-size-space-400); flex-wrap: wrap; }
.reaction {
  display: inline-flex; align-items: center; gap: var(--sds-size-space-100);
  font-size: var(--sds-typography-scale-01);
  padding: var(--sds-size-space-050) var(--sds-size-space-200);
  border-radius: var(--sds-size-radius-full);
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  color: var(--text-secondary);
  cursor: default;
  transition: transform .2s ease, border-color .2s ease;
}
[data-theme="dark"] .reaction { background: var(--bg-300); }
.reaction:hover { transform: scale(1.12); border-color: var(--accent); }

/* ============ Footer ============ */
.site-footer {
  border-top: var(--sds-size-stroke-border) solid var(--border-color);
  padding: var(--sds-size-space-1200) 0;
  background: var(--bg-100);
  transition: background-color .35s ease;
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: var(--sds-size-space-600); flex-wrap: wrap; }
.footer-social { display: flex; gap: var(--sds-size-space-300); margin-top: var(--sds-size-space-300); }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--sds-size-radius-full);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  color: var(--icon-default);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.footer-social a:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }
.footer-contact { text-align: right; }
.footer-contact .body-sm { color: var(--text-secondary); }

/* ============ Case study pages ============ */
.cs-hero { padding: var(--sds-size-space-2400) 0 var(--sds-size-space-1200); position: relative; overflow: hidden; }
.cs-hero .eyebrow { margin-bottom: var(--sds-size-space-400); display: block; }
.cs-hero .subtitle { margin-top: var(--sds-size-space-600); max-width: 56ch; }
.cs-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sds-size-space-600);
  margin: var(--sds-size-space-1200) 0 0;
  padding: var(--sds-size-space-600);
  background: var(--bg-100);
  border-radius: var(--sds-size-radius-400);
  border: var(--sds-size-stroke-border) solid var(--border-color);
}
.cs-meta dt {
  font-size: var(--sds-typography-scale-01);
  font-weight: var(--sds-typography-weight-semibold);
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: var(--sds-size-space-100);
}
.cs-meta dd { font-size: var(--sds-typography-scale-02); color: var(--text-default); }

/* Gap from the hero to the main image: 40px added below the hero */
.cs-hero + .container { padding-top: 40px; }
/* Gap between sections: 40px top and bottom, so 80px between each section */
.cs-section { padding: 40px 0; }
.cs-section .container { max-width: 880px; }
.cs-section--wide .container { max-width: 1200px; }
.cs-section h2 {
  font-size: var(--sds-typography-scale-06);
  font-weight: var(--sds-typography-weight-semibold);
  color: var(--text-hero);
  margin-bottom: var(--sds-size-space-600);
}
.cs-section h3 {
  font-size: var(--sds-typography-scale-04);
  font-weight: var(--sds-typography-weight-semibold);
  color: var(--text-hero);
  margin: var(--sds-size-space-800) 0 var(--sds-size-space-300);
}
.cs-section p { margin-bottom: var(--sds-size-space-400); max-width: 68ch; }
.cs-section ul { margin: 0 0 var(--sds-size-space-400) var(--sds-size-space-600); }
.cs-section li { margin-bottom: var(--sds-size-space-200); }
.cs-section .ph { margin: var(--sds-size-space-600) 0; }
.cs-lede { font-size: var(--sds-typography-scale-04); color: var(--text-default); }

/* Bar charts (case studies) */
.cs-chart { margin: var(--sds-size-space-600) 0; max-width: 68ch; }
.cs-chart .chart-title {
  font-size: var(--sds-typography-scale-02);
  font-weight: var(--sds-typography-weight-semibold);
  color: var(--text-hero);
  margin-bottom: var(--sds-size-space-300);
}
.cs-chart .bar-row {
  display: grid; grid-template-columns: minmax(160px, 240px) 1fr 56px;
  gap: var(--sds-size-space-400); align-items: center;
  margin-bottom: var(--sds-size-space-300);
  font-size: var(--sds-typography-scale-02);
  color: var(--text-default);
}
.cs-chart .bar-track {
  display: block; height: 12px; overflow: hidden;
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-radius: var(--sds-size-radius-full);
}
.cs-chart .bar-fill {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: var(--sds-size-radius-full);
}
.cs-chart .bar-value {
  font-weight: var(--sds-typography-weight-semibold);
  color: var(--text-hero);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cs-chart figcaption { font-size: var(--sds-typography-scale-01); color: var(--text-secondary); margin-top: var(--sds-size-space-300); }
@media (max-width: 767px) {
  .cs-chart .bar-row { grid-template-columns: 1fr auto; }
  .cs-chart .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* Images in case studies */
.cs-figure { margin: var(--sds-size-space-600) 0; }
.cs-figure img {
  display: block; width: 100%; height: auto;
  border-radius: var(--sds-size-radius-400);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  background: var(--bg-100);
}
.cs-figure--narrow img { max-width: 320px; margin: 0 auto; }
.cs-figure figcaption { font-size: var(--sds-typography-scale-01); color: var(--text-secondary); margin-top: var(--sds-size-space-300); }
.cs-figure--narrow figcaption { text-align: center; }
.cs-figure video { display: block; width: 100%; border-radius: var(--sds-size-radius-400); border: 1px solid var(--border-color); }
.cs-figure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sds-size-space-600); align-items: start; }
@media (max-width: 767px) { .cs-figure-grid { grid-template-columns: 1fr; } }
/* Screen pairs: desktop and mobile side by side, same height on desktop */
.screen-pair { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: var(--sds-size-space-600); margin: var(--sds-size-space-600) 0; }
.screen-pair .cs-figure { margin: 0; }
.screen-pair img { height: 560px; width: auto; max-width: 100%; }
@media (max-width: 767px) {
  .screen-pair .cs-figure { flex: 1 1 100%; }
  .screen-pair img { height: auto; width: 100%; }
}

/* Decision cards */
.decision-card {
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--sds-size-radius-200);
  padding: var(--sds-size-space-600);
  margin-bottom: var(--sds-size-space-600);
  transition: transform .3s ease, box-shadow .3s ease, background-color .35s ease;
}
.decision-card:hover { transform: translateX(4px); box-shadow: var(--shadow-card); }
.decision-card h3 { margin: 0 0 var(--sds-size-space-300); font-size: var(--sds-typography-scale-04); }
.decision-card .d-row { margin-bottom: var(--sds-size-space-300); font-size: var(--sds-typography-scale-02); }
.decision-card .d-label {
  display: inline-block;
  font-size: var(--sds-typography-scale-01);
  font-weight: var(--sds-typography-weight-semibold);
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent);
  margin-right: var(--sds-size-space-200);
  min-width: 72px;
}

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sds-size-space-600); margin: var(--sds-size-space-800) 0; }
.stat-tile {
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-radius: var(--sds-size-radius-400);
  padding: var(--sds-size-space-600);
  text-align: left;
  transition: transform .3s ease, background-color .35s ease;
}
.stat-tile:hover { transform: translateY(-4px); }
.stat-number {
  font-size: var(--sds-typography-scale-07);
  font-weight: var(--sds-typography-weight-bold);
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.stat-label { font-size: var(--sds-typography-scale-02); color: var(--text-secondary); margin-top: var(--sds-size-space-200); }

/* Quote */
.cs-quote {
  border-left: 4px solid var(--accent);
  padding: var(--sds-size-space-400) var(--sds-size-space-600);
  margin: var(--sds-size-space-800) 0;
  background: var(--bg-100);
  border-radius: 0 var(--sds-size-radius-200) var(--sds-size-radius-200) 0;
  font-size: var(--sds-typography-scale-04);
  color: var(--text-hero);
  font-style: italic;
}
.cs-quote footer { font-size: var(--sds-typography-scale-02); color: var(--text-secondary); font-style: normal; margin-top: var(--sds-size-space-300); }

/* Next / prev */
.cs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sds-size-space-600); }
.cs-pager a {
  display: block; text-decoration: none;
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-radius: var(--sds-size-radius-400);
  padding: var(--sds-size-space-600);
  color: var(--text-default);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.cs-pager a:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-card); }
.cs-pager .pager-dir { font-size: var(--sds-typography-scale-01); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: var(--sds-typography-weight-semibold); }
.cs-pager .pager-title { font-weight: var(--sds-typography-weight-semibold); color: var(--text-hero); margin-top: var(--sds-size-space-200); }
.cs-pager .pager-next { text-align: right; }

/* ============ About page ============ */
.carousel { position: relative; margin-top: var(--sds-size-space-1200); overflow: hidden; }
.carousel-track {
  display: flex; gap: var(--sds-size-space-600);
  width: max-content;
  animation: marquee 36s linear infinite;
}
.carousel:hover .carousel-track { animation-play-state: paused; }
.carousel .ph { width: 240px; height: 180px; flex: none; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.process-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sds-size-space-600); }
/* Process cards: horizontal row, image on top, no card chrome (matches Figma node 25:3665) */
.process-card {
  background: transparent;
  border: 0;
  padding: 0;
  transition: transform .3s ease;
}
.process-card:hover { transform: translateY(-4px); }
.process-ph {
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 0;
  margin-bottom: var(--sds-size-space-400);
  background: var(--ph-b);
  border: 0;
}
.process-ph::before { display: none; }
.process-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: var(--sds-size-space-400);
  border-radius: var(--sds-size-radius-200);
  background: var(--ph-b);
}
.process-step {
  font-size: var(--sds-typography-scale-03);
  font-weight: var(--sds-typography-weight-regular);
  color: var(--accent);
  margin-bottom: var(--sds-size-space-100);
}
.process-card h3 { font-size: var(--sds-typography-scale-03); font-weight: var(--sds-typography-weight-semibold); color: var(--text-hero); margin-bottom: var(--sds-size-space-200); }
.process-card p { font-size: var(--sds-typography-scale-03); color: var(--text-default); }
.process-card .ai-note {
  margin-top: var(--sds-size-space-300);
  font-size: var(--sds-typography-scale-03);
  color: var(--text-success);
  font-family: var(--sds-typography-family-sans);
}

/* Work experience */
.xp-layout { display: grid; grid-template-columns: 7fr 4fr; gap: var(--sds-size-space-1600); align-items: start; }
.xp-entry {
  position: relative;
  padding: 0 0 var(--sds-size-space-1200) var(--sds-size-space-800);
  border-left: 2px solid var(--border-color);
}
.xp-entry:last-child { padding-bottom: 0; }
.xp-entry::before {
  content: '';
  position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.xp-dates {
  display: inline-block;
  font-size: var(--sds-typography-scale-01);
  font-weight: var(--sds-typography-weight-semibold);
  background: var(--accent); color: var(--accent-on);
  padding: var(--sds-size-space-050) var(--sds-size-space-300);
  border-radius: var(--sds-size-radius-full);
  margin-bottom: var(--sds-size-space-300);
}
.xp-entry h3 { font-size: var(--sds-typography-scale-04); font-weight: var(--sds-typography-weight-semibold); color: var(--text-hero); }
.xp-entry .xp-role { color: var(--text-secondary); font-size: var(--sds-typography-scale-02); margin-bottom: var(--sds-size-space-300); }
.xp-entry ul { margin: var(--sds-size-space-300) 0 0 var(--sds-size-space-600); }
.xp-entry li { font-size: var(--sds-typography-scale-02); color: var(--text-default); margin-bottom: var(--sds-size-space-200); }
.xp-side {
  position: sticky; top: 96px;
  background: var(--bg-100);
  border: var(--sds-size-stroke-border) solid var(--border-color);
  border-radius: var(--sds-size-radius-400);
  padding: var(--sds-size-space-800);
  transition: background-color .35s ease;
}
.xp-side h3 { font-size: var(--sds-typography-scale-04); font-weight: var(--sds-typography-weight-semibold); color: var(--text-hero); margin-bottom: var(--sds-size-space-400); }
.xp-side ul { list-style: none; margin: 0 0 var(--sds-size-space-600); }
.xp-side li { font-size: var(--sds-typography-scale-02); color: var(--text-default); padding: var(--sds-size-space-150) 0; border-bottom: var(--sds-size-stroke-border) solid var(--border-color); }
.xp-side li:last-child { border-bottom: 0; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 1199px) {
  .work-grid { gap: var(--sds-size-space-600); }
  .kudos-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(3, 1fr); }
  .cs-meta { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .title-hero { font-size: var(--sds-typography-scale-08); }
  .title-page { font-size: var(--sds-typography-scale-07); }
  .subtitle { font-size: var(--sds-typography-scale-04); }
  .hero { padding: var(--sds-size-space-1600) 0; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sds-size-space-800); }
  .work-grid { grid-template-columns: 1fr; }
  .kudos-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .xp-layout { grid-template-columns: 1fr; }
  .xp-side { position: static; }
  .cs-meta { grid-template-columns: 1fr; }
  .cs-pager { grid-template-columns: 1fr; }
  .section { padding: var(--sds-size-space-1600) 0; }
  .nav-links { gap: var(--sds-size-space-400); }
  .nav-links .nav-hide-mobile { display: none; }
  .nav-links a:not(.btn) { white-space: nowrap; }
  .brand { font-size: var(--sds-typography-scale-03); letter-spacing: .18em; white-space: nowrap; }
  .brand:hover { letter-spacing: .22em; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
  .footer-contact { text-align: left; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .carousel-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
}


/* ============ Hero photo (home) ============
   Two photos stacked. Dark mode shows the night sky,
   light mode shows the sunset. They crossfade on theme switch. */
.hero--photo { overflow: hidden; isolation: isolate; }
.hero-photo {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(.45,0,.2,1);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  transform: scale(1.06);
  animation: photo-drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
.hero-photo::after { content: ''; position: absolute; inset: 0; }
/* Scrims keep the title readable where the copy sits (right side) */
.hero-photo--dark::after {
  background: linear-gradient(90deg,
    color-mix(in srgb, #1A1613 30%, transparent) 0%,
    color-mix(in srgb, #1A1613 60%, transparent) 55%,
    color-mix(in srgb, #1A1613 78%, transparent) 100%);
}
.hero-photo--light::after {
  background: linear-gradient(90deg,
    color-mix(in srgb, #FCF9F8 8%, transparent) 0%,
    color-mix(in srgb, #FCF9F8 46%, transparent) 55%,
    color-mix(in srgb, #FCF9F8 68%, transparent) 100%);
}
:root:not([data-theme="light"]) .hero-photo--dark,
[data-theme="light"] .hero-photo--light { opacity: 1; }

@keyframes photo-drift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-1.2%, -0.8%, 0); }
}

/* Placeholder for Jamie's gif sits as frosted glass over the photo */
/* Caricature hero: keep the placeholder box and its blurred frosted background, drop the dashed frame */
.hero-caricature { border: 0; }
.hero-caricature::before { display: none; }
.hero-caricature img {
  position: relative;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}
/* Caricature micro-interactions: slow float at rest, small lift on hover */
.hero-caricature img {
  animation: caricature-float 6s ease-in-out infinite;
  transition: scale .5s cubic-bezier(.22,1,.36,1), rotate .5s cubic-bezier(.22,1,.36,1);
  transform-origin: 50% 100%;
}
.hero-caricature:hover img { scale: 1.03; rotate: -1.5deg; }
@keyframes caricature-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-caricature img { animation: none; transition: none; }
  .hero-caricature:hover img { scale: 1; rotate: 0deg; }
}
.hero--photo .ph--hero {
  background: color-mix(in srgb, var(--bg-100) 55%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 767px) {
  .hero-photo--dark::after { background: color-mix(in srgb, #1A1613 62%, transparent); }
  .hero-photo--light::after { background: color-mix(in srgb, #FCF9F8 58%, transparent); }
}

/* Phone nav: keep logo and links from colliding */
@media (max-width: 767px) {
  .brand { letter-spacing: .06em; font-size: var(--sds-typography-scale-03); }
  .nav-links { gap: var(--sds-size-space-300); }
  .nav-links a:not(.btn) { font-size: var(--sds-typography-scale-01); }
}

/* ============ About page: one-column text, 16px ============ */
/* Bio: photo left, all text right (matches Figma node 25:3640) */
.page-about .about-hero { padding: var(--sds-size-space-1600) 0; }
/* Let the About header use the full browser width, not the 1200px column */
.page-about .about-hero .container { max-width: none; }
.page-about .about-hero .about-photo {
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  transform-origin: 50% 100%;
  animation: about-sway 6s ease-in-out infinite;
}
@keyframes about-sway {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .page-about .about-hero .about-photo { animation: none; }
}
/* Home hero portrait: keep the column width, let the height follow the photo */
.hero-caricature.hero-portrait { aspect-ratio: auto; }
.hero-caricature.hero-portrait img { width: 100%; max-width: 100%; max-height: none; height: auto; }
.about-body {
  font-size: var(--sds-typography-scale-03);
  color: var(--text-default);
  margin-top: var(--sds-size-space-600);
}
.about-photos .carousel { margin-top: 0; }
.about-photos .carousel .ph { width: 250px; height: 225px; }
.about-photos .carousel img {
  width: 250px; height: 225px; flex: none;
  object-fit: cover; object-position: center;
  border-radius: var(--sds-size-radius-400);
}
/* 20 photos instead of 8 tiles: slow the loop so it moves at the same pace */
.page-about .carousel-track { animation-duration: 90s; }

/* Process and experience text at 16px, process stacked in one column */
.page-about .process-card p,
.page-about .process-card .ai-note,
.page-about .xp-entry li,
.page-about .xp-entry .xp-role,
.page-about .xp-side li { font-size: var(--sds-typography-scale-03); }

/* ============ Tool logos in the work experience right rail ============ */
.xp-side .logo-grid {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sds-size-space-300);
  margin: 0 0 var(--sds-size-space-600);
}
.xp-side .logo-grid li { padding: 0; border-bottom: 0; }
.xp-side .logo-grid img { width: 100%; height: auto; aspect-ratio: 1 / 1; }
/* Dark mode is the default. Show the dark tile set there and the light set in light mode. */
:root:not([data-theme="light"]) .logo-grid .logo-light { display: none; }
[data-theme="light"] .logo-grid .logo-dark { display: none; }

@media (max-width: 767px) {
  .page-about .hero-grid > * { max-width: none; }
}

/* Video demos */
.cs-video { margin: var(--sds-size-space-600) 0; }
.cs-video video { display: block; width: 100%; max-height: 80vh; margin: 0 auto; object-fit: contain; border-radius: var(--sds-size-radius-400); border: 1px solid var(--border-color); }
.work-card-media video { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: 50% 35%; border-radius: var(--sds-size-radius-200); transition: transform .5s cubic-bezier(.22,1,.36,1); }
.work-card:hover .work-card-media video { transform: scale(1.04); }
.work-card-media img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--sds-size-radius-200); transition: transform .5s cubic-bezier(.22,1,.36,1); }
.work-card:hover .work-card-media img { transform: scale(1.04); }
#work { scroll-margin-top: 96px; }
.work-card-media .ph-logo { display: flex; align-items: center; justify-content: center; }
.work-card-media .ph-logo img { display: block; width: 70%; height: auto; max-height: 70%; object-fit: contain; }

/* Phone animation embeds */
.phone-embed { display: block; width: 100%; height: min(640px, 80vh); border: 0; background: transparent; }
.work-card-media .phone-embed { height: 100%; aspect-ratio: 16/10; border-radius: var(--sds-size-radius-200); }
.work-card:hover .work-card-media .phone-embed { transform: scale(1.02); transition: transform .5s cubic-bezier(.22,1,.36,1); }
@media (max-width: 767px) { .phone-embed { height: 520px; } }
