/* ==========================================================================
   Portfolio template — styling inspired by diabrowser.com
   1rem = 10px (html font-size 62.5%), same as the reference site.
   ========================================================================== */

:root {
  /* Surfaces & text */
  --background: #fbfaf6;
  --true-white: #ffffff;
  --black: #000000;
  --primary: rgba(0, 0, 0, 0.85);
  --secondary: rgba(0, 0, 0, 0.6);
  --tertiary: rgba(0, 0, 0, 0.45);
  --quaternary: rgba(0, 0, 0, 0.2);
  --soft: rgba(60, 60, 67, 0.78);
  --fill-secondary: rgba(0, 0, 0, 0.08);
  --fill-secondary-hover: rgba(0, 0, 0, 0.12);
  --fill-tertiary: rgba(0, 0, 0, 0.04);
  --stroke-light: rgba(0, 0, 0, 0.06);
  --stroke-medium: rgba(0, 0, 0, 0.12);
  --stroke-card: rgba(0, 0, 0, 0.3);

  /* Type — swap these for licensed faces (e.g. Exposure / ABC Oracle / ABC Favorit Mono) */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Hanken Grotesk", Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Motion */
  --ease-site: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Elevation */
  --shadow-pill: 0 2px 8px 0 rgba(0, 0, 0, 0.06), 0 0 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-asset: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -12px rgba(0, 0, 0, 0.18);
  --filter-shadow: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05)) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.08));
  --filter-shadow-lift: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06)) drop-shadow(0 20px 44px rgba(0, 0, 0, 0.13));

  /* Placeholder gradients — replace .ph elements with real images later */
  /* Soft palette: butter, sage, sky, apricot (keep pink/purple out) */
  --c-butter: #f6e3a1;
  --c-sage: #c5dfc0;
  --c-sky: #bcd6ee;
  --c-apricot: #f4cdb1;
  --ph-1: linear-gradient(180deg, var(--c-butter) 40%, var(--c-apricot));
  --ph-2: linear-gradient(180deg, var(--c-sky) 40%, var(--c-sage));
  --ph-3: linear-gradient(180deg, var(--c-apricot) 40%, var(--c-sky));
  --ph-4: linear-gradient(180deg, var(--c-sage) 30%, var(--c-butter));
  --ph-5: linear-gradient(180deg, var(--c-sky) 30%, var(--c-butter));
  /* One gradient per case study. Each ends on the colour the next one starts with,
     and the home page cards use the same tokens, so the two always match. */
  --study-1: linear-gradient(180deg, var(--c-butter) 40%, var(--c-sage));
  --study-2: linear-gradient(180deg, var(--c-sage) 40%, var(--c-sky));
  --study-3: linear-gradient(180deg, var(--c-sky) 30%, var(--c-apricot));
  /* Other case studies (Propeller Aero) */
  --study-4: linear-gradient(180deg, var(--c-apricot) 30%, var(--c-butter));
  --study-5: linear-gradient(180deg, var(--c-butter) 30%, var(--c-sky));
  /* Subtle grain laid over every gradient container */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 62.5%;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.5;
  background: var(--background);
  overflow-x: clip;
}

h1, h2, h3, h4, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
/* width/height attributes on images and videos are only there for the shape (so the page
   doesn't jump while they load); the CSS decides the size. :where() keeps this weaker than any rule. */
:where(img, video) { width: auto; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.page-enter { animation: page-enter 0.4s var(--ease-site) both; }
@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
   Type scale
   -------------------------------------------------------------------------- */
.h1 {
  font-size: 4.8rem; font-weight: 300; line-height: 5.2rem; letter-spacing: -0.04em;
}
.h2-serif {
  font-family: var(--font-serif);
  font-size: 3.2rem; font-weight: 500; line-height: 3.8rem; letter-spacing: -0.03em;
  text-wrap: balance;
}
.p1 { font-size: 1.8rem; line-height: 1.5; }
.p2 { font-size: 1.6rem; line-height: 1.5; }
.caption {
  font-family: var(--font-mono);
  font-size: 1.3rem; line-height: 1.7rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.mono-index { font-family: var(--font-mono); font-size: 1.2rem; line-height: 1.6rem; color: var(--tertiary); }

@media (min-width: 800px) {
  .h1 { font-size: 7.2rem; line-height: 8.4rem; }
  .h2-serif { font-size: 4rem; line-height: 4.8rem; }
}
@media (min-width: 1000px) {
  .h2-serif { font-size: 4.8rem; line-height: 5.6rem; }
  .p1 { font-size: 2.2rem; }
}

/* --------------------------------------------------------------------------
   Placeholder images
   -------------------------------------------------------------------------- */
.ph { background: var(--noise) 0 0 / 160px 160px, var(--ph, var(--ph-1)); }
.ph-1 { --ph: var(--ph-1); }
.ph-2 { --ph: var(--ph-2); }
.ph-3 { --ph: var(--ph-3); }
.ph-4 { --ph: var(--ph-4); }
.ph-5 { --ph: var(--ph-5); }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.site-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 2rem;
  padding-inline: 1rem;
  max-width: 1440px;
  margin-inline: auto;
}
.col-main { grid-column: 1 / -1; }
@media (min-width: 800px) {
  .col-main { grid-column: 2 / span 10; }
}

/* Small screens: a little more breathing room at the sides */
@media (max-width: 799px) {
  .site-grid, main .work { padding-inline: 2rem; }
}

/* One-page menu targets: leave room for the floating menu when jumping to them */
#about, #work, #how, #contact { scroll-margin-top: 9rem; }

/* Scroll reveal (only when JS is running) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.js [data-reveal].is-revealed { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed; top: 1.4rem; left: 1rem; right: 1rem; z-index: 50;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

/* Logo — the pig from assets/logo/pig.svg. --logo-size sets its height. */
.logo-mark {
  --logo-size: 3rem;
  display: block;
  width: calc(var(--logo-size) * 0.91); height: var(--logo-size); /* the pig's proportions */
  background: url("logo/pig.svg") center / contain no-repeat;
}

/* Desktop pill */
.nav-desktop { display: none; }
.nav-pill {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 1.2rem 2.4rem 1.2rem 1.2rem; /* less on the left, where the pig logo's own box adds space */
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.6rem;
  box-shadow: var(--shadow-pill);
}
.nav-pill .nav-logo {
  display: grid; place-items: center; width: 4rem; height: 4rem;
  transition: opacity 0.2s;
}
.nav-pill .nav-logo:hover { opacity: 0.7; }
.nav-pill ul { display: flex; gap: 1.6rem; align-items: center; }
.nav-link {
  font-size: 1.6rem; line-height: 2rem; color: var(--black);
  opacity: 0.5; transition: opacity 0.2s var(--ease-site);
}
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; }

/* Mobile expanding panel */
.nav-mobile {
  position: relative; width: 100%;
  height: 5.2rem;
  background: var(--true-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3rem;
  box-shadow: var(--shadow-pill);
  overflow: hidden;
  transition: height 0.5s var(--ease-site), border-radius 0.5s var(--ease-site);
}
.nav-mobile.is-open { height: calc(100svh - 2.8rem); border-radius: 2.4rem; }
.nav-mobile-bar {
  position: absolute; top: 0; left: 2.4rem; right: 2.4rem; height: 5.2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-toggle { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; }
.nav-toggle span {
  grid-area: 1 / 1;
  display: block; width: 1.6rem; height: 1.5px; background: var(--black);
  transition: transform 0.3s var(--ease-site);
}
.nav-toggle span:first-child { transform: translateY(-3px); }
.nav-toggle span:last-child { transform: translateY(3px); }
.nav-mobile.is-open .nav-toggle span:first-child { transform: rotate(45deg); }
.nav-mobile.is-open .nav-toggle span:last-child { transform: rotate(-45deg); }
.nav-mobile-links {
  position: absolute; top: 5.2rem; left: 2.4rem; right: 2.4rem;
  height: calc(100svh - 2.8rem - 5.2rem - 2.4rem);
  display: flex; flex-direction: column; justify-content: center; gap: 3rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.nav-mobile.is-open .nav-mobile-links {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.3s 0.2s, visibility 0s;
}
.nav-mobile-links a { opacity: 0.3; transition: opacity 0.2s; }
.nav-mobile-links a:hover, .nav-mobile-links a[aria-current="page"] { opacity: 1; }

@media (min-width: 800px) {
  .site-header { top: 2.8rem; }
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.pill-cta {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  width: 100%; max-width: 44.3rem; height: 4.8rem;
  padding: 0 2.2rem 0 2.4rem;
  border-radius: 999px;
  background: var(--black); color: var(--true-white);
  font-size: 1.6rem; font-weight: 500;
  transition: transform 0.22s var(--ease-out), box-shadow 0.42s var(--ease-out);
}
.pill-cta:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.35); }
.pill-cta:active { transform: scale(0.98); }

.soft-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 1.2rem;
  height: 3.5rem; padding: 0 2.4rem; border-radius: 2rem;
  background: var(--fill-secondary);
  font-size: 1.5rem;
  transition: background-color 0.2s;
}
.soft-link:hover { background: var(--fill-secondary-hover); }
.soft-link .arrow { display: inline-block; transition: transform 0.3s var(--ease-site); }
.soft-link:hover .arrow { transform: translateX(6px); }

/* --------------------------------------------------------------------------
   Home — hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  padding-top: 10.4rem;
  text-align: center;
}
.hero-bg {
  position: absolute; inset: 0 0 22% 0; z-index: -1;
}
.hero-bg::after { /* hairline edge where the colour field meets the page */
  content: ""; position: absolute; inset: auto 0 0 0; height: 0.5px; background: rgba(0, 0, 0, 0.08);
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em;
  padding-inline: 2.4rem;
  text-wrap: balance;
  max-width: 24ch; margin-inline: auto;
}
.hero-wordmark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(9rem, 26vw, 38rem);
  line-height: 0.82;
  letter-spacing: -0.035em;
  color: var(--true-white);
  margin-top: 2.4rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transform-origin: bottom center;
  will-change: transform, opacity;
}
.hero-media {
  width: min(118rem, 100% - 3.2rem);
  margin: -4vw auto 0;
  transform-origin: bottom center;
  will-change: transform;
}
.hero-media-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 30px 60px -20px rgba(0, 0, 0, 0.25);
}
.play-btn {
  position: absolute; inset: 0; margin: auto;
  width: 7.2rem; height: 7.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-pill);
  transition: transform 0.3s var(--ease-out);
}
.play-btn:hover { transform: scale(1.06); }
.hero-media-frame.is-playing .play-btn { opacity: 0; pointer-events: none; }
.hero-media-frame.is-playing::after {
  content: "Lorem ipsum showreel"; position: absolute; left: 2rem; bottom: 1.6rem;
  font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}
.hero-media-frame.is-playing { animation: shimmer 6s linear infinite; background-size: 100% 300%; }
@keyframes shimmer { 0% { background-position: 0 0; } 50% { background-position: 0 100%; } 100% { background-position: 0 0; } }

@media (min-width: 800px) {
  .hero-title { font-size: 3.6rem; }
  .hero-media-frame { border-radius: 1.6rem; }
}

/* --------------------------------------------------------------------------
   Home — selected work (sticky list + scrolling assets)
   -------------------------------------------------------------------------- */
.work {
  max-width: 1400px; margin: 8rem auto; padding-inline: 1rem;
}
.section-head { text-align: center; padding-inline: 2rem; margin-bottom: 4rem; }
.section-head .h2-serif { max-width: 20ch; margin-inline: auto; }

