/* ==========================================================================
   Isodesic — styles.css
   The main stylesheet, shared by every page. Project pages add projects.css.
   One breakpoint, 900px: each section ends with its own phone rules.
   Sections:   1 settings     2 base         3 nav            4 hero
               5 photo credits                6 section layout 7 work
               8 services     9 process      10 expertise     11 expert witness
              12 about       13 contact      14 footer        15 motion
   ========================================================================== */

@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* 1 — settings ----------------------------------------------------------- */
:root {
  /* the six blues of the Isodesic logo, lightest to darkest */
  --very-light-blue: #c2dbf2;
  --light-blue:      #9bc6e9;
  --medium-blue:     #6bb0e1;
  --blue:            #1a9ad6;   /* previous main brand blue (was the theme-color in each page's <head>) */
  --dark-blue:       #0883c6;   /* main brand blue (also the theme-color in each page's <head>) */
  --very-dark-blue:  #016baf;   /* links and small blue text */

  --ink:         #33383d;
  --ink-soft:    #5a6066;
  --ink-faint:   #6f757b;
  --paper:       #fdfdfc;
  --paper-tint:  #f4f7f9;
  --rule:        #e9ebed;
  --white:       #fff;
  --label:       var(--blue);   /* small mono labels (.label) */

  --sans: Figtree, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* type sizes: every font size uses one of these (phone sizes below) */
  --text-xs:   12px;   /* mono labels, photo credits */
  --text-sm:   15px;   /* nav, card text, stats, footer */
  --text-md:   17px;   /* body text, photo captions */
  --text-lg:   19px;   /* intro text, hero paragraph */
  --text-xl:   22px;   /* tile and step headings, lead paragraphs, quotes */
  --text-2xl:  30px;   /* section titles, process numbers */
  --text-3xl:  44px;   /* contact heading, expert witness stats */
  --text-4xl:  64px;   /* hero headline */

  /* camera icon for photo credits: Bootstrap Icons "camera" (MIT license) */
  --camera-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M15 12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.172a3 3 0 0 0 2.12-.879l.83-.828A1 1 0 0 1 6.827 3h2.344a1 1 0 0 1 .707.293l.828.828A3 3 0 0 0 12.828 5H14a1 1 0 0 1 1 1zM2 4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-1.172a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 9.172 2H6.828a2 2 0 0 0-1.414.586l-.828.828A2 2 0 0 1 3.172 4z'/%3E%3Cpath d='M8 11a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5m0 1a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7M3 6.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0'/%3E%3C/svg%3E");

  /* LinkedIn "in" logo for the nav (34 × 34), filled with the link color like the camera icon */
  --linkedin-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 34'%3E%3Cpath d='M34,2.5v29c0,1.38-1.12,2.5-2.5,2.5H2.5c-1.38,0-2.5-1.12-2.5-2.5V2.5C0,1.12,1.12,0,2.5,0h29c1.38,0,2.5,1.12,2.5,2.5M10,13h-5v16h5V13ZM10.45,7.5c.01-1.59-1.27-2.89-2.86-2.9,0,0,0,0,0,0h-.09c-1.6,0-2.9,1.3-2.9,2.9,0,1.6,1.3,2.9,2.9,2.9,1.59.04,2.91-1.22,2.95-2.81,0,0,0,0,0,0v-.09ZM29,19.28c0-4.81-3.06-6.68-6.1-6.68-2.03-.1-3.95.88-5.06,2.58h-.14v-2.18h-4.7v16h5v-8.51c-.15-1.81,1.19-3.41,3-3.58h.19c1.59,0,2.77,1,2.77,3.52v8.57h5l.04-9.72Z'/%3E%3C/svg%3E");

  /* email icon for the phone nav: Bootstrap Icons "envelope" (MIT license) */
  --envelope-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1zm13 2.383-4.708 2.825L15 11.105zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741M1 11.105l4.708-2.897L1 5.383z'/%3E%3C/svg%3E");
}
@media (max-width: 900px) {
  :root {
    --text-lg:  17px;
    --text-xl:  20px;
    --text-2xl: 26px;
    --text-3xl: 30px;
    --text-4xl: 38px;
  }
}

