/* ==========================================================================
   appsby.io — v2 landing page
   Hand-written, no build step. Tokens mirror design-system.md.
   ========================================================================== */

/* ---------- Inter, self-hosted (no Google hotlink: DSGVO) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url('fonts/inter-300.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 300; font-display: swap; src: url('fonts/inter-300-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/inter-400-italic.woff2') format('woff2'); }

/* ---------- tokens ---------- */
:root {
  --bg-page:        #F3F9F7;
  /* the same colour at zero alpha. Writing `transparent` in a gradient makes
     some engines interpolate through transparent BLACK, which greys the fade;
     naming the colour explicitly keeps the ramp clean. */
  --bg-page-0:      rgb(243 249 247 / 0);
  --bg-surface:     #FFFFFF;
  --bg-subtle:      #DDEFE9;
  --bg-inverse:     #000000;
  --text-primary:   #000000;
  --text-muted:     #6B7280;
  --text-accent:    #FF3157;
  --text-on-inverse:#FFFFFF;
  --border-subtle:  #E5E7EB;
  --border-strong:  #000000;

  /* Brand accent. #FF3157 only clears WCAG AA as LARGE text (3.38:1 on the page
     background, 3.6:1 under white) — fine for the 96px hero highlight and for
     decorative dots, but it fails AA at body size and as a button fill.
     --accent-strong is the same hue darkened until both pass: 5.04:1 under
     white, 4.73:1 as text on the page background. */
  --accent:         #FF3157;
  --accent-strong:  #D81B46;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --container: 1280px;
  --gutter: 80px;
  --section-gap: 128px;

  --hero-fs: clamp(2.5rem, 7.2vw, 6rem);
  --t-peek: 44px;        /* how much of the next testimonial card shows */

  --radius-card: 20px;
  --radius-media: 16px;

  --shadow-card: 0 4px 32px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.03);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-back: cubic-bezier(.34,1.56,.64,1);   /* slight overshoot, for pops */

  /* The reel's own ratio. The hero box must match the file: with
     object-fit: cover any difference is cropped, and the box used to be
     1440/788 on desktop and 4/3 on phones — which cut 2.7% off the top and
     bottom, and a full 25% off the sides on mobile. If the reel is ever
     re-encoded at another ratio, change it here and nowhere else. */
  --reel-ratio: 16 / 9;
}

/* ---------- reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
body { overflow-x: hidden; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { margin-top: var(--section-gap); }
/* No padding-bottom here: .site-footer already owns a --section-gap margin-top,
   and the two stacked to give the footer double the gap every other section
   gets (256 vs 128 on desktop). The footer owns that space. */

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cta-line > span { transform: none !important; transition: none !important; }
  /* the blanket animation-duration override below does NOT zero animation-delay,
     so a delayed `both` animation would sit on its from-state forever */
  .chat, .chat *, .chat *::after { animation: none !important; }
  .chat-dots, .is-typing::after { display: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* A ramp, not a slab. The bottom padding is the fade strip — it carries no
     content, so the logo and the button always sit in the opaque part while
     the edge dissolves into the page instead of cutting across it.
     (It was briefly 82% + blur: dark gallery images smeared through that as a
     grey haze. A ramp to zero alpha reads as intended; a haze does not.) */
  padding-top: 12px;
  padding-bottom: 22px;
  background: linear-gradient(to bottom,
              var(--bg-page) 0%,
              var(--bg-page) 72%,
              var(--bg-page-0) 100%);
  transition: padding .3s var(--ease);
}
/* Once it is actually floating over content it gets out of the way: shorter,
   and the button comes down with it so the whole bar is less of a lid. */
.site-header.is-stuck { padding-top: 8px; padding-bottom: 20px; }
.site-header.is-stuck .btn { padding: 9px 18px; font-size: .9375rem; }
.site-header.is-stuck .btn .btn-arrow { width: 14px; height: 14px; }
.site-header.is-stuck .brand img { height: 30px; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 36px; width: auto; transition: height .3s var(--ease); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 100px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.75;
  text-decoration: none;
  white-space: nowrap;          /* wrapped to two lines at 320px */
  flex-shrink: 0;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), padding .3s var(--ease), font-size .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(216,27,70,.34); }
.btn:active { transform: translateY(0); }
.btn .btn-arrow { width: 16px; height: 16px; fill: currentColor; transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translate(3px, 3px); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: 56px; }
.arrow-mark { fill: var(--text-primary); }