.work-layout { display: flex; flex-direction: column; gap: 6rem; }
.work-nav { display: none; }
.work-panel { display: flex; flex-direction: column; gap: 2rem; }
.work-asset {
  display: block;
  width: 100%; max-width: 76rem; margin-inline: auto;
  aspect-ratio: 4 / 3;
  border-radius: 1.2rem; overflow: hidden;
  box-shadow: var(--shadow-asset);
  transition: box-shadow 0.3s;
  /* Softer gradient: white wash over the project colour */
  background: var(--noise) 0 0 / 160px 160px, linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)), var(--ph);
}
.work-asset:has(> img) { display: flex; align-items: center; justify-content: center; padding: 3.5%; }
.work-asset > img {
  display: block; max-width: 100%; max-height: 100%;
  border-radius: 0.8rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.22);
}
.work-asset:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 20px 40px -16px rgba(0, 0, 0, 0.28); }
.work-caption { padding-inline: 0.4rem; }
.work-caption .mono-index { display: block; margin-bottom: 0.6rem; }
.work-caption h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 2.4rem; line-height: 3rem; letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.work-caption p { max-width: 38ch; color: var(--secondary); }
/* "View more" link under each study */
.work-more {
  display: inline-flex; align-items: center; gap: 0.8rem;
  height: 4rem; margin-top: 2.4rem; padding: 0 1.8rem 0 2rem;
  border-radius: 999px; background: var(--black); color: var(--true-white);
  font-size: 1.4rem; font-weight: 500;
  transition: transform 0.22s var(--ease-out), box-shadow 0.42s var(--ease-out);
}
.work-more span { transition: transform 0.22s var(--ease-out); }
.work-more:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.35); }
.work-more:hover span { transform: translateX(3px); }
.work-panels { display: flex; flex-direction: column; gap: 5.6rem; } /* space between projects on phones */

@media (min-width: 800px) {
  .work { margin-block: 10rem; }
  .section-head { margin-bottom: 5rem; }
  .work-layout {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 2rem;
  }
  .work-nav {
    display: flex; flex-direction: column;
    grid-column: span 4;
    position: sticky; top: 20vh; align-self: start;
  }
  .work-panels { grid-column: span 8; gap: 0; }
  .work-panel { min-height: 60vh; padding-bottom: 4rem; }
  .work-panel .work-caption { display: none; }
  .work-asset { border-radius: 2.4rem !important; }

  .work-tab {
    position: relative; text-align: left;
    padding: 2rem 2.4rem; cursor: pointer;
  }
  .work-tab-btn { display: block; width: 100%; text-align: left; }
  .work-tab .work-more { margin-top: 2rem; }
  .work-tab:not(.is-active) .work-more { visibility: hidden; }
  .work-tab::before {
    content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 3px; border-radius: 999px;
    background: var(--primary); opacity: 0.15; transition: opacity 0.3s;
  }
  .work-tab.is-active::before { opacity: 1; }
  .work-tab .mono-index {
    display: block; font-size: 1.1rem; line-height: 1.4rem; margin-bottom: 0.8rem;
    color: var(--quaternary); transition: color 0.3s;
  }
  .work-tab.is-active .mono-index { color: var(--tertiary); }
  .work-tab-title {
    display: block; font-family: var(--font-serif); font-weight: 500;
    font-size: 2.2rem; line-height: 2.8rem; letter-spacing: -0.02em;
    color: var(--tertiary); transition: color 0.3s;
  }
  .work-tab.is-active .work-tab-title { color: var(--primary); }
  .work-tab-body {
    display: grid; grid-template-rows: 0fr; opacity: 0;
    transition: grid-template-rows 0.4s var(--ease-out), opacity 0.3s;
  }
  .work-tab.is-active .work-tab-body { grid-template-rows: 1fr; opacity: 1; }
  .work-tab-body > span { display: block; min-height: 0; }
  .work-tab-desc {
    display: block; padding-top: 1rem;
    font-size: 1.4rem; line-height: 2rem; color: var(--secondary); max-width: 32ch;
  }
  .work-tab .work-meta { max-width: 32ch; }
}

/* Project metadata — Role / Company / Date / Outcome (label above value) */
.work-meta {
  display: grid; grid-template-columns: minmax(0, 1fr); /* one item per row */
  gap: 1.4rem;
  margin: 1.6rem 0 0; max-width: 38ch;
}
.work-caption .work-meta + p { margin-top: 2rem; }
.work-meta > div, .work-meta-item { display: block; min-width: 0; }
.work-meta > .is-wide, .work-meta-item.is-wide { grid-column: 1 / -1; }
.work-meta dt, .work-meta-label {
  display: block; margin-bottom: 0.4rem;
  font-family: var(--font-mono); font-size: 1.1rem; line-height: 1.4rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tertiary);
}
.work-meta dd, .work-meta-value {
  display: block; margin: 0;
  font-size: 1.5rem; line-height: 2.1rem; color: var(--primary);
}
.work-tab .work-meta { gap: 1.2rem; margin-top: 1.4rem; }
.work-tab .work-meta + .work-tab-desc { padding-top: 1.8rem; }
.work-tab .work-meta-value { font-size: 1.4rem; line-height: 2rem; }
@media (min-width: 1000px) {
  .work-tab-title { font-size: 2.4rem; line-height: 3rem; }
}

/* --------------------------------------------------------------------------
   Home — feature card grid
   -------------------------------------------------------------------------- */
.features { margin-block: 8rem; }
.features .h2-serif { text-align: center; max-width: 17ch; margin-inline: auto; }
.card-rows { margin-top: 6rem; display: flex; flex-direction: column; gap: 1rem; }
.card-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }

.feature-card {
  grid-column: span 12;
  display: flex; flex-direction: column;
  height: 100%;
  border: 1px solid var(--stroke-card);
  border-radius: 1.2rem;
  overflow: hidden;
  transition: background-color 0.3s;
}
@media (min-resolution: 2dppx) { .feature-card { border-width: 0.5px; } }
.feature-card:hover { background: rgba(255, 255, 255, 0.6); }
.feature-card-text { display: flex; flex-direction: column; gap: 2rem; padding: 3rem; flex-shrink: 0; }
.tag {
  width: fit-content; margin-left: -0.4rem;
  height: 3rem; padding: 0 1.2rem; border-radius: 2rem;
  background: var(--true-white);
  font-size: 1.2rem; line-height: 3rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--secondary);
}
.feature-card h3 {
  font-size: 1.6rem; font-weight: 350; line-height: 1.5;
  color: rgba(0, 0, 0, 0.7);
  text-wrap: pretty;
}
.feature-card h3 strong { font-weight: 500; color: var(--primary); }
.feature-card-media {
  flex: 1; min-height: 0;
  display: flex; align-items: flex-end;
  padding-inline: 3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.04)) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.06));
}
.feature-card-media > div {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 1.2rem 1.2rem 0 0;
  transform: translateY(0);
  transition: transform 0.5s var(--ease-out);
}
.feature-card:hover .feature-card-media > div { transform: translateY(-6px); }

@media (min-width: 800px) {
  .features { margin-block: 12rem; }
  .card-rows { margin-top: 8rem; gap: 2rem; }
  .card-row { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2rem; }
  .feature-card.span-6 { grid-column: span 6; }
  .feature-card.span-4 { grid-column: span 4; }
  .feature-card-text { padding: 2rem; gap: 1rem; }
  .feature-card-media { padding-inline: 4rem; }
}
@media (min-width: 1000px) {
  .feature-card-text { padding: 3rem; gap: 2rem; }
  .feature-card h3 { font-size: 2rem; }
  .feature-card.span-6 .feature-card-media { padding-inline: 7rem; }
  .feature-card.span-4 .feature-card-media { padding-inline: 5rem; }
}

/* --------------------------------------------------------------------------
   Home — dashed panel with marquee toggles
   -------------------------------------------------------------------------- */
