/* Shared print/club identity: palette, measure, motion, the one arrow, the
   masthead and the browser surfaces every page inherits. */
:root {
  color-scheme: dark;
  --identity-bg: #151515;
  --identity-fg: #ecece8;
  --identity-muted: #aaa9a3;
  --identity-rule: #414141;
  --identity-accent: #f28abc;
  --identity-panel: #202020;
  --identity-on-accent: #151515;
  --font-display: 'Instrument Sans', sans-serif;
  --font-mono: 'Courier Prime', 'Courier New', monospace;
  /* 12px is the floor for anything a visitor is meant to read. */
  --text-meta: 12px;
  --text-small: 13px;
  --text-body: 16px;
  /* One measure and one gutter line up the header and content on every page. */
  --measure: 1600px;
  --gutter: max(clamp(20px, 4vw, 64px), calc((100vw - var(--measure)) / 2));
  --header-height: 72px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M3.5 12.5l9-9M5.25 3.5h7.25v7.25'/%3E%3C/svg%3E");
  accent-color: var(--identity-accent);
  scrollbar-color: var(--identity-rule) var(--identity-bg);
  scrollbar-gutter: stable;
  -webkit-tap-highlight-color: transparent;
}
:root[data-palette='day'] {
  color-scheme: light;
  --identity-bg: #ecece8;
  --identity-fg: #171717;
  --identity-muted: #595955;
  --identity-rule: #b9b9b3;
  --identity-accent: #9b1653;
  --identity-panel: #ddddd7;
  --identity-on-accent: #fff;
}
/* Without JavaScript the palette still follows the device. */
@media (prefers-color-scheme: light) {
  :root:not([data-palette]) { color-scheme: light; --identity-bg: #ecece8; --identity-fg: #171717; --identity-muted: #595955; --identity-rule: #b9b9b3; --identity-accent: #9b1653; --identity-panel: #ddddd7; --identity-on-accent: #fff; }
}
::selection { color: var(--identity-on-accent); background: var(--identity-accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* A modal artwork viewer holds the page still behind it. */
html.flyer-open { overflow: hidden; }

/* Masthead: the same wordmark, links and controls on every page. Below 1000px
   the brand row scrolls away and only the link row stays pinned. */
.masthead { position: sticky; top: 0; z-index: 40; box-sizing: border-box; min-height: var(--header-height); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; padding: 8px var(--gutter); background: var(--identity-bg); border-bottom: 1px solid var(--identity-rule); }
.portfolio-home { justify-self: start; display: grid; align-content: center; gap: 2px; min-height: 44px; color: var(--identity-fg); font: 600 21px/1.2 var(--font-display); letter-spacing: -.03em; text-decoration: none; }
.portfolio-home__location { font: var(--text-meta)/1.4 var(--font-mono); letter-spacing: 0; color: var(--identity-muted); }
.masthead__nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }
.masthead__nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--identity-fg); font: var(--text-small)/1.5 var(--font-mono); text-decoration: none; background: linear-gradient(var(--identity-accent), var(--identity-accent)) 0 calc(50% + 14px) / 0 2px no-repeat; transition: background-size .35s var(--ease-out), color .2s var(--ease-out); }
.masthead__nav a[aria-current] { background-size: 100% 2px; }
.masthead__nav a:hover { color: var(--identity-accent); background-size: 100% 2px; }
.masthead__settings { display: flex; justify-self: end; align-items: center; gap: 4px; }
[data-theme-toggle], .motion-toggle { min-height: 44px; padding: 10px; border: 0; border-radius: 0; background: none; cursor: pointer; font: var(--text-meta)/1.4 var(--font-mono); transition: color .2s var(--ease-out); }
[data-theme-toggle] { display: inline-flex; align-items: center; gap: 8px; color: var(--identity-fg); }
[data-theme-toggle]::before { content: ''; width: 8px; height: 8px; border: 1px solid currentColor; }
[data-theme-toggle][aria-pressed='true']::before { background: currentColor; }
[data-theme-toggle]:hover { color: var(--identity-accent); }
.motion-toggle { padding-right: 0; padding-left: 14px; color: var(--identity-muted); border-left: 1px solid var(--identity-rule); }
.motion-toggle:hover { color: var(--identity-fg); }
.motion-toggle:disabled { cursor: default; }
:where(.masthead) :where(a, button):focus-visible { outline: 2px solid var(--identity-accent); outline-offset: 3px; }
@media (max-width: 1000px) {
  :root { --header-height: 48px; }
  /* reading-flow keeps Tab in the order the two rows are seen: brand, controls, then links. */
  .masthead { top: -60px; grid-template-columns: 1fr auto; grid-template-rows: 60px 48px; gap: 0 18px; padding-block: 0; reading-flow: grid-rows; }
  .masthead__settings { grid-column: 2; grid-row: 1; }
  .masthead__nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid var(--identity-rule); }
}
@media (max-width: 650px) {
  .masthead { top: -54px; grid-template-rows: 54px 46px; }
  .portfolio-home { font-size: 19px; }
  .portfolio-home__location { display: none; }
  .masthead__settings { gap: 0; }
  [data-theme-toggle] { padding-inline: 8px; }
  .motion-toggle { padding-left: 10px; }
  .masthead__nav { gap: 8px; }
}
@media (max-width: 359px) {
  .portfolio-home { font-size: 17px; }
  .masthead__nav a { font-size: var(--text-meta); }
}