/* 2 — base --------------------------------------------------------------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 1440px; margin: 0 auto; }

a { color: var(--very-dark-blue); text-decoration: none; }
a:hover { color: var(--blue); }

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; font-size: var(--text-md); line-height: 1.6; color: var(--ink-soft); }
figure, blockquote, dl, dd { margin: 0; }
:where(ul, ol)[class] { margin: 0; padding: 0; list-style: none; }   /* lists with a class are styled; a plain <ul> keeps its bullets */
img { display: block; }

/* intro paragraph at the top of a section's content */
.intro {
  margin: 0 0 28px;
  max-width: 720px;
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

/* larger opening paragraph (Expert witness, About) */
.lead {
  margin: 0 0 18px;
  max-width: 720px;
  font-size: var(--text-xl);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}

/* small mono labels: section numbers, kickers, fact headings, table headings.
   Type them in normal case; CSS shows them in capitals. */
.label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}
.label-muted { color: var(--ink-faint); }

.btn {
  background: var(--dark-blue);
  color: var(--white);
  border-radius: 24px;
  padding: 10px 20px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--blue); color: var(--white); }
.btn-lg { display: inline-block; font-size: var(--text-lg); padding: 16px 34px; border-radius: 28px; }

/* grey striped stand-in for a missing photo, with an optional caption in a <span> */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, var(--paper-tint) 0 10px, var(--rule) 10px 20px);
}
.ph span {
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* visible only to screen readers */
.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;
}

/* keyboard users: jump straight past the nav */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--blue);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: var(--white); }

/* focus ring for keyboard users (not shown on mouse clicks) */
a:focus-visible, label:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--very-dark-blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.hero a:focus-visible, .sec-dark a:focus-visible { outline-color: var(--white); }

@media (max-width: 900px) {
  /* "pretty" wrapping is off on phones: Safari evens out every line and pulls the right edge in */
  .intro { margin-bottom: 20px; max-width: none; text-wrap: wrap; }
  .btn-lg { display: block; }
}

/* 3 — nav ---------------------------------------------------------------- */
/* One list of links for both layouts. On phones it becomes the menu that the
   burger opens: a CSS-only toggle (the hidden checkbox), no JavaScript needed. */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  background: rgba(253, 253, 252, 0.97);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow 0.25s ease;
}
.nav.is-scrolled { box-shadow: 0 1px 16px rgba(20, 40, 60, 0.09); }   /* class added by motion.js */

.nav-logo { display: flex; align-items: center; height: 68px; }   /* sets the bar height */
.nav-logo img { height: 44px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 32px);   /* shrinks on narrow windows so the links stay on one line */
  font-size: var(--text-sm);
  font-weight: 500;
}
.nav-links a { color: var(--ink); white-space: nowrap; }
.nav-links a:hover { color: var(--blue); }
.nav-links a.is-active { color: var(--very-dark-blue); }

/* text links: color fade, plus an underline that grows from the left */
.nav-links a:not(.btn) { position: relative; transition: color 0.2s ease; }
.nav-links a:not(.btn, .nav-social)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }

/* LinkedIn: the --linkedin-icon shape (section 1) filled with the link color, so the HTML is just the link */
.nav-links .nav-social { display: flex; color: var(--ink-soft); margin-right: -8px; }
.nav-links .nav-social:hover { color: var(--dark-blue); }
.nav-social::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--linkedin-icon) center / contain no-repeat;
          mask: var(--linkedin-icon) center / contain no-repeat;
}
/* Email icon, phones only (shown in the phone rules below): a shortcut to the contact section, left of the burger */
.nav-email { display: none; margin: 0 6px 0 auto; padding: 10px; color: var(--dark-blue); transition: color 0.2s ease; }   /* 44px tap target, 6px from the burger's */
.nav-email:hover { color: var(--blue); }
.nav-email::before {
  content: "";
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--envelope-icon) center / contain no-repeat;
          mask: var(--envelope-icon) center / contain no-repeat;
}

.nav-links .btn, .nav-links .btn:hover { color: var(--white); }