.dashed-panel-wrap { margin-block: 8rem; }
.dashed-panel {
  position: relative;
  border-radius: 1.2rem;
  padding: 7rem 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  overflow: hidden;
}
.dashed-border {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
.dashed-border rect {
  x: 0.5px; y: 0.5px;
  width: calc(100% - 1px); height: calc(100% - 1px);
  rx: 12px;
  fill: none; stroke: var(--stroke-card); stroke-width: 1; stroke-dasharray: 6 6;
}
.dashed-panel .h2-serif { padding-inline: 2rem; }

.marquee {
  width: 100%; margin-block: 2rem; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 2rem; padding-right: 2rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Skill / tool pills in the marquee */
.skill-pill {
  display: inline-flex; align-items: center;
  height: 4rem; padding: 0 1.8rem;
  border-radius: 999px;
  background: var(--fill-tertiary);
  border: 1px solid var(--stroke-light);
  font-family: var(--font-mono); font-size: 1.3rem; letter-spacing: 0.04em;
  color: var(--primary);
  white-space: nowrap; user-select: none;
}
.dashed-panel .body {
  max-width: 50ch; margin: 4rem auto 0; padding-inline: 2rem;
  color: var(--secondary);
}
.dashed-panel .body p + p { margin-top: 1em; }
.dashed-panel .soft-link { margin-top: 4rem; }

@media (min-width: 800px) { .dashed-panel-wrap { margin-block: 12rem; } }
@media (min-width: 1000px) { .dashed-panel .body { max-width: 48ch; line-height: 3rem; } }

/* --------------------------------------------------------------------------
   Closing CTA + footer
   -------------------------------------------------------------------------- */
.closing {
  display: flex; flex-direction: column; align-items: center; gap: 2.4rem;
  margin: 10rem auto 12rem; padding-inline: 2rem; text-align: center;
}
.closing .h2-serif { max-width: 76rem; color: var(--black); }
.closing .note { font-size: 1.2rem; line-height: 1.2; color: rgba(0, 0, 0, 0.5); }

.site-footer {
  padding: 2rem 1rem 3rem;
  font-family: var(--font-mono); font-size: 1.3rem; line-height: 1.6rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}
.site-footer-inner {
  max-width: 1440px; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center;
}
@media (min-width: 1000px) {
  .site-footer-inner {
    flex-direction: row; justify-content: space-between;
    padding-inline: calc((100% - 2rem * 11) / 12 + 2rem);
  }
}

/* --------------------------------------------------------------------------
   Project / case study page (inspired by /apps/google tour)
   -------------------------------------------------------------------------- */
.tour {
  position: relative;
  min-height: 100svh;
  padding: 22rem 2.4rem 9.6rem;
  font-size: 2rem; line-height: 1.65;
}
.tour-topfade {
  position: absolute; inset: 0 0 auto 0; height: 34rem; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 0%, #000 30%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 30%, transparent 100%);
}
.tour-inner { position: relative; max-width: 72rem; margin-inline: auto; }

.tour-dots {
  position: fixed; left: 1.3rem; top: 50%; z-index: 5;
  display: none; flex-direction: column; transform: translateY(-50%);
}
.tour-dots a { display: grid; place-items: center; width: 4.4rem; height: 2.4rem; }
.tour-dots span {
  width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--black); opacity: 0.16;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.tour-dots a:hover span { opacity: 0.4; }
.tour-dots a[aria-current] span { opacity: 0.85; transform: scale(1.45); }
@media (min-width: 1100px) { .tour-dots { display: flex; } }

.tour-hero { text-align: center; margin-bottom: 1.4rem; }
@keyframes lockup-left { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lockup-drop { from { transform: translateY(-60px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

.tour-title {
  font-family: var(--font-serif); font-weight: 550;
  font-size: clamp(5.2rem, 9vw, 8.2rem); line-height: 1; letter-spacing: -0.02em;
  white-space: pre-line; margin-bottom: 1.8rem;
}
.tour-kicker {
  font-family: var(--font-serif); font-weight: 550; font-style: italic;
  font-size: 1.9rem; letter-spacing: 0.01em; color: rgba(0, 0, 0, 0.4);
}
.tour-intro { max-width: 56rem; margin: 2.6rem auto 0; color: var(--soft); }
.tour-intro p + p { margin-top: 1em; }
/* Project details on case studies — a row of items, label above value */
.case-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 2rem 4rem;
  max-width: 72rem; margin: 2.8rem auto 0;
  text-align: left;
}
.case-meta > div { min-width: 0; }
.case-meta dt {
  margin-bottom: 0.4rem;
  font-family: var(--font-mono); font-size: 1.2rem; line-height: 1.6rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tertiary);
}
.case-meta dd {
  margin: 0; max-width: 26ch;
  font-size: 1.6rem; line-height: 2.2rem; color: var(--primary);
  text-wrap: pretty;
}
@media (min-width: 800px) {
  .case-meta dd { font-size: 1.8rem; line-height: 2.5rem; }
}
@media (max-width: 520px) {
  .case-meta { gap: 1.8rem 3.2rem; }
}
.tour-rule { width: 6.4rem; height: 1px; background: var(--black); margin: 4rem auto 8.4rem; }

.tour-section { margin-bottom: 11rem; scroll-margin-top: 12rem; }
.tour-pill-wrap { display: flex; justify-content: center; margin-bottom: 1.8rem; }
.tour-pill {
  display: inline-flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 1.4rem 0.5rem 0.6rem; border-radius: 999px;
  background: var(--fill-tertiary);
  font-size: 1.1rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; line-height: 2rem;
  color: var(--secondary);
}
.tour-pill .num {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--black); color: var(--true-white);
  font-family: var(--font-serif); font-size: 1.2rem; letter-spacing: 0; font-weight: 550;
}
.tour-section h2 {
  font-family: var(--font-serif); font-weight: 550; font-style: italic;
  font-size: 3.4rem; line-height: 1.12; letter-spacing: -0.01em;
  text-align: center; text-wrap: balance;
  margin-bottom: 3.6rem;
}
/* Figures break out of the 720px text column: up to 1200px wide, 32px from the screen edges */
.tour-figure {
  --figure-w: min(120rem, 100vw - 6.4rem);
  width: var(--figure-w);
  margin-inline: calc((100% - var(--figure-w)) / 2);
}
/* the image itself: a placeholder <div class="ph"> or a real <img> */
.tour-figure .ph, .tour-figure img {
  display: block; width: 100%;
  border-radius: 4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 30px rgba(0, 0, 0, 0.08);
}
.tour-figure .ph { aspect-ratio: 16 / 9; }
.tour-figure img { height: auto; }
/* two images side by side (stacks on phones) */
.tour-figure .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4rem; }
.tour-figure .pair .ph { aspect-ratio: 4 / 3; border-radius: 3rem; }
.tour-figure .pair img { border-radius: 3rem; }
/* three in a row (stacks on phones) */
.tour-figure .trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.tour-figure .trio .ph { aspect-ratio: 3 / 4; border-radius: 2.4rem; }
.tour-figure .trio img { border-radius: 2.4rem; }
/* static caption under an image */
.tour-figure figcaption {
  max-width: 60rem; margin: 1.6rem auto 0;
  text-align: center; font-size: 1.5rem; line-height: 1.5; color: var(--tertiary);
  text-wrap: balance;
}
/* when the side dots are visible (≥1100px), keep a clear lane for them on both sides
   (dots sit 13px from the left and are 44px wide, so 75px leaves an 18px gap) */
@media (min-width: 1100px) {
  .tour-figure { --figure-w: min(120rem, 100vw - 15rem); }
}

.tour-prompt {
  position: relative; z-index: 2;
  max-width: 72rem; margin: -9.6rem auto 0;
  filter: var(--filter-shadow);
  transition: filter 0.3s;
}
.tour-prompt:hover { filter: var(--filter-shadow-lift); }
.tour-prompt-card {
  background: var(--true-white); border-radius: 1.6rem;
  padding: 1.8rem 1.8rem 1.4rem; text-align: left;
}
.tour-query {
  font-size: clamp(15px, 0.85rem + 0.8vw, 21px); line-height: 1.5; text-wrap: pretty;
  min-height: 3lh;
}
.tour-query.is-typing::after, .tour-query.is-done::after {
  content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px;
  vertical-align: -0.15em; background: var(--black);
}
.tour-query.is-done::after { animation: caret-blink 1.1s step-end infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.tour-prompt-meta {
  display: flex; align-items: center; gap: 0.8rem;
  margin-top: 1.6rem; padding-top: 1.4rem;
  border-top: 0.5pt solid rgba(0, 0, 0, 0.1);
  font-size: 1.6rem; line-height: 1.4; color: var(--soft);
}
.tour-prompt-meta .icons { display: inline-flex; gap: 0.5rem; flex: none; }
.tour-prompt-meta .icons span {
  width: 2.2rem; height: 2.2rem; border-radius: 0.6rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.tour-caption {
  max-width: 60rem; margin: 3.4rem auto 0;
  text-align: center; font-size: 1.7rem; color: var(--soft); text-wrap: balance;
}

/* long-form writing inside a section — left-aligned for easy reading */
.tour-body { max-width: 64ch; margin: 0 auto; text-align: left; font-size: 1.8rem; line-height: 1.65; color: var(--secondary); }
.tour-body p + p { margin-top: 1em; }
.tour-body strong { color: var(--primary); font-weight: 600; }
.tour-body + .tour-figure, .tour-figure + .tour-body, .tour-figure + .tour-figure,
.tour-prompt + .tour-body, .tour-body + .tour-stats, .tour-stats + .tour-body, .tour-stats + .tour-figure { margin-top: 5.6rem; }
.tour-figure + .tour-prompt { margin-top: 5.6rem; } /* highlight card sits on its own, never over an image */
.tour-cover { margin-top: 6.4rem; }

/* outcome numbers */
.tour-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2.4rem;
  max-width: 72rem; margin: 0 auto; text-align: center;
}
.tour-stat { padding: 2.4rem 1.6rem; border-radius: 1.6rem; background: var(--fill-tertiary); }
.tour-stat-value {
  display: block; font-family: var(--font-serif); font-weight: 550;
  font-size: 4.8rem; line-height: 1; letter-spacing: -0.02em; color: var(--primary);
}
.tour-stat-label { display: block; margin-top: 1rem; font-size: 1.5rem; line-height: 1.4; color: var(--secondary); }

/* reflection */
.tour-reflection { max-width: 64ch; margin: 0 auto; text-align: center; }
.tour-reflection .label {
  display: block; margin-bottom: 1.4rem;
  font-family: var(--font-mono); font-style: normal; font-weight: 400;
  font-size: 1.2rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tertiary);
}

.tour-closing {
  margin-top: 0.8rem; padding: 3rem 3.6rem; border-radius: 1.6rem;
  background: var(--fill-tertiary);
  font-family: var(--font-serif); font-weight: 550; font-style: italic;
  font-size: 2.3rem; line-height: 1.3; text-align: center;
}
.tour-cta {
  margin-top: 9.6rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.6rem;
  font-family: var(--font-sans);
}
.tour-cta .note a { text-decoration: underline; text-underline-offset: 3px; }
.tour-cta .note { max-width: 45ch; text-align: center; font-size: 1.4rem; line-height: 1.3; color: rgba(0, 0, 0, 0.5); }

@media (max-width: 900px) {
  .tour { padding-top: 16rem; }
  .tour-figure { width: auto; margin-inline: 0; } /* stay inside the page's side padding */
  .tour-figure .ph, .tour-figure img { border-radius: 2.4rem; }
  .tour-figure .pair { grid-template-columns: 1fr; gap: 1.6rem; }
  .tour-figure .pair .ph, .tour-figure .pair img { border-radius: 2.4rem; }
  .tour-figure .trio { grid-template-columns: 1fr; gap: 1.6rem; }
  .tour-prompt { margin-top: 2.2rem; }
  .tour-figure + .tour-prompt { margin-top: 4rem; }
  .tour-body { font-size: 1.7rem; }
  .tour-stat-value { font-size: 4rem; }
}
@media (max-width: 520px) {
  .tour-section h2 { font-size: 2.8rem; }
  .tour-cta { margin-top: 7.2rem; }
}

/* --------------------------------------------------------------------------
   About page (inspired by /apps)
   -------------------------------------------------------------------------- */
.about-hero {
  position: relative;
  min-height: 27rem;
  padding: 16rem 2rem 5.3rem;
  text-align: center;
}
.about-hero-fade {
  position: absolute; inset: 0 0 auto 0; height: 14rem; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 180% 100% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 180% 100% at 50% 0%, #000 30%, transparent 100%);
}
.about-hero-inner { position: relative; max-width: 129.6rem; margin-inline: auto; }

/* Floating tiles that drop in around the heading */
.float-tile {
  position: absolute; pointer-events: none;
  width: 1.6rem; height: 1.6rem; border-radius: 0.4rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: rotate(var(--r, 0deg));
  animation: tile-drop 1.1s var(--ease-out) var(--d, 0s) both;
}
@keyframes tile-drop {
  from { transform: translateY(-60vh) rotate(0deg) scale(0.97); opacity: 0; }
  to { transform: rotate(var(--r, 0deg)); opacity: 1; }
}
.float-tile.t1 { left: 0; top: 2.6rem; --r: -12deg; --d: 0.1s; }
.float-tile.t2 { left: 1rem; top: 14rem; --r: -7deg; --d: 0.25s; }
.float-tile.t3 { right: 1rem; top: 2.6rem; --r: -8deg; --d: 0.18s; }
.float-tile.t4 { right: 1rem; top: 14.8rem; --r: 12deg; --d: 0.32s; }
.float-tile.t5 { left: 2.8rem; top: 19.6rem; --r: 7deg; --d: 0.4s; }
.float-tile.t6 { right: 2.8rem; top: 19.6rem; --r: -10deg; --d: 0.46s; }
.float-tile.t7 { left: 4rem; top: 8.4rem; --r: 9deg; --d: 0.52s; }

.about-title {
  position: relative;
  max-width: 25rem; margin-inline: auto;
  font-family: var(--font-serif); font-weight: 550;
  font-size: 4rem; line-height: 3.8rem; letter-spacing: -0.02em;
  text-wrap: balance;
}
.about-intro {
  max-width: 24.2rem; margin: 1.6rem auto 0;
  font-weight: 350; font-size: 1.6rem; line-height: 2.4rem;
  color: rgba(0, 0, 0, 0.65);
  text-wrap: balance;
}

.about-body { max-width: 1440px; margin-inline: auto; padding-inline: 2rem; }
.about-section { padding-bottom: 4.8rem; }
.about-section:last-child { padding-bottom: 12rem; }
.about-section h2 {
  margin-bottom: 2.4rem;
  font-family: var(--font-serif); font-weight: 550;
  font-size: 2.8rem; line-height: 3.2rem; letter-spacing: -0.01em;
}

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }

/* Shared card shell */
.a-card {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.8rem;
  background: var(--background);
}

/* Featured card: gradient media on top, text below */
.a-card.is-wide { grid-column: span 2; }
.a-card-media { aspect-ratio: 306 / 166; flex: none; }
.a-card.is-wide .a-card-media { aspect-ratio: 306 / 83; }
.a-card-body {
  flex: 1;
  display: flex; flex-direction: column; gap: 0.6rem;
  min-height: 12.5rem; padding: 1.2rem;
}
.a-card-label {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 350; font-size: 1.1rem; line-height: 1.6rem;
}
.a-card-label .icon { width: 1.4rem; height: 1.4rem; border-radius: 0.3rem; flex: none; }
.a-card-title {
  max-width: 21rem; white-space: pre-line;
  font-family: var(--font-serif); font-weight: 550;
  font-size: 1.8rem; line-height: 2rem; letter-spacing: -0.01em;
}
.a-card.is-wide .a-card-title { max-width: 32rem; }
.a-card-foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  font-weight: 350; font-size: 1.1rem; line-height: 1.6rem;
  color: rgba(0, 0, 0, 0.65);
}
.a-card-foot svg, .a-card-top svg { flex: none; color: rgba(0, 0, 0, 0.45); }

