/* Material · shared chrome: buttons, nav, footer. Every page. */

/* ── Buttons ───────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-75);
  padding: var(--space-75) var(--space-100);
  border: var(--hairline) solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fade) var(--ease), color var(--dur-fade) var(--ease), border-color var(--dur-fade) var(--ease), transform var(--dur-fade) var(--ease);
}
.button--primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); }
.button--primary:hover { background: #5bb4dd; border-color: #5bb4dd; }
.button--ghost { background: rgb(19 18 9 / 0.2); color: var(--color-text); border-color: var(--color-line-2); }
.button--ghost:hover { border-color: var(--color-text); }
.button:active { transform: scale(0.98); }
/* Adapter sits low in its line box (ascent 1.06em, descent 0.25em): trim to the caps so the label centres */
@supports (text-box: trim-both cap alphabetic) {
  .button { padding-block: var(--space-100); }
  .button > span { text-box: trim-both cap alphabetic; }
  .nav .button { padding-block: var(--space-75); }
}
.button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.button[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.button__arrow { width: 16px; height: 16px; flex-shrink: 0; transition: transform var(--dur-move) var(--ease); }
.button:hover .button__arrow { transform: translate(2px, -2px); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-75); }

/* ── Bt: a label and its arrow, each in its own block, 2px apart ── */
.bt {
  --h: 48px;
  display: inline-flex; gap: 2px;
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
}
.bt--sm { --h: 40px; font-size: 0.9375rem; }
.bt--xs { --h: 30px; font-size: 0.875rem; }
/* pointing up: both arrows turn, so the hover slide turns with them */
.bt--up .bt__icon svg { rotate: -45deg; }
.bt__label {
  display: block; height: var(--h);
  padding: 0 calc(var(--h) * 0.42);
  line-height: var(--h);
  transition: background-color var(--dur-fade) var(--ease), color var(--dur-fade) var(--ease);
}
/* Adapter sits low in its line box: trim to the caps so the label really centres */
@supports (text-box: trim-both cap alphabetic) {
  .bt__label { height: auto; line-height: 1; padding-block: calc((var(--h) - 0.7em) / 2); text-box: trim-both cap alphabetic; }
}
.bt__icon {
  position: relative; display: grid; place-items: center;
  width: var(--h); height: var(--h); overflow: hidden;
  transition: background-color var(--dur-fade) var(--ease), color var(--dur-fade) var(--ease);
}
.bt__icon svg { grid-area: 1 / 1; width: 45%; height: 45%; transition: transform 450ms var(--ease); }
.bt__icon svg + svg { transform: translate(-160%, 160%); }
.bt:hover .bt__icon svg:first-child { transform: translate(160%, -160%); }
.bt:hover .bt__icon svg + svg { transform: none; }
.bt:active { transform: scale(0.98); }
.bt:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.bt--primary .bt__label, .bt--primary .bt__icon { background: var(--color-accent); color: var(--color-accent-ink); }
.bt--primary:hover .bt__label { background: #5bb4dd; }
.bt--ghost .bt__label, .bt--ghost .bt__icon { background: rgb(242 239 230 / 0.09); color: var(--color-text); }
.bt--ghost:hover .bt__icon { background: var(--color-accent); color: var(--color-accent-ink); }
.bt--ghost:hover .bt__label { background: rgb(242 239 230 / 0.14); }
.bt--quiet .bt__label { padding-inline: 0 var(--space-100); color: var(--color-text-2); }
.bt--quiet .bt__icon { background: rgb(242 239 230 / 0.09); color: var(--color-text); }
.bt--quiet:hover .bt__label { color: var(--color-text); }
.bt--quiet:hover .bt__icon { background: var(--color-accent); color: var(--color-accent-ink); }

/* Section label: a small mono caption */
.label { margin: 0; color: inherit; }

/* Hover shared by nav and footer links: a block wipes in from the left, leaves to the right */
.nav__link, .footer__big { position: relative; isolation: isolate; }
.nav__link::before, .footer__big::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgb(242 239 230 / 0.14);
  transform: scaleX(0); transform-origin: right;
  transition: transform 450ms var(--ease);
}
.nav__link:hover::before, .footer__big:hover::before { transform: scaleX(1); transform-origin: left; }