/* Footer: the same sign-off closes every page. */
.portfolio-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px var(--gutter); border-top: 1px solid var(--identity-rule); }
.portfolio-footer p { margin: 0; }
.portfolio-footer__signoff { color: var(--identity-fg); font: 600 20px/1.2 var(--font-display); letter-spacing: -.03em; }
.portfolio-footer__signoff span { display: block; margin-top: 8px; font: var(--text-meta)/1.4 var(--font-mono); letter-spacing: 0; color: var(--identity-muted); }
.portfolio-footer__nav { display: flex; gap: 28px; }
.portfolio-footer__nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--identity-muted); font: var(--text-small)/1.5 var(--font-mono); text-decoration: none; transition: color .2s var(--ease-out); }
.portfolio-footer__nav a:hover { color: var(--identity-accent); }
@media (max-width: 650px) {
  .portfolio-footer { align-items: flex-start; flex-direction: column; gap: 12px; }
  .portfolio-footer__nav { justify-content: space-between; width: 100%; gap: 10px; }
}

/* One drawn arrow replaces the mixed fallback-font glyphs. Up-right leaves the
   site, right goes to another page here, down and up move within the page. */
.arrow { --lean: .14em -.14em; display: inline-block; flex: none; width: .8em; height: .8em; background: currentColor; -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; transition: translate .3s var(--ease-out); }
.arrow--right { --lean: .2em 0; rotate: 45deg; }
.arrow--down { --lean: 0 .2em; rotate: 135deg; }
.arrow--left { --lean: -.2em 0; rotate: -135deg; }
.arrow--up { --lean: 0 -.2em; rotate: -45deg; }
@media (hover: hover) { :where(a, button):hover .arrow { translate: var(--lean); } }
@media (forced-colors: active) { .arrow { background: CanvasText; forced-color-adjust: none; } }

/* Solid controls share one press and one colour transition on every page. */
:where(.portfolio-button, .project-cta, .cover-browse, [data-film-toggle], .filters button, .archive-tools button, .media-viewer button, .flyer-viewer button) { transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out), scale .16s var(--ease-out); }
:where(.portfolio-button, .project-cta, .cover-browse, [data-film-toggle], .filters button, .archive-tools button, .media-viewer button, .flyer-viewer button):active { scale: .97; }

/* Sections settle upward as they scroll in, where the browser can tie motion to
   scroll. Only position moves: text is never dimmed, so it keeps full contrast
   wherever the page comes to rest. */
@keyframes scroll-arrive { from { translate: 0 20px; } }

/* Moving between pages: the old sheet lifts away, shared artwork travels. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation-duration: .2s; }
::view-transition-new(root) { animation-duration: .35s; }
/* Artwork with no counterpart on the next page leaves with the old page. */
::view-transition-old(*):only-child { animation-duration: .2s; }
html[data-motion-paused='true'] { scroll-behavior: auto !important; }
html[data-motion-paused='true']::view-transition-group(*),
html[data-motion-paused='true']::view-transition-old(*),
html[data-motion-paused='true']::view-transition-new(*) { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .arrow, .masthead__nav a, [data-theme-toggle], .motion-toggle { transition: none; }
}