/* The arrow's stroke is 74/602 of its box (from the traced geometry), and Inter
   Regular's stem measures 0.094 of the font size. 0.094 / (74/602) = 0.765, so
   sizing the arrow at 76.5% of the headline makes the two strokes identical —
   and keeps them matched at every width, since both scale off --hero-fs. */
.hero .arrow-mark {
  width: calc(var(--hero-fs) * 0.765);
  height: calc(var(--hero-fs) * 0.765);
  margin-bottom: 32px;
}

.hero-headline {
  font-size: var(--hero-fs);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: .01em;
  max-width: 18ch;
}
.hero-headline .line { display: block; }
.hero-headline .highlight { color: var(--accent); position: relative; }

/* the particle canvas sits exactly over the highlight line */
.hero-headline .highlight canvas,
.rotating canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.is-particled { color: transparent !important; }

/* service chips, straight under the headline */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  list-style: none;
}
.chip {
  padding: 10px 20px;
  background: var(--bg-subtle);
  border-radius: 100px;
  font-size: 1rem;
  line-height: 1.5;
  white-space: nowrap;
}

/* video — full bleed, so it sits outside .container in the markup */
.hero-media {
  margin-top: 72px;
  overflow: hidden;
  background: #D9D9D9;
  aspect-ratio: var(--reel-ratio);
  position: relative;
  width: 100%;
}
.hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-media .media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  justify-items: center;
  color: #595F5D;                 /* 4.62:1 on #D9D9D9 — was #8A8F8D at 2.33:1 */
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 14px),
    #D9D9D9;
  font-size: .875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-media.has-video .media-placeholder { display: none; }
.media-placeholder svg { width: 40px; height: 40px; fill: currentColor; opacity: .6; }

/* ==========================================================================
   Clients
   ========================================================================== */
/* a 6/3/2 column grid, never flex-wrap: a wrapped flex row left the last two
   logos flung to opposite edges by space-between. Fixed column counts divide
   6 logos evenly at every breakpoint, so a row is never orphaned. */
.clients {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  justify-items: center;
  gap: 40px 24px;
}
.clients li { list-style: none; display: flex; align-items: center; max-width: 100%; }
/* each logo carries its own --logo-h inline, because their intrinsic shapes
   differ wildly (Mercedes is square, tribeworks is 3.7:1) and a single height
   would make some look twice the weight of others */
.clients img {
  display: block;
  width: auto;
  height: calc(var(--logo-h, 36px) * var(--logo-scale, 1));
  /* a column narrower than the logo shrinks it proportionally rather than
     letting it bleed into its neighbour */
  max-width: 100%;
  opacity: .88;
  transition: opacity .25s var(--ease);
}
.clients li:hover img { opacity: 1; }

/* ==========================================================================
   Section header (title + rule) — mirrors the Figma component
   ========================================================================== */
.section-head { margin-bottom: 64px; }
.section-head h2,
.section-head .rotating {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .01em;
}
.section-head .rule {
  display: block;
  width: 91px;
  height: 5px;
  margin-top: 32px;
  background: var(--border-strong);
}
.section-head.is-inverse h2,
.section-head.is-inverse .rotating { color: var(--text-on-inverse); }
.section-head.is-inverse .rule { background: var(--text-on-inverse); }

/* Rotating headline. JS reserves exactly the height the longest sentence needs
   at the current width, and the text sits at the BOTTOM of that box — so a
   one-line and a two-line sentence keep the same distance from the rule. */
.rotating {
  position: relative;
  min-height: 1.2em;
  display: flex;
  align-items: flex-end;
}

/* ==========================================================================
   About — dark band
   ========================================================================== */
.about {
  background: var(--bg-inverse);
  color: var(--text-on-inverse);
  padding-block: 88px;
}
.about-grid { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 56px; align-items: center; }
.about-intro { font-size: 1.25rem; font-weight: 300; line-height: 1.6; max-width: 62ch; margin-top: 8px; }
.about-intro p + p { margin-top: 1.5rem; }
.about-intro a { color: var(--text-on-inverse); text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }
.about-intro a:hover { color: var(--accent); }
.about-portrait {
  width: 232px; height: 232px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}

/* ==========================================================================
   Testimonials
   ========================================================================== */
.t-list { display: flex; flex-direction: column; gap: 64px; }
.t-row { display: flex; }
.t-row:nth-child(even) { justify-content: flex-end; }

