/* Site layout. Prefixed s- so it never fights the design system (tokens.css, components.css). */
html { scroll-behavior: smooth; scroll-padding-top: var(--space-6); overflow-x: clip; } /* hidden hover cards and tooltips can never widen the page on a phone */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.s-skip { position: absolute; inset-inline-start: var(--space-4); inset-block-start: -5rem; z-index: var(--z-toast); }
.s-skip:focus-visible { inset-block-start: var(--space-3); }
.frame { padding-block-end: var(--dock-clearance); }
.s-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.s-cap { font: var(--text-meta); color: var(--color-text-tertiary); }
.s-hide-sm { display: none; }
@media (min-width: 40em) { .s-hide-sm { display: inline; } }
.dotted-box { background: var(--rule-dotted-h) top / 100% 1px no-repeat, var(--rule-dotted-h) bottom / 100% 1px no-repeat, var(--rule-dotted-v) left / 1px 100% no-repeat, var(--rule-dotted-v) right / 1px 100% no-repeat; }
.w { display: inline-block; }
.w.is-punct, .hw.is-punct { display: inline; } /* a comma after a styled phrase stays on its line */
.nobr { white-space: nowrap; }
.acc__item.is-settled .acc__body { overflow: visible; } /* a fully open answer lets its copy tooltip show */
.acc__copy { font: inherit; padding: 0; border: 0; cursor: pointer; }
.rise--line { animation-delay: calc(var(--i, 0) * 160ms); }

/* sections: one continuous hairline between main sections (content width, never touching the dotted guides),
   with twice the old air above and below it (--rule-above, --rule-below); big title, short note, then the content */
/* Optically equal air on both sides of the hairline: below it, --rule-below plus the big heading's own space above its
   capitals (about half its size, measured: 40px of an 80px heading); above it, the same total, so the eye reads both
   gaps as one size. Measured with scratch tooling: last baseline or box -> line = line -> heading cap top. */
:root { --s-head-size: clamp(2.5rem, 1rem + 5vw, 5rem); --rule-gap: calc(var(--rule-below) + 0.5 * var(--s-head-size)); }
@media (max-width: 63.99em) { :root { --rule-below: 5rem; } }    /* tablets: about 107 px either side of a hairline (desktop 140) */
@media (max-width: 35.99em) { :root { --rule-below: 3.75rem; } } /* phones: 80 px */
.s-section { padding-block: var(--rule-below) var(--rule-gap); background: linear-gradient(var(--color-border-default), var(--color-border-default)) top / 100% 1px no-repeat; }
.s-proof { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-10); padding-block-end: var(--rule-gap); }
/* Grouping: a title and its text belong together, so they are close; the buttons that act on them are the next group,
   1.5x as far on phones and 2x on tablets and desktops (measured optically: baseline to cap height, text to button). */
.s-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-block: 0 var(--space-12); }
.s-head__title { font: 600 var(--s-head-size) / 0.95 var(--font-display); letter-spacing: -0.045em; text-wrap: balance; }
.s-head__text { font: var(--text-body-lg); color: var(--color-text-secondary); max-inline-size: 54ch; text-wrap: pretty; }

/* hero: the layout of aryandeopa.com (layout only). The words in a narrow column; below them the photo on a tall red card,
   centred and a little below the middle of the screen, the name and the roles either side of it. On scroll the card rises
   above the photo and the photo follows much more slowly. The KPIs sit below the hero, not in it.
   The photo is shrunk, never cropped; the card is the texture, cropped to fill. */