/* ── Nav: contact topbar over a full-width bar. The topbar tucks away once you scroll;
   the bar steps aside while you read down and comes back as soon as you scroll up. ── */
.nav {
  --topbar-h: 36px;
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  border-bottom: var(--hairline) solid transparent;
  transition: transform var(--dur-move) var(--ease), background-color var(--dur-fade) var(--ease), border-color var(--dur-fade) var(--ease);
}
.topbar { border-bottom: var(--hairline) solid var(--color-line); color: var(--color-text-3); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; letter-spacing: -0.005em; }
.topbar__row { display: flex; align-items: center; gap: var(--space-300); height: var(--topbar-h); overflow: hidden; white-space: nowrap; }
.topbar a { color: inherit; text-decoration: none; transition: color var(--dur-fade) var(--ease); }
.topbar a:hover { color: var(--color-text); }
.topbar__row > :nth-child(3) { margin-left: auto; }
.nav--scrolled {
  background: rgb(19 18 9 / 0.78);
  border-bottom-color: var(--color-line);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
.nav--scrolled:not(.is-open) { transform: translateY(calc(-1 * var(--topbar-h))); }
.nav--away:not(.is-open) { transform: translateY(-100%); }
.nav__bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--space-700);
}
.nav__logo { display: flex; justify-self: start; }
.nav__logo svg { width: 28px; height: auto; }
.logo-m { fill: var(--color-text); }
.logo-bar { fill: var(--color-accent); }
.nav__links { display: flex; }
/* bymonolog's proportions, a step up: 17px semibold, a hair of negative tracking */
.nav__link { padding: var(--space-75) var(--space-100); font-family: var(--font-sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--color-text-2); text-decoration: none; transition: color var(--dur-fade) var(--ease); }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--color-text); }
/* the section you're in: the link lights and a celeste rule draws under it */
.nav__link::after { content: ""; position: absolute; inset: auto var(--space-100) 0; height: 2px; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-move) var(--ease); }
.nav__link.is-here { color: var(--color-text); }
.nav__link.is-here::after { transform: scaleX(1); }
.nav__link:focus-visible, .footer__big:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.nav__end { display: flex; align-items: center; gap: var(--space-200); justify-self: end; }
.nav__toggle { display: none; }
.nav__panel { display: none; }

@media (max-width: 64rem) {
  .topbar__more { display: none; }
}
@media (max-width: 47.99rem) {
  .nav__bar { grid-template-columns: 1fr auto; height: var(--space-600); }
  .nav__links, .nav__quote { display: none; }
  .topbar__row { justify-content: space-between; }
  .nav__toggle {
    font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.01em;
    display: inline-flex; align-items: center; gap: var(--space-75);
    padding: var(--space-75) 0 var(--space-75) var(--space-100);
    background: none; border: 0; color: var(--color-text); cursor: pointer;
  }
  /* Two bars that cross into an X */
  .nav__icon { position: relative; width: 18px; height: 10px; }
  .nav__icon i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform var(--dur-move) var(--ease); }
  .nav__icon i:first-child { top: 0; }
  .nav__icon i:last-child { bottom: 0; }
  .nav.is-open .nav__icon i:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav.is-open .nav__icon i:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  /* Full-height panel: the links in Nickel, the facts underneath; 60ms apart */
  .nav__panel {
    position: fixed; inset: 0 0 auto;
    height: 100dvh;
    display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-100);
    padding: var(--space-900) var(--gutter) var(--space-400);
    background: var(--color-bg);
    visibility: hidden; opacity: 0;
    transition: opacity var(--dur-fade) var(--ease), visibility 0s var(--dur-fade);
  }
  .nav.is-open .nav__panel { visibility: visible; opacity: 1; transition: opacity var(--dur-fade) var(--ease); }
  .nav__panel > * { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-fade) var(--ease), transform var(--dur-move) var(--ease); }
  .nav.is-open .nav__panel > * { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 60ms); }
  .nav__panel-link { --wdth: var(--wdth-condensed); color: var(--color-text); text-decoration: none; }
  .nav__panel-link:active { color: var(--color-accent); }
  .nav__facts { display: flex; flex-direction: column; gap: var(--space-50); margin-top: var(--space-400); padding-top: var(--space-300); border-top: var(--hairline) solid var(--color-line); color: var(--color-text-2); }
  .nav__facts a { color: inherit; text-decoration: none; }
}

