/* acbarth.com: Helvetica on a light ground, dark ink, one accent.
   Every color on the site is written in OKLCH. */

:root {
  --ground: oklch(0.924 0.007 97.4);
  --ink: oklch(0.178 0 0);
  --quiet: oklch(0.482 0.006 95.2);
  --hair: oklch(0.178 0 0 / 0.18);
  --wash: oklch(0.178 0 0 / 0.06);
  --edge: oklch(0 0 0 / 0.1);
  --accent: oklch(0.501 0.306 280.3);
  --pad: 40px;
  --gap: 24px;
  --font: "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--quiet);
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--pad);
  top: 8px;
  background: var(--ink);
  color: var(--ground);
  padding: 8px 12px;
  z-index: 10;
}

/* Header */
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 22px var(--pad);
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand .mark {
  width: 14px;
  height: 14px;
  background: var(--accent);
  flex: none;
}

.brand a {
  font-weight: 700;
  text-decoration: none;
}

.brand .where {
  color: var(--quiet);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.nav a {
  text-decoration: none;
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 96px;
  padding: 18px var(--pad) 40px;
  border-top: 1px solid var(--ink);
  font-size: 13px;
  color: var(--quiet);
}

.foot nav,
.foot .group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px var(--foot-gap, 24px);
}

/* The site links and the social marks each stay on one line; on a phone they share it. */
.foot .group {
  flex-wrap: nowrap;
}

@media (max-width: 600px) {
  .foot nav {
    --foot-gap: 20px;
  }
}

.foot a {
  color: var(--quiet);
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
}

.foot a.icon {
  display: block;
}

.foot a.icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Grid and type */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 40px;
  padding: 40px var(--pad);
}

.section {
  padding: 0 var(--pad);
}

.label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quiet {
  color: var(--quiet);
}