/* Compact card: icon row, title, blurb, category */
.a-card.is-compact { min-height: 19rem; padding: 1.2rem; gap: 0.4rem; }
.a-card-top { display: flex; align-items: center; justify-content: space-between; height: 2.8rem; }
.a-card-top .icon { width: 2rem; height: 2rem; border-radius: 0.5rem; }
.a-card.is-compact h3 {
  font-family: var(--font-serif); font-weight: 550;
  font-size: 1.8rem; line-height: 2.2rem; letter-spacing: -0.01em;
}
.a-card.is-compact p { font-weight: 350; font-size: 1.2rem; line-height: 1.7rem; }
.a-card.is-compact .category {
  margin-top: auto; padding-top: 0.4rem;
  font-weight: 350; font-size: 1.1rem; line-height: 1.6rem; color: rgba(0, 0, 0, 0.65);
}

@media (min-width: 600px) {
  .about-hero { min-height: 34.1rem; padding: 16rem 3.2rem 3.9rem; }
  .float-tile { width: 2.2rem; height: 2.2rem; border-radius: 0.5rem; }
  .float-tile.t1 { left: 0; top: 0; }
  .float-tile.t2 { left: 5.2rem; top: 11.2rem; }
  .float-tile.t3 { right: 3.6rem; top: 11.2rem; }
  .float-tile.t4 { right: 0; top: 0; }
  .float-tile.t5 { left: 2rem; top: 17rem; }
  .float-tile.t6 { right: 2rem; top: 17rem; }
  .float-tile.t7 { left: 8.4rem; top: 20.4rem; }
  .about-title { max-width: 12ch; font-size: 6.4rem; line-height: 6.7rem; }
  .about-intro { max-width: 65ch; margin-top: 2.3rem; font-size: 1.8rem; line-height: 2.6rem; }
  .about-body { padding-inline: 3.2rem; }
  .about-section { padding-bottom: 6.4rem; }
  .about-section h2 { font-size: 3.2rem; line-height: 3.8rem; }
  .about-section.is-index h2 { font-size: 4rem; line-height: 4.4rem; }
  .card-grid { gap: 2.4rem; }
  .a-card { border-radius: 1.2rem; }
  .a-card-body { min-height: 15.2rem; gap: 0.8rem; padding: 2rem; }
  .a-card-label { gap: 0.8rem; font-size: 1.4rem; line-height: 2rem; }
  .a-card-label .icon { width: 2rem; height: 2rem; border-radius: 0.4rem; }
  .a-card-title { font-size: 2.4rem; line-height: 2.8rem; }
  .a-card-foot { font-size: 1.3rem; line-height: 1.8rem; }
  .a-card.is-compact { padding: 2rem; }
  .a-card-top { height: 4rem; }
  .a-card-top .icon { width: 2.4rem; height: 2.4rem; border-radius: 0.6rem; }
  .a-card.is-compact h3 { font-size: 2.4rem; line-height: 3rem; }
  .a-card.is-compact p { font-size: 1.6rem; line-height: 2.2rem; }
  .a-card.is-compact .category { font-size: 1.3rem; line-height: 1.8rem; }
}
@media (min-width: 1000px) {
  .about-hero { min-height: 43.8rem; padding: 18.1rem 7.2rem 6.8rem; }
  .about-hero-fade { height: 20rem; }
  .float-tile { width: 3.2rem; height: 3.2rem; border-radius: 0.7rem; }
  .float-tile.t1 { left: 0; top: 4rem; }
  .float-tile.t2 { left: 10rem; top: 8.2rem; }
  .float-tile.t3 { right: 10rem; top: 7.6rem; }
  .float-tile.t4 { right: 0; top: 4rem; }
  .float-tile.t5 { left: 2.4rem; top: 21.6rem; }
  .float-tile.t6 { right: 2.8rem; top: 20.6rem; }
  .float-tile.t7 { left: 11.2rem; top: 27rem; }
  .about-title { font-size: 9.6rem; line-height: 1; }
  .about-intro { margin-top: 4.1rem; }
  .about-body { padding-inline: 7.2rem; }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* a wide card sits beside regular ones, so let its media match their height */
  .a-card.is-wide .a-card-media { aspect-ratio: auto; flex: 1; min-height: 16rem; }
  .a-card.is-wide .a-card-body { flex: none; }
}

/* Shorter hero variant (about.html, contact.html) so content shows on the first screen */
@media (max-width: 599px) {
  .about-hero.is-compact .float-tile.t5,
  .about-hero.is-compact .float-tile.t6 { display: none; }
}
@media (min-width: 600px) {
  .about-hero.is-compact { min-height: 0; padding-top: 13rem; padding-bottom: 2rem; }
}
@media (min-width: 1000px) {
  .about-hero.is-compact .about-title { font-size: 7.2rem; line-height: 7.4rem; }
  .about-hero.is-compact .about-intro { margin-top: 2.4rem; }
}

/* --------------------------------------------------------------------------
   Strip hero (work-2.html) — like diabrowser.com/apps/granola: a band of the
   painting across the top that fades into the page, with the title below.
   -------------------------------------------------------------------------- */
.about-hero.strip-hero { padding-top: 17.5rem; }
.strip-hero-art {
  position: absolute; inset: 0 0 auto 0; height: 13rem;
  background-color: #e9cfa5; /* warm tone from the painting while it loads */
  background-size: cover; background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(#000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 45%, transparent 100%);
  pointer-events: none;
}
@media (min-width: 521px) {
  .about-hero.strip-hero { padding-top: 24.5rem; }
  .strip-hero-art { height: 20rem; }
}
@media (min-width: 961px) {
  .about-hero.strip-hero { padding-top: 38rem; }
  .strip-hero-art { height: 34rem; }
}

/* Logo tiles (index.html — education & work experience). Uses slots t1, t4, t5, t6. */
.float-tile.is-logo {
  width: 2.2rem; height: 2.2rem; border-radius: 0.55rem;
  object-fit: cover;
  background: var(--black);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.16);
}
@media (max-width: 599px) {
  .about-hero.has-logos .float-tile.t5,
  .about-hero.has-logos .float-tile.t6 { display: block; }
  .about-hero.has-logos .float-tile.t1 { left: 0.4rem; top: 3rem; }
  .about-hero.has-logos .float-tile.t4 { right: 0.4rem; top: 3rem; }
  .about-hero.has-logos .float-tile.t5 { left: 0.4rem; top: 18rem; }
  .about-hero.has-logos .float-tile.t6 { right: 0.4rem; top: 18rem; }
}
@media (min-width: 600px) {
  .float-tile.is-logo { width: 3rem; height: 3rem; border-radius: 0.72rem; }
  .about-hero.has-logos .float-tile.t5 { left: 0; top: 11rem; }
  .about-hero.has-logos .float-tile.t6 { right: 0; top: 11rem; }
}
@media (min-width: 1000px) {
  .float-tile.is-logo { width: 4.3rem; height: 4.3rem; border-radius: 0.96rem; }
  .about-hero.has-logos .float-tile.t1 { left: 2rem; top: 1rem; }
  .about-hero.has-logos .float-tile.t4 { right: 2rem; top: 1rem; }
  .about-hero.has-logos .float-tile.t5 { left: 0; top: 18rem; }
  .about-hero.has-logos .float-tile.t6 { right: 0; top: 18rem; }
}
@media (min-width: 1200px) {
  .about-hero.has-logos .float-tile.t5 { left: 9rem; top: 17rem; }
  .about-hero.has-logos .float-tile.t6 { right: 9rem; top: 17rem; }
}

/* --------------------------------------------------------------------------
   Contact page
   -------------------------------------------------------------------------- */
.contact-actions {
  display: flex; flex-direction: column; align-items: center; gap: 1.2rem;
  margin-top: 3.2rem;
}
.contact-actions .pill-cta { max-width: 32rem; }
.contact-links { padding-top: 4rem; }
@media (min-width: 600px) {
  .contact-actions { flex-direction: row; justify-content: center; }
  .contact-actions .pill-cta { width: auto; padding-inline: 3.2rem; }
  .contact-actions .soft-link { height: 4.8rem; border-radius: 999px; padding-inline: 2.8rem; }
}

/* --------------------------------------------------------------------------
   Fun facts — fanned deck of flip cards
   .fact-card is the whole card; .fact-card-inner flips; it holds a back
   face (pig pattern, #card-back symbol) and a front face (the fact).
   -------------------------------------------------------------------------- */
.fact-deck { padding: 0 2rem 10rem; }
.fact-fan {
  /* layout knobs — tweak per breakpoint below */
  --cw: 22rem;          /* card width (height follows 5:7) */
  --spread: 11.8rem;    /* horizontal step between cards */
  --angle: 8deg;        /* rotation step between cards */
  --drop: 0.7rem;       /* vertical drop per step² (makes the arc) */
  --top: 4rem;          /* where the fan sits inside the stage */
  --open-s: 1.32;       /* scale of a revealed card (grows from its bottom edge) */
  --open-y: 5rem;       /* push a revealed card down so its top stays in the stage */
  --ink: #661b29;

  --stage-h: 46rem;     /* stage height while all cards are face down */

  position: relative;
  max-width: 100rem; height: var(--stage-h); margin: 0 auto;
  transition: height 0.5s var(--ease-out);
}
/* JS sets --open-s / --open-y / --open-h from the viewport size */
.fact-fan.has-open { height: max(var(--stage-h), var(--open-h, 0px)); }

.fact-card {
  position: absolute; left: 50%; top: var(--top);
  width: var(--cw); margin-left: calc(var(--cw) / -2);
  aspect-ratio: 5 / 7;
  z-index: var(--z);
  container-type: inline-size;
  perspective: 1400px;
  border-radius: 5.6cqw;
  transform-origin: 50% 100%;
  transform:
    translate(calc(var(--i) * var(--spread)), calc(var(--d) * var(--drop) - var(--lift, 0px)))
    rotate(calc(var(--i) * var(--angle)));
  transition: transform 0.6s var(--ease-out), opacity 0.4s, filter 0.4s;
  -webkit-tap-highlight-color: transparent;
}
.fact-card:focus-visible { outline-offset: 6px; }

/* deal-in on first reveal */
.js .fact-fan:not(.is-dealt) .fact-card { transform: translateY(3rem); opacity: 0; }
.fact-fan.is-dealt:not(.is-settled) .fact-card { transition-delay: calc((var(--i) + 2) * 80ms); }

@media (hover: hover) {
  .fact-fan:not(.has-open) .fact-card:hover { --lift: 1.8rem; }
}
.fact-fan:not(.has-open) .fact-card:focus-visible { --lift: 1.8rem; }

/* revealed card comes to the front, straightens and grows */
.fact-card.is-open {
  z-index: 20;
  transform: translateY(var(--open-y)) scale(var(--open-s));
}
.fact-fan.has-open .fact-card:not(.is-open) {
  filter: saturate(0.55) brightness(1.06);
  transform:
    translate(calc(var(--i) * var(--spread) * 1.15), calc(var(--d) * var(--drop) + 6rem))
    rotate(calc(var(--i) * var(--angle) * 1.3));
}

