/* ══════════════════════════════════════════════════════════════════════
   Landing page: case studies as a scroll slider + an all-projects grid
   ══════════════════════════════════════════════════════════════════════

   One list (.i2-list), two layouts, picked by data-view on the section:

   grid    The default in the markup, so it is what visitors get without JS,
           on phones and on short screens. Tiles sit edge to edge with no gap
           and no shadow, filling the content column.

   slider  Desktop. The section becomes a scroll runway (.i2-runway) and the
           stage inside it sticks to the viewport for its whole height. The
           slides are stacked on top of each other and js/home.js turns the
           scroll position into a clip-path per slide, so each one wipes in
           from the right over the one before. Nothing moves in the layout,
           which keeps it cheap to animate.

   Loaded after stylish-portfolio.css and only by index.html, so nothing
   here reaches the live homepage or the case-study pages. */

.i2-work{
  /* Scroll distance that moves the slider on by one slide. */
  --i2-step: 85svh;
  /* Width of the next slide's strip peeking in at the right edge, and of the
     one after it. js/home.js reads both. 0 = no strips: each slide wipes
     in edge to edge with nothing showing ahead of it. */
  --i2-peek-1: 0px;
  --i2-peek-2: 0px;
  /* Room the pinned stage keeps clear above it for the floating navbar and
     below it for the floating contact bar. JS replaces the first with the
     navbar's measured bottom edge. */
  --i2-nav-clear: 96px;
  --i2-bar-clear: 104px;

  /* Full bleed with no padding: the slides and grid tiles run to the
     viewport edges, and the text inside them steps back in to the page
     gutter so it still lines up with the hero above. */
  margin: 0 var(--page-bleed);
  padding: 0;
  background-color: #fff;
  color: var(--ink);
}

/* ── Title and intro, on the page above the section ──────────────────── */

/* Same black ground as the section below, running edge to edge, so the
   heading, the slides and the grid read as one dark band. */
.i2-intro{
  margin: 0 var(--page-bleed);
  padding: 96px var(--page-gutter) 48px;
  background-color: #0d0d0d;
}

.i2-intro .i2-title,
.i2-intro .i2-work-body{
  color: #fff;
}

.i2-title{
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 40px;
  line-height: 58px;
  font-weight: 500;
  color: var(--ink);
}

.i2-work-body{
  max-width: 44rem;
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 36px;
  color: var(--ink);
}

/* ── Right rail: layout toggle + scroll to top ────────────────────────
   One white pill pinned to the middle of the right edge (same surface as
   the floating contact bar). It holds two parts that fold open and shut on
   their own: the layout toggle (while the case studies fill the middle of
   the screen) and scroll to top (once the page has scrolled; js/home.js
   moves the page's .scroll-to-top in). Folding is a grid-row collapse, so
   the pill resizes in place around its centre instead of sliding away, and
   it fades out only when both parts are shut. Every button is 40px, with
   4px of padding and gaps, so the closed rail is a 48px circle. */
.i2-rail{
  position: fixed;
  top: 50%;
  right: 24px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border-radius: 100px;
  background-color: #fff;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.i2-rail.is-visible{
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s;
}

.i2-rail-part{
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.2s ease, margin-top 0.3s ease;
}

.i2-rail-part.is-open{
  grid-template-rows: 1fr;
  opacity: 1;
}

/* Set while the rail is appearing: its parts take their size at once, so
   it fades in at its final shape (js/home.js, renderRail). */
.i2-rail.is-instant .i2-rail-part{
  transition: none;
}

.i2-rail-part[hidden]{
  display: none;
}

/* 4px between the two parts when both are open, the same as between pills. */
.i2-rail-part.is-open + .i2-rail-part.is-open{
  margin-top: 4px;
}

.i2-rail-inner{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}

.i2-rail-btn,
.i2-rail .scroll-to-top{
  position: static;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 100px !important;
  background-color: transparent;
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .3s ease-in-out;
}

.i2-rail-btn svg,
.i2-rail .scroll-to-top svg{
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .i2-rail-btn:hover,
  .i2-rail .scroll-to-top:hover{
    background-color: #f2f2f2;
  }
}

