/* =========================================================
   Hero (Home): centred. A signature (photo, name, role), a bold claim, a
   two-line intro, and the "Talk to my Work" chat box as the centrepiece,
   with Download resume below, over a faint dot grid. On load the letters
   of "complicated" arrive scattered and askew, then snap into a line
   (js/hero.js). The chat box turns through real questions; clicking it
   opens the chat and asks the one showing.
   ========================================================= */
.hc {
  --hc-io: cubic-bezier(0.77, 0, 0.175, 1);
  --hc-out: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: calc(var(--pad) + 8rem);
  padding-bottom: 6.5rem;
}

/* ---------- Atmosphere (full width, behind everything) ---------- */
.hc-sky { position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); overflow: hidden; pointer-events: none; }
/* Faint dot grid, strongest in the middle, fading to nothing. */
.hc-sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 45%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 55% at 50% 45%, #000 0%, transparent 75%);
  opacity: 0.8;
}
/* The dots fade out through their own mask (above), so nothing is painted
   over the page here and its film grain carries on unbroken. */

/* ---------- Words ---------- */
.hc-title {
  max-width: 17em;
  font-size: clamp(2.375rem, 5.2vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}
.hc-title .hc-line { display: block; }
.hc-mess { display: inline-block; white-space: nowrap; user-select: none; -webkit-user-select: none; }
.hc-mess[role="button"] { cursor: pointer; }
.hc-mess:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 0.25rem; }
.hc-mess .ch { display: inline-block; }
.hc-lede { max-width: 40em; text-wrap: balance; margin-top: 1.5rem; font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }

/* ---------- The chat box ---------- */
.hc-ask {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 28rem);
  min-height: 3.5rem;
  margin-top: 2.25rem;
  padding: 0.5rem 0.5rem 0.5rem 1.125rem;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  --hc-base: 0 1.5rem 3rem -1.75rem rgba(57, 60, 120, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --hc-k: 0.7; /* how strong the AI shade is; softer on white */
  box-shadow: var(--hc-base), -1.75rem 1rem 3rem -1.25rem rgb(57 101 250 / calc(0.34 * var(--hc-k))), 1.25rem 1.25rem 3rem -1.25rem rgb(242 54 154 / calc(0.26 * var(--hc-k)));
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s var(--hc-out);
}
:root[data-theme="dark"] .hc-ask { --hc-k: 1; --hc-base: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
/* A soft shade in the AI colours under the box, drifting slowly from side
   to side (still with motion reduced or in Calm). */
@media (prefers-reduced-motion: no-preference) { .hc-ask { animation: hc-shade 9s ease-in-out infinite alternate; } }
@keyframes hc-shade {
  0% { box-shadow: var(--hc-base), -1.75rem 1rem 3rem -1.25rem rgb(57 101 250 / calc(0.34 * var(--hc-k))), 1.25rem 1.25rem 3rem -1.25rem rgb(242 54 154 / calc(0.26 * var(--hc-k))); }
  50% { box-shadow: var(--hc-base), 0.25rem 1.5rem 3.25rem -1.25rem rgb(155 127 232 / calc(0.34 * var(--hc-k))), 1.75rem 0.75rem 3rem -1.25rem rgb(57 101 250 / calc(0.26 * var(--hc-k))); }
  100% { box-shadow: var(--hc-base), 1.75rem 1rem 3rem -1.25rem rgb(242 54 154 / calc(0.3 * var(--hc-k))), -1.25rem 1.25rem 3rem -1.25rem rgb(57 101 250 / calc(0.28 * var(--hc-k))); }
}
/* A thin Bloom-coloured light that slowly travels round the box's edge. */
@property --hc-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.hc-ask::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--hc-a), #3965fa, #9b7fe8 12%, #f2369a 24%, transparent 36%, transparent 64%, #3965fa);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@media (prefers-reduced-motion: no-preference) { .hc-ask::before { animation: hc-turn 6s linear infinite; } }
@keyframes hc-turn { to { --hc-a: 360deg; } }
.hc-ask .nav-ai-ic { flex: none; }
.hc-q { position: relative; flex: 1; height: 1.5rem; overflow: hidden; font-size: 1rem; }
.hc-q span { position: absolute; inset: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; color: var(--ink-soft); transition: transform 0.45s var(--hc-out), opacity 0.35s ease; }
.hc-q span.is-out { transform: translateY(-110%); opacity: 0; }
.hc-q span.is-next { transform: translateY(110%); opacity: 0; transition: none; }
.hc-go { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.875rem; background: var(--ink); color: var(--bg); transition: transform 0.2s var(--hc-out); }
.hc-go svg { width: 0.9375rem; height: 0.9375rem; }
@media (hover: hover) and (pointer: fine) {
  .hc-ask:hover { transform: translateY(-2px); }
  .hc-ask:hover .hc-go { transform: rotate(-12deg) scale(1.05); }
}
.hc-ask:active { transform: scale(0.99); }
.hc-ask:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }



/* Download resume, centred under the chat box. */
.hc-resume { margin-top: 1.5rem; }
.hc-link.hc-resume { font-size: 1.0625rem; }
.hc-link.hc-resume svg { width: 1rem; height: 1rem; }
.hc-link { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 24px; font-size: var(--fs-small); font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent); text-underline-offset: 0.3em; transition: text-decoration-color 0.2s ease; }
.hc-link svg { width: 0.875rem; height: 0.875rem; }
@media (hover: hover) and (pointer: fine) { .hc-link:hover { text-decoration-color: currentColor; } }
.hc-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 0.25rem; }

/* ---------- Entrance: one sequence ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hc:not(.is-in) .hc-rise { opacity: 0; transform: translateY(0.875rem); filter: blur(6px); }
  .hc-rise { transition: opacity 0.9s var(--hc-out), transform 0.9s var(--hc-out), filter 0.9s var(--hc-out); transition-delay: calc(var(--d, 0) * 1ms); }
  /* Clicked: the letters fly apart at once. Tidied: they snap back into line
     one by one, slowly enough to watch. */
  .hc-mess .ch { transition: transform 0.25s var(--hc-out); }
  .hc-mess.is-messed .ch { transform: translate(calc(var(--x) * 1px), calc(var(--y) * 1px)) rotate(calc(var(--r) * 1deg)); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); transition-delay: calc(var(--i) * 18ms); }
  .hc-mess.is-tidying .ch { transition: transform 1.1s var(--hc-io); transition-delay: calc(var(--i) * 70ms); }
  html:not([data-motion="calm"]) .hc-mess:not(.is-messed, .is-tidying) .ch { transition: transform 0.32s var(--hc-out); transition-delay: calc(var(--i) * 22ms); }
  /* The nudge as the page opens (.is-hint, hero.js), on every screen size:
     the letters tip further than on hover, so it is easy to notice. The
     letters are children 2 to 6 (the first child is the screen-reader word). */
  html:not([data-motion="calm"]) .hc-mess.is-hint .ch:nth-child(2) { transform: translateY(-0.05em) rotate(-6deg); }
  html:not([data-motion="calm"]) .hc-mess.is-hint .ch:nth-child(3) { transform: translateY(0.1em) rotate(7deg); }
  html:not([data-motion="calm"]) .hc-mess.is-hint .ch:nth-child(4) { transform: translateY(-0.085em) rotate(-10deg); }
  html:not([data-motion="calm"]) .hc-mess.is-hint .ch:nth-child(5) { transform: translateY(0.11em) rotate(8deg); }
  html:not([data-motion="calm"]) .hc-mess.is-hint .ch:nth-child(6) { transform: translateY(-0.06em) rotate(-7deg); }
  /* Pointing at it, the letters settle unevenly, each at its own height and
     angle, and stay until the pointer leaves. */
  @media (hover: hover) and (pointer: fine) and (min-width: 641px) {
    html:not([data-motion="calm"]) .hc-mess:not(.is-messed, .is-tidying):hover .ch:nth-child(2) { transform: translateY(-0.025em) rotate(-3deg); }
    html:not([data-motion="calm"]) .hc-mess:not(.is-messed, .is-tidying):hover .ch:nth-child(3) { transform: translateY(0.055em) rotate(4deg); }
    html:not([data-motion="calm"]) .hc-mess:not(.is-messed, .is-tidying):hover .ch:nth-child(4) { transform: translateY(-0.045em) rotate(-6deg); }
    html:not([data-motion="calm"]) .hc-mess:not(.is-messed, .is-tidying):hover .ch:nth-child(5) { transform: translateY(0.065em) rotate(5deg); }
    html:not([data-motion="calm"]) .hc-mess:not(.is-messed, .is-tidying):hover .ch:nth-child(6) { transform: translateY(-0.03em) rotate(-4deg); }
  }
}