.fact-card-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease-out);
}
.fact-card.is-open .fact-card-inner { transform: rotateY(180deg); transition-delay: 0.08s; }

.fact-card-face {
  position: absolute; inset: 0;
  border-radius: 5.6cqw;
  overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 1px 2px rgba(102, 27, 41, 0.15), 0 14px 30px -12px rgba(102, 27, 41, 0.45);
}
.fact-card-back svg { width: 100%; height: 100%; }

.fact-card-front {
  transform: rotateY(180deg);
  display: flex; flex-direction: column;
  padding: 10cqw 8cqw 8cqw;
  background: #fffcf7;
  color: var(--tertiary);
  text-align: left;
}
.fact-card-front::before { /* thin inner frame echoing the card back */
  content: ""; position: absolute; inset: 3cqw;
  border: 0.4cqw solid rgba(102, 27, 41, 0.22); border-radius: 3.4cqw;
  pointer-events: none;
}
.fact-corner {
  position: absolute; top: 4.8cqw; left: 6cqw;
  font-family: var(--font-mono); font-size: 3.6cqw; line-height: 1; letter-spacing: 0.06em;
}
.fact-corner.is-bottom { top: auto; left: auto; bottom: 4.8cqw; right: 6cqw; transform: rotate(180deg); }
/* square photo (20% taller than the old 6:5); on a card with a long fact it gives up
   just enough height for the text to fit */
.fact-media { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 3cqw; flex: 0 1 auto; min-height: 0; object-fit: cover; }
.fact-label {
  margin-top: 5cqw;
  font-family: var(--font-mono); font-size: 3.4cqw; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tertiary);
}
.fact-title {
  margin-top: 6cqw;
  font-family: var(--font-serif); font-weight: 550;
  font-size: 7.4cqw; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--black);
}
.fact-text { margin-top: 3cqw; font-size: 4.6cqw; line-height: 1.45; color: var(--secondary); }

.fact-hint { margin-top: 2.4rem; text-align: center; color: var(--tertiary); }

/* Mobile takeover — JS adds .is-takeover to the fan and .fact-takeover to <body>,
   and sets --tx / --ty / --ts on the open card to centre it on screen */
.fact-fan.is-takeover.has-open { height: var(--stage-h); }
.fact-fan.is-takeover .fact-card.is-open {
  z-index: 40;
  transform: translate(var(--tx), var(--ty)) scale(var(--ts));
}
.fact-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(251, 250, 246, 0.96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.fact-close {
  position: fixed; top: 1.6rem; right: 1.6rem; z-index: 45;
  display: grid; place-items: center;
  width: 4.4rem; height: 4.4rem; border-radius: 50%;
  background: var(--true-white); color: var(--black);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-pill);
  opacity: 0; pointer-events: none; transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}
.fact-takeover { overflow: hidden; }
.fact-takeover .fact-overlay { opacity: 1; pointer-events: auto; }
.fact-takeover .fact-close { opacity: 1; pointer-events: auto; transform: none; transition-delay: 0.25s; }
.site-header { transition: opacity 0.25s ease, visibility 0s; }
.fact-takeover .site-header { opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0s 0.25s; }
.fact-takeover .fact-hint { visibility: hidden; }

@media (max-width: 999px) {
  .fact-fan { --cw: 19rem; --spread: 9.5rem; --open-s: 1.5; --open-y: 10.3rem; --stage-h: 45rem; }
}
@media (max-width: 599px) {
  .fact-fan {
    --cw: 12rem; --spread: 4rem; --angle: 8deg; --drop: 0.5rem;
    --top: 6rem; --open-s: 2.5; --open-y: 20.2rem;
    --stage-h: 30rem;
  }
}
@media (max-width: 379px) {
  .fact-fan { --cw: 11rem; --spread: 3.6rem; --open-s: 2.45; --open-y: 17.3rem; }
}

/* --------------------------------------------------------------------------
   Case study reading layout — left-aligned, two columns on desktop:
   label + statement heading on the left, paragraphs on the right.
   -------------------------------------------------------------------------- */
.tour-inner { --col-w: min(120rem, 100vw - 4.8rem); max-width: var(--col-w); }
@media (min-width: 1100px) { .tour-inner { --col-w: min(120rem, 100vw - 15rem); } } /* clear lane for the side dots */
.tour-figure { --figure-w: var(--col-w); }

/* hero */
.tour-hero { text-align: center; margin-bottom: 0; }
.tour-title { max-width: 14ch; margin-inline: auto; }
.case-meta { justify-content: center; margin: 3.2rem auto 0; max-width: none; }
.tour-intro { max-width: 52ch; margin: 2.4rem auto 0; color: var(--secondary); font-size: 1.9rem; line-height: 1.6; }
.tour-rule { margin: 6.4rem auto 8rem; }

/* sections */
.tour-split { display: grid; gap: 2.4rem; }
.tour-split-head .tour-pill-wrap { justify-content: flex-start; margin-bottom: 2rem; }
.tour-section .tour-split-head h2 {
  text-align: left; margin: 0;
  font-family: var(--font-serif); font-style: normal; font-weight: 500;
  font-size: 3.2rem; line-height: 1.15; letter-spacing: -0.02em;
  text-wrap: balance;
}
.tour-split .tour-body { margin: 0; max-width: 60ch; color: rgba(0, 0, 0, 0.72); }
.tour-split + .tour-figure, .tour-split + .tour-stats { margin-top: 5.6rem; }
@media (min-width: 900px) {
  .tour-split { grid-template-columns: 5fr 7fr; column-gap: 8rem; align-items: start; }
  .tour-section .tour-split-head h2 { font-size: 4rem; }
  .tour-split .tour-body { padding-top: 5.2rem; } /* line up with the heading, below the label */
}

.tour-figure figcaption { text-align: left; margin: 1.4rem 0 0; max-width: 60ch; }
.tour-stats { margin: 0; max-width: none; text-align: left; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); } /* boxes stretch to fill the row */
.tour-reflection, .tour-closing { text-align: left; }
.tour-reflection { max-width: none; }
.tour-reflection p { max-width: none; } /* runs the full width of the box */
.tour-cta { align-items: flex-start; }
.tour-cta .note { text-align: left; }

/* Sub-areas inside a section (e.g. Pre-qualification / Inductions) */
.tour-split.is-sub { margin-top: 8rem; }
.tour-sub-label {
  display: block; margin-bottom: 1.2rem;
  font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 0.1em; color: var(--tertiary);
}
.tour-split-head h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 2.8rem; line-height: 1.15; letter-spacing: -0.02em;
}
@media (min-width: 900px) {
  .tour-split.is-sub { margin-top: 11rem; }
  .tour-split.is-sub .tour-body { padding-top: 2.8rem; }
  .tour-split-head h3 { font-size: 3.2rem; }
}
.tour-split.is-sub + .tour-figure { margin-top: 4.8rem; }
/* small source line under stats */
.tour-source { margin-top: 1.6rem; font-size: 1.3rem; line-height: 1.5; color: var(--tertiary); }
.tour-source + .tour-figure { margin-top: 5.6rem; }
/* smaller stat tiles that sit inside the paragraph column */
.tour-stats.is-compact { margin-top: 3.2rem; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); } /* three across, stacking on phones; keep captions short */
.tour-stats.is-compact .tour-stat-label { white-space: nowrap; }
.tour-stats.is-compact .tour-stat { padding: 1.8rem 1.6rem; border-radius: 1.4rem; }
.tour-stats.is-compact .tour-stat-value { font-size: 3.2rem; }
.tour-stats.is-compact .tour-stat-label { margin-top: 0.8rem; font-size: 1.4rem; }
.tour-body .tour-source { margin-top: 1.2rem; }

/* Click-to-play YouTube cover */
.video-embed {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 1.6rem; background: var(--black);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 30px rgba(0, 0, 0, 0.08);
}
.tour-figure .video-embed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed .play-btn { z-index: 1; }
.video-embed.is-playing .play-btn, .video-embed.is-playing img { display: none; }
@media (max-width: 900px) { .video-embed { border-radius: 1.2rem; } }
/* Looping cover video (e.g. a prototype recording) */
.cover-video {
  display: block; width: 100%; height: auto;
  border-radius: 1.6rem; background: var(--true-white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 30px rgba(0, 0, 0, 0.08);
}
@media (max-width: 900px) { .cover-video { border-radius: 1.2rem; } }
/* Shrink the cover so the whole video (plus caption) fits on screen; 1.328 = the recording's width / height */
.tour-cover:has(> .cover-video) { --figure-w: min(120rem, 100vw - 6.4rem, (100svh - 12rem) * 1.328); }

/* "My contribution": two cards side by side (stack below 900px) */
.tour-split-head > h2 { max-width: 24ch; }
.contrib-cards { display: grid; gap: 2.4rem; margin-top: 4.8rem; }


@media (min-width: 900px) { .contrib-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contrib-card { padding: 3.2rem; border-radius: 2.4rem; background: var(--fill-tertiary); }
/* illustration under the text in each card; same height in both so the cards line up */
.contrib-card { display: flex; flex-direction: column; }
.contrib-card .contrib-tag { align-self: flex-start; }
.contrib-art { display: block; width: 100%; height: auto; margin-top: auto; padding-top: 3.6rem; } /* sits at the bottom so both line up */
.contrib-tag {
  display: inline-block; padding: 0.6rem 1.2rem; border-radius: 99rem;
  background: var(--true-white); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--secondary);
}
.contrib-card h3 {
  margin: 2rem 0 1.2rem;
  font-family: var(--font-serif); font-weight: 500; font-size: 2.8rem; line-height: 1.15; letter-spacing: -0.02em;
}
.contrib-card p { font-size: 1.7rem; line-height: 1.65; color: rgba(0, 0, 0, 0.72); }
.contrib-cards + .gallery { margin-top: 8rem; }
.tour-split + .gallery { margin-top: 6.4rem; } /* gallery straight after the heading and text */
@media (max-width: 599px) { .tour-split + .gallery { margin-top: 4.8rem; } }
@media (max-width: 599px) {
  .contrib-card { padding: 2.4rem; }
  .contrib-art { height: auto; }
  .contrib-tag { font-size: 1.1rem; letter-spacing: 0.04em; }
}

/* Gallery: full-width rows of tinted frames in different widths.
   Each frame is a washed-out version of the study's gradient, with the image floating on top. */
.gallery { display: grid; gap: 4.8rem; }
.gallery-row { --row-h: clamp(32rem, 42vw, 60rem); display: grid; gap: 2.4rem; }
.gallery-row.is-full { --row-h: clamp(36rem, 52vw, 72rem); }
@media (min-width: 900px) {
  .gallery-row.is-2-1 { grid-template-columns: 2fr 1fr; }
  .gallery-row.is-1-2 { grid-template-columns: 1fr 2fr; }
  .gallery-row.is-1-1 { grid-template-columns: 1fr 1fr; --row-h: clamp(28rem, 30vw, 46rem); }
}
.gallery-frame {
  display: flex; align-items: center; justify-content: center;
  height: var(--row-h); padding: 3.5%;
  border-radius: 3.2rem; overflow: hidden;
}
/* the washed-out study gradient behind gallery images */
.gallery-frame { background: var(--noise) 0 0 / 160px 160px, linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)), var(--ph); }
.gallery-frame img, .gallery-frame video, .gallery-shot {
  border-radius: 1.2rem; background: var(--true-white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 20px 50px rgba(0, 0, 0, 0.14);
}
/* Images: no white backing, so transparent areas show the gradient.
   drop-shadow follows the image's own shape instead of its rectangle. */
.gallery-frame img {
  background: none; box-shadow: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.06)) drop-shadow(0 16px 32px rgba(0, 0, 0, 0.12));
}
.gallery-frame img, .gallery-frame video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
/* full-width rows with a real image: let the image set the height so there's no empty band */
.gallery-row.is-full .gallery-frame:has(> img, > video) { height: auto; aspect-ratio: auto; padding: 3%; }
.gallery-row.is-full .gallery-frame > img, .gallery-row.is-full .gallery-frame > video { width: 100%; max-height: none; }
/* placeholders until real images arrive */
.gallery-shot.is-wide { width: 100%; max-height: 100%; aspect-ratio: 16 / 10; }
.gallery-shot.is-phone { height: 100%; aspect-ratio: 9 / 19; border-radius: 2.4rem; }
/* quote tile */
.gallery-frame.is-quote blockquote { text-align: left; }
.gallery-frame.is-quote p {
  font-family: var(--font-serif); font-style: italic; font-weight: 450;
  font-size: clamp(2.6rem, 2.4vw, 3.6rem); line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance;
}
.gallery-frame.is-quote footer {
  margin-top: 2rem; font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--secondary);
}
/* caption: mono uppercase */
.gallery-item figcaption, .tour-cover figcaption {
  margin-top: 1.8rem;
  font-family: var(--font-mono); font-size: 1.3rem; line-height: 1.5; letter-spacing: 0.08em; text-transform: uppercase; color: var(--secondary);
}
@media (max-width: 899px) {
  .gallery { gap: 3.2rem; }
  .gallery-row { gap: 3.2rem; }
  .gallery-frame { height: auto; aspect-ratio: 4 / 3; border-radius: 2.4rem; padding: 4%; }
  .gallery-frame.is-quote { aspect-ratio: auto; padding: 4.8rem 2.4rem; }
}