.t-card {
  width: 85%;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 48px;
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.t-card:hover { transform: translateY(-4px); box-shadow: 0 12px 44px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.04); }
.t-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.t-card .arrow-mark { width: 42px; height: 42px; }
.t-head { display: flex; flex-direction: column; gap: 4px; }
.t-name { font-size: clamp(1.375rem, 2.4vw, 2rem); font-weight: 700; line-height: 1.25; letter-spacing: .01em; }
/* role and quote share the Showroom's body style exactly (.p-client / .p-body),
   so the page has one body size rather than two. The role has to come down with
   the quote — left at 1.25rem it would be a caption larger than the text under
   it. The name stays big: it is the card's headline and its credibility. */
.t-role { font-size: 1rem; font-style: italic; line-height: 1.75; letter-spacing: .01em; }
.t-quote { font-size: 1rem; font-weight: 400; line-height: 1.75; }
/* markup puts the photo first for mobile; on desktop it sits on the right */
.t-photo { order: 2; width: 200px; height: 200px; border-radius: var(--radius-media); object-fit: cover; flex-shrink: 0; }

/* mobile slider chrome — hidden on desktop */
.t-controls { display: none; }

/* Centred, because the cards alternate left and right: a left-aligned link
   would sit under the empty half of the last row. On mobile it lines up under
   the carousel dots, which are centred too. */
.t-more-wrap { margin-top: 56px; text-align: center; }
.t-more {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-size: 1rem; line-height: 1.75;
  text-decoration: underline; text-underline-offset: 4px;
}
.t-more-arrow { width: 16px; height: 16px; fill: currentColor; transition: transform .25s var(--ease); }
.t-more:hover { color: var(--accent-strong); }
.t-more:hover .t-more-arrow { transform: translateX(3px); }

/* ==========================================================================
   Showroom
   ========================================================================== */