.s-hero { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: var(--space-12); min-block-size: calc(100svh - var(--dock-clearance)); padding-block: var(--space-16) var(--space-10); } /* 64 px above the headline, the height unchanged */
.s-hero__text { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; inline-size: min(100%, 44rem); justify-self: center; } /* above the photo and its red card as they rise on scroll */
.s-hero__text .btn--secondary { --btn-bg: var(--color-bg-primary); } /* solid, so the rising red card passes under it, not through it */
.s-hero__text .btn--secondary:is(:hover, .is-hover) { --btn-bg: var(--color-bg-secondary); }
.s-hero__text .btn--secondary:is(:active, .is-active) { --btn-bg: var(--color-bg-tertiary); }
.s-hero__text > .s-lead { margin-block-start: 0.875rem; }
.s-hero__text > .s-row { margin-block-start: 1.9375rem; }
@media (min-width: 48em) { .s-hero__text > .s-row { margin-block-start: clamp(2.875rem, 2.6rem + 0.55vw, 3.125rem); } } /* 2x at every width */
.s-hero__title { font: var(--text-display-weight) clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem) / 1.08 var(--font-display); letter-spacing: -0.035em; text-wrap: balance; } /* 36px at most */
.s-lead { max-inline-size: var(--measure-lead); text-wrap: pretty; }
.s-hero .s-lead { font-size: 1rem; line-height: 1.6; } /* 16px under a 36px heading: a clear step */
.s-hero__stage { --fig-w: min(100%, 34rem); display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "fig fig" "name role"; gap: var(--space-6) var(--space-4); align-self: center; align-items: start; }
.s-figure { grid-area: fig; position: relative; justify-self: center; inline-size: var(--fig-w); aspect-ratio: 1800 / 1520; isolation: isolate; }
.s-figure__card { position: absolute; inset-block: 0; inset-inline: 28%; z-index: -1; background: var(--color-accent) url(/assets/img/red-texture.jpg) center / cover; transform: translate3d(0, calc(-1 * var(--shift, 0px)), 0); will-change: transform; }
/* Hero entrance: the red card unrolls downward like a carpet, same place, same size, its texture already on it; a shaded roll
   rides the leading edge and thins out as it unrolls. The script starts it once the texture is decoded (.is-unrolling);
   without the script it unrolls on its own after 6 s (late enough not to race a slow script). Reduced motion: the card is simply there. */
@property --u { syntax: "<number>"; inherits: true; initial-value: 1; }
@keyframes carpet { from { --u: 0; } to { --u: 1; } }
@keyframes carpet-late { from { --u: 0; } to { --u: 1; } }
.s-hero { --carpet-ms: 1000; }
.s-figure__card { clip-path: inset(0 0 calc((1 - var(--u)) * 100%) 0); }
.s-figure__card::after { content: ""; position: absolute; inset-inline: 0; inset-block-start: calc(var(--u) * 100% - var(--roll)); block-size: var(--roll); --roll: calc((1 - var(--u)) * 9% + 1.5%);
  background: linear-gradient(180deg, rgb(0 0 0 / 0.42), rgb(255 255 255 / 0.2) 38%, rgb(255 255 255 / 0.06) 55%, rgb(0 0 0 / 0.5)), var(--color-accent) url(/assets/img/red-texture.jpg) center / cover;
  box-shadow: 0 0.35rem 0.6rem -0.3rem rgb(0 0 0 / 0.45); opacity: clamp(0, (1 - var(--u)) * 8, 1); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .s-figure__card { animation: carpet-late calc(var(--carpet-ms) * 1ms) cubic-bezier(0.3, 0, 0.12, 1) 6s both; }
  .js .s-hero.is-unrolling .s-figure__card { animation-name: carpet; animation-delay: 0s; }
}
.s-figure__photo { position: absolute; inset-inline: 0; inset-block-start: 9.65%; transform: translate3d(0, calc(-0.3 * var(--shift, 0px)), 0); will-change: transform; } /* photo centre at 43% of the card: a little above its middle */
.s-figure__photo img { display: block; inline-size: 100%; block-size: auto; }
.s-hero__side { font: var(--text-body-sm); color: var(--color-text-primary); margin: 0; }
.s-hero__side--name { grid-area: name; }
.s-hero__side--role { grid-area: role; text-align: end; }
@media (min-width: 48em) {
  .s-hero__stage { --fig-w: min(40vw, 26rem); grid-template-columns: 1fr auto 1fr; grid-template-areas: "name fig role"; }
  .s-hero__side { padding-block-start: calc(var(--fig-w) * 0.363 - 0.75em); } /* level with the middle of the photo */
}
#kpis .kpi__value { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.25rem); }
/* testimonial: the logos sit to the right of the name and designation */
.testimonial__who { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3) var(--space-8); } /* name and role at the left, the logos at the far right (below them only when there is no room) */
.testimonial__id { display: grid; gap: var(--space-1); }
.testimonial__logos { --s: 0.6; flex-wrap: nowrap; margin: 0; }
.testimonial__logos .logo-tile { --s: 0.6; }
.testimonial__logos:empty { display: none; }

.s-metrics { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; font: var(--text-mono-ui); color: var(--color-text-secondary); }
.s-metrics li::before { content: "› "; color: var(--color-accent-text); }
.s-side .card-project__hero img { display: block; inline-size: 100%; block-size: auto; background: var(--color-bg-tertiary); }
/* side projects carry less weight than Selected Work: a 3 / 2 / 1 grid of compact cards (image, title, KPIs, CTA),
   each opened by a dotted rule. The CTA sits twice as far from the KPIs as the KPIs sit from the title (optically). */