.huge {
  margin: 0;
  font-size: clamp(56px, 10.5vw, 176px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.82;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(36px, 4.4vw, 72px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.lede {
  margin: 0;
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 34em;
}

.prose {
  max-width: 38em;
  font-size: 17px;
  line-height: 1.55;
}

.prose p {
  margin: 0 0 1em;
}

.prose h2 {
  margin: 2em 0 0.6em;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  margin-bottom: 32px;
}

.bar h2 {
  margin: 0;
  font-size: clamp(44px, 6.4vw, 104px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.85;
  text-transform: uppercase;
}

.bar span {
  font-size: 13px;
  font-weight: 700;
}

/* Number */
.no {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.no .digits {
  font-size: clamp(80px, 10.5vw, 176px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.78;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.no .tag {
  font-size: 13px;
  font-weight: 700;
  padding-top: 8px;
}

var {
  font-style: italic;
}

var.mean {
  text-decoration: overline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0;
}

.spec dt var,
.spec dt sub {
  font-size: 15px;
}

.spec dt sub {
  font-size: 11px;
  font-style: normal;
}

.vspec {
  margin: 28px 0 20px;
}

.vspec .band {
  position: relative;
  height: 28px;
}

.vspec .mark {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}

.vspec .mark span {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
}

.vspec .ticks {
  position: relative;
  height: 16px;
  margin-top: 10px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--quiet);
}

.vspec .ticks span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.readout-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--quiet);
}

.spec dd sub {
  font-size: 0.7em;
}

/* Spec tables */
.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.spec {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid var(--ink);
}

.spec dt,
.spec dd {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink);
}

.spec dd {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Colors as chip, L, C, h in fixed columns, so every color row lines up field by field. */
.spec dd.lch {
  display: grid;
  grid-template-columns: 11px 5ch 5ch 4.5ch;
  column-gap: 12px;
  justify-content: end;
  align-items: center;
}

.spec dd.lch .chip {
  margin: 0;
}

/* Painting plate */
.plate {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.plate img {
  width: 100%;
  height: auto;
}

/* Thumbnails */
.thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 32px var(--gap);
  padding: 0 var(--pad);
}

.thumb {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
}

.thumb .img {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--wash);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.thumb:hover img {
  transform: scale(1.03);
}

.thumb .cap {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
}

.thumb .cap b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.thumbs.large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thumbs.large .cap {
  font-size: 15px;
}


/* Analysis: two rows of three equal square cells, optical first, then spectral */
.anat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px var(--gap);
  padding: 0 var(--pad);
}

.anat-row {
  padding: 0 var(--pad);
  margin: 0 0 14px;
}

.anat+.anat-row {
  margin-top: 48px;
}

.cell {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cell .cv {
  position: relative;
  flex: none;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--hair);
}

.cell .cv>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cell figcaption {
  display: flex;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cell figcaption b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Detail: octave panes over a dial, or stacked in 3D, in a square cell like the others */
.octaves {
  --dial: 58px;
}

.octaves .glass {
  position: absolute;
  inset: 0 0 var(--dial) 0;
  perspective: 1400px;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.octaves.stacked .glass {
  cursor: grab;
  touch-action: none;
}

.octaves .glass:focus-visible {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.octaves .stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.octaves.deep .stack {
  transform-style: preserve-3d;
}

.octaves .pane {
  position: absolute;
}

.octaves .pane img {
  display: block;
  width: 100%;
  height: 100%;
}

/* On the dial an octave is seen alone, so its marks get more contrast; stacked, the panes
   must add up to the painting, so they are shown as they are. */
.octaves .pane img {
  transition: filter 0.4s ease;
}

.octaves.solo .pane img {
  filter: contrast(var(--boost));
}

/* A hairline edge on each pane in the stack; it fades rather than repaint the pane. */
.octaves .pane::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: 0 0 0 1px var(--hair);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.octaves.stacked .pane::after {
  opacity: 1;
}

/* octaves.js moves the panes every frame while they animate; meanwhile they keep their rasters
   and move on the compositor, and are drawn afresh at their final size once they stop. */
.octaves.moving .stack,
.octaves.moving .pane {
  will-change: transform;
}

.octaves .pane span {
  position: absolute;
  left: 100%;
  top: 0;
  padding-left: 0.7em;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--quiet);
}

/* The sliders: a hairline track with a tick per stop, a round knob, labels under the ticks. */
.octaves .slide {
  --knob: 16px;
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: calc(var(--dial) - 12px);
  transition: opacity 0.3s ease, visibility 0.3s;
}

.octaves .spread,
.octaves.stacked .dial {
  opacity: 0;
  visibility: hidden;
}

.octaves.stacked .spread {
  opacity: 1;
  visibility: visible;
}

.octaves .slide input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: var(--knob);
  margin: 0;
  background: none;
  cursor: pointer;
  touch-action: pan-y;
  position: relative;
  z-index: 1; /* the knob covers the tick it rests on */
}

.octaves .slide input:focus {
  outline: none;
}

.octaves .slide input::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--ink);
}

.octaves .slide input::-moz-range-track {
  height: 1px;
  background: var(--ink);
}

.octaves .slide input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--knob);
  height: var(--knob);
  margin-top: calc(var(--knob) / -2 + 0.5px);
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--ground);
  cursor: grab;
}

.octaves .slide input::-moz-range-thumb {
  width: var(--knob);
  height: var(--knob);
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--ground);
  cursor: grab;
}

.octaves .slide input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--ink);
}

.octaves .slide input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--ink);
}

/* Ticks and labels sit where the knob's centre stops: half a knob in from each end. */
.octaves .slide ol {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--knob) / 2 - 3px);
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.octaves .slide li {
  --steps: calc(var(--n) - 1);
  position: absolute;
  left: calc(var(--knob) / 2 + (100% - var(--knob)) * var(--i) / var(--steps));
  transform: translateX(-50%);
  padding-top: 12px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  color: var(--quiet);
}

.octaves .slide li::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  height: 7px;
  border-left: 1px solid var(--ink);
}

.octaves .dial li.on {
  color: var(--accent);
}