.p-list { display: flex; flex-direction: column; gap: 82px; }
.p-card { display: grid; grid-template-columns: 546fr 679fr; gap: 29px; align-items: start; }
.p-copy { min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.p-head { display: flex; flex-direction: column; }
.p-number, .p-title { font-size: 1rem; font-weight: 700; line-height: 1.75; }
.p-client { font-size: 1rem; font-style: italic; line-height: 1.75; }
.p-body { font-size: 1rem; font-weight: 400; line-height: 1.75; }
.p-body p + p { margin-top: 1.25rem; }
.p-body u, .p-body .label {
  text-decoration: underline; text-underline-offset: 3px; font-weight: 400;
}

/* gallery */
/* 3:2, not the 679/509 (4:3) the Figma card specified: every Showroom frame on
   the asset board is composed at 1200x800, and a 4:3 box would have cropped
   ~66px off each side — enough to cut into the mockups in ing-2 and
   tribeworks-1. Matching the assets shows each frame exactly as designed. */
.gallery { position: relative; border-radius: var(--radius-media); overflow: hidden; background: #E9EFEE; aspect-ratio: 3 / 2; }
.gallery-track { display: flex; height: 100%; transition: transform .5s var(--ease); }
.gallery-slide { flex: 0 0 100%; height: 100%; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }

.g-btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: grid;
  place-items: center;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .25s var(--ease);
}
.g-btn:hover { transform: translateY(-50%) scale(1.08); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.g-btn svg { width: 22px; height: 22px; fill: var(--text-primary); }
.g-prev { left: 16px; }
.g-next { right: 16px; }

.g-dots {
  position: absolute;
  left: 50%; bottom: 16px; translate: -50% 0;
  display: flex; gap: 0;
  padding: 2px 6px;
  border-radius: 16px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}
/* the visible dot is 8px; the button itself is a 24x24 touch target */
.g-dot {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: none;
}
.g-dot::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.g-dot.is-active::before { background: var(--accent); transform: scale(1.2); }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta {
  scroll-margin-top: 96px;          /* clears the sticky header when linked to */
  /* one source of truth for the thread's geometry: the avatar's own size feeds
     both the circle and the indent that keeps the email under the bubble */
  --avatar: 140px;
  --rim: 7px;
  --chat-gap: 24px;
}
/* a flex column, not blocks: the mask's negative margins below would collapse
   against each other between sibling lines (10px absorbed instead of 14px),
   which quietly added 25px to the headline. Flex items never collapse, so the
   line rhythm stays exactly line-height 1.2. */
.cta-headline {
  display: flex; flex-direction: column; align-items: flex-start;
  font-size: clamp(2rem, 5vw, 4rem); font-weight: 400; line-height: 1.2; letter-spacing: .01em;
}
/* The headline keeps .reveal only so the observer flips it; its own fade is
   replaced by the per-line mask below, so neutralise the generic one. */
.cta-headline.reveal { opacity: 1; transform: none; transition: none; }
/* Each line is its own overflow clip. The padding/negative-margin pair grows
   the clip past the line box without moving anything: Inter's ascent+descent
   is ~1.25em and line-height here is 1.2, so a bare clip would shave the top
   of an ascender and the tail of the "q" in "requirements?". */
.cta-line {
  display: block;
  overflow: hidden;
  padding-block: .06em .16em;
  margin-block: -.06em -.16em;
}
.cta-line > span {
  display: block;
  transform: translateY(125%);   /* > 100% + the clip padding, so no sliver peeks below the mask */
  transition: transform .85s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: transform;
}
.cta-headline.is-in .cta-line > span { transform: none; }
/* ---- the chat exchange --------------------------------------------------
   Bubble one is the portrait. Bubble two is its speech: it types, then opens.
   Every element's BASE state is the finished state, and the choreography only
   exists inside the `is-in` animations — so with JS off, or animations killed,
   the section renders complete rather than half-built. */
.chat {
  display: flex;
  align-items: center;
  gap: var(--chat-gap);
  margin-top: 48px;
}
/* the block itself only fades; the pieces inside do the real work, so the
   generic reveal's 24px slide would just fight them */
.chat.reveal { transform: none; transition: opacity .35s var(--ease); }

.chat-avatar {
  position: relative;
  flex-shrink: 0;
  padding: var(--rim);               /* the white rim that makes it a bubble */
  background: var(--bg-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
}
.cta-portrait { width: var(--avatar); height: var(--avatar); border-radius: 50%; object-fit: cover; }

.chat-bubble {
  position: relative;
  display: inline-block;
  min-width: 96px;                   /* room for the three dots while typing */
  /* nowrap below means an over-long line would clip rather than wrap; this
     stops it ever pushing the page into a horizontal scroll. If the copy grows,
     re-measure at 320px — there are only ~25px of slack there. */
  max-width: 100%;
  padding: 18px 26px;
  background: var(--bg-subtle);
  border-radius: 24px;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 300;
  line-height: 1.2;
}
/* The tail belongs to the message now, pointing back at her. Its flat edge is
   buried 10px inside the bubble — both shapes are --bg-subtle, so they fuse
   with no seam to line up, and it scales with the bubble's own pop. */
.chat-bubble::before {
  content: '';
  position: absolute;
  top: 50%; left: 10px;
  width: 28px; height: 32px;
  background: var(--bg-subtle);
  clip-path: polygon(100% 0, 0 38%, 100% 100%);
  transform: translate(-100%, -50%);
}
/* min-height holds the line box open while the text is still empty, so the
   bubble is already a pill during the dots instead of collapsing to padding */
.chat-line { display: block; min-height: 1.2em; white-space: nowrap; }

.chat-mail {
  display: inline-block;
  margin-top: 6px;
  padding-block: 7px;                /* ~38px tall: clears the 24px AA target */
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.chat-mail:hover { color: var(--accent-strong); }
/* hidden until its own line starts typing, so the bubble grows one line at a
   time the way a message does, rather than sitting half-empty at full height */
.chat-mail.is-pending { display: none; }

/* the caret rides whichever node is being typed, and goes when it finishes */
.is-typing::after {
  content: '';
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 3px;
  vertical-align: -.14em;
  background: var(--accent);
  animation: caretBlink .9s steps(1, end) infinite;
}
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

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

.chat-dots {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  opacity: 0;
  pointer-events: none;
}
.chat-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

@keyframes chatAvatarIn { from { opacity: 0; transform: scale(.88) translateY(16px); } }
@keyframes chatPop      { from { opacity: 0; transform: scale(.35); } }
@keyframes chatDots     { 0%, 100% { opacity: 0; } 14%, 86% { opacity: 1; } }
@keyframes chatBounce   { 0%, 55%, 100% { transform: none; } 28% { transform: translateY(-5px); } }

/* She arrives, the message pops up and thinks, then landingpage.js types into it.
   The pop's origin is the tail, so the bubble grows out of the pointer. */
.chat.is-in .chat-avatar { animation: chatAvatarIn .7s var(--ease) both; }
.chat.is-in .chat-bubble { animation: chatPop .5s var(--ease-back) .4s both;
                           transform-origin: left center; }
.chat.is-in .chat-dots   { animation: chatDots .62s linear .42s both; }  /* gone by 1040ms, just before TYPE_START */
.chat.is-in .chat-dots i { animation: chatBounce .62s ease-in-out .46s 2 both; }
.chat.is-in .chat-dots i:nth-child(2) { animation-delay: .55s; }
.chat.is-in .chat-dots i:nth-child(3) { animation-delay: .64s; }
/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: var(--section-gap); padding: 24px 0 32px; }
.footer-links { display: flex; gap: 1rem; justify-content: center; }
/* padded to a 44px-tall touch target without changing how it reads */
.footer-links a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding-inline: 12px;
  font-size: .875rem; text-decoration: underline; text-underline-offset: 3px;
}
.footer-links a:hover { color: var(--accent-strong); }  /* body-size text on light: needs the AA-safe accent */

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 1100px) {
  :root { --gutter: 48px; --section-gap: 96px; }
  .t-card { width: 100%; }
  .about-grid { grid-template-columns: 1fr; justify-items: start; gap: 40px; }
  .about-portrait { width: 180px; height: 180px; }
  .clients { grid-template-columns: repeat(3, 1fr); gap: 44px 24px; }
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 768px) {
  :root { --gutter: 24px; --section-gap: 72px; }

  /* padding-block would flatten the fade strip back to a slab */
  .site-header { padding-top: 10px; padding-bottom: 18px; }
  .site-header.is-stuck { padding-top: 7px; padding-bottom: 16px; }
  .brand img { height: 28px; }
  .btn { padding: 11px 18px; font-size: .9375rem; }

  .hero { padding-top: 24px; }
  .hero .arrow-mark { margin-bottom: 20px; }   /* size comes from --hero-fs */
  .chips { gap: 8px; margin-top: 28px; }
  .chip { padding: 8px 14px; font-size: .875rem; }
  .hero-headline { max-width: none; line-height: 1.15; }
  .hero-media { margin-top: 40px; }   /* ratio stays --reel-ratio at every width */

  .clients { gap: 28px 20px; --logo-scale: .72; }

  .section-head { margin-bottom: 40px; }
  .section-head .rule { width: 64px; height: 4px; margin-top: 20px; }

  .about { padding-block: 56px; }
  .about-intro { font-size: 1.0625rem; }
  .about-portrait { width: 140px; height: 140px; }

  /* ---- testimonials become a swipeable carousel ---- */
  .t-list {
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* bleed to the screen edges, keep the first card aligned to the gutter */
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: 8px;
    /* Without this, scroll-snap-align:start aligns to the SCROLLPORT edge and
       ignores padding-inline — every card came to rest flush against the screen
       edge with no gutter. */
    scroll-padding-inline-start: var(--gutter);
    /* Trailing room so the LAST card can still reach the gutter. It must equal
       the peek exactly: card = 100vw - gutter - peek, so the shortfall at the
       end is always exactly one peek, at any width. */
    padding-inline-start: var(--gutter);
    padding-inline-end: var(--t-peek);
  }
  .t-list::-webkit-scrollbar { display: none; }
  /* Fixed width off the viewport, NOT a % of the flex container: a percentage
     resolves against the container's content box, so the trailing padding fed
     back into the card width and the two could never settle. */
  .t-row {
    flex: 0 0 auto;
    width: calc(100vw - var(--gutter) - var(--t-peek));
    scroll-snap-align: start;
  }
  .t-row:nth-child(even) { justify-content: flex-start; }
  .t-card {
    position: relative;              /* anchors the corner arrow */
    width: 100%;
    height: 100%;
    flex-direction: column;
    gap: 16px;
    padding: 22px 20px;
  }
  .t-card:hover { transform: none; }
  /* arrow sits in the top-right corner and mirrors to point down-left,
     so it frames the card instead of eating a whole row of height */
  .t-card .arrow-mark {
    position: absolute;
    top: 22px;
    right: 20px;
    width: 30px;
    height: 30px;
    transform: scaleX(-1);
  }
  .t-photo { width: 72px; height: 72px; order: -1; }
  .t-content { gap: 12px; }
  .t-name { font-size: 1.25rem; line-height: 1.3; }
  .t-role { font-size: .9375rem; line-height: 1.7; }
  .t-quote { font-size: .9375rem; line-height: 1.7; }   /* = .p-body on mobile */

  .t-more-wrap { margin-top: 32px; }
  .t-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 12px;
  }
  /* 44x44 touch target, 8px visible dot */
  .t-dot {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: none;
  }
  .t-dot::before {
    content: '';
    width: 8px; height: 8px; border-radius: 50%;
    background: #C9D6D2;
    transition: background .25s var(--ease), transform .25s var(--ease);
  }
  .t-dot.is-active::before { background: var(--accent); transform: scale(1.25); }

  /* ---- showroom stacks ---- */
  .p-list { gap: 56px; }
  .p-card { grid-template-columns: 1fr; gap: 20px; }
  .gallery { order: -1; }   /* ratio comes from the assets, as above */
  .g-btn { width: 44px; height: 44px; }   /* minimum comfortable touch target */
  .g-btn svg { width: 18px; height: 18px; }
  .g-prev { left: 10px; } .g-next { right: 10px; }
  .p-body { font-size: .9375rem; line-height: 1.7; }

  .cta { --avatar: 104px; --chat-gap: 18px; }
  .chat { flex-direction: column; align-items: flex-start; margin-top: 32px; }
  .chat-bubble { font-size: 1.125rem; padding: 14px 20px; min-width: 84px; border-radius: 20px; }
  /* stacked, so the tail moves to the top of the bubble and points up at the
     circle; the left offset tracks the avatar's centre rather than a constant */
  .chat-bubble::before {
    top: 10px; left: calc((var(--avatar) + var(--rim) * 2) / 2 - 11px);   /* apex (38% of 30px) lands on the avatar's centre */
    width: 30px; height: 26px;
    clip-path: polygon(0 100%, 38% 0, 100% 100%);
    transform: translateY(-100%);
  }
  .chat-mail { font-size: 1rem; }
  .site-footer { padding: 16px 0 32px; }
}