.main--offset { padding-top: calc(var(--space-900) + 32px); }

/* ── Footer: the question on the left half, how to answer it on the right; then the menu ── */
.footer { position: relative; z-index: var(--z-content); background: var(--color-bg); border-top: var(--hairline) solid var(--color-line); }
.footer__cta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--columns-gap); align-items: end;
  padding-block: calc(var(--section-pad) * 1.5) var(--section-pad);
  border-bottom: var(--hairline) solid var(--color-line); color: var(--color-text-3);
}
.footer__ask { display: block; color: var(--color-text); text-decoration: none; }
.footer__heading { display: block; --wdth: var(--wdth-condensed); padding-bottom: 0.08em; }
.footer__heading [data-fit] { transition: color var(--dur-fade) var(--ease); }
.footer__heading [data-fit]:last-child { color: var(--color-accent); }
.footer__ask:hover [data-fit] { color: var(--color-accent); }
.footer__ask:hover [data-fit]:last-child { color: var(--color-text); }
.footer__ask:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 6px; }
.footer__cta-row { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-400); padding-bottom: var(--space-100); padding-left: var(--space-700); }
.footer__body { max-width: 34ch; color: var(--color-text-2); }

.footer__menu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--columns-gap);
  padding-block: var(--space-800) 0;
}
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-75); }
/* links read brighter and underlined; plain facts (address, hours) stay quiet */
.footer__text { margin: 0; color: var(--color-text-3); }
.footer__link {
  color: var(--color-text);
  text-decoration: underline 1px var(--color-line-2); text-underline-offset: 0.25em;
  transition: color var(--dur-fade) var(--ease), text-decoration-color var(--dur-fade) var(--ease);
}
.footer__link:hover { text-decoration-color: currentColor; }
.footer__link:active { color: var(--color-accent); }
/* bottom row: the wordmark, one column wide */
.footer__base {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--columns-gap); align-items: end;
  padding-block: var(--space-900) var(--space-600);
}
.footer__word { display: block; width: 100%; height: auto; }

@media (max-width: 47.99rem) {
  .footer__menu { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-400); }
  .footer__cta { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-500); }
  .footer__cta-row { padding-left: 0; }
  .footer__base { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: var(--space-700) var(--space-500); }
}

/* Paper grain, shared by the bands that carry it (home and footer) */
.hero__pin::after, .clients::after, .statement__pin::after, .footer::after {
  content: ""; position: absolute; inset: -80px; pointer-events: none; /* bigger than its block, so it can jitter */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.45;
  mix-blend-mode: overlay;
  animation: grain 0.5s steps(6) infinite;
}
/* the blocks clip their grain; clip, not hidden, so nothing inside turns into a scroll container */
.clients, .statement__pin, .footer { overflow: clip; }
/* the grain jitters like film: the layer jumps a few pixels at a time. A transform, so the
   compositor moves it and nothing repaints */
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  17% { transform: translate(-22px, -44px); }
  33% { transform: translate(13px, -66px); }
  50% { transform: translate(53px, 40px); }
  67% { transform: translate(40px, 18px); }
  83% { transform: translate(-4px, 31px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__pin::after, .clients::after, .statement__pin::after, .footer::after { animation: none; }
}