.octaves .spread li {
  --steps: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.octaves .spread li:first-child {
  transform: none;
  left: 0;
}

.octaves .spread li:last-child {
  transform: translateX(-100%);
  left: 100%;
}

.octaves .spread li::before {
  display: none;
}

/* The octave slider leaves room on its left for the unit of its labels. */
.octaves .dial {
  left: 48px;
}

.octaves .unit {
  position: absolute;
  right: calc(100% + 14px);
  top: calc(var(--knob) / 2 - 5px);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* View switch: a two-way segmented control at the right of the caption. */
.octaves figcaption {
  align-items: center;
}

.octaves .mode {
  display: flex;
  margin: -4px 0 -4px auto;
  border: 1px solid var(--ink);
  letter-spacing: 0;
}

.octaves .mode button {
  min-width: 34px;
  padding: 5px 7px 4px;
  border: 0;
  background: var(--ground);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.octaves .mode button+button {
  border-left: 1px solid var(--ink);
}

.octaves .mode button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ground);
  cursor: default;
}

.octaves .mode button:not([aria-pressed="true"]):hover {
  color: var(--accent);
}

.octaves .mode button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.specimg .ax {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
}

.specimg .h,
.specimg .v {
  position: absolute;
  background: var(--hair);
}

.specimg .h {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.specimg .v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

/* Bar graphs: tone over lightness, detail over wavelength */
.graph {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.wave {
  height: 62%;
  display: flex;
  align-items: center;
  gap: 1px;
}

.wave span {
  flex: 1 1 0;
  border-radius: 1px;
  background: var(--ink);
}

.grad {
  height: 4px;
  background: linear-gradient(90deg in oklch, oklch(0 0 0), oklch(1 0 0));
}

.graph .ends {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

/* Palette: the mixing primaries, equal widths, dark to light */
.stripes {
  display: flex;
}

.stripes div {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.stripes div span {
  position: absolute;
  left: 50%;
  bottom: 10px;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  font-size: 10px;
  font-weight: 700;
  white-space: pre;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Prev / next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding: 0 var(--pad);
  margin-top: 72px;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  text-decoration: none;
}

.pager a.next {
  text-align: right;
}

.pager small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--quiet);
}

.pager b {
  font-size: 20px;
  letter-spacing: -0.02em;
}

/* Research */
.papers {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.papers li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--gap);
  padding: 12px 0;
  border-bottom: 1px solid var(--ink);
}

.papers .y {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.papers .pt {
  font-weight: 700;
}

.papers .pa,
.papers .pv {
  color: var(--quiet);
  font-size: 13px;
}

/* Zoom viewer */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ground);
  display: none;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.viewer.open {
  display: block;
}

.viewer .stage {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.viewer .stage.dragging {
  cursor: grabbing;
}

.viewer img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  -webkit-user-drag: none;
  pointer-events: none;
}

.viewer .chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  pointer-events: none;
}

.viewer .chrome>* {
  pointer-events: auto;
}

.viewer .id {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  background: var(--ground);
  padding: 6px 10px;
}

.viewer .id b:first-child {
  color: var(--accent);
}

.viewer .close,
.viewer .tool {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
}

.viewer .tools {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 6px;
}

.viewer .scale {
  position: absolute;
  left: 20px;
  bottom: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--ground);
  padding: 6px 10px;
  font-variant-numeric: tabular-nums;
}

/* Small parts */
.chip {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px var(--edge);
}

.more {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
}

.more:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.acc {
  color: var(--accent);
  margin-right: 8px;
}

.lede.big {
  font-size: clamp(26px, 3.2vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 24em;
  font-weight: 400;
}

.statement {
  margin-top: 56px;
  padding-top: 24px;
}

.bar h2.small {
  font-size: clamp(32px, 4vw, 56px);
}

.grid.flush {
  padding-left: 0;
  padding-right: 0;
}

.specs.one {
  grid-template-columns: minmax(0, 1fr);
}

.points {
  row-gap: 56px;
}

.point p:not(.label) {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  max-width: 34em;
}

.point .label {
  padding-top: 10px;
  border-top: 2px solid var(--ink);
  margin-bottom: 14px;
}

.hero {
  align-items: end;
}

.prose h2 {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 960px) {
  .thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .thumbs.large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --pad: 16px;
    --gap: 16px;
  }

  .grid>* {
    grid-column: 1 / -1 !important;
  }

  .anat {
    gap: 28px var(--gap);
  }

  .specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .thumbs,
  .thumbs.large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand .where {
    display: none;
  }

  .pager b {
    font-size: 16px;
  }

  .top {
    padding: 16px var(--pad);
  }

  .nav {
    gap: 8px 20px;
  }
}

@media (max-width: 600px) {
  .anat {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}