/* phone menu toggle: the checkbox holds the open/closed state, the burger is its label */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 14px 9px;    /* 44px tap target */
  margin-right: -9px;   /* the lines line up with the 20px page edge */
  cursor: pointer;
}
.nav-burger span { display: block; width: 26px; height: 2px; background: var(--ink); transition: transform 0.25s ease, opacity 0.2s ease; }
/* the burger turns into an X while the menu is open */
.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Windows high-contrast mode blanks backgrounds, which would hide the icons and burger lines (all drawn with
   background): icons in the system link color, like the other links; the burger in the system text color */
@media (forced-colors: active) {
  .nav-social::before, .nav-email::before { forced-color-adjust: none; background: LinkText; }
  .nav-burger span { forced-color-adjust: none; background: CanvasText; }
}

@media (max-width: 900px) {
  .nav { padding: 0 20px; }
  .nav-logo { height: 60px; }
  .nav-logo img { height: 40px; }
  .nav-email { display: flex; }
  .nav-burger { display: flex; }

  /* the menu: one link per row across the full width; "Get in touch" and LinkedIn share the last row */
  .nav-links {
    display: none;
    flex-basis: calc(100% + 40px);
    margin: 0 -20px;
    grid-template-columns: 1fr auto;
    gap: 0;
    border-top: 1px solid var(--rule);
    font-size: var(--text-md);
  }
  .nav-toggle:checked ~ .nav-links { display: grid; }
  .nav-links a { grid-column: 1 / -1; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
  .nav-links a::after { display: none; }
  .nav-links .btn, .nav-links .btn:hover {
    grid-column: 1;
    order: 1;
    border-bottom: 0;
    border-radius: 0;
    background: none;
    color: var(--very-dark-blue);
  }
  .nav-links .nav-social { grid-column: 2; order: 2; align-items: center; margin: 0; border-bottom: 0; }
}

/* 4 — hero --------------------------------------------------------------- */
/* Photo box: 1440 × 810 (16:9) on desktop, shorter to fit laptop windows below
   the 68px nav, and full width × 580 on phones. Export landing photos at 2400 × 1350;
   narrower screens crop the sides, keeping each photo's --focus point in frame.
   The landing page has a slideshow; project pages use the same markup with one photo:
   the project's 3:2 Work card photo (2400 × 1600), which also crops top and bottom on
   desktop. E.g. --focus: 38% 100% keeps its bottom edge; phones crop the sides around 38%. */
.hero {
  position: relative;
  height: 810px;   /* fallback for older browsers */
  height: clamp(480px, calc(100svh - 68px), 810px);
  padding: 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ink);   /* so the white text reads before the photo loads */
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--scrim, 0.2));   /* darkens the photo: 20% black, or use style="--scrim: 0.1" in the HTML */
}
.hero-text { position: relative; max-width: 900px; }
.hero h1 {
  margin: 0 0 20px;
  font-size: var(--text-4xl);
  line-height: 1.08;
  color: var(--white);
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.hero p {
  margin: 0 auto;
  max-width: 620px;
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--paper-tint);
  text-wrap: pretty;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 0 12px rgba(0, 0, 0, 0.35);   /* readable over busy rock and trees */
}
/* the text drifts up and fades in on load ("rise" is in section 15) */
.hero-text > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero h1 { animation-delay: 0.15s; }
.hero p { animation-delay: 0.28s; }

/* Photos stack on top of each other; motion.js moves .is-current and builds the dots.
   Photos after the first stay hidden (and, with loading="lazy", not downloaded) until
   motion.js queues them one at a time, after the first has loaded. */
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);   /* crop point: style="--focus: X% Y%" on the <img> */
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-slide.is-current { opacity: 1; }
.hero-slide:not(.is-current):not(.is-queued) { display: none; }

/* dots + pause button, bottom center */
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}
.hero-dots button {
  width: 28px;   /* tap target around a small mark */
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-dots button:focus-visible { outline: 2px solid var(--white); outline-offset: 0; border-radius: 6px; }
.hero-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  transition: width 0.3s ease, background-color 0.3s ease;
}
.hero-dot:hover::before { background: rgba(255, 255, 255, 0.8); }
.hero-dot[aria-current="true"]::before { width: 22px; background: var(--white); }

