/* ============================================================================
   Anamorphics — shared site layer
   Adds the cross-concept helpers on top of the design system: scroll-reveal,
   image curtains, the clients wall, the nav/footer chrome, and the live-tweak
   hooks (type scale, accent intensity, rhythm, motion).

   LOAD ORDER MATTERS. This file expects tokens.css (the design tokens and
   @font-face rules) and kit.css (the am-* components) to already be loaded.
   Both pages <link> all three in order — tokens, kit, then this. That used to
   be a chain of @imports reaching into _ds/, which serialised four round trips
   before any text could paint; linking them directly lets the browser fetch
   them in parallel. Keep the order if you add a page.
   ========================================================================= */

:root {
  --tscale: 1;            /* type-scale tweak multiplier */
  --maxw: 1440px;
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; }

/* ---------------------------------------------------------------- reveals */
.reveal { opacity: 0; transform: translateY(18px); transition:
  opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal--d1 { transition-delay: 70ms; }
.reveal--d2 { transition-delay: 140ms; }
.reveal--d3 { transition-delay: 210ms; }
.reveal--d4 { transition-delay: 280ms; }

/* curtain image reveal — paper-cream wipe, top to bottom */
.curtain { position: relative; overflow: hidden; }
.curtain::after {
  content: ""; position: absolute; inset: 0; background: var(--paper-200);
  transform: scaleY(1); transform-origin: top;
  transition: transform var(--dur-curtain) var(--ease-out);
}
.curtain.is-in::after { transform: scaleY(0); transform-origin: bottom; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .curtain::after { display: none; }
}
/* tweak: motion off — everything visible, no transitions */
body[data-motion="off"] .reveal { opacity: 1; transform: none; transition: none; }
body[data-motion="off"] .curtain::after { display: none; }
body[data-motion="off"] * { scroll-behavior: auto; }

/* Hard guarantee: JS forces this class on any element whose reveal transition
   failed to tick (throttled/background tab, capture harness). Bypasses the
   transition entirely so content can never be trapped at opacity:0. */
.reveal-forced { opacity: 1 !important; transform: none !important; transition: none !important; }
.reveal-forced.curtain::after { display: none !important; }
/* Print / PDF: never export the pre-animation hidden state. */
@media print {
  .reveal, .curtain { opacity: 1 !important; transform: none !important; }
  .curtain::after { display: none !important; }
}

/* ----------------------------------------------------------- type scale */
.am-hero__title, .am-section-title, .hero-title, .big-type, h1.t-h1 {
  font-size: calc(var(--_fs, 1em) * var(--tscale));
}
.hero-title { --_fs: clamp(46px, 8.4vw, 140px); font-family: var(--font-display);
  font-weight: 300; line-height: 1.0; letter-spacing: -0.03em; margin: 0; text-wrap: balance;
  font-variation-settings: 'opsz' 72; }
.am-hero__title { --_fs: clamp(48px, 8.4vw, 132px); }
.am-section-title { --_fs: var(--fs-3xl); }

/* ----------------------------------------------------- accent intensity */
/* med = default. low pulls sage back to type color; high spreads it wider. */
.am-eyebrow, .eyebrow { color: var(--fg-2); }
body[data-accent="high"] .am-eyebrow, body[data-accent="high"] .eyebrow { color: var(--accent-500); }
body[data-accent="low"] .am-eyebrow, body[data-accent="low"] .eyebrow { color: var(--fg-3); }

.accent-em { color: var(--accent-500); font-style: italic; font-family: var(--font-serif); }
body[data-accent="low"] .accent-em { color: inherit; }
.on-paper .accent-em { color: var(--accent-700); }

.accent-num { color: var(--accent-500); }
body[data-accent="low"] .accent-num { color: var(--fg-3); }
.on-paper .accent-num { color: var(--accent-700-text); }

.accent-rule { background: var(--line-strong); }
body[data-accent="high"] .accent-rule { background: var(--accent-700); }

body[data-accent="high"] .am-sw__year,
body[data-accent="high"] .idx-year { color: var(--accent-600); }

/* --------------------------------------------------- cream ground (.on-paper)
   The kit's Approach/WhatWeDo bands are meant to sit on cream. The kit never
   shipped the ground rule, so we remap the semantic tokens for any section
   tagged .on-paper — text flips to ink, hairlines to paper. */
.on-paper {
  background: var(--paper-200);
  --bg: var(--paper-200); --bg-raised: var(--paper-300);
  --fg: var(--ink-900); --fg-2: var(--ink-400); --fg-3: var(--ink-300);
  --line: var(--paper-400); --line-strong: var(--paper-500);
  color: var(--ink-900);
}
.on-paper .am-section-title { color: var(--ink-900); }

/* rhythm tweak: "unified" drops the cream bands so the page reads all-dark */
body[data-rhythm="unified"] .on-paper {
  background: var(--ink-900);
  --bg: var(--ink-900); --bg-raised: var(--ink-800);
  --fg: var(--paper-200); --fg-2: var(--paper-500); --fg-3: var(--ink-300);
  --line: var(--ink-600); --line-strong: var(--ink-500);
  color: var(--paper-200);
}
body[data-rhythm="unified"] .on-paper .am-approach__grid { border-top-color: var(--ink-600); }
body[data-rhythm="unified"] .on-paper .am-approach__cell { border-right-color: var(--ink-600); }
body[data-rhythm="unified"] .on-paper .am-approach__hr { background: var(--ink-500); }
body[data-rhythm="unified"] .on-paper .accent-num,
body[data-rhythm="unified"] .on-paper .am-approach__num { color: var(--accent-500); }

/* ------------------------------------------------------------- nav extras */
.am-nav__wordmark { white-space: nowrap; }
.am-nav__mark-letter {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  color: var(--accent-500); line-height: 1;
}
.am-nav__brand:hover .am-nav__wordmark { color: var(--accent-500); }
.am-nav__brand:hover { text-decoration: none; }

/* ---- header condense: full lockup at top, butterfly once scrolled ---- */
/* The header is FIXED, not sticky, and .page reserves its full height up top.
   History: it used to be an in-flow sticky bar, so condensing it (207px ->
   81px) reflowed the whole page by 126px. That caused two bugs: size-pulsing
   on slow scroll (scroll anchoring nudged scrollY back across the trigger),
   and every in-page anchor landing 126px past its target, because the browser
   computed the destination before the header shrank on the way down.
   Out of flow, condensing moves nothing, so both are gone at the root.
   overflow-anchor: none and the hysteresis band in site.js initNav() stay as
   belt and braces; neither is load-bearing any more.
   The size tokens live on :root so .page and scroll-padding can derive the
   reserved space from the same numbers the header is drawn with. */
:root {
  --nav-pad-top: 28px;
  --nav-pad-condensed: 15px;
  --nav-logo-h: 150px;
  --nav-mark-h: 50px;
  --nav-h-full: calc(var(--nav-logo-h) + 2 * var(--nav-pad-top) + 1px);
  --nav-h-condensed: calc(var(--nav-mark-h) + 2 * var(--nav-pad-condensed) + 1px);
}
/* Phones (U-022, 2026-11-19): the full lockup at 150px took 207px, about a quarter
   of an 844px screen, before any content. Same lockup, same behavior, smaller:
   the header is 129px open and 65px condensed. Everything that reserves header
   space derives from these tokens, so nothing else changes. */
@media (max-width: 600px) {
  :root {
    --nav-pad-top: 18px;
    --nav-pad-condensed: 12px;
    --nav-logo-h: 92px;
    --nav-mark-h: 40px;
  }
}
html {
  overflow-anchor: none;
  /* anchors land just below the condensed header, not underneath it */
  scroll-padding-top: var(--nav-h-condensed);
}
.page { padding-top: var(--nav-h-full); }
/* #top sits below the reserved header space, so cancel it out: the logo's
   back-to-top link has to reach scrollY 0, not stop at the hero's edge. */
#top { scroll-margin-top: var(--nav-h-full); }
.am-nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding-top: var(--nav-pad-top);
  padding-bottom: var(--nav-pad-top);
  transition:
    background var(--dur-base) var(--ease-out),
    backdrop-filter var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    padding-top var(--dur-base) var(--ease-out),
    padding-bottom var(--dur-base) var(--ease-out);
}
.am-nav.is-condensed {
  padding-top: var(--nav-pad-condensed);
  padding-bottom: var(--nav-pad-condensed);
  background: rgba(14,14,14,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* both logos share one left-anchored cell and cross-fade */
.am-nav__brand { display: grid; align-items: center; gap: 0; }
.am-nav__brand > img {
  grid-area: 1 / 1; justify-self: start; align-self: center;
  width: auto; transform-origin: left center;
}
.am-nav__logo-full {
  height: var(--nav-logo-h);
  transition: height var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}
.am-nav__logo-mark {
  height: var(--nav-mark-h); opacity: 0;
  transition: height var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}
.am-nav.is-condensed .am-nav__logo-full { height: var(--nav-mark-h); opacity: 0; }
.am-nav.is-condensed .am-nav__logo-mark { opacity: 1; }
/* Services: the one nav item that opens a list (navigation.php). Open on hover
   and on keyboard focus without script; .is-open is the click/touch state from
   js/site.js. The menu's top padding bridges the gap to the button, so the
   pointer never leaves the group on the way down. */
/* display:flex so the button is a flex item, not an inline box on a text line:
   as an inline box it sat a third of a pixel low, which rounded to 1px below
   the other labels (Michael spotted it, 2026-11-12). */
.am-nav__group { position: relative; display: flex; align-items: center; }
.am-nav__toggle { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font-family: inherit; line-height: inherit;
  display: inline-flex; align-items: center; gap: 7px; }
.am-nav__toggle::after { content: ""; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease-out); }
.am-nav__group:hover .am-nav__toggle, .am-nav__group.is-open .am-nav__toggle { color: var(--accent); }
.am-nav__group.is-open .am-nav__toggle::after, .am-nav__group:hover .am-nav__toggle::after { transform: translateY(1px) rotate(225deg); }
.am-nav__menu { position: absolute; top: 100%; left: -20px; min-width: 200px; padding-top: 14px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast); }
.am-nav__menu::before { content: ""; position: absolute; inset: 14px 0 0 0; z-index: -1; background: rgba(16,13,11,0.94);
  border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.am-nav__group:hover .am-nav__menu, .am-nav__group:focus-within .am-nav__menu, .am-nav__group.is-open .am-nav__menu {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.am-nav__group.is-closed .am-nav__menu { opacity: 0; visibility: hidden; }
.am-nav__menu a { display: block; padding: 11px 20px; font-size: 14px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.am-nav__menu a:first-child { padding-top: 16px; }
.am-nav__menu a:last-child { padding-bottom: 16px; }
.am-nav__menu a:hover, .am-nav__menu a[aria-current] { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .am-nav, .am-nav__logo-full, .am-nav__logo-mark, .am-nav__menu, .am-nav__toggle::after { transition: none; }
}


/* --------------------------------------------------------- clients wall */
.clients { padding: var(--s-9) 0; border-bottom: 1px solid var(--line); }
.clients__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.clients__cell {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 26px 24px; min-height: 92px; display: flex; align-items: center;
  font-family: var(--font-display); font-weight: 300; font-size: 19px;
  letter-spacing: -0.01em; color: var(--fg-2);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.clients__cell:hover { color: var(--fg); background: var(--ink-800); }
.on-paper .clients__cell:hover { background: var(--paper-300); }
.clients__cell .since { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--accent-500); margin-left: auto; padding-left: 14px; text-transform: uppercase; }
body[data-accent="low"] .clients__cell .since { color: var(--fg-3); }

/* ------------------------------------------------------ generic helpers */
.eyebrow { font-family: var(--font-sans); font-weight: 500; font-size: 11px;
  letter-spacing: var(--track-eyebrow); text-transform: uppercase; }
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-3); }
.lede { font-family: var(--font-serif); font-style: italic; font-weight: 300;
  font-size: var(--fs-xl); line-height: 1.42; color: var(--fg); max-width: 40ch; }
.btn-line {
  display: inline-flex; align-items: center; gap: 14px; background: transparent;
  border: 0; padding: 0; cursor: pointer; color: var(--fg);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out); }