/* Sections alternate background, full width (grey value from the inspiration site) */
:root { --section-grey: #f1f1f1; }
.tour-section {
  position: relative; isolation: isolate;
  margin: 0; padding-block: 9.6rem;
  scroll-margin-top: 4rem;
}
.tour-section:nth-of-type(odd)::before {          /* The problem, The outcome */
  content: ""; position: absolute; z-index: -1;
  top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: var(--section-grey);
}
.tour-rule { display: none; }                      /* the bands now separate the story */
.tour-cover { margin-bottom: 9.6rem; }
.tour-section + .tour-closing { margin-top: 9.6rem; }
@media (max-width: 899px) {
  .tour-section { padding-block: 6.4rem; }
  .tour-cover { margin-bottom: 6.4rem; }
  .tour-section + .tour-closing { margin-top: 6.4rem; }
}

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

/* Next study link at the end of each case study */
.next-study { display: inline-flex; flex-direction: column; gap: 1.2rem; color: var(--primary); }
.next-study-label {
  font-family: var(--font-mono); font-size: 1.3rem; line-height: 1.5;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--tertiary);
}
.next-study-title {
  display: inline-flex; align-items: center; gap: 1.6rem; flex-wrap: wrap;
  font-size: 2.8rem; line-height: 1.25; letter-spacing: -0.01em;
}
.next-study-arrow { flex: none; color: #ff6f3c; transition: transform 0.3s var(--ease-out); }
.next-study:hover .next-study-arrow { transform: translateX(6px); }
.tour-cta .next-study + .note { margin-top: 2.4rem; }
@media (max-width: 599px) {
  .next-study-title { font-size: 2.2rem; gap: 1.2rem; }
}

/* Home page study cards: each gradient ends on the colour the next card starts with */
.work-panel:nth-child(1) .work-asset { --ph: var(--study-1); }
.work-panel:nth-child(2) .work-asset { --ph: var(--study-2); }
.work-panel:nth-child(3) .work-asset { --ph: var(--study-3); }

/* Gallery helpers: square-cornered images, and a taller row */
.gallery-frame img.is-square { border-radius: 0; }
.gallery-row.is-tall { --row-h: clamp(44rem, 52vw, 76rem); }
@media (max-width: 899px) { .gallery-row.is-tall .gallery-frame { aspect-ratio: 4 / 5; } }
/* See-through videos (e.g. a phone recording): no white backing; shadow follows the phone's shape */
.gallery-frame video.is-transparent {
  height: 100%; width: auto; max-width: 100%;
  background: none; box-shadow: none; border-radius: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.06)) drop-shadow(0 16px 32px rgba(0, 0, 0, 0.14));
}

/* No cover image: keep the same space between the intro and the first section */
.tour-hero:has(+ .tour-rule) { margin-bottom: 9.6rem; }
@media (max-width: 899px) { .tour-hero:has(+ .tour-rule) { margin-bottom: 6.4rem; } }

/* --------------------------------------------------------------------------
   Tidbit cards (feature cards that open a dialog) + the dialog itself
   -------------------------------------------------------------------------- */
button.feature-card { width: 100%; text-align: left; border: 1px solid var(--stroke-card); cursor: pointer; }
@media (min-resolution: 2dppx) { button.feature-card { border-width: 0.5px; } }
.feature-card-video { overflow: hidden; background: var(--black); }
.feature-card-video video { display: block; width: 100%; height: 100%; object-fit: cover; }

.tidbit-dialog {
  width: min(96rem, 100vw - 3.2rem); max-width: none; max-height: calc(100svh - 3.2rem);
  margin: auto; padding: 0; border: 0; border-radius: 2.4rem;
  background: var(--background); color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 40px 80px -20px rgba(0, 0, 0, 0.35);
  overflow: auto;
}
.tidbit-dialog::backdrop { background: rgba(20, 16, 12, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tidbit-dialog[open] { animation: tidbit-in 0.35s var(--ease-out); }
.tidbit-dialog[open]::backdrop { animation: tidbit-fade 0.35s var(--ease-out); }
@keyframes tidbit-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes tidbit-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tidbit-dialog[open], .tidbit-dialog[open]::backdrop { animation: none; } }
.tidbit-dialog-inner { position: relative; padding: 1.2rem; }
.tidbit-video { display: block; width: 100%; aspect-ratio: 3090 / 2160; max-height: 52svh; border-radius: 1.6rem; background: var(--black); object-fit: contain; }
.tidbit-body { padding: 3.2rem 2.4rem 2.8rem; }
.tidbit-body h3 {
  margin: 1.6rem 0 1.2rem;
  font-family: var(--font-serif); font-weight: 500; font-size: 3.2rem; line-height: 1.15; letter-spacing: -0.02em;
}
.tidbit-body p { font-size: 1.7rem; line-height: 1.6; color: var(--secondary); }
.tidbit-body p + p { margin-top: 1.2rem; }
.tidbit-close {
  position: absolute; top: 2.4rem; right: 2.4rem; z-index: 2;
  display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--black); box-shadow: var(--shadow-pill);
  transition: transform 0.2s var(--ease-out);
}
.tidbit-close:hover { transform: scale(1.06); }
@media (max-width: 599px) {
  .tidbit-dialog { border-radius: 1.6rem; }
  .tidbit-dialog-inner { padding: 0.8rem; }
  .tidbit-video { border-radius: 1.2rem; }
  .tidbit-body { padding: 2.4rem 1.6rem 2rem; }
  .tidbit-body h3 { font-size: 2.6rem; }
  .tidbit-close { top: 1.6rem; right: 1.6rem; }
}
html:has(.tidbit-dialog[open]) { overflow: hidden; } /* no page scroll behind the dialog */
.feature-card-video img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tidbit-link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.tidbit-image { display: block; width: auto; max-width: 100%; height: auto; max-height: 52svh; margin-inline: auto; border-radius: 1.6rem; }
@media (max-width: 599px) { .tidbit-image { border-radius: 1.2rem; } }

/* Contact section: two buttons side by side (stacked on small phones) */
.closing-lede { max-width: 44ch; font-size: 1.8rem; line-height: 1.5; color: var(--secondary); margin-top: -0.8rem; }
.closing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; width: 100%; max-width: 52rem; }
.closing-actions .pill-cta { flex: 1 1 20rem; width: auto; }
.pill-cta.is-outline { background: transparent; color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.pill-cta.is-outline:hover { background: var(--true-white); box-shadow: inset 0 0 0 1px var(--black), 0 10px 24px -8px rgba(0, 0, 0, 0.2); }

/* Home hero: name on line one, role on line two in the same serif, animated in word by word */
.about-title:has(.about-title-sub) { max-width: none; }
.about-title-line, .about-title-sub { display: block; }
.about-title-sub { margin-top: 0.18em; font-size: 0.62em; line-height: 1.1; color: inherit; } /* same black as the name */
.about-title-sub > span {
  display: inline-block;
  animation: title-word-in 0.9s var(--ease-out) both;
  animation-delay: calc(0.45s + var(--w) * 0.14s);
}
@keyframes title-word-in {
  from { opacity: 0; transform: translateY(0.35em); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) { .about-title-sub > span { animation: none; } }

/* Top colour bands: softer than the raw palette, to match the washed containers */
.about-hero-fade, .tour-topfade { opacity: 0.6; }
@media (min-width: 900px) { .tour-stats.is-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --------------------------------------------------------------------------
   Fork in the road (home hero): two options with the pig in between
   -------------------------------------------------------------------------- */
.fork {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  gap: 2.4rem; max-width: 72rem; margin: 5.6rem auto 0;
  animation: fork-in 0.9s var(--ease-out) 1s both;
}
@keyframes fork-in { from { opacity: 0; transform: translateY(1.6rem); } to { opacity: 1; transform: none; } }
.fork-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 2.8rem 2rem 2.4rem; border-radius: 2.4rem;
  border: 1px solid var(--stroke-medium); background: rgba(255, 255, 255, 0.55);
  text-align: center; color: var(--primary);
  transition: transform 0.35s var(--ease-out), background-color 0.3s, box-shadow 0.35s var(--ease-out);
}
.fork-option:hover, .fork-option:focus-visible {
  transform: translateY(-4px); background: var(--true-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 20px 40px -18px rgba(0, 0, 0, 0.22);
}
.fork-label { font-family: var(--font-serif); font-weight: 500; font-size: 2.6rem; line-height: 1.15; letter-spacing: -0.02em; }
.fork-sub { font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tertiary); }

/* the little piles: three items fanned, spreading a bit more on hover */
.fork-stack { position: relative; display: block; width: 100%; height: 9rem; margin-bottom: 1.6rem; }
.fork-stack > * {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(calc(-50% + var(--n) * 2.6rem)) rotate(calc(var(--n) * 7deg));
  transform-origin: 50% 100%;
  transition: transform 0.45s var(--ease-out);
}
.fork-option:hover .fork-stack > *, .fork-option:focus-visible .fork-stack > * {
  transform: translateX(calc(-50% + var(--n) * 4.2rem)) rotate(calc(var(--n) * 11deg)) translateY(calc(var(--n) * var(--n) * 0.4rem - 0.6rem));
}
.fork-stack.is-work > img {
  width: 11rem; height: 7.4rem; object-fit: cover; object-position: top;
  border-radius: 0.8rem; background: var(--true-white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 18px -8px rgba(0, 0, 0, 0.3);
}
.fork-stack.is-cards > svg {
  width: 5.6rem; height: 7.8rem; border-radius: 0.6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 18px -8px rgba(0, 0, 0, 0.3);
}

/* the pig: pupils move with --px / --py (set in main.js), and it blinks now and then */
.fork-pig { display: block; width: 10rem; }
.fork-pig-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pig-pupil { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform 0.25s var(--ease-out); }
.pig-eye { transform-box: fill-box; transform-origin: center; animation: pig-blink 5s infinite 2.4s; }
@keyframes pig-blink { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(0.1); } }

@media (max-width: 599px) {
  .fork { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 1.2rem; margin-top: 3.6rem; }
  .fork-sub { font-size: 1.1rem; letter-spacing: 0.06em; text-wrap: balance; }
  .fork-pig { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: 7.2rem; margin-bottom: 0.4rem; }
  .fork-option { padding: 2rem 1.2rem 1.8rem; border-radius: 1.8rem; }
  .fork-label { font-size: 2rem; }
  .fork-stack { height: 6.6rem; margin-bottom: 1.2rem; }
  .fork-stack > * { transform: translateX(calc(-50% + var(--n) * 1.6rem)) rotate(calc(var(--n) * 7deg)); }
  .fork-stack.is-work > img { width: 8rem; height: 5.4rem; }
  .fork-stack.is-cards > svg { width: 4.2rem; height: 5.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .fork { animation: none; }
  .pig-eye { animation: none; }
  .pig-pupil, .fork-stack > *, .fork-option { transition: none; }
}
/* hint now sits above the fan */
.fact-deck .section-head { margin-bottom: 1.6rem; }
.fact-hint { margin: 0 0 1.6rem; }

/* Home page: sections alternate cream / grey like the case studies
   (hero cream > work grey > side quests cream > get to know me grey > contact cream) */
.work { position: relative; isolation: isolate; margin-block: 0 !important; padding-block: 9.6rem; }
.work::before {
  content: ""; position: absolute; z-index: -1;
  top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: var(--section-grey);
}
.features { margin-block: 0 !important; padding-block: 9.6rem; }
.fact-deck { background: var(--section-grey); padding-block: 9.6rem; }
@media (max-width: 799px) {
  .work, .features, .fact-deck { padding-block: 6.4rem; }
}
/* Tidbit cards: pill on the left, small logo on the right */
.feature-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; }
.feature-card-logo { flex: none; width: 3.2rem; height: 3.2rem; border-radius: 0.8rem; object-fit: cover; }

/* Home hero fills the first screen, with the name and fork centred in it */
.about-hero#top {
  min-height: 100svh; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 9.6rem; padding-bottom: 6.4rem;
}
.about-hero#top .about-hero-inner { width: 100%; }
.footer-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s; }
.footer-link:hover { color: var(--primary); }