/* pause: two bars. play: a triangle. */
.hero-pause::before,
.hero-pause::after { content: ""; width: 3px; height: 10px; margin: 0 1.5px; background: rgba(255, 255, 255, 0.85); }
.hero-pause[aria-pressed="true"]::before {
  width: 0;
  height: 0;
  margin: 0 0 0 2px;
  background: none;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.85);
}
.hero-pause[aria-pressed="true"]::after { display: none; }

@media (max-width: 900px) {
  .hero { height: 580px; padding: 0 32px; } /* was padding: 0 20px; */
}

/* 5 — photo credits ------------------------------------------------------ */
/* data-credit="Name" on an <img> shows a camera icon and the name in the photo's
   lower right. Hero: desktop only, filled in by motion.js as the photos change.
   Other photos: motion.js wraps the <img> in .photo-frame and adds .photo-credit
   (smaller, with a tight dark shadow so it reads even on white product shots). */
.hero-credit,
.photo-credit {
  position: absolute;
  right: 18px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper-tint);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hero-credit.is-shown { opacity: 0.85; }
.hero-credit::before,
.photo-credit::before {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: var(--camera-icon) center / contain no-repeat;
          mask: var(--camera-icon) center / contain no-repeat;
}

.photo-frame { position: relative; display: block; }
.photo-credit {
  right: 10px;
  bottom: 8px;
  gap: 5px;
  color: var(--white);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7), 0 1px 4px rgba(0, 0, 0, 0.6);
  opacity: 1;
}
.photo-credit::before {
  width: 11px;
  height: 11px;
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.7)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

@media (max-width: 900px) {
  .hero-credit { display: none; }   /* keeps the hero dots clear */
}

/* 6 — section layout ----------------------------------------------------- */
.sec { padding: 96px 56px; }
.sec-tint { background: var(--paper-tint); }
.sec-dark { background: var(--dark-blue); color: var(--white); }
.sec-dark .label { color: var(--very-light-blue); }

/* label column on the left, content on the right */
.cols { display: grid; grid-template-columns: 220px 1fr; gap: 56px; }
/* the section label sits inside the heading (<h2><span class="label">02 / Services</span> What I can do…</h2>)
   so its keyword counts as part of the heading for search engines; it still shows on its own line above */
.sec-title { font-size: var(--text-2xl); line-height: 1.15; }
.sec-title .label { display: block; margin-bottom: 12px; line-height: normal; }
.sec-link { display: inline-block; margin-top: 16px; font-size: var(--text-sm); font-weight: 600; transition: transform 0.3s ease; }
.sec-link:hover { transform: translateX(3px); }

@media (max-width: 900px) {
  .sec { padding: 44px 20px; }
  .cols { display: block; }
  .cols > :first-child { margin-bottom: 20px; }
}

/* 7 — work --------------------------------------------------------------- */
/* Hover: the card lifts and its photo zooms slightly. The lift uses the "translate"
   property, not "transform", so it doesn't fight the scroll fade-in (section 15). */
.card {
  display: block;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  transition: translate 0.35s ease, box-shadow 0.35s ease, border-color 0.25s ease;
}
.card:hover { color: inherit; border-color: var(--light-blue); translate: 0 -4px; box-shadow: 0 12px 32px rgba(20, 40, 60, 0.10); }
.card img { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card:hover img { transform: scale(1.04); }

/* Photos keep their shape at every screen size: featured 16:9, cards 3:2. Export all at
   2400 × 1600 (3:2): the featured photo crops top and bottom on desktop and shows whole
   on phones, where its box is 3:2 too.
   Crop point: style="--focus: X% Y%" on the <img> (e.g. "38% 100%" keeps the bottom edge). */
.work-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: var(--focus, 50% 50%); }
.grid-3 .work-img { aspect-ratio: 3 / 2; }