.btn-line:hover { color: var(--accent-500); }
.btn-line .r { width: 44px; height: 1px; background: currentColor; opacity: .6;
  transition: width var(--dur-base) var(--ease-out); }
.btn-line:hover .r { width: 64px; }

/* mobile */
@media (max-width: 860px) {
  .am-section-head { grid-template-columns: 1fr; gap: 16px; padding-top: var(--s-8); padding-bottom: var(--s-6); }
  .am-wwd__grid { grid-template-columns: 1fr; }
  .am-wwd__col { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--s-6); }
  .am-wwd__col:first-child { border-top: 0; }
  .am-approach__grid { grid-template-columns: 1fr 1fr; }
  .clients__grid { grid-template-columns: repeat(2, 1fr); }
  .am-hero__foot { grid-template-columns: 1fr; gap: 24px; }
  .am-footer__hero { grid-template-columns: 1fr; }
  .am-footer__pitch, .am-footer__email { grid-column: 1; }
  .am-footer__cols { grid-template-columns: 1fr 1fr; }
  .am-nav__items { gap: 18px; }
  .am-nav__items .am-nav__link, .am-nav__items .am-nav__group { display: none; }
}

/* ============================================================================
   PAGE CHROME — shared by every page
   These rules used to be copy-pasted verbatim into the <style> block of both
   pages (UPGRADES U-004), and had already drifted once. Everything that is
   genuinely per-page now lives in css/home.css / css/case-studies.css, linked
   after this file so the cascade order is unchanged from the inline version.
   ========================================================================= */