/* Home hero band: the pig's maroon (#661B29) as a deep shade at the top, easing into apricot then sky */
:root { --c-maroon: #661b29; }
#top .about-hero-fade {
  --ph: linear-gradient(180deg, color-mix(in srgb, var(--c-maroon) 55%, var(--c-apricot)) 0%, var(--c-apricot) 45%, var(--c-sky) 100%);
  opacity: 0.7;
}

/* Fork: more breathing room so the piles don't feel squeezed */
@media (min-width: 600px) {
  .fork { max-width: 84rem; gap: 3.2rem; }
  .fork-option { padding: 4rem 2.4rem 3.2rem; gap: 0.8rem; }
  .fork-stack { height: 12rem; margin-bottom: 2.8rem; }
  .fork-stack.is-work > * { --spread: 4.4rem; }
  .fork-stack.is-cards > * { --spread: 3.8rem; }
  .fork-stack > * { transform: translateX(calc(-50% + var(--n) * var(--spread))) rotate(calc(var(--n) * 6deg)); }
  .fork-option:hover .fork-stack > *, .fork-option:focus-visible .fork-stack > * {
    transform: translateX(calc(-50% + var(--n) * var(--spread) * 1.45)) rotate(calc(var(--n) * 9deg)) translateY(calc(var(--n) * var(--n) * 0.4rem - 0.6rem));
  }
  .fork-stack.is-work > img { width: 13rem; height: 9.8rem; border-radius: 1rem; } /* 4:3, so less of each screen is cropped */
  .fork-stack.is-cards > svg { width: 7rem; height: 9.8rem; border-radius: 0.7rem; }
  .fork-pig { width: 11rem; }
}

/* Pig sits centred below the two options (all screen sizes) */
.fork { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fork-pig { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin: 1.2rem 0 0; }
@media (min-width: 600px) { .fork { max-width: 76rem; } .fork-pig { width: 9rem; } }
/* Home hero band reaches as far down as the case study bands */
#top .about-hero-fade {
  height: 34rem;
  -webkit-mask-image: linear-gradient(#000 0%, #000 30%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 30%, transparent 100%);
}
/* lighter maroon, and the band reaches a little further down */
#top .about-hero-fade {
  --ph: linear-gradient(180deg, color-mix(in srgb, var(--c-maroon) 30%, var(--c-apricot)) 0%, var(--c-apricot) 50%, var(--c-sky) 100%);
  height: 46rem;
}
/* Fork options: portrait cards */
.fork-option { justify-content: center; aspect-ratio: 4 / 5; }
@media (min-width: 600px) { .fork { max-width: 60rem; } .fork-option { padding: 3.2rem 2rem; } }
@media (max-width: 599px) { .fork-option { aspect-ratio: 3 / 4; } }
@media (min-width: 600px) { .fork { max-width: min(60rem, (100svh - 40rem) * 1.6); } }
/* piles scale with their card, so they never spill over the edges */
@media (min-width: 600px) {
  .fork-option { container-type: inline-size; }
  .fork-stack { height: 40cqw; margin-bottom: 9cqw; }
  .fork-stack.is-work > * { --spread: 15cqw; }
  .fork-stack.is-cards > * { --spread: 13cqw; }
  .fork-stack.is-work > img { width: 46cqw; height: 34.5cqw; }
  .fork-stack.is-cards > svg { width: 24cqw; height: 33.6cqw; }
}
@media (min-width: 600px) and (max-height: 780px) {
  .about-hero#top { padding-top: 8rem; padding-bottom: 3.2rem; }
  .fork { margin-top: 3.2rem; }
  .fork-pig { width: 7.2rem; margin-top: 0.8rem; }
}
/* Fit name + options + pig inside one screen on any laptop height */
@media (min-width: 600px) {
  .about-hero#top { padding-top: clamp(7.2rem, 11svh, 9.6rem); padding-bottom: clamp(2.4rem, 4svh, 6.4rem); }
  .fork { margin-top: clamp(2.4rem, 4.5svh, 5.6rem); max-width: min(60rem, (100svh - 47rem) * 1.6); }
  .fork-pig { width: clamp(6.4rem, 9svh, 9rem); margin-top: clamp(0.4rem, 1.5svh, 1.2rem); }
}

/* Fork with three options (work, how I work, about) */
.fork { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fork-pig { grid-row: 2; grid-column: 1 / -1; }
.fork-stack.is-how > img {
  object-fit: cover; object-position: center;
  border-radius: 0.8rem; background: var(--true-white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 18px -8px rgba(0, 0, 0, 0.3);
}
@media (min-width: 600px) {
  .fork { max-width: min(90rem, (100svh - 47rem) * 2.4); gap: 2.4rem; }
  .fork-stack.is-how > * { --spread: 15cqw; }
  .fork-stack.is-how > img { width: 46cqw; height: 34.5cqw; }
}
@media (max-width: 599px) {
  .fork { gap: 0.8rem; }
  .fork-option { aspect-ratio: auto; padding: 1.6rem 0.8rem 1.4rem; border-radius: 1.4rem; }
  .fork-label { font-size: 1.6rem; }
  .fork-sub { font-size: 1rem; }
  .fork-stack { height: 5.2rem; margin-bottom: 1rem; }
  .fork-stack > * { transform: translateX(calc(-50% + var(--n) * 1.1rem)) rotate(calc(var(--n) * 7deg)); }
  .fork-stack.is-work > img, .fork-stack.is-how > img { width: 6rem; height: 4.4rem; border-radius: 0.5rem; }
  .fork-stack.is-cards > svg { width: 3.2rem; height: 4.5rem; }
}

/* Phones: the three options become full-width rows (pile left, text right, arrow), pig on top */
@media (max-width: 599px) {
  .fork { grid-template-columns: 1fr; gap: 1rem; margin-top: 3.2rem; max-width: 42rem; }
  .fork-pig { grid-row: 4; width: 7.2rem; margin: 1.6rem 0 0; } /* pig always sits below the options */
  .fork-option {
    display: grid; grid-template-columns: 9.6rem 1fr auto; grid-template-rows: auto auto;
    align-items: center; column-gap: 1.6rem; row-gap: 0.2rem;
    aspect-ratio: auto; padding: 1.4rem 1.8rem 1.4rem 1.4rem; border-radius: 1.6rem;
    text-align: left;
  }
  .fork-option::after { content: "→"; grid-column: 3; grid-row: 1 / 3; color: var(--tertiary); font-size: 1.8rem; }
  .fork-stack { grid-column: 1; grid-row: 1 / 3; width: 9.6rem; height: 6.4rem; margin: 0; }
  .fork-label { grid-column: 2; grid-row: 1; align-self: end; font-size: 2.2rem; }
  .fork-sub { grid-column: 2; grid-row: 2; align-self: start; font-size: 1.1rem; letter-spacing: 0.1em; }
  .fork-stack > * { transform: translateX(calc(-50% + var(--n) * 1.8rem)) rotate(calc(var(--n) * 7deg)); }
  .fork-stack.is-work > img, .fork-stack.is-how > img { width: 6.4rem; height: 4.8rem; border-radius: 0.6rem; }
  .fork-stack.is-cards > svg { width: 3.8rem; height: 5.3rem; border-radius: 0.4rem; }
}

/* Floating back-to-top button */
.to-top {
  position: fixed; right: 2.4rem; bottom: 2.4rem; z-index: 50;
  display: grid; place-items: center; width: 4.8rem; height: 4.8rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--black);
  border: 1px solid rgba(0, 0, 0, 0.08); box-shadow: var(--shadow-pill);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(1.2rem); pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 12px 24px -10px rgba(0, 0, 0, 0.25); }
.fact-takeover .to-top, html:has(.tidbit-dialog[open]) .to-top { opacity: 0; pointer-events: none; }
@media (max-width: 599px) { .to-top { right: 1.6rem; bottom: 1.6rem; width: 4.4rem; height: 4.4rem; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
/* Home header band: the cream from the tarot card's diamond, no maroon */
:root { --c-card-cream: #eecdc0; }
#top .about-hero-fade {
  --ph: linear-gradient(180deg, var(--c-card-cream) 0%, color-mix(in srgb, var(--c-card-cream) 60%, var(--background)) 55%, var(--background) 100%);
  opacity: 1;
}
/* Header band, cleaner: fade the card cream through its own lighter tint (no muddy mix with the
   yellow page background), warm grain instead of black, and solid option cards */
#top .about-hero-fade {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .11 0 0 0 0 .16 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E") 0 0 / 160px 160px,
    linear-gradient(180deg, #eecdc0 0%, #f4ddd3 45%, rgba(251, 240, 234, 0) 100%);
}
#top .fork-option { background: #fffdfb; }
#top .fork-option:hover, #top .fork-option:focus-visible { background: var(--true-white); }
/* Phone rows: label centred vertically (no sub line any more), and a gentle hover that stays inside the row */
@media (max-width: 599px) {
  .fork-option { grid-template-rows: 1fr; }
  .fork-label { grid-row: 1; align-self: center; }
  .fork-stack, .fork-option::after { grid-row: 1; }
  .fork-option:hover .fork-stack > *, .fork-option:focus-visible .fork-stack > * {
    transform: translateX(calc(-50% + var(--n) * 2.2rem)) rotate(calc(var(--n) * 9deg)) translateY(-0.2rem);
  }
}
/* Phone rows: centre each pile vertically on the row, in line with its label */
@media (max-width: 599px) {
  .fork-stack { align-self: center; height: 5.4rem; }
  .fork-stack > * { bottom: auto; top: 50%; transform-origin: 50% 50%;
    transform: translate(calc(-50% + var(--n) * 1.8rem), -50%) rotate(calc(var(--n) * 7deg)); }
  .fork-option:hover .fork-stack > *, .fork-option:focus-visible .fork-stack > * {
    transform: translate(calc(-50% + var(--n) * 2.2rem), -50%) rotate(calc(var(--n) * 9deg));
  }
}

/* --------------------------------------------------------------------------
   Loading skeletons: a soft shimmer while images, videos and embeds load.
   main.js adds .is-loading and takes it off once each one is ready.
   -------------------------------------------------------------------------- */
:root {
  --skeleton-base: rgba(0, 0, 0, 0.06);
  --skeleton-sheen: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
}
img.is-loading, video.is-loading {
  background: var(--skeleton-sheen) 150% 0 / 200% 100% no-repeat, var(--skeleton-base) !important;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
  color: transparent; /* hides the alt text until the image arrives */
}
@keyframes skeleton-sweep { from { background-position: 150% 0; } to { background-position: -50% 0; } }
/* on the black card previews, a lighter base so the shimmer still shows */
.feature-card-video .is-loading { --skeleton-base: rgba(255, 255, 255, 0.08); }
/* images fade in once they've loaded */
img.is-loaded { animation: media-in 0.5s var(--ease-out); }
@keyframes media-in { from { opacity: 0; } }

/* Until an image loads its size isn't known, so fill the space it'll sit in */
.gallery-frame img.is-loading, .work-asset > img.is-loading { width: 100%; height: 100%; }
.tidbit-image.is-loading { width: 100%; }
.gallery-frame video.is-transparent.is-loading { width: auto; border-radius: 3.2rem; } /* phone-shaped */

/* Shimmer laid over a box: the YouTube player starting up, a dialog video buffering */
.tidbit-media { position: relative; border-radius: 1.6rem; overflow: hidden; }
.video-embed.is-loading::after, .tidbit-media.is-loading::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--skeleton-sheen) 150% 0 / 200% 100% no-repeat;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
}
.video-embed.is-loading::after { background-color: rgba(255, 255, 255, 0.06); }
@media (max-width: 599px) { .tidbit-media { border-radius: 1.2rem; } }

/* Home: the menu stays out of the way on the hero and slides in once you've
   scrolled past it (main.js toggles .is-tucked on [data-hide-on-hero]) */
.site-header { transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0s; }
.site-header.is-tucked {
  opacity: 0; visibility: hidden; transform: translateY(-1.2rem);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0s 0.3s;
}

/* --------------------------------------------------------------------------
   Home: "Other case studies" under the main three. Smaller, quieter tiles:
   a thumbnail on the study's gradient, then company, title and one line.
   -------------------------------------------------------------------------- */
.other-studies { margin-top: 8rem; padding-inline: 0.4rem; }
.other-studies-title {
  margin-bottom: 2.4rem;
  font-family: var(--font-mono); font-size: 1.3rem; font-weight: 400; line-height: 1.5;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--tertiary);
}
.other-studies-grid { display: grid; gap: 1.6rem; }
.other-study {
  display: flex; align-items: center; gap: 2rem;
  padding: 1.2rem; border-radius: 2rem;
  background: rgba(255, 255, 255, 0.6); border: 1px solid var(--stroke-card); /* sits on the grey band */
  transition: background-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.other-study:hover { transform: translateY(-2px); background: var(--true-white); box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.25); }