.feature { margin-bottom: 32px; }
.feature-body { padding: 32px 36px 36px; }
.feature-body .label { margin-bottom: 10px; }
.feature-body h3 { margin-bottom: 10px; font-size: var(--text-2xl); line-height: 1.15; }
.feature-body p { max-width: 620px; font-size: var(--text-lg); line-height: 1.55; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-body { padding: 20px 22px 24px; }
.card-body h3 { margin-bottom: 6px; font-size: var(--text-lg); letter-spacing: -0.01em; }
.card-body p { font-size: var(--text-sm); line-height: 1.5; color: var(--ink-faint); }

@media (max-width: 900px) {
  .feature .work-img { aspect-ratio: 3 / 2; }
  .feature-body { padding: 20px; }
  .feature-body h3 { font-size: var(--text-xl); }   /* keeps the title on one line */
  .grid-3 { grid-template-columns: 1fr; }
}

/* 8 — services ----------------------------------------------------------- */
/* Each tile: a photo across the top (5:2, export 1500 × 600), then the text. */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border-radius: 12px;
  transition: translate 0.3s ease, box-shadow 0.3s ease;
}
.tile:hover { translate: 0 -3px; box-shadow: 0 10px 26px rgba(20, 40, 60, 0.08); }
.tile-img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  transform-origin: 50% 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile:hover .tile-img { transform: scale(1.04); }
.tile-body { padding: 24px 30px 30px; }
.tile-body .label { margin-bottom: 10px; }
.tile h3 { margin-bottom: 10px; font-size: var(--text-xl); letter-spacing: -0.01em; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tile-body { padding: 20px 22px 24px; }
}

/* 9 — process ------------------------------------------------------------ */
.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  transition: background-color 0.25s ease;
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step:hover { background: rgba(155, 198, 233, 0.10); }
.step-num { font-size: var(--text-2xl); font-weight: 700; color: var(--light-blue); }
.step h3 { margin-bottom: 6px; font-size: var(--text-xl); }
.step p { max-width: 680px; }   /* keeps each description to two lines on desktop */

@media (max-width: 900px) {
  .step { grid-template-columns: 44px 1fr; gap: 16px; }
}

/* 10 — expertise --------------------------------------------------------- */
/* product categories: numbered, two columns filled top to bottom */
.exp-list {
  margin-bottom: 52px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);   /* 5 per column; change if the list grows */
  column-gap: 48px;
}
.exp-list li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  font-size: var(--text-lg);
  font-weight: 500;
}
.exp-list span { font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--very-light-blue); }

/* brand logos on white cards, 4 across. --h on each <img> (in the HTML) sets its size. */
.exp-logos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.exp-logos li {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.exp-logos li:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18); }
.exp-logos img { height: calc(var(--h, 44px) * 1.3); width: auto; filter: brightness(0); opacity: 0.63; }   /* 63% black ≈ #5e5e5e */

@media (max-width: 900px) {
  .exp-list { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; margin-bottom: 36px; }
  .exp-list li { padding: 12px 0; }
  .exp-logos { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .exp-logos li { height: 86px; }
  .exp-logos img { height: calc(var(--h, 44px) * 0.85); }
}

/* 11 — expert witness ---------------------------------------------------- */
/* Lead paragraph, then a stats column beside the subject list, then the latest
   case and the CV link along the bottom.
   The subject list is capped at 425px so each row wraps to two lines and the list
   ends about level with the stats (410–440px all work). */
.ew-body { display: grid; grid-template-columns: 220px minmax(0, 425px); gap: 48px; margin: 40px 0 36px; }

.ew-stats { padding: 0 32px 0 0; border-right: 1px solid var(--rule); }
.ew-stats li {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-soft);
}
.ew-stats li:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.ew-stat-num { display: block; margin-bottom: 8px; font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--blue); }

.ew-body .label { margin-bottom: 4px; }
.ew-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ew-list li:last-child { border-bottom: 0; }
.ew-list h4 { font-size: var(--text-md); letter-spacing: -0.01em; }
.ew-list p { font-size: var(--text-sm); line-height: 1.5; }

/* optional numerals: see the comment above the list in index.html */
.ew-list-numbered li { display: grid; grid-template-columns: 32px 1fr; }
.ew-list-numbered li > * { grid-column: 2; }
.ew-list-numbered .ew-num { grid-column: 1; grid-row: 1 / span 2; padding-top: 4px; font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--blue); }