html, body { background: var(--ink-900); }

/* the whole document sits above the fixed #smoke-canvas (z-index: 0, kit.css) */
.page { position: relative; z-index: 1; }
/* Skip link (2026-11-19): off screen until a keyboard user tabs to it, then it
   shows at the top left, above the header, in the site's own colors. */
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 12px 18px;
  background: var(--ink-900); color: var(--fg); font-family: var(--font-sans); font-size: 14px;
  text-decoration: none; border: 1px solid var(--line-strong); transform: translateY(-200%); }
.skip-link:focus, .skip-link:focus-visible { transform: none; }
#main:focus { outline: none; }
/* footer: the privacy link reads as part of the copyright line */
.am-footer__privacy { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.am-footer__privacy:hover { color: var(--accent-500); }

/* scrim variants for the [data-smoke] windows. .sw-scrim itself is in kit.css;
   these are the per-section darkening gradients that keep text legible over
   the smoke field, tuned section by section. */
.sw-scrim--hero {
  background: linear-gradient(180deg, rgba(16,13,11,0.62) 0%, rgba(16,13,11,0.74) 55%, rgba(16,13,11,0.94) 100%); }
.sw-scrim--work {
  background: linear-gradient(180deg, rgba(16,13,11,0.88) 0%, rgba(16,13,11,0.80) 45%, rgba(16,13,11,0.92) 100%); }
.sw-scrim--quote {
  background: radial-gradient(130% 100% at 50% 42%, rgba(16,13,11,0.34) 0%, rgba(16,13,11,0.78) 64%, rgba(16,13,11,0.9) 100%); }
.sw-scrim--footer {
  background: linear-gradient(180deg, rgba(16,13,11,0.46) 0%, rgba(16,13,11,0.72) 55%, rgba(16,13,11,0.86) 100%); }

/* CTA row under a work list (all-work / portfolio download / start a project) */
.work-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-top: var(--s-7); }