.s-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); } /* selected work: card, 48px, dotted line, 48px, next card */
.s-sides { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12) var(--space-8); align-items: start; }
@media (min-width: 48em) { .s-sides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .s-sides { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.s-sides > .card-project { gap: var(--space-5); padding-block: var(--space-6) 0; background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
.s-side__body { display: grid; grid-template-columns: minmax(0, 1fr); }
.s-side__title { font: var(--text-h5); letter-spacing: var(--text-h5-ls); text-wrap: balance; max-inline-size: none; } /* the card is the measure */
.s-side .s-metrics { margin-block-start: var(--space-3); }
.s-side__cta { margin: calc(var(--space-8) + 0.45em) 0 0; }
@media (max-width: 47.99em) { .s-side__cta { margin-block-start: calc(var(--space-5) + 0.45em); } .s-side .s-metrics { margin-block-start: var(--space-5); } .s-metrics { gap: var(--space-3); } } /* phones: the points breathe */ /* phones: 1.5x */ /* measured: KPIs-to-button = 2 x title-to-KPIs (46 / 23 px) */
/* phones: every button inside a card fills the card, its label on the centre line */
@media (max-width: 47.99em) { .card-project .btn:not(.btn--icon) { inline-size: 100%; justify-content: center; } .card-project .s-links { flex-direction: column; align-items: stretch; } }

/* testimonials: the switcher needs script; the full list stays in the HTML for everyone and everything else */
.testi-all { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: var(--space-8); }
.js .testi-all { display: none; }
html:not(.js) .testimonial, html:not(.js) .testimonial__nav { display: none; }
.testi-item { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--space-1) var(--space-5); align-items: start; margin: 0; }
.testi-item img { grid-row: 1 / span 2; display: block; inline-size: 5rem; block-size: auto; }
.testi-item figcaption { display: grid; gap: 2px; }
.testi-item figcaption span { font: var(--text-meta); color: var(--color-text-tertiary); }
.testi-item blockquote { margin: 0; font: var(--text-body-lg); text-wrap: pretty; }

/* about, gallery */
.s-about { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); align-items: start; }
@media (min-width: 48em) { .s-about { grid-template-columns: 1fr 1.1fr; gap: var(--space-12); } .s-about__photo { position: sticky; inset-block-start: 6rem; } } /* four paragraphs are tall: the photo stays beside them as they are read */
.s-about__photo img { display: block; inline-size: 100%; block-size: auto; }
.s-about__text { font: var(--text-h4); font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem); font-weight: var(--weight-regular); letter-spacing: var(--text-h4-ls); line-height: 1.6; /* 24 px at most */ display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
.s-about__text p { text-wrap: pretty; }
.s-about__text :is(.sel, .s-about__strong) { font-weight: 600; font-family: var(--font-display); }
.s-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }

/* experience, quick answers */
.s-exp { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 var(--space-8); padding: 0; list-style: none; }
.s-exp__item { display: grid; gap: var(--space-1); padding-block: var(--space-5); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
.s-exp__head { display: grid; gap: var(--space-1); }
.s-exp__icon { display: none; }
/* Achievements: the same list as Experience, always open; a point ends with the link to its proof when there is one */
.s-achieve__link { justify-self: start; margin-block-start: var(--space-3); }
.s-achieve .s-exp__more { display: grid; justify-items: start; }
.s-exp__head { align-content: start; }
@media (min-width: 48em) { .s-exp__item { grid-template-columns: 17rem minmax(0, 1fr); gap: var(--space-1) var(--space-8); } .s-exp__head { grid-column: 1; } .s-exp__more { grid-column: 2; } }
/* phones: like Quick Answers. Company, role and years show; a tap opens the line; one open at a time */
.s-exp.is-folding .s-exp__head { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); cursor: pointer; }
.s-exp.is-folding .s-exp__head > :not(.s-exp__icon) { grid-column: 1; }
.s-exp.is-folding .s-exp__icon { display: block; grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.s-exp.is-folding .s-exp__item.is-open .s-exp__icon { color: var(--color-accent-2-text); rotate: 180deg; }
.s-exp.is-folding .s-exp__item.is-open .s-exp__icon i:last-child { transform: rotate(90deg) scaleX(0); }
.s-exp.is-folding .s-exp__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--motion-duration-base) var(--motion-easing-out); }
.s-exp.is-folding .s-exp__more > .s-exp__line { min-block-size: 0; overflow: hidden; }
.s-exp.is-folding .s-exp__item.is-open .s-exp__more { grid-template-rows: 1fr; }
.s-exp.is-folding .s-exp__item.is-open .s-exp__line { padding-block-start: var(--space-3); }
.s-exp.is-folding .s-exp__head:focus-visible { outline: var(--focus-ring); outline-offset: 4px; }
.s-exp__org { font: var(--text-h5); letter-spacing: var(--text-h5-ls); }
.s-exp__meta { font: var(--text-meta); color: var(--color-text-tertiary); margin: 0; }
.s-exp__line { color: var(--color-text-secondary); margin: 0; max-inline-size: 62ch; text-wrap: pretty; font-size: 1rem; } /* 16px here (was 18px) */