/* the line along the bottom is as wide as .ew-body (stats 220 + gap 48 + list 425); change together */
.ew-foot { max-width: calc(220px + 48px + 425px); padding-top: 22px; border-top: 1px solid var(--rule); }
.ew-foot p { margin-bottom: 12px; text-wrap: pretty; }
.ew-foot .sec-link { margin-top: 0; }

@media (max-width: 900px) {
  .ew-body { display: block; margin: 28px 0 24px; }
  .ew-stats {   /* the column becomes a row of three */
    display: grid;
    grid-template-columns: 0.8fr 1fr 1.25fr;
    gap: 16px;
    padding: 20px 0;
    margin-bottom: 24px;
    border-right: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
  .ew-stats li, .ew-stats li:last-child { padding: 0; margin: 0; border: 0; line-height: 1.4; }
  .ew-stat-num { margin-bottom: 6px; }
  .ew-foot { padding-top: 20px; }
}

/* 12 — about ------------------------------------------------------------- */
/* Desktop: the photo stretches to the height of the bio text beside it (never shorter
   than its own 4:5), cropping the sides as needed; max-height stops it at 1:2 in narrow
   windows, where the text gets very tall. Crop point: style="--focus: X% Y%" on the <img>.
   Phones show the full 4:5 photo. */
.about { display: grid; grid-template-columns: 380px 1fr; gap: 44px; align-items: stretch; }
.about-photo { width: 100%; height: 100%; max-height: 760px; object-fit: cover; object-position: var(--focus, 50% 50%); border-radius: 12px; }
.about p { margin-bottom: 18px; }
.about p:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .about { display: block; }
  .about-photo { max-width: 360px; height: auto; aspect-ratio: 4 / 5; margin-bottom: 20px; }
}

/* 13 — contact ----------------------------------------------------------- */
.contact { text-align: center; }
.contact h2 {
  margin: 0 auto 20px;
  max-width: 700px;
  font-size: var(--text-3xl);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.contact p { margin: 0 auto 30px; max-width: 560px; font-size: var(--text-lg); text-wrap: pretty; }

/* 14 — footer ------------------------------------------------------------ */
/* Three groups: left-aligned, centered, right-aligned. The two side columns are always
   equal (1fr each), so the middle group sits at the page center, under the contact button.
   Phones: one centered column. */
.footer {
  padding: 32px 56px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 8px 24px;
  font-size: var(--text-sm);
  color: var(--ink-faint);
}
.footer > :last-child { text-align: right; text-wrap: balance; }   /* wraps to two even lines in narrow windows */

/* the middle group: a small triangle between items (CSS, so screen readers skip it) */
.footer-info { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.footer-info > :not(:last-child)::after {
  content: "\25B4";        /* ▴ */
  content: "\25B4" / "";   /* the same, with empty alt text for screen readers (ignored by older browsers) */
  margin-left: 10px;
}

@media (max-width: 900px) {
  .footer {
    padding: 24px 20px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    text-align: center;
    font-size: calc(var(--text-sm) - 1px);
  }
  .footer > :last-child { text-align: center; }
}

/* 15 — motion ------------------------------------------------------------ */
/* smooth in-page scrolling; scroll-margin keeps headings clear of the sticky nav */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 84px; }

/* Scroll fade-in: elements with data-reveal rise into place once, when first seen
   (motion.js adds .reveal-ready to the page and .is-in to each element; with
   JavaScript off nothing is hidden). It's an animation, not a transition, so the
   hover transitions on cards, tiles and buttons keep working.
   "rise" ends on translate3d(0, 0, 0), not "none": ending on "none" makes the text
   snap to the pixel grid with a visible 1–2px jump at the end. */
.reveal-ready [data-reveal] { opacity: 0; }
.reveal-ready [data-reveal].is-in { opacity: 1; animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* the OS "reduce motion" setting: no movement, except the slideshow keeps its slow crossfade */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-ready [data-reveal] { opacity: 1; }
  .hero-slide { transition: opacity 1.2s ease !important; }
}