.other-study-thumb {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 42%; aspect-ratio: 4 / 3; padding: 6%;
  border-radius: 1.2rem; overflow: hidden;
  background: var(--noise) 0 0 / 160px 160px, linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)), var(--ph);
}
.other-study-thumb img {
  max-width: 100%; max-height: 100%; border-radius: 0.6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 20px -10px rgba(0, 0, 0, 0.25);
}
.other-study-body { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; padding-right: 1.2rem; }
.other-study-name {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 2rem; line-height: 2.6rem; letter-spacing: -0.02em; color: var(--primary);
}
.other-study-desc { font-size: 1.4rem; line-height: 2rem; color: var(--secondary); }
@media (min-width: 800px) {
  .other-studies { margin-top: 10rem; }
  .other-studies-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 479px) {
  .other-study { flex-direction: column; align-items: stretch; }
  .other-study-thumb { width: 100%; }
  .other-study-body { padding: 0.4rem 0.8rem 0.8rem; }
}

/* A quote on its own row: size to the text rather than the tall full-row height */
.gallery-row.is-full .gallery-frame.is-quote { height: auto; padding: 8rem 10%; }

/* --------------------------------------------------------------------------
   Home hero, after diabrowser.com/apps: a short colour band at the very top
   that washes out to white with an eased radial fade, a big serif name, and
   the role as a lighter serif subtitle with real space under the name.
   -------------------------------------------------------------------------- */
#top .about-hero-fade {
  height: 14rem;
  -webkit-mask-image: radial-gradient(ellipse 180% 100% at 50% 0%, #000 20%, rgba(0, 0, 0, 0.98) 30%, rgba(0, 0, 0, 0.9) 40%, rgba(0, 0, 0, 0.72) 50%, rgba(0, 0, 0, 0.48) 60%, rgba(0, 0, 0, 0.23) 70%, rgba(0, 0, 0, 0.06) 80%, transparent 88%);
  mask-image: radial-gradient(ellipse 180% 100% at 50% 0%, #000 20%, rgba(0, 0, 0, 0.98) 30%, rgba(0, 0, 0, 0.9) 40%, rgba(0, 0, 0, 0.72) 50%, rgba(0, 0, 0, 0.48) 60%, rgba(0, 0, 0, 0.23) 70%, rgba(0, 0, 0, 0.06) 80%, transparent 88%);
}
#top .about-title { font-weight: 550; font-size: 4rem; line-height: 3.8rem; letter-spacing: -0.02em; }
#top .about-title-sub {
  margin-top: 1.6rem;
  font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em;
  font-size: 1.8rem; line-height: 2.4rem; color: rgba(0, 0, 0, 0.65);
}
@media (min-width: 600px) {
  #top .about-title { font-size: 6.4rem; line-height: 6.7rem; }
  #top .about-title-sub { margin-top: 2.3rem; font-size: 2.1rem; line-height: 2.8rem; }
}
@media (min-width: 1000px) {
  #top .about-hero-fade { height: 20rem; }
  #top .about-title { font-size: 9.6rem; line-height: 10rem; }
  #top .about-title-sub { margin-top: 4.1rem; font-size: 2.6rem; line-height: 3.4rem; }
  /* the taller name leaves a little less room for the fork cards */
  .fork { max-width: min(90rem, (100svh - 53rem) * 2.4); }
}

/* Three tiles in one row (e.g. customer quotes); stacks on phones like the other rows */
@media (min-width: 900px) {
  .gallery-row.is-1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.gallery-row.is-1-1-1 .gallery-frame.is-quote { height: 100%; aspect-ratio: auto; padding: 4.8rem 3.2rem; }
.gallery-row.is-1-1-1 .gallery-frame.is-quote p { font-size: clamp(2.2rem, 1.8vw, 2.8rem); }

/* Project 04 (PDF Overlay) on the home page uses its case study's gradient */
.work-panel:nth-child(4) .work-asset { --ph: var(--study-5); }

/* Home work panels can hold a looping video instead of an image (e.g. PDF Overlay) */
.work-asset:has(> video) { display: flex; align-items: center; justify-content: center; padding: 3.5%; }
.work-asset > video {
  display: block; max-width: 100%; max-height: 100%;
  border-radius: 0.8rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.22);
}

/* The pig now sits at the bottom of the home page, under the contact buttons.
   Overrides the old hero sizing rules for .fork-pig. */
.closing .fork-pig { width: 9rem; margin: 4.8rem auto 0; justify-self: auto; }
@media (max-width: 599px) { .closing .fork-pig { width: 7.2rem; margin-top: 4rem; } }

/* Home tagline is a full sentence: keep it to a readable width, balance the lines,
   and bring the words in faster so the whole line lands in about a second */
#top .about-title-sub { max-width: 46ch; margin-inline: auto; text-wrap: balance; } /* two lines on tablet and desktop */
#top .about-title-sub > span { animation-delay: calc(0.45s + var(--w) * 0.05s); }

/* Home: nudge the name (and everything under it) a little further down the hero */
#top .about-title { margin-top: 2.4rem; }
@media (min-width: 1000px) { #top .about-title { margin-top: 4rem; } }

/* ---------------------------------------------------------------------------
   Locked case studies (added by main.js): lock tag on the card, passcode dialog
   --------------------------------------------------------------------------- */
.work-asset { position: relative; }
.lock-badge {
  position: absolute; top: 1.6rem; left: 1.6rem; z-index: 1;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1.2rem 0.6rem 1rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 6px 16px -8px rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono); font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary);
}
.lock-badge svg, .work-more svg { flex: none; }
@media (min-width: 800px) { .lock-badge { top: 2.4rem; left: 2.4rem; } }

#locked-dialog { max-width: min(46rem, calc(100vw - 3.2rem)); }
.lock-simple { padding: 4.8rem 3.2rem 3.2rem; text-align: center; }
.lock-pig { display: block; width: 8.8rem; height: auto; margin: 0 auto 2rem; }
.lock-simple h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 3rem; line-height: 1.15; letter-spacing: -0.02em; color: var(--primary);
}
.lock-simple p { max-width: 30ch; margin: 1.2rem auto 0; font-size: 1.7rem; line-height: 1.5; color: var(--secondary); }
.lock-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2.8rem; }
.lock-actions .pill-cta { width: auto; flex: 1 1 auto; height: 4.8rem; padding-inline: 2.4rem; white-space: nowrap; } /* labels stay on one line */
/* Passcode entry: quieter than the buttons, under a hairline */
.lock-form { margin-top: 2.8rem; padding-top: 2.4rem; border-top: 1px solid var(--stroke-card); text-align: left; }
.lock-form-label { display: block; margin-bottom: 1rem; font-size: 1.4rem; color: var(--secondary); text-align: center; }
.lock-form-row { display: flex; gap: 0.8rem; }
.lock-form-row input {
  flex: 1; min-width: 0; height: 4.4rem; padding: 0 1.6rem; border-radius: 999px;
  border: 1px solid var(--stroke-card); background: var(--true-white); font: inherit; font-size: 1.5rem;
}
.lock-form-row input:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.lock-form-row button {
  flex: none; height: 4.4rem; padding: 0 2rem; border-radius: 999px;
  background: var(--black); color: var(--true-white); font-size: 1.4rem; font-weight: 500;
}
/* Copy button keeps its width when the label swaps to "Copied ✓": an invisible copy of
   the longer label sits in the same spot and sets the size */
.lock-actions [data-copy-email] { display: inline-grid; place-items: center; }
.lock-actions [data-copy-email] > span { grid-area: 1 / 1; }
.copy-sizer { visibility: hidden; }
.lock-simple .lock-form-note { max-width: none; margin-top: 1rem; font-size: 1.3rem; color: var(--c-maroon); text-align: center; }
@media (max-width: 599px) { .lock-simple { padding: 4rem 1.6rem 2rem; } .lock-simple h3 { font-size: 2.6rem; } }

/* 404 page: the closing section, filling the screen */
.not-found { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.not-found .mono-index { margin-bottom: 1.6rem; }
.not-found .closing-actions .pill-cta { width: auto; padding-inline: 3.2rem; }