/* contact */
.s-connect { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); margin-block-start: var(--space-12); }
@media (min-width: 48em) { .s-connect { grid-template-columns: 1fr 1.25fr; } }
.s-contact .postcard { margin-block-start: var(--space-12); }
#contact .s-head { padding-block-end: 0; }
#contact .s-head + .s-row { margin-block-start: 1.75rem; }
@media (min-width: 48em) { #contact .s-head + .s-row { margin-block-start: clamp(2.75rem, 2.3rem + 0.95vw, 3.1875rem); } }
.s-panel { padding: var(--space-6) var(--space-6) calc(var(--space-6) * var(--card-bottom-ratio)); min-inline-size: 0; }
.s-panel--fill { background-color: var(--color-bg-secondary); }
.s-foot-note { padding-block: 0; } /* 40% less air under the last line (it still clears the dock) */

/* chat: a panel above the dock, bottom right; a sheet on phones */
.chat-panel { position: fixed; inset-inline-end: var(--space-4); inset-block-end: var(--dock-clearance); z-index: var(--z-overlay); inline-size: min(26rem, 100vw - 2 * var(--space-4)); max-block-size: min(40rem, 100dvh - var(--dock-clearance) - var(--space-8)); display: grid; background: var(--color-bg-primary); box-shadow: var(--elevation-hard-md); }
.chat-panel[hidden] { display: none; }
.chat-panel .chat { min-block-size: 0; max-block-size: inherit; }
@media (max-width: 40em) { .chat-panel { inset-inline: 0; inset-block-end: 0; inline-size: auto; max-block-size: 88dvh; } }

/* document pages: project summaries, side-project case studies, resume */
.s-doc { padding-block-start: var(--space-6); }
.s-crumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); font: var(--text-meta); color: var(--color-text-tertiary); padding-block-end: var(--space-8); }
.s-crumbs a { color: inherit; text-decoration: none; }
.s-crumbs a:hover { text-decoration: underline; }
.s-doc__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); padding-block-end: var(--space-10); justify-items: start; }
.s-doc__title { font: 600 clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem) / 1.08 var(--font-display); letter-spacing: -0.035em; text-wrap: balance; max-inline-size: 26ch; } /* 36px at most */
.s-doc__head > .chip--status { justify-self: start; }
.s-doc__lede { max-inline-size: 60ch; text-wrap: pretty; font-size: 1rem; line-height: 1.6; } /* 16px under a 36px title */
.s-facts { display: grid; margin: 0 0 var(--space-12); }
.s-facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1) var(--space-6); padding-block: var(--space-3); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
@media (min-width: 40em) { .s-facts > div { grid-template-columns: 11rem minmax(0, 1fr); } }
.s-facts dt { font: var(--text-meta); color: var(--color-text-tertiary); }
.s-facts dd { margin: 0; max-inline-size: 70ch; text-wrap: pretty; }
.s-figs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-block-end: var(--space-12); }
@media (min-width: 48em) { .s-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .s-figs__lead { grid-column: 1 / -1; } }
.s-figs figure { margin: 0; display: grid; gap: var(--space-2); align-content: start; }
.s-figs img { display: block; inline-size: 100%; block-size: auto; background: var(--color-bg-tertiary); }
.s-figs figcaption { font: var(--text-meta); color: var(--color-text-tertiary); }
.s-doc__sec { display: grid; gap: var(--space-3); max-inline-size: 70ch; padding-block: var(--space-8); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
.s-doc__sec h2 { font: var(--text-h3); letter-spacing: var(--text-h3-ls); text-wrap: balance; }
.s-doc__sec p, .s-doc__sec li { color: var(--color-text-secondary); text-wrap: pretty; }
.s-doc__sec ul { margin: 0; padding-inline-start: 1.25rem; display: grid; gap: var(--space-2); }
.s-doc__foot { display: grid; gap: var(--space-4); padding-block: var(--space-10) var(--space-6); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }

/* the contact section does not clip: the postcard tilts and casts its shadow past the column (the page itself clips sideways, see html) */

/* case-study pages: the recording first, inside the column, at its own ratio; the two navigation links at opposite ends */
.s-video { margin: 0 0 var(--space-10); display: grid; gap: var(--space-2); }
.s-video__frame { position: relative; inline-size: 100%; background: var(--color-bg-tertiary); }
.s-video__el { display: block; inline-size: 100%; block-size: 100%; }
.s-video__toggle { position: absolute; inset-inline-end: var(--space-3); inset-block-end: var(--space-3); }
.s-video figcaption { font: var(--text-meta); color: var(--color-text-tertiary); }
.s-doc__intro { padding-block-end: var(--space-10); }
.s-doc__head:has(+ .s-doc__intro) { padding-block-end: var(--space-3); } /* a title straight above its lede: one group */
.s-doc__intro > .s-row { margin-block-start: 0.6875rem; }
@media (min-width: 48em) { .s-doc__intro > .s-row { margin-block-start: 1.75rem; } }
.s-xp .s-doc__intro { padding-block-end: 0; }
.doc-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-12) var(--space-10); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
.doc-nav > :last-child { margin-inline-start: auto; } /* when the two wrap on a phone, Next still sits at the right edge */
.s-doc .s-doc__sec:last-of-type { padding-block-end: var(--space-4); }