.i2-rail-btn:active{
  transform: scale(0.95);
}

.i2-toggle-btn[aria-pressed="true"],
.i2-toggle-btn[aria-pressed="true"]:hover{
  background-color: #0d0d0d;
  color: #fff;
}

.i2-rail-btn:focus{
  outline: none;
}

.i2-rail-btn:focus-visible{
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.i2-index[hidden]{
  display: none;
}

/* ── Shared card parts ───────────────────────────────────────────────── */

.i2-frame{
  position: relative;
  overflow: hidden;
}

.i2-list{
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Black and white tiles. Every item reads its colours from these three
   properties; the dark ones are switched on below. */
.i2-item{
  --i2-bg: #fff;
  --i2-fg: var(--ink);
  --i2-muted: rgba(33, 37, 41, 0.62);
  /* Tags: light grey on white, dark grey with a faint ring on black (the
     same surfaces as the floating contact bar). */
  --i2-chip-bg: #f2f2f2;
  --i2-chip-fg: var(--ink);
  --i2-chip-ring: transparent;
  background-color: var(--i2-bg);
  color: var(--i2-fg);
}

/* Black slides: every other one in the slider, starting with the first.
   The grid view is all white (see Grid view below). */
.i2-work[data-view="slider"] .i2-item:nth-child(odd){
  --i2-bg: #0d0d0d;
  --i2-fg: #fff;
  --i2-muted: rgba(255, 255, 255, 0.6);
  --i2-chip-bg: #1a1a1a;
  --i2-chip-fg: #fff;
  --i2-chip-ring: rgba(255, 255, 255, 0.08);
}

.i2-card{
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--i2-fg);
  text-decoration: none;
}

.i2-card:hover,
.i2-card:focus{
  color: var(--i2-fg);
  text-decoration: none;
}

.i2-card:focus{
  outline: none;
}

.i2-card:focus-visible{
  outline: 2px solid var(--i2-fg);
  outline-offset: -6px;
}

.i2-card-text{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.i2-card-index{
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--i2-muted);
  font-variant-numeric: tabular-nums;
}

.i2-card-title{
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  color: var(--i2-fg);
}

.i2-card-sub{
  display: block;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--i2-muted);
}


/* justify-content is explicit: stylish-portfolio.css centres every bare
   `ul` below 750px for the old nav. */
.i2-card-tags{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Chips follow the tile: light grey on white, dark grey on black. */
.i2-card-tags .project-chip{
  background-color: var(--i2-chip-bg);
  color: var(--i2-chip-fg);
  box-shadow: 0 0 0 1px var(--i2-chip-ring);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.2;
}

.i2-card-media{
  position: relative;
  overflow: hidden;
  border-radius: 16px;   /* same as the case-study pages' hero and quote boxes */
}

.i2-card-media img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.i2-card-media img.is-contained{
  object-fit: contain;
}

/* ── Grid view ───────────────────────────────────────────────────────
   Editorial cards on black: a large rounded cover first, then the tags as
   quiet grey labels, then the project's subtitle as the headline and its
   name underneath in grey. Two columns edge to edge with no gap.
   The tile (.i2-item) only spaces the cards out; the card itself (.i2-card)
   is the box that reacts: 8px of padding around its content, so on hover
   its dark grey ground wraps the cover and text with a thin margin, and
   the cover zooms slowly. The text sits 8px further in than the cover. */

.i2-work[data-view="grid"]{
  background-color: #0d0d0d;
}

.i2-work[data-view="grid"] .i2-list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;   /* every row as tall as the tallest card */
}

.i2-work[data-view="grid"] .i2-item{
  transition: background-color .25s ease;
}

/* Tile spacing, less the card's own 8px so the cover still lines up with
   the page gutter (outer edges) and the header above. */
.i2-work[data-view="grid"] .i2-item{
  --i2-bg: #0d0d0d;
  --i2-fg: #fff;
  --i2-muted: rgba(255, 255, 255, 0.6);
  padding: 32px 16px 48px;
}

.i2-work[data-view="grid"] .i2-item:nth-child(odd){
  padding-left: calc(var(--page-gutter) - 8px);
}