/* The contact block sits in column 2 of .am-footer__hero. kit.css styles the
   form itself; placement in the footer grid now belongs to .cta-block (see the
   CONTACT BLOCK section at the end of this file) because the form is no longer
   the grid child — it shares that slot with the sent-state panel.
   The 860px override has to be repeated after kit.css's own copy, which is
   earlier in the cascade and would otherwise lose to the rule above it. */
@media (max-width: 860px) {
  .am-footer__pitch { grid-column: 1; }
  .cta-form__row { grid-template-columns: 1fr; }
}

/* ============================================================================
   CONTACT BLOCK — form / sent-state swap
   Both states live in the markup at once; js/site.js toggles [hidden] and
   .is-sent. The block keeps the grid placement that used to sit on .cta-form,
   so either state lands in column 2 of the footer hero.
   ========================================================================= */
.cta-block { grid-column: 2; margin-top: 8px; }
.cta-block.is-sent .cta-form { display: none; }

.cta-done { max-width: 660px; display: grid; gap: 0; outline: none;
  border-top: 1px solid var(--line-strong); padding-top: var(--s-6); }
.cta-done[hidden] { display: none; }
.cta-done__eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-500); }
body[data-accent="low"] .cta-done__eyebrow { color: var(--fg-3); }
.cta-done__title { font-family: var(--font-display); font-weight: 300;
  font-size: clamp(30px, 3.6vw, 46px); line-height: 1.06; letter-spacing: -0.02em;
  color: var(--fg); margin: 18px 0 0; text-wrap: balance; }
