@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-text.woff2") format("woff2");
  font-weight: 400 520;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-questions.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* One vertical axis organises the page. Content starts on its right; the margin on its
   left holds the question that introduces each work.
   White type on warm grey-brown paper; blue pen marks provide the annotation colour.
   Hierarchy comes from size, italic and the margin; only question-size type softens. */
:root {
  --accent: #5e5852;
  --paper: var(--accent);
  --shadow-colour: #000000;
  --ink: #fff;
  --soft: rgb(255 255 255 / 0.8);
  --line: rgb(255 255 255 / 0.42);
  --underline: rgb(255 255 255 / 0.55);
  --pen-ink: #5d82ff;
  --page: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
  --hang: clamp(210px, 25vw, 360px);
  --fs-small: 16px;
  --fs-ui: 15px;
  --fs-read: clamp(17px, 1.3vw, 20px);
  --fs-q: clamp(34px, 4.4vw, 64px);
  --lh-q: 1.08;
  /* A word space at question size, so the margin and the column read as one sentence. */
  --gap: calc(var(--fs-q) * 0.26);
  --pin-top: clamp(40px, 9svh, 104px);
  --space: clamp(112px, 17svh, 200px);
  --t-quick: 200ms;
  color-scheme: dark;
}
@media screen {
  :root {
    --paper: var(--preview-paper, var(--accent));
    --shadow-colour: var(--preview-shadow, #000000);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  isolation: isolate;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  font-size: var(--fs-ui);
  font-weight: 400;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--underline);
  transition: text-decoration-color var(--t-quick);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed;
  left: var(--gutter);
  top: -100px;
  z-index: 30;
  padding: 10px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.skip:focus { top: 12px; }

.row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The name and statement share a reading size; the white pen marks the name. */
.statement { z-index: auto; padding-top: clamp(48px, 10svh, 128px); }
.statement-text { display: grid; gap: 1.5rem; }
.statement-title {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(28px, 4svh, 48px);
  font-family: inherit;
  font-size: var(--fs-read);
  font-weight: 520;
  font-variant-caps: normal;
  line-height: 1.62;
  letter-spacing: 0;
}
.statement-copy { position: relative; z-index: 2; display: grid; gap: 1rem; }
.statement-text p {
  max-width: 34em;
  font-size: var(--fs-read);
  line-height: 1.45;
  text-wrap: pretty;
}
/* Light ink reads heavier than dark ink, so the one bold line stays restrained. */
.statement-text strong { font-weight: 520; }

/* A real vector pen stroke follows the phrase; inline text keeps normal flow. */
[data-pen-underline] {
  text-decoration: underline;
  text-decoration-color: var(--pen-ink);
  text-decoration-thickness: .08em;
  text-underline-offset: .22em;
}
[data-pen-underline][data-pen-rendered] { text-decoration: none; }
a[data-pen-underline] { --pen-dry-side: left; display: inline-block; max-width: 100%; padding-bottom: .85em; transition: color var(--t-quick), text-decoration-color var(--t-quick); }
a[data-pen-underline]:is(:hover, :focus-visible) { color: var(--pen-ink); }
.name-underline, .intro-question { --pen-ink: #fff; --pen-dry-side: left; display: inline-block; max-width: 100%; padding-bottom: .85em; }
.intro-question { --pen-ink: #000; --pen-dry-side: right; }
@media (max-width: 899px) {
  a[data-pen-underline], .name-underline {
    --pen-dry-side: right;
    overflow-wrap: anywhere;
  }
}
.pen-underline-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: visible;
  z-index: 3;
  pointer-events: none;
}

/* Works */
.works { margin-top: var(--space); }
.pin-col { display: none; }
.pin-filter-defs { position: absolute; overflow: hidden; pointer-events: none; }
.pin-words { display: inline-block; }
.pin-words[data-dissolving] { filter: url("#pin-grain-dissolve"); }
.question {
  max-width: 15em;
  font-size: var(--fs-q);
  font-weight: 400;
  line-height: var(--lh-q);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.question i, .pin i { font-style: italic; letter-spacing: -0.02em; }
.work + .work { margin-top: var(--space); }
.work-media { margin-top: clamp(32px, 4vw, 56px); }
.work-media img { width: 100%; }
.work-media.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 16px); }
.work-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 36px;
}
.work-meta {
  display: grid;
  align-content: start;
  gap: 2px;
  font-size: var(--fs-read);
  line-height: 1.45;
}
.work-text {
  display: grid;
  gap: .85em;
  max-width: 34em;
  font-size: var(--fs-read);
  line-height: 1.45;
  text-wrap: pretty;
}

/* Partner marks share the text column; optical sizes preserve each identity. */
.work-partners { display: grid; gap: 18px; margin-top: 24px; }
.partner-title { margin: 0; font: inherit; }
.partner-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.partner-marks li { flex: 0 0 auto; }
.partner-marks a { display: flex; align-items: center; min-height: 44px; max-width: 100%; }
.partner-marks img { display: block; width: 100%; height: auto; }
.partner-mazette { width: 212px; }
.partner-fwb { width: 170px; }
.partner-bij { width: 130px; }
.partner-arts2 { width: 72px; }
.partner-mapa { width: 84px; }
.partner-marks--azulejos { gap: 28px; }
@media (max-width: 540px) {
  .partner-marks--mill { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 24px; row-gap: 28px; }
  .partner-marks--mill li:first-child { grid-column: 1 / -1; }
}

.contact { z-index: auto; margin-top: var(--space); padding-bottom: var(--space); }
.contact-lines {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.1em;
  font-size: var(--fs-q);
  line-height: var(--lh-q);
  letter-spacing: -0.03em;
}
.contact-lines a { width: fit-content; text-decoration: none; }
.contact-lines a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.contact-lines span { color: var(--soft); }

/* Foliage shades the paper; reading text stays above it. */
.paper-grain, .leaf-shadow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.leaf-shadow { z-index: 1; mix-blend-mode: normal; }
.leaf-shadow canvas { display: block; width: 100%; height: 100%; }
.leaf-shadow::before, .leaf-shadow::after {
  content: "";
  position: absolute;
  width: max(230vw, 240vh);
  aspect-ratio: 1;
  right: -155vw;
  top: -110vh;
  background: var(--shadow-colour);
  -webkit-mask: url("assets/leaf-shadow.svg") center / contain no-repeat;
  mask: url("assets/leaf-shadow.svg") center / contain no-repeat;
  opacity: .28;
  transform-origin: 65% 30%;
}
.leaf-shadow::after { right: auto; left: -170vw; top: -30vh; transform: rotate(115deg); opacity: .2; }
.motion-ready .leaf-shadow::before { animation: leaf-shadow-wind 23s ease-in-out infinite alternate; }
.motion-ready .leaf-shadow::after { animation: leaf-shadow-wind-reverse 31s ease-in-out infinite alternate; }
.leaf-shadow.is-ready::before, .leaf-shadow.is-ready::after { display: none; }
.paper-grain { z-index: 21; mix-blend-mode: soft-light; opacity: .16; }
.paper-grain canvas { display: block; position: absolute; left: 0; top: 0; }
@keyframes leaf-shadow-wind { from { transform: rotate(-2deg) translate(0, 0); } to { transform: rotate(2deg) translate(10px, 7px); } }
@keyframes leaf-shadow-wind-reverse { from { transform: rotate(113deg) translate(0, 0); } to { transform: rotate(117deg) translate(-13px, 9px); } }
:root[data-motion="paused"] .leaf-shadow::before, :root[data-motion="paused"] .leaf-shadow::after { animation-play-state: paused; }

/* An unobtrusive corner reveals local colour experiments, above the grain. */
.colour-tools {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  color: #302d29;
  color-scheme: light;
  font-size: 14px;
  line-height: 1.4;
}
.colour-tools[hidden], .colour-panel[hidden] { display: none; }
.colour-tools button, .colour-tools input { font: inherit; }
.colour-tools button { cursor: pointer; color: inherit; }
.colour-tools :focus-visible { outline: 2px solid #302d29; outline-offset: 3px; }
.colour-toggle {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid rgb(48 45 41 / .16);
  border-radius: 50%;
  background: #f3f0e9;
  opacity: 0;
  transition: opacity var(--t-quick);
}
.colour-tools:hover .colour-toggle, .colour-toggle:focus-visible,
.colour-toggle[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .colour-toggle { opacity: .18; } }
.colour-panel {
  position: absolute;
  right: 0;
  bottom: 54px;
  width: min(300px, calc(100vw - 28px));
  max-height: calc(100svh - 90px);
  overflow: auto;
  padding: 12px 18px 18px;
  border: 1px solid rgb(48 45 41 / .2);
  border-radius: 3px;
  background: #f3f0e9;
  box-shadow: 0 6px 30px rgb(0 0 0 / .16);
}
.colour-panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.colour-panel-heading h2 { font: inherit; font-weight: 520; }
.colour-tools .colour-close { width: 44px; height: 44px; margin-right: -12px; border: 0; background: none; font-size: 24px; }
.colour-field { display: grid; grid-template-columns: 1fr 40px 90px; gap: 10px; align-items: center; margin-block: 12px; }
.colour-field input[type="color"] { width: 40px; height: 40px; padding: 2px; border: 1px solid #b9b3a9; border-radius: 2px; background: transparent; cursor: pointer; }
.colour-field input[type="text"] { min-width: 0; width: 100%; padding: 9px 6px; border: 1px solid #b9b3a9; border-radius: 2px; background: transparent; color: inherit; }
.colour-tools .colour-field input { font-size: 16px; }
.colour-field input[aria-invalid="true"] { border-color: #a62828; }
.colour-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.colour-reset { min-height: 36px; padding: 5px 9px; border: 1px solid #b9b3a9; border-radius: 2px; background: transparent; }
.colour-panel-foot p { max-width: 14em; font-size: 11px; }

/* A collection of actual traced patterns, arranged in three dimensions, without a globe. */
.tile-orbit {
  --orbit-radius: clamp(90px, 24vw, 210px);
  --orbit-width: 1.14;
  --orbit-height: .62;
  --orbit-depth: .8;
  --tile-size: clamp(56px, 7vw, 94px);
  position: relative;
  width: 100%;
  height: clamp(280px, 52vw, 460px);
  overflow: hidden;
  contain: layout paint;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.tile-orbit[data-dragging] { cursor: grabbing; }
.tile-orbit, .tile-orbit:focus, .tile-orbit:focus-visible, .tile-orbit:active {
  outline: none;
  border: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.tile-cloud {
  position: absolute;
  left: 50%; top: 50%;
  width: calc(var(--orbit-radius) * 2);
  height: calc(var(--orbit-radius) * 2);
  margin: calc(var(--orbit-radius) * -1);
}
.orbit-tile {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--tile-size); height: var(--tile-size);
  margin: calc(var(--tile-size) / -2);
  transform: translate(calc(var(--nx) * var(--orbit-radius) * var(--orbit-width)), calc(var(--ny) * var(--orbit-radius) * var(--orbit-height)));
}
.tile-orbit[data-active] .orbit-tile { will-change: transform, opacity; }
.orbit-tile img { width: 100%; height: 100%; pointer-events: none; user-select: none; }
.work-media .tracing { object-fit: contain; }
/* A parallel-projection working model, without a frame or a separate ground. */
.mill-study { position: relative; }
.mill-interactive, .mill-plate { width: 100%; aspect-ratio: 10 / 7; }
.mill-interactive { position: relative; touch-action: pan-y pinch-zoom; cursor: grab; contain: layout paint; }
.mill-interactive canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mill-interactive[data-dragging] { cursor: grabbing; }
.mill-interactive:focus, .mill-interactive:focus-visible { outline: none; }
.mill-study[data-ready] .mill-plate { display: none; }
.mill-study[data-ready] .mill-interactive { display: block; }

@media (min-width: 900px) {
  html { scroll-padding-top: var(--pin-top); }
  .row { grid-template-columns: var(--hang) minmax(0, 1fr); column-gap: var(--gap); }
  .row > * { grid-column: 2; }
  .works { grid-template-rows: auto; }
  .works > .pin-col { display: block; grid-column: 1; grid-row: 1; }
  .works > .works-list { grid-row: 1; }
  .pin {
    position: sticky;
    top: var(--pin-top);
    font-size: var(--fs-q);
    line-height: var(--lh-q);
    text-align: right;
  }
  /* In the wide layout the margin speaks the first words of every question. */
  .question .lead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .work-body { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
}

@media (max-width: 899px) {
  .question { max-width: 13em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .pin-words[data-dissolving] { filter: none; }
}

/* Printed, the page becomes a dossier: one work to a page. Paper stays white,
   since browsers drop background colours by default, and the grey passes to the questions. */
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  :root {
    --paper: #fff;
    --ink: #121211;
    --soft: #121211;
    --line: rgb(18 18 17 / 0.2);
    --underline: rgb(18 18 17 / 0.3);
    --fs-read: 10.5pt;
    --fs-small: 8.5pt;
    --fs-q: 24pt;
    --space: 12mm;
    color-scheme: light;
  }
  .question { color: var(--accent); }
  .name-underline, .intro-question { --pen-ink: var(--ink); }
  .skip, .pin-col, .mosaic-hits, .colour-tools { display: none !important; }
  .row { display: block; padding: 0; }
  .question .lead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  .work { break-before: page; }
  .work-media img { max-height: 120mm; width: auto; }
  .work-media.pair { display: flex; flex-wrap: wrap; gap: 3mm; }
  .work-media.pair img { width: calc(50% - 1.5mm); }
  .work-body { display: grid; grid-template-columns: 1fr 2fr; gap: 6mm; }
  .contact-lines { font-size: 18pt; }
  .contact { padding-bottom: 0; }
  .work-partners { margin-top: 4mm; gap: 3mm; break-inside: avoid; }
  .partner-marks, .partner-marks--mill { display: flex; gap: 4mm; flex-wrap: wrap; }
  .partner-marks a { min-height: 0; }
  .partner-marks img { filter: brightness(0); }
  .partner-mazette { width: 42mm; }
  .partner-fwb { width: 34mm; }
  .partner-bij { width: 26mm; }
  .partner-arts2 { width: 14mm; }
  .partner-mapa { width: 17mm; }
}

@media print {
  .leaf-shadow, .paper-grain { display: none !important; }
  .pen-underline-layer { display: none !important; }
  a[data-pen-underline] { margin-inline-start: 0; max-width: 100%; }
  [data-pen-underline][data-pen-rendered] { text-decoration-line: underline; text-decoration-color: var(--pen-ink); }
  .tile-orbit { height: auto; overflow: visible; contain: none; perspective: none; }
  .tile-cloud { position: static; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2mm; width: 100%; height: auto; margin: 0; transform: none !important; }
  .orbit-tile { position: static; width: 100%; height: auto; aspect-ratio: 1; margin: 0; transform: none !important; opacity: 1 !important; }
  .work-media .tracing, .orbit-tile img { filter: brightness(0); }
  .work-media .tracing { width: 100%; max-height: 100mm; }
  .mill-study[data-ready] .mill-plate, .mill-plate { display: block; width: 100%; max-height: 120mm; }
  .work-media .mill-plate { filter: none; }
  .mill-study[data-ready] .mill-interactive { display: none; }
}