.i2-work[data-view="grid"] .i2-item:nth-child(even){
  padding-right: calc(var(--page-gutter) - 8px);
}

.i2-work[data-view="grid"] .i2-card{
  height: 100%;   /* fill the row, so every card is the same height */
  padding: 8px;
  border-radius: 24px;   /* the cover's 16px plus the 8px around it */
  background-color: transparent;
  transition: background-color .25s ease;
}

@media (hover: hover) {
  .i2-work[data-view="grid"] a.i2-card:hover{
    background-color: #1a1a1a;
  }
}

.i2-work[data-view="grid"] .i2-card-text{
  padding: 8px 8px 12px;
}

.i2-work[data-view="grid"] .i2-card-media{
  order: -1;   /* cover first */
  aspect-ratio: 2 / 1;
  margin-bottom: 12px;
  border-radius: 16px;   /* the case-study pages' radius (hero, quotes) */
  background-color: #f2f2f2;   /* behind covers that don't fill the frame */
}

.i2-work[data-view="grid"] .i2-card-media img{
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

@media (hover: hover) {
  .i2-work[data-view="grid"] a.i2-card:hover .i2-card-media img{
    transform: scale(1.03);
  }
}

.i2-work[data-view="grid"] .i2-card-index{
  display: none;
}

/* Tags before the headline, as soft grey labels. */
.i2-work[data-view="grid"] .i2-card-tags{
  order: -1;
  margin-bottom: 16px;
}

.i2-work[data-view="grid"] .i2-card-tags .project-chip{
  padding: 6px 12px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 400;
}

/* The title element holds the name with the subtitle in a span. Here the
   subtitle becomes the headline and the name the grey line under it. */
.i2-work[data-view="grid"] .i2-card-title{
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

.i2-work[data-view="grid"] .i2-card-sub{
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
}

/* ── Slider view ─────────────────────────────────────────────────────── */

/* One viewport for the first slide, plus one step for every slide after
   it. --i2-count is set by js/home.js from the list. */
.i2-work[data-view="slider"] .i2-runway{
  height: calc(100svh + (var(--i2-count, 1) - 1) * var(--i2-step));
}

.i2-work[data-view="slider"] .i2-stage{
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100svh;
}

.i2-work[data-view="slider"] .i2-frame{
  flex: 1;
  min-height: 0;
}

.i2-work[data-view="slider"] .i2-list{
  position: absolute;
  inset: 0;
}

.i2-work[data-view="slider"] .i2-item{
  position: absolute;
  inset: 0;
  /* Hidden off the right edge until js/home.js places it. */
  clip-path: inset(0 0 0 100%);
  will-change: clip-path;
}

.i2-work[data-view="slider"] .i2-item:first-child{
  clip-path: none;
}

.i2-work[data-view="slider"] .i2-card{
  /* Top clears the floating navbar; right clears the peeking strips;
     bottom clears the contact bar and the slide index. The sides sit on
     the page gutter so the text lines up with the hero. Named so the click
     area below can use the same box. */
  --i2-pad-t: calc(var(--i2-nav-clear) + 24px);
  --i2-pad-r: calc(var(--page-gutter) + var(--i2-peek-1));
  --i2-pad-b: calc(var(--i2-bar-clear) + 64px);
  --i2-pad-l: var(--page-gutter);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px;
  padding: var(--i2-pad-t) var(--i2-pad-r) var(--i2-pad-b) var(--i2-pad-l);
}

/* One tight block pinned to the top of the slide, so every slide's number
   and title sit on the same line and stay aligned mid-wipe (centring them
   moved each block by its own height). */
.i2-work[data-view="slider"] .i2-card-text{
  justify-content: flex-start;
  align-self: start;   /* hug the text, so the empty space below isn't a target */
}

/* Only the slide's content area opens the case study: one rectangle from
   the top of the text to the bottom of the cover, across both columns and
   the gap between them, so the "View" label stays on without flickering as
   you move from text to image. The rest of the slide (the margins, the band
   around the number index) ignores the pointer, so clicking near the index
   never opens a case study by accident.
   The rectangle is the link's own ::before, sized to its padding box, so a
   click on it is a click on the link; the link stays focusable for the
   keyboard. */
.i2-work[data-view="slider"] .i2-card{
  pointer-events: none;
}

.i2-work[data-view="slider"] .i2-card::before{
  content: "";
  position: absolute;
  top: var(--i2-pad-t);
  right: var(--i2-pad-r);
  bottom: var(--i2-pad-b);
  left: var(--i2-pad-l);
  pointer-events: auto;
}

.i2-work[data-view="slider"] .i2-card-title{
  font-size: clamp(40px, 4.2vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.i2-work[data-view="slider"] .i2-card-sub{
  max-width: 34ch;
  margin-top: 16px;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.3;
}


.i2-work[data-view="slider"] .i2-card-tags{
  margin-top: 32px;
}

/* Short windows: the subtitles are a sentence or two, so tighten the
   spacing to keep the tags clear of the slide index. */
@media (max-height: 719px){
  .i2-work[data-view="slider"] .i2-card-sub{ margin-top: 12px; }
  .i2-work[data-view="slider"] .i2-card-tags{ margin-top: 20px; }
}

.i2-work[data-view="slider"] .i2-card-media img{
  will-change: transform;
}

/* Slide index: one number per slide over the bottom of the frame, the
   current one in full white, and a line that fills with progress. */
.i2-index{
  position: absolute;
  left: var(--page-gutter);
  right: calc(var(--page-gutter) + var(--i2-peek-1));
  bottom: calc(var(--i2-bar-clear) + 8px);
  z-index: 50;
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  /* Sits over black and white slides alike, often both at once mid-wipe,
     so it is drawn in white with `difference` blending: white over black
     stays white, white over white turns black. */
  mix-blend-mode: difference;
}

.i2-index-btn{
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 8px 12px 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color .2s ease;
}

.i2-index-btn.is-active{
  color: #fff;
}

@media (hover: hover) {
  .i2-index-btn:hover{
    color: #fff;
  }
}

.i2-index-btn:focus{
  outline: none;
}

.i2-index-btn:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

.i2-index-fill{
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background-color: #fff;
  transform-origin: left center;
  transform: scaleX(var(--i2-progress, 0));
}

/* ── Phones and small tablets ────────────────────────────────────────── */

@media (max-width: 767px) {
  .i2-intro{
    padding: 64px var(--page-gutter) 32px;
  }

  .i2-title{
    font-size: 24px;
    line-height: 30px;
  }

  .i2-work-body{
    font-size: 18px;
    line-height: 28px;
  }

  .i2-work[data-view="grid"] .i2-list{
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;   /* one column: each card keeps its own height */
  }

  .i2-work[data-view="grid"] .i2-item,
  .i2-work[data-view="grid"] .i2-item:nth-child(n){
    padding: 16px calc(var(--page-gutter) - 8px) 32px;
  }

  .i2-work[data-view="grid"] .i2-card-media{
    aspect-ratio: 16 / 10;
    border-radius: 16px;
  }

  .i2-work[data-view="grid"] .i2-card-title{
    font-size: 16px;
  }

  .i2-work[data-view="grid"] .i2-card-sub{
    font-size: 24px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Top nav: text only, adapting to whatever is behind it
   ══════════════════════════════════════════════════════════════════════
   No white bar and no shadow, in either state: just the logo, links and
   weather, sticky at the spot where the nav starts (the page's top padding),
   so it never shifts as you scroll. It is drawn in white with `difference`
   blending, so it reads dark over white and white over black, including
   over the black and white slides mid-wipe. The logo is inverted first so
   the blend turns it back to its normal colours on white.
   The scrolled state from stylish-portfolio.css (moves down 16px, gains
   side margins and a shadow) is cancelled so nothing moves. */
/* The blend needs a white backdrop inside <body>. The body fades in on load
   (.animate.fadeIn), which turns it into its own compositing group, and a
   white set only on <body> is painted on the page canvas instead of inside
   that group. The nav then blended against nothing and vanished until the
   group was dropped. Giving <html> its own white keeps the body's white in
   the body itself. */
html{
  background-color: #fff;
}

.navbar,
.navbar.scrolled{
  top: var(--page-pad-top);
  margin: 0;
  background-color: transparent;
  box-shadow: none;
  mix-blend-mode: difference;
}

.navbar a,
.navbar li a,
.navbar.scrolled a,
.navbar .weather-time-bar{
  color: #fff;
}

.navbar li a:hover,
.navbar li a:focus{
  color: #fff !important;
}

.navbar .logo-nav img{
  filter: invert(1);
}

/* Hover, and the Work pill while the case studies are in view: a dark grey
   fill, which the blend shows as the usual light grey on white and as a
   dark grey on black. */
.navbar li a.link-pill:hover,
.navbar li a.link-pill:focus-visible,
.navbar li a.link-pill.is-current{
  background-color: #262626;
}

.navbar li a.link-pill:focus-visible{
  outline-color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   Floating bars on dark ground
   ══════════════════════════════════════════════════════════════════════
   js/home.js adds .is-on-dark to the contact bar and the right rail while
   the ground behind them is dark (black slides and tiles, the testimonials
   band). They swap to a near-black surface with white labels and icons;
   the coloured Meet and LinkedIn marks stay as they are. */
/* Fade the surface swap while the bar is showing (the hidden states keep
   their own transitions from the base rules). */
.contact-bar.is-visible{
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s,
    background-color 0.3s ease, box-shadow 0.3s ease;
}

.i2-rail.is-visible{
  transition: opacity 0.3s ease, visibility 0s,
    background-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-bar.is-on-dark,
.i2-rail.is-on-dark{
  background-color: #1a1a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.contact-bar.is-on-dark .pill-btn-outline,
.contact-bar.is-on-dark .pill-btn-split-main,
.contact-bar.is-on-dark .pill-btn-copy,
.i2-rail.is-on-dark .i2-rail-btn,
.i2-rail.is-on-dark .scroll-to-top{
  color: #fff !important;
}

@media (hover: hover) {
  .contact-bar.is-on-dark .pill-btn:hover,
  .i2-rail.is-on-dark .i2-rail-btn:hover,
  .i2-rail.is-on-dark .scroll-to-top:hover{
    background-color: #2a2a2a;
  }
}

/* The pressed layout pill inverts on the dark rail: white with a black icon. */
.i2-rail.is-on-dark .i2-toggle-btn[aria-pressed="true"],
.i2-rail.is-on-dark .i2-toggle-btn[aria-pressed="true"]:hover{
  background-color: #fff;
  color: #0d0d0d !important;
}

.contact-bar.is-on-dark .pill-btn-copy:focus-visible,
.i2-rail.is-on-dark .i2-rail-btn:focus-visible{
  outline-color: #fff;
}

/* Phones outline the bar's pills instead of a hover fill. */
@media (max-width: 750px) {
  .contact-bar.is-on-dark .pill-btn{
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* No divider under the logo belt: the grey case-study ground it used to
   separate from is gone, and the white intro now follows straight on. */
.logo-belt{
  border-bottom: 0;
}

/* Closing section's contact pills: the same dark surface as the floating
   bars on dark ground (.is-on-dark above), instead of the lighter #3d3b3b. */
.pill-btn-row-inverted .pill-btn{
  background: #1a1a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease-in-out, background-color 0.2s ease;
}

@media (hover: hover) {
  .pill-btn-row-inverted .pill-btn:hover{
    background: #2a2a2a;
  }
}

/* Floating contact bar: 4px inner padding (was 8px, 6px on phones), the
   same as the right rail. */
.contact-bar{
  padding: 4px;
}

@media (max-width: 750px) {
  .contact-bar{
    padding: 4px;
  }
}

/* Phones stack scroll-to-top above the bar: 24px inset + the bar, now 61px
   with the 4px padding, + 12px breathing room (stylish-portfolio.css used
   102px for the old 66px bar). */
@media (max-width: 750px) {
  body.has-contact-bar .scroll-to-top{
    bottom: calc(97px + var(--stt-lift));
  }
}

/* Top nav links: 120% line height instead of the site-wide `li` 2rem, so
   the pills hug their labels. Lists elsewhere keep their 32px lines. */
.navbar li,
.navbar li a{
  line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════════════
   Testimonial cards
   ══════════════════════════════════════════════════════════════════════
   Same 16px rounding as the case-study covers and the quote boxes on the
   case-study pages. In the two-column layout every closed card is as tall
   as the tallest one: js/home.js measures them into --t-card-min. The
   grid keeps `align-items: start`, so opening one card's full
   recommendation still grows that card only. The author sits at the
   bottom, so names line up across cards. */
.testimonial-card{
  border-radius: 16px;
  min-height: var(--t-card-min, 0);
  /* 16px inside, like the case-study cards (8px card + 8px text inset). */
  padding: 16px;
}

@media (max-width: 750px) {
  .testimonial-card{
    padding: 16px;
  }
}

.testimonial-author{
  margin-top: auto;
}

/* ── Testimonials: full recommendation in a modal ─────────────────────
   js/home.js adds .has-modal to the grid once the modal is ready; only
   then does the in-card "Read full recommendation" toggle go away, so the
   page still works without JS. */
.testimonials-grid.has-modal .testimonial-more{
  display: none;
}

.testimonials-grid.has-modal .testimonial-card{
  position: relative;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease;
}

@media (hover: hover) {
  .testimonials-grid.has-modal .testimonial-card:hover{
    background-color: #222;
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Arrow button, top right: only on touch screens. On desktop the card's
   hover and the "Read" cursor label do that job, so the button stays out
   of sight and only shows when a keyboard user tabs to it. */
.t-open{
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: opacity .2s ease, background-color .2s ease, transform .3s ease-in-out;
}

.t-open svg{
  width: 16px;
  height: 16px;
}

.t-open:active{
  transform: scale(0.95);
}

.t-open:focus{
  outline: none;
}

.t-open:focus-visible{
  opacity: 1;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) {
  .t-open{
    opacity: 0;
  }

  .t-open:hover{
    background-color: rgba(255, 255, 255, 0.16);
  }
}

/* The modal: same dark surface, hairline and 16px rounding as the cards,
   filling the screen with 32px clear on every side; the text runs the full
   width of it. */
.t-modal{
  width: calc(100vw - 64px);
  height: calc(100svh - 64px);
  max-width: none;
  max-height: none;
  margin: 32px;
  padding: 16px;   /* same 16px as the testimonial cards */
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background-color: #1a1a1a;
  color: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overscroll-behavior: contain;
}

/* The modal itself takes focus on open (js), so no ring is drawn on it. */
.t-modal:focus{
  outline: none;
}

.t-modal[open]{
  animation: t-modal-in .25s ease-out both;
}

.t-modal::backdrop{
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

@keyframes t-modal-in{
  from{ opacity: 0; transform: translateY(12px) scale(0.98); }
  to{ opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .t-modal[open]{
    animation: none;
  }
}

/* Keep the page behind still while the modal is open. */
html.t-modal-open{
  overflow: hidden;
}

/* Top row: the quote mark on the left and the close button on the right,
   on one shared centre line. */
.t-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Close: the dark pill of the closing section's contact buttons (near-black,
   faint ring, soft shadow) with a white cross. */
.t-modal-close{
  flex-shrink: 0;
  /* The quote glyph's ink sits 1.5px below the middle of its 40px box;
     3px of top margin moves the button's centre down to match it. */
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background-color: #1a1a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s ease, transform .3s ease-in-out;
}

.t-modal-close svg{
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .t-modal-close:hover{
    background-color: #2a2a2a;
  }
}

.t-modal-close:active{
  transform: scale(0.95);
}

.t-modal-close:focus{
  outline: none;
}

.t-modal-close:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.t-modal .t-modal-body{
  margin-top: 24px;
}

.t-modal .t-modal-body p{
  font-size: 18px;
  line-height: 1.6;
  color: #e0e0e0;
}

.t-modal-author{
  margin-top: 32px;
}

@media (max-width: 750px) {
  /* Phones: 16px clear on each side, so the text keeps some width. */
  .t-modal{
    width: calc(100vw - 32px);
    height: calc(100svh - 32px);
    margin: 16px;
  }

  .t-modal .t-modal-body p{
    font-size: 16px;
  }
}