.cta-done__body { font-family: var(--font-serif); font-style: italic; font-weight: 300;
  font-size: var(--fs-lg); line-height: 1.45; color: var(--fg-2); margin: 18px 0 0;
  max-width: 46ch; }

.cta-done__list { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: 0; }
.cta-done__list li { display: flex; justify-content: space-between; gap: 20px;
  padding: 13px 0; border-top: 1px solid var(--line); }
.cta-done__list li:last-child { border-bottom: 1px solid var(--line); }
.cta-done__k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
.cta-done__v { font-size: 13px; color: var(--fg); text-align: right; }
.cta-done__v a { color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.cta-done__v a:hover { color: var(--accent-500); border-bottom-color: var(--accent-500); }

/* same treatment as .btn-line, but it's a <button> so it needs the resets */
.cta-done__again { display: inline-flex; align-items: center; gap: 14px;
  margin-top: var(--s-6); background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--fg); font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; transition: color var(--dur-fast) var(--ease-out); }
.cta-done__again:hover { color: var(--accent-500); }
.cta-done__again .r { width: 44px; height: 1px; background: currentColor; opacity: .6;
  transition: width var(--dur-base) var(--ease-out); }
.cta-done__again:hover .r { width: 64px; }

/* in flight */
.cta-form__submit[disabled] { opacity: .55; cursor: default; }

@media (max-width: 860px) {
  .cta-block { grid-column: 1; }
  .cta-done__list li { flex-direction: column; gap: 6px; }
  .cta-done__v { text-align: left; }
}

/* ===================================================== WORK ROWS AS LINKS
   Block-link pattern: the project name is the real <a>, and its ::after
   stretches over the whole row. One focusable link per row, so Tab, Enter,
   middle-click and screen readers all behave, while the row stays the hit
   target. Rows without a page keep a plain <span class="am-sw__name">. */
.am-sw__row { position: relative; }
.am-sw__link { color: inherit; text-decoration: none; }
.am-sw__link::after { content: ""; position: absolute; inset: 0; }
.am-sw__link:focus-visible { outline: none; }
.am-sw__row:has(.am-sw__link:focus-visible) { padding-left: 24px; }
.am-sw__row:has(.am-sw__link:focus-visible) .am-sw__name { color: var(--accent-500); }
.am-sw__row:not(:has(.am-sw__link)) { cursor: default; }

/* The hover tile is desktop-only, so on touch the work had no imagery at all.
   Each row carries a lazy <picture> that only displays below 980px; a
   display:none lazy image is never fetched, so desktop pays nothing. */
.am-sw__thumb { display: none; }
@media (max-width: 980px) {
  .am-sw__row { grid-template-columns: 96px 1fr; row-gap: 6px; padding: 22px 0; }
  .am-sw__row:hover { padding-left: 0; }
  .am-sw__name { font-size: 28px; grid-column: 2; }
  .am-sw__disc { grid-column: 2; }
  .am-sw__view { display: none; }
  .am-sw__thumb { display: block; grid-column: 1 / -1; margin-top: 14px; border: 1px solid var(--line); overflow: hidden; }
  .am-sw__thumb .pic, .am-sw__thumb img { display: block; width: 100%; height: auto; }
}

/* ======================================================= VIEW TRANSITIONS
   Cross-document: opening a project morphs the hovered work image into the
   project hero, and the row's name into the page title. Native CSS, no
   framework; browsers without it just navigate. js/site.js names the source
   elements at the moment of navigation (pageswap); project.php names the
   destinations ('pj-hero', 'pj-name'). The smoke canvas is excluded so the
   field never doubles up mid-transition. */
@view-transition { navigation: auto; }
#smoke-canvas { view-transition-name: smoke; }
::view-transition-old(smoke) { display: none; }
::view-transition-new(smoke) { animation: none; }
::view-transition-group(pj-hero),
::view-transition-group(pj-name) { animation-duration: 640ms; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
::view-transition-old(root) { animation: 280ms ease-out both vt-fade-out; }
::view-transition-new(root) { animation: 420ms 120ms ease-out both vt-fade-in; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