/* Selected Work cards: the CTA row stacks (a second link sits under the button, never jammed beside it) */
.card-project .s-links { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }

/* side-project cards: like the strength cards. The image sits at the top, title, KPIs and CTA at the bottom,
   every card as tall as the tallest (the Swish card today). KPI lines wrap under their own first letter. */
/* each card is as tall as its content; image to title is 0.75 x the KPIs-to-button gap, measured optically
   (image edge to the title's capitals : last KPI baseline to the button's top edge) */
.s-sides > .card-project { display: flex; flex-direction: column; gap: 1.75rem; } /* measured: 35 / 33 / 34 px at 1440 / 768 / 390 against 0.75 x 46 = 34.5 */
.s-metrics li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.6ch; }
.s-metrics li::before { content: "›"; }

/* Quick Answers: 16px answers, points for anything longer than three lines */
.acc__a { font-size: 1rem; }
.acc__body > .acc__a:not(:last-child) { padding-block-end: var(--space-3); }
.acc__points { display: grid; gap: var(--space-2); margin: 0; padding: 0 0 var(--space-6) 1.1em; max-inline-size: 66ch; color: var(--color-text-secondary); font-size: 1rem; line-height: 1.55; }
.acc__points li { padding-inline-start: 0.2em; text-wrap: pretty; }

/* logo ticker: logos run edge to edge between the two dotted rails and are cut by them; the band's own
   dotted lines stay at the content width */
.s-proof .ticker { margin-inline: calc(-1 * var(--layout-frame-pad)); background: var(--rule-dotted-h) top center / calc(100% - 2 * var(--layout-frame-pad)) 1px no-repeat, var(--rule-dotted-h) bottom center / calc(100% - 2 * var(--layout-frame-pad)) 1px no-repeat; }

/* chat: it grows out of the dock, centred above it, a little wider than the dock (the dock's width on phones);
   the page behind blurs */
.chat-scrim { position: fixed; inset: 0; z-index: calc(var(--z-dock) - 1); background: var(--color-scrim); -webkit-backdrop-filter: blur(var(--blur-scrim)); backdrop-filter: blur(var(--blur-scrim)); opacity: 0; transition: opacity var(--motion-duration-base) var(--motion-easing-out); }
.chat-scrim.is-on { opacity: 1; }
.chat-scrim[hidden] { display: none; }
.chat-panel { inset-inline: auto; inset-inline-start: 50%; inset-block-end: calc(var(--dock-clearance) - var(--space-3)); inline-size: min(34rem, 100vw - 2 * var(--space-4)); translate: -50% 1.25rem; opacity: 0; clip-path: inset(100% 0 0 0); transform-origin: 50% 100%;
  transition: translate var(--motion-duration-slow) var(--motion-easing-out), clip-path var(--motion-duration-slow) var(--motion-easing-out), opacity var(--motion-duration-base) var(--motion-easing-out); }