@media (max-width: 560px) {
  .clients { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
}

@media (max-width: 380px) {
  :root { --t-peek: 32px; }
  /* must drive --hero-fs, not font-size directly, or the arrow stops tracking
     the headline and its stroke no longer matches the stem */
  :root { --hero-fs: 2.125rem; }
}

/* ==========================================================================
   Print
   There was no print stylesheet: the sticky header overlapped content, the
   dark About band printed as a solid black slab, canvas-rendered headlines
   came out blank, and carousel controls printed as meaningless circles.
   ========================================================================== */
@media print {
  :root { --gutter: 0; --section-gap: 24px; }

  html { background: #fff; font-size: 11pt; }
  body { overflow: visible; }

  /* a sticky header prints on top of the first screen of content */
  .site-header { position: static; background: none; backdrop-filter: none; box-shadow: none; }
  .site-header .btn { display: none; }

  /* reveal animations must never leave printed content invisible */
  .reveal { opacity: 1 !important; transform: none !important; }
  .cta-line > span { transform: none !important; }
  .chat, .chat *, .chat *::after { animation: none !important; }
  .chat-dots, .is-typing::after { display: none !important; }

  /* the particle canvases render nothing on paper — show the real DOM text */
  canvas { display: none !important; }
  .is-particled { color: #000 !important; }
  .section-head.is-inverse .rotating { color: #000 !important; }

  /* invert the dark band rather than flooding the page with toner */
  .about { background: #fff !important; color: #000 !important; padding-block: 16px; }
  .about-intro a { color: #000 !important; }
  .section-head.is-inverse .rule { background: #000 !important; }

  /* interactive chrome is meaningless on paper */
  .g-btn, .g-dots, .t-controls, .media-placeholder { display: none !important; }
  .hero-media { display: none; }

  /* carousels must print as a full list, not a cropped viewport */
  .t-list {
    display: block !important;
    overflow: visible !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
  .t-row { width: auto !important; display: block !important; }
  .t-card {
    width: auto !important;
    flex-direction: row !important;
    box-shadow: none;
    border: 1pt solid #ccc;
    padding: 12pt;
  }
  .t-card .arrow-mark { position: static !important; transform: none !important; }

  /* only the visible gallery slide is meaningful */
  .gallery { aspect-ratio: auto; height: auto; }
  .gallery-track { display: block !important; transform: none !important; }
  .gallery-slide { display: none !important; }
  .gallery-slide:first-child { display: block !important; }

  /* keep blocks whole across page breaks */
  .t-card, .p-card, .section-head { break-inside: avoid; page-break-inside: avoid; }
  .section-head { break-after: avoid; page-break-after: avoid; }

  /* a printed page can't be clicked — surface the address */
  .site-footer a::after { content: ' (' attr(href) ')'; font-size: 9pt; }
}