@media (max-width: 640px) {
  .hc { padding-top: calc(var(--pad) + 7.5rem); padding-bottom: 4rem; } /* a little more air under the nav */
  .hc-title { font-size: clamp(1.5rem, 8.2vw, 3.25rem); }
  .hc-title .hc-line { white-space: nowrap; }
  .hc-lede { font-size: 1rem; margin-top: 1.25rem; }
  .hc-ask { margin-top: 2rem; min-height: 3.5rem; }
  .hc-q { font-size: 0.9375rem; }
}
@media (forced-colors: active) {
  .hc-ask { border: 1px solid CanvasText; }
  .hc-sky { display: none; }
}

/* =========================================================
   Headline: always two lines ("I turn messy products" / "into ones
   people get."), heavy, with stickers that act out the words: a sky knot
   on "messy", an app window and a lilac tick on the second line. Sticker
   styles are shared site-wide (style.css, .hs).
   ========================================================= */
.hc-title.hc-big { max-width: none; font-size: clamp(1.625rem, 6.3vw, 4.75rem); font-weight: 800; letter-spacing: -0.05em; word-spacing: 0.08em; line-height: 1; }
.hc-big .hc-line { position: relative; display: block; width: fit-content; margin-inline: auto; white-space: nowrap; }
.hs-knot { right: -0.78em; top: -0.32em; width: 0.86em; height: 0.86em; --hr: 10deg; }
.hs-knot .hs-burst { fill: #c4d6fb; }
.hs-tick { right: -0.7em; top: 0.1em; width: 0.56em; height: 0.56em; border-radius: 50%; background: #d4d0f2; color: #1b1b39; --hr: 8deg; }
.hs-tick svg { width: 62%; height: 62%; }
@media (prefers-reduced-motion: no-preference) {
  .hc.is-in .hs-knot { transition-delay: 1.3s; }
  .hc.is-in .hs-tick { transition-delay: 1.55s; }
}
@media (max-width: 640px) {
  .hc-title.hc-big { font-size: clamp(1.5rem, 8.4vw, 2.75rem); line-height: 1.12; }
  .hs-knot { right: -0.5em; top: -0.5em; width: 0.7em; height: 0.7em; }
  .hs-tick { right: -0.6em; width: 0.48em; height: 0.48em; }
}

/* ---------- The visiting cursor (hero.js) ----------
   A design-tool cursor with a name tag; the blue selection with handles and
   its size; a dark floating toolbar with Tidy up; and a comment pin with a
   note. All drawn inside the hero, above it, and never in the way. */
.hcur { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; --hcur-me: #e42f97; --hcur-arrow: #0d0d0d; --hcur-arrow-edge: #fff; --hcur-sel: #3965fa; } /* a plain black pointer with a white edge, a Bloom-pink name tag and avatar, the selection in the brand blue */
:root[data-theme="dark"] .hcur { --hcur-me: #ea3a96; --hcur-sel: #5b82ff; }
.hcur.is-on { opacity: 1; }
.hcur.is-gone { opacity: 0; }
.hcur-cur { position: absolute; left: 0; top: 0; z-index: 3; transition: opacity 0.35s ease; }
.hcur-cur.is-gone { opacity: 0; }
.hcur-cur svg { display: block; width: 22px; height: 22px; fill: var(--hcur-arrow); stroke: var(--hcur-arrow-edge); stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.25)); transform-origin: 3px 2px; transition: transform 0.12s ease-out; }
.hcur-cur.is-down svg { transform: scale(0.86); }
.hcur-cur span { position: absolute; left: 21px; top: 19px; padding: 5px 13px 6px; border-radius: 3px 14px 14px 14px; background: var(--hcur-me); color: #fff; font: 500 13px/1.25 var(--font), sans-serif; letter-spacing: 0.01em; white-space: nowrap; }
.hcur-sel { position: absolute; left: 0; top: 0; border: 1px solid var(--hcur-sel); opacity: 0; transition: opacity 0.18s ease; }
.hcur-sel.is-on { opacity: 1; }
.hcur-sel i { position: absolute; width: 6px; height: 6px; border: 1px solid var(--hcur-sel); background: #fff; }
.hcur-sel i:nth-child(1) { left: -3.5px; top: -3.5px; } .hcur-sel i:nth-child(2) { right: -3.5px; top: -3.5px; }
.hcur-sel i:nth-child(3) { left: -3.5px; bottom: -3.5px; } .hcur-sel i:nth-child(4) { right: -3.5px; bottom: -3.5px; }
.hcur-size { position: absolute; left: 50%; top: calc(100% + 7px); transform: translateX(-50%); padding: 1px 5px; border-radius: 3px; background: var(--hcur-sel); color: #fff; font: 600 10px/1.3 var(--font), sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hcur-bar { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 8px; background: #1e1e1e; color: #fff; font: 600 12px/1 var(--font), sans-serif; white-space: nowrap; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.45); opacity: 0; scale: 0.92; transform-origin: 50% 100%; transition: opacity 0.16s ease, scale 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hcur-bar svg { width: 13px; height: 13px; fill: currentColor; }
.hcur-bar.is-on { opacity: 1; scale: 1; }
@media print { .hcur { display: none; } }

/* A quiet line above the title, "Hi, this is Pallav Bhatnagar". The name is
   in full ink with the dotted underline that says there's more: point at
   it for how to say it, click it to hear it. */
.hc-hi { position: relative; z-index: 2; margin: 0 0 0.5rem; font-size: 1.1875rem; font-weight: 500; line-height: 1.4; letter-spacing: 0.012em; color: var(--ink-soft); }
.hc-hi .say { font-weight: 600; color: var(--ink); }
@media (max-width: 640px) { .hc-hi { margin-bottom: 0.375rem; font-size: 1.0625rem; } }

/* A soft highlighter stroke behind "people get.", covering the lower
   part of the letters, with slightly uneven edges and a small tilt. */
.hc-mark { position: relative; display: inline-block; isolation: isolate; }
.hc-mark::before {
  content: ""; position: absolute; z-index: -1; left: -0.09em; right: -0.11em; top: 0.4em; bottom: -0.1em;
  background: #e2dafa; opacity: 0.5; rotate: -0.5deg;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'%3E%3Cpath d='M6 14C60 6 130 10 200 5S285 4 296 9C300 18 297 34 298 46 250 52 180 50 120 55S30 58 7 54C2 40 3 26 6 14Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'%3E%3Cpath d='M6 14C60 6 130 10 200 5S285 4 296 9C300 18 297 34 298 46 250 52 180 50 120 55S30 58 7 54C2 40 3 26 6 14Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
:root[data-theme="dark"] .hc-mark::before { background: #4a3f78; opacity: 0.3; }
@media (forced-colors: active) { .hc-mark::before { display: none; } }

/* The wash behind the hero: three soft pools of colour drifting slowly
   (pale blue, rose and lilac in the light theme; navy into plum in the
   dark), fading into the page at the bottom so the next section starts
   clean. Still with motion reduced or in Calm. */
.hc { --hx-a: #dfe6ff; --hx-b: #f9dcee; --hx-c: #e9e0ff; }
:root[data-theme="dark"] .hc { --hx-a: #172a52; --hx-b: #43192f; --hx-c: #261a47; }
.hc .hc-sky::before {
  inset: -15% -10%;
  background:
    radial-gradient(38% 46% at 16% 72%, var(--hx-a), transparent 70%),
    radial-gradient(36% 44% at 84% 26%, var(--hx-b), transparent 70%),
    radial-gradient(30% 36% at 58% 88%, var(--hx-c), transparent 70%);
  background-size: auto;
  -webkit-mask-image: none; mask-image: none;
  opacity: 1;
  filter: blur(24px);
}
.hc .hc-sky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 62%, var(--bg)); }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="calm"]) .hc .hc-sky::before { animation: hx-drift 28s ease-in-out infinite alternate; }
}
@keyframes hx-drift { from { transform: translate3d(-3%, 2%, 0) scale(1.04); } to { transform: translate3d(3%, -2.5%, 0) scale(1); } }
/* Softer in the dark theme, so the colour stays a glow behind the type. */
.hc .hc-sky::before { opacity: 0.6; } /* softer wash */
:root[data-theme="dark"] .hc .hc-sky::before { opacity: 0.42; }
@media (forced-colors: active) { .hc .hc-sky { display: none; } }
/* On "untangle" in the "How I untangle a product." heading, the highlight
   is drawn deeper and wider so it reads as boldly as it did on the hero's
   bigger type. */
#value-title .hc-mark::before { left: -0.16em; right: -0.18em; top: 0.22em; bottom: -0.16em; }

/* =========================================================
   The first screen: the hero fills it, and its foot carries three quiet
   facts (a small coloured sticker, a bold line, a soft line) and a text
   link down to the work. On phones the foot follows the hero in the flow.
   ========================================================= */
.hc { box-sizing: border-box; min-height: 100vh; min-height: 100svh; padding-bottom: max(14rem, 37vh); } /* lifts the centred hero well clear of the facts, scaled to the screen height */
.hc-foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 0.875rem; display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
.hc-facts { display: flex; justify-content: space-between; gap: 1.5rem; width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.hc-fact { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; }
/* Each icon is a small tilted sticker, like the ones on the headings. */
.hc-fact-ic { flex: none; display: grid; place-items: center; width: 2.125rem; height: 2.125rem; border-radius: 0.625rem; background: var(--stk, #c3cff9); color: #1b1b39; rotate: var(--hr, -6deg); }
.hc-fact:nth-child(2) .hc-fact-ic { --stk: #cfe7b0; --hr: 7deg; color: #215452; }
.hc-fact:nth-child(3) .hc-fact-ic { --stk: #fbd0e4; --hr: -8deg; color: #7a1f4f; }
.hc-fact-ic svg { width: 58%; height: 58%; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hc-fact-ic { transition: rotate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .hc-fact:hover .hc-fact-ic { rotate: calc(var(--hr, -6deg) * -1); }
}
.hc-fact-txt { display: flex; flex-direction: column; gap: 0.125rem; }
.hc-fact-txt b { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.hc-fact-txt span { max-width: 17em; font-size: 0.8125rem; line-height: 1.4; color: var(--ink-soft); }
/* A plain text link with a nudging arrow, no button box. */
.hc-down { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 32px; padding: 0 0.25rem; font-size: var(--fs-small); font-weight: 500; color: var(--ink); text-decoration: none; }
.hc-down svg { width: 0.9375rem; height: 0.9375rem; }
.hc-down:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 0.25rem; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="calm"]) .hc-down svg { animation: hc-down-nudge 2.4s ease-in-out infinite; }
}
@keyframes hc-down-nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(3px); } }
@media (max-width: 900px) { .hc-facts { flex-direction: column; gap: 1rem; } }
@media (max-width: 900px), (max-height: 700px) {
  .hc { padding-bottom: 3rem; }
  .hc-foot { position: static; margin-top: 3rem; width: 100%; }
}
/* At the very top of Home the frosted band at the bottom edge steps aside,
   so the facts and the link read clearly; it returns as soon as you scroll
   (js/fold.js sets .home-top). */
/* Home: the blur and its fade follow the scroll in (js/fold.js sets
   --edge-in from 0 at the top to 1 after 600px), instead of popping on. */
.edge-blur > i, .edge-blur::after { opacity: calc(var(--edge-in, 1) * var(--edge-out, 1)); }
/* The projects heading follows the first screen with a little air. */
.projects { margin-top: 6rem; }
/* Phones: the three facts become a ribbon drifting sideways on an endless
   loop (the second copy only makes the loop seamless; hidden from screen
   readers). Motion reduced or Calm: they stack, still. */
.hc-facts-view { width: 100%; }
.hc-facts-copy { display: none; }
@media (max-width: 640px) {
  .hc-facts-view { display: flex; overflow: hidden; width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
  .hc-facts { flex: none; flex-direction: row; gap: 2.25rem; width: auto; padding-right: 2.25rem; }
  .hc-fact { flex: none; }
  .hc-fact-txt span { max-width: 13.5em; }
  .hc-facts-copy { display: flex; }
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="calm"]) .hc-facts { animation: hc-ribbon 26s linear infinite; }
  }
}
@keyframes hc-ribbon { to { transform: translateX(-100%); } }
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .hc-facts-view { display: block; width: 100%; margin: 0; -webkit-mask-image: none; mask-image: none; }
  .hc-facts { flex-direction: column; padding: 0; }
  .hc-facts-copy { display: none; }
}
@media (max-width: 640px) {
  html[data-motion="calm"] .hc-facts-view { display: block; width: 100%; margin: 0; -webkit-mask-image: none; mask-image: none; }
  html[data-motion="calm"] .hc-facts { flex-direction: column; padding: 0; }
  html[data-motion="calm"] .hc-facts-copy { display: none; }
}
/* Phones: the ribbon and the link sit at the bottom of the first screen, as
   on wide screens; the hero lifts to leave them room. */
@media (max-width: 640px) {
  .hc { padding-bottom: max(11rem, 27vh); }
  .hc-foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 1.25rem; margin-top: 0; width: auto; gap: 1.25rem; }
}
/* Phones: no "Selected work, this way" link; the ribbon alone sits at the
   bottom of the first screen. */
@media (max-width: 640px) {
  .hc-down { display: none; }
  .hc-foot { bottom: 1.75rem; }
  .hc { padding-bottom: max(8.5rem, 22vh); }
}
/* Tablets and narrow windows (641-900px): the three facts stay in one row
   at the bottom of the first screen, as on wide screens. */
@media (min-width: 641px) and (max-width: 900px) and (min-height: 701px) {
  .hc { padding-bottom: max(14rem, 33vh); }
  .hc-foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 1.75rem; margin-top: 0; width: auto; }
  .hc-facts { flex-direction: row; gap: 1rem; }
  .hc-fact { flex: 1 1 0; }
  .hc-fact-txt span { max-width: none; }
}
/* "Selected work, this way" fades away once you start scrolling and returns at
   the top (js/fold.js sets .home-top). */
.hc-down { transition: opacity 0.5s ease; }
html:not(.home-top) .hc-down { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .hc-down { transition: none; } }
html[data-motion="calm"] .hc-down { transition: none; }

/* =========================================================
   First-screen layout (supersedes the padding-based placement above):
   a grid as tall as the screen. Spare space splits above the hero content
   (1 part) and below it (1.35 parts), so the content sits a little above
   centre; the facts and the link take the last row, so they always end
   at the bottom of the screen and never fall below it. If the screen is
   too short for everything, the gap below the content shrinks first
   (to 2.5rem) before the hero grows.
   ========================================================= */
.hc { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto auto auto auto minmax(2.5rem, 1.35fr) auto; justify-items: center; align-content: stretch; padding-bottom: 1rem; }
.hc > .hc-hi { grid-row: 2; }
.hc > .hc-title { grid-row: 3; }
.hc > .hc-lede { grid-row: 4; }
.hc > .hc-ask { grid-row: 5; }
.hc > .hc-resume { grid-row: 6; }
.hc > .hc-foot { grid-row: 8; position: relative; left: auto; right: auto; bottom: auto; width: 100%; margin: 0; }
/* The foot fades and rises in with the rest of the hero as the page opens
   (the same entrance as the other .hc-rise parts; a rule above had swapped
   it for a slide). */
@media (prefers-reduced-motion: no-preference) {
  .hc-foot.hc-rise { transition: opacity 0.9s var(--hc-out), transform 0.9s var(--hc-out), filter 0.9s var(--hc-out); transition-delay: calc(var(--d, 0) * 1ms); }
}
@media (max-width: 640px) { .hc { padding-bottom: 1.5rem; } }
/* Short screens (a landscape tablet or a small laptop window): less air under
   the nav, so the facts and the link still end on the first screen. */
@media (min-width: 641px) and (max-height: 700px) { .hc { padding-top: calc(var(--pad) + 5rem); } }
/* The facts: each title and line on one line, the three spaced evenly with
   air between them, and more room above them on every screen. */
.hc { grid-template-rows: minmax(0, 1fr) auto auto auto auto auto minmax(5rem, 1.6fr) auto; }
.hc-fact-txt b, .hc-fact-txt span { white-space: nowrap; max-width: none; }
@media (min-width: 641px) {
  .hc-facts { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 1.25rem clamp(2rem, 6vw, 4.5rem); }
  .hc-fact { flex: none; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .hc-facts { gap: 1rem 1.5rem; }
  .hc-fact { gap: 0.5rem; }
  .hc-fact-ic { width: 1.875rem; height: 1.875rem; }
  .hc-fact-txt b { font-size: 0.875rem; }
  .hc-fact-txt span { font-size: 0.75rem; }
}
/* The link is the caret alone (named for screen readers), with a 40px tap area. */
.hc-down { justify-content: center; width: 40px; height: 40px; min-height: 0; padding: 0; }
.hc-down svg { width: 1.25rem; height: 1.25rem; }
/* The hero content sits higher: less of the spare space above it. */
.hc { grid-template-rows: minmax(0, 0.55fr) auto auto auto auto auto minmax(5rem, 1.6fr) auto; }
/* iPad and desktop: the hero content starts at a set distance under the nav
   (not centred); all the spare space goes between it and the facts. */
@media (min-width: 641px) {
  .hc { grid-template-rows: 0 auto auto auto auto auto minmax(4rem, 1fr) auto; padding-top: calc(var(--pad) + 7.5rem); }
}
@media (min-width: 641px) and (max-height: 700px) { .hc { padding-top: calc(var(--pad) + 5rem); } }
/* iPad and desktop: the three facts always stay on one row. The foot may
   run wider than the hero's text column (up to the page edges), and the
   gaps between the facts shrink before anything would wrap. */
@media (min-width: 641px) {
  .hc > .hc-foot { width: min(calc(100vw - 2 * var(--pad)), 68rem); }
  .hc-facts { flex-wrap: nowrap; justify-content: center; gap: clamp(1rem, 4vw, 4.5rem); }
}
/* Less space between the facts and the arrow under them. */
.hc-foot { gap: 0.5rem; }
/* iPad and desktop: the facts row spans the same column as the content
   below (the projects heading and cards): first fact on the left edge,
   last on the right. If the column is ever too narrow it grows past it,
   centred, rather than wrapping. */
@media (min-width: 641px) {
  .hc > .hc-foot { width: 100%; min-width: max-content; }
  .hc-facts { justify-content: space-between; gap: 1.25rem; }
}
/* Smaller screens: the description is as wide as the title (hero.js measures
   it), with lines filled rather than balanced so it reaches that width. */
@media (max-width: 820px) {
  .hc .hc-lede { width: 100%; max-width: var(--hc-title-w, 40em); text-wrap: pretty; }
}

/* The hero description, a size up. */
.hc .hc-lede { font-size: 1.1875rem; line-height: 1.55; }
@media (max-width: 640px) { .hc .hc-lede { font-size: 1.0625rem; } }

/* "messy": the hover and click area hugs the letters, so it no longer
   reaches up toward the "Hi, I'm" line. */
.hc-mess { line-height: 0.72; vertical-align: baseline; }
.hc-mess .ch, .hc-mess .sr-only { pointer-events: none; }
.hc-mess:focus-visible { outline-offset: 3px; }
/* Only the letters answer the pointer: the word itself ignores it, and an
   invisible strip from the top of the letters to just under the baseline
   takes the hover and the click. */
.hc-mess { position: relative; z-index: 1; pointer-events: none; }
.hc-mess::after { content: ""; position: absolute; left: 0; right: 0; top: 0.14em; bottom: -0.12em; pointer-events: auto; }

/* Tablets held upright (iPad portrait): the hero no longer stretches to
   the full, very tall screen, which left a large empty band between the
   words and the facts. It ends with its content; the facts follow a fixed
   distance below, and the projects start soon after. */
@media (min-width: 641px) and (max-width: 1199px) and (orientation: portrait), (min-width: 641px) and (orientation: portrait) and (hover: none) and (pointer: coarse) {
  .hc { min-height: 0; grid-template-rows: minmax(0, 1fr) auto auto auto auto auto 6.5rem auto; padding-bottom: 1rem; }
}

/* Trial: the headline in medium (500) instead of extra-bold (800). Lighter
   strokes read a touch wider, so the tracking opens slightly. */
.hc-title.hc-big { font-weight: 500; letter-spacing: -0.04em; }

/* Trial: the ask box keeps its design (the light travelling round the edge,
   the soft shade underneath, the dark send key) but in greys only, no blue,
   violet or pink. */
.hc-ask { box-shadow: var(--hc-base), -1.75rem 1rem 3rem -1.25rem rgb(60 60 60 / calc(0.22 * var(--hc-k))), 1.25rem 1.25rem 3rem -1.25rem rgb(120 120 120 / calc(0.2 * var(--hc-k))); --hc-base: 0 1.5rem 3rem -1.75rem rgba(40, 40, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
:root[data-theme="dark"] .hc-ask { --hc-base: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
@media (prefers-reduced-motion: no-preference) { .hc-ask { animation-name: hc-shade-grey; } }
@keyframes hc-shade-grey {
  0% { box-shadow: var(--hc-base), -1.75rem 1rem 3rem -1.25rem rgb(60 60 60 / calc(0.22 * var(--hc-k))), 1.25rem 1.25rem 3rem -1.25rem rgb(120 120 120 / calc(0.2 * var(--hc-k))); }
  50% { box-shadow: var(--hc-base), 0.25rem 1.5rem 3.25rem -1.25rem rgb(90 90 90 / calc(0.24 * var(--hc-k))), 1.75rem 0.75rem 3rem -1.25rem rgb(60 60 60 / calc(0.18 * var(--hc-k))); }
  100% { box-shadow: var(--hc-base), 1.75rem 1rem 3rem -1.25rem rgb(120 120 120 / calc(0.22 * var(--hc-k))), -1.25rem 1.25rem 3rem -1.25rem rgb(60 60 60 / calc(0.2 * var(--hc-k))); }
}
.hc-ask::before { background: conic-gradient(from var(--hc-a), #6b6b6b, #a3a3a3 12%, #d6d6d6 24%, transparent 36%, transparent 64%, #6b6b6b); }
:root[data-theme="dark"] .hc-ask::before { background: conic-gradient(from var(--hc-a), #d6d6d6, #9a9a9a 12%, #5c5c5c 24%, transparent 36%, transparent 64%, #d6d6d6); }

/* Trial: the hero set flush left. Every line, the box, the resume link and
   the down arrow start at the same left edge. The app sticker hangs in the
   margin beside the second line on wide screens; on phones (no margin) it
   sits at the start of that line instead. */
.hc { justify-items: start; text-align: left; }
.hc > .hc-hi, .hc > .hc-title, .hc > .hc-lede, .hc > .hc-ask, .hc > .hc-resume { justify-self: start; }
.hc-big .hc-line { margin-inline: 0; }
.hc .hc-lede { margin-inline: 0; text-wrap: pretty; }
.hc-foot { align-items: flex-start; }
@media (max-width: 640px) {
  .hs-app { position: relative; left: auto; top: 0.02em; display: inline-block; margin-right: 0.18em; vertical-align: -0.02em; }
}

/* Trial: the ask box holds still. No light travelling round the edge, no
   drifting shade: a plain grey edge and a soft, steady grey shadow. */
.hc-ask { animation: none !important; border-color: color-mix(in srgb, var(--ink) 18%, transparent); box-shadow: var(--hc-base), 0 1rem 2.5rem -1.25rem rgb(60 60 60 / 0.22); }
:root[data-theme="dark"] .hc-ask { border-color: rgba(255, 255, 255, 0.16); box-shadow: var(--hc-base); }
.hc-ask::before { display: none; }

/* Trial: the ask box in its colours again, held still: the blue, violet
   and pink light rests on the top-left edge, and the soft blue and pink
   shade sits under the box without drifting. */
.hc-ask { border-color: color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: var(--hc-base), -1.75rem 1rem 3rem -1.25rem rgb(57 101 250 / calc(0.34 * var(--hc-k))), 1.25rem 1.25rem 3rem -1.25rem rgb(242 54 154 / calc(0.26 * var(--hc-k))) !important; animation: none !important; }
:root[data-theme="dark"] .hc-ask { border-color: color-mix(in srgb, var(--ink) 12%, transparent); }
.hc-ask::before { display: block; --hc-a: 200deg; background: conic-gradient(from var(--hc-a), #3965fa, #9b7fe8 12%, #f2369a 24%, transparent 36%, transparent 64%, #3965fa) !important; animation: none !important; }
/* Trial: and its motion back, as in the original: the light travels round
   the edge and the shade drifts. Still with reduced motion or in Calm. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="calm"]) .hc-ask { animation: hc-shade 9s ease-in-out infinite alternate !important; }
  html:not([data-motion="calm"]) .hc-ask::before { animation: hc-turn 6s linear infinite !important; }
}
/* Trial: no colour wash behind the hero; plain page colour. */
.hc .hc-sky, .hc-sky { display: none !important; }
/* Trial: no shadow under the ask box; only the light travelling round
   its edge moves. */
html .hc .hc-ask, html:not([data-motion="calm"]) .hc .hc-ask { box-shadow: none !important; animation: none !important; }
/* Trial: a softer edge light on the ask box: the same colours, toned down. */
.hc .hc-ask::before { opacity: 1; } /* light: full colour */
:root[data-theme="dark"] .hc .hc-ask::before { opacity: 0.55; }
/* The ask box with softer corners (was 1.25rem), its send key to match. */
.hc .hc-ask { border-radius: 0.75rem; }
.hc .hc-go { border-radius: 0.5rem; }
/* Rounder ask boxes: the hero's and the chat panel's, with their send keys. */
.hc .hc-ask { border-radius: 1.5rem; }
.hc .hc-go { border-radius: 1rem; }
.ask-panel-form { border-radius: 1.5rem !important; }
.ask-panel-send { border-radius: 1rem !important; }