.chat-panel.is-open { translate: -50% 0; opacity: 1; clip-path: inset(0 0 0 0); }
@media (max-width: 40em) { .chat-panel { inset-inline: auto; inset-inline-start: 50%; inset-block-end: calc(var(--space-4) + 4rem); inline-size: calc(100vw - 2 * var(--space-4)); max-block-size: calc(100dvh - 7rem); } }

/* Experiments. Every piece keeps its own shape (never cropped). In a row, flex-grow and flex-basis both follow the
   piece's width-to-height ratio (--r), so every piece in that row comes out the same height: a justified row. */
.s-head--action { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-8); }
.s-head--action > * { grid-column: 1; }
.s-head--action > .s-head__action { grid-column: 2; grid-row: 1; align-self: end; }
@media (max-width: 35.99em) { .s-head--action { grid-template-columns: minmax(0, 1fr); } .s-head--action > .s-head__action { grid-column: 1; grid-row: auto; order: 1; justify-self: start; margin-block-start: 1rem; } }
.xp-row { display: flex; gap: var(--space-5); --row-h: 8rem; }
.xp-tile { margin: 0; min-inline-size: 0; flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row-h)); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-content: start; }
.xp-tile.s-video { margin: 0; }
.xp-tile__media { aspect-ratio: var(--r); background: var(--color-bg-tertiary); overflow: hidden; }
.xp-tile__media > img, .xp-tile__media video { display: block; inline-size: 100%; block-size: 100%; }
.xp-tile__cap { display: grid; gap: var(--space-1); }
.xp-tile__name { font: 600 1rem / 1.3 var(--font-display); letter-spacing: -0.01em; color: var(--color-text-primary); }
.xp-tile__kind, .xp-group__kind, .xp-index__n, .xp-index__kind { font: var(--text-mono-ui); color: var(--color-text-tertiary); }
/* home: one row on laptops and up; below 1024 px the animation takes its own row; on phones one per row */
@media (max-width: 63.99em) { .xp-row--home { flex-wrap: wrap; } .xp-row--home > :first-child { flex-basis: 100%; } }
@media (max-width: 35.99em) { .xp-row--home > * { flex-basis: 100%; } }
/* the page: an index to jump from, then each project with all of its pieces */
.xp-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); column-gap: var(--space-8); margin-block-start: var(--space-8); }
.xp-index a { display: grid; grid-template-columns: 2.5ch minmax(0, 1fr) auto auto; column-gap: var(--space-3); align-items: baseline; padding-block: var(--space-3); background: var(--rule-dotted-h) bottom / 100% 1px no-repeat; color: var(--color-text-primary); text-decoration: none; }
.xp-index__go { color: var(--color-text-tertiary); }
@media (max-width: 35.99em) { .xp-index__kind { display: none; } .xp-index { margin-block-start: var(--space-6); } }
@media (hover: none) { .xp-index__name { background-size: 100% 1px; } }
.xp-index__name { justify-self: start; font: 500 1rem / 1.3 var(--font-display); background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat; transition: background-size var(--motion-duration-base) var(--motion-easing-out); }
.xp-index a:is(:hover, :focus-visible) .xp-index__name { background-size: 100% 1px; }
.xp-group { padding-block-start: var(--space-16); scroll-margin-block-start: var(--space-8); }
.xp-group__head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-3); row-gap: var(--space-1); margin-block-end: var(--space-6); }
.xp-group__title { margin: 0; font: 700 1.375rem / 1.1 var(--font-display); letter-spacing: -0.025em; }
.xp-group__kind { margin: 0; }
.xp-row--page { flex-wrap: wrap; gap: var(--space-4); --row-h: 15rem; --row-max: 22rem; }
/* a short last row may stretch to fill, but never past --row-max tall (the cap scales with each piece, so heights stay equal) */
.xp-row--page > .xp-tile { max-inline-size: calc(var(--r) * var(--row-max)); }
.s-xp .doc-nav { margin-block-start: var(--space-16); }
@media (max-width: 35.99em) { .xp-row--page { --row-h: 8rem; --row-max: 16rem; gap: var(--space-3); } }

/* Sections that end on a line of text: pull the section end up by the space under that line's baseline (half-leading plus
   descent), so the gap to the next hairline is measured from the letters, like every other section (140 / 120 px). */
.s-about__text { margin-block-end: -0.5em; }
.s-gallery { margin-block-end: calc(-1 * var(--space-2) - 0.45rem); }
.xp-row--home { margin-block-end: -0.4rem; }
