/* Organs showcase. Light theme only; tokens are the light values of the portfolio's styles/tokens.css.
   Aeonik Soft is licensed and not in this repo: it is loaded from /fonts/ on ndr3svt.art, with a system fallback. */

:root {
  color-scheme: light;

  --bg: #f4f2ec;
  --fg: #0b0b16;
  --muted: rgba(11, 11, 22, 0.68);
  --line: rgba(11, 11, 22, 0.36);
  --line-soft: rgba(11, 11, 22, 0.14);
  --row-hover: rgba(11, 11, 22, 0.04);
  --pill-bg: #fbfaf6;
  --pill-hover: #e9e6dd;
  --pill-line: rgba(11, 11, 22, 0.3);
  --ground: #ecece8; /* the neutral ground every cutout sits on */

  --font: "Aeonik Soft", Inter, system-ui, sans-serif;
  --section: clamp(2.5rem, 6vw, 6rem);
  --row: clamp(1.5rem, 2.4vw, 2.25rem);
  --body: clamp(1rem, 1.5vw, 1.5rem);
  --meta: clamp(0.875rem, 1.1vw, 1.125rem);
  --gap: clamp(1.5rem, 3vw, 3.5rem);

  --dur-1: 150ms;
  --dur-2: 250ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(11, 11, 22, 0.75);
    --pill-line: rgba(11, 11, 22, 0.75);
  }
}

@font-face {
  font-family: "Aeonik Soft";
  src: url("/fonts/AeonikSoft-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aeonik Soft";
  src: url("/fonts/AeonikSoft-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scrollbar-width: none;
  scroll-padding-bottom: 6rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  padding-bottom: 7rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.35;
  font-weight: 400;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

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

strong {
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: none;
}

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

.skip {
  position: absolute;
  left: 25px;
  top: 0;
  transform: translateY(-120%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.4rem 0.8rem;
}

.skip:focus {
  transform: none;
}

.wrap {
  margin-inline: 25px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* head */

.page-head {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3.5rem);
}

.kicker {
  margin: 0 0 0.5rem;
  font-size: var(--body);
}

.page-title {
  max-width: 16ch;
  margin: 0 0 1rem;
  font-size: var(--section);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.subhead {
  margin: 0.5rem 0 0;
  max-width: 34rem;
  font-size: var(--row);
  font-weight: 400;
  line-height: 1.15;
}

.meta-line {
  margin: 1.5rem 0 0;
  min-height: 1.4em;
  font-size: var(--meta);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.meta-line span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.8em;
  margin: 0 1rem;
  background: var(--line);
}

/* bands: a hairline, a small label on the left, the work on the right */

.band {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) 6fr;
  gap: var(--gap);
  padding: var(--gap) 0 calc(var(--gap) * 1.2);
  border-top: 1px solid var(--line);
}

.band-label {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin: 0;
  font-size: var(--meta);
  font-weight: 400;
}

.band-label .num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.band-body {
  min-width: 0;
}

.note {
  max-width: 46rem;
  margin: 0;
  font-size: var(--meta);
  color: var(--muted);
}

/* 01 realms */

.realms {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.realm {
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--line-soft);
  transition: background-color var(--dur-2) var(--ease);
}

.realm:first-child {
  border-top-color: var(--line);
}

.realm.is-active {
  background: var(--row-hover);
}

.realm-head {
  display: grid;
  grid-template-columns: 2.5rem minmax(7rem, 12rem) 6.5rem 1fr;
  gap: 1rem;
  align-items: center;
  font-size: var(--meta);
}

.realm-head .idx {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.realm-name {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: var(--body);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.realm-name:hover {
  text-decoration: underline;
}

.realm-name[aria-pressed="true"] {
  text-decoration: underline;
}

.realm-name:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.sw {
  width: 0.62em;
  height: 0.62em;
  background: var(--c);
}

.count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.share {
  position: relative;
  height: 1px;
  background: var(--line-soft);
}

.share i {
  position: absolute;
  left: 0;
  top: -1px;
  height: 3px;
  width: var(--w);
  background: var(--c);
}

.strip {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 2px;
  margin-top: 1rem;
}

.tile {
  padding: 0;
  border: 0;
  background: var(--ground);
  aspect-ratio: 1;
  cursor: pointer;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-2) var(--ease);
}

.tile:hover img {
  opacity: 0.6;
}

.tile[aria-current="true"] {
  outline: 1px solid var(--fg);
  outline-offset: 1px;
}

/* 02 specimen */

.specimen {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.stage {
  margin: 0;
}

.plate {
  position: relative;
  aspect-ratio: 1;
  background: var(--ground);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

/* --p runs 0 to 2 and drives the three layers: source, cutout, mask. Crossfade is pure CSS. */
.plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plate img:nth-child(1) {
  opacity: clamp(0, calc(1 - var(--p)), 1);
}

.plate img:nth-child(2) {
  opacity: clamp(0, calc(1 - max(var(--p) - 1, 1 - var(--p))), 1);
}

.plate img:nth-child(3) {
  opacity: clamp(0, calc(var(--p) - 1), 1);
}

.caption {
  min-height: 3.6em;
  margin-top: 0.8rem;
  font-size: var(--meta);
  color: var(--muted);
}

.caption .title {
  display: block;
  color: var(--fg);
}

.controls {
  display: grid;
  gap: 0.4rem;
}

.readout {
  margin: 0 0 0.6rem;
  font-size: var(--section);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.readout output {
  font: inherit;
}

.readout .of {
  margin-left: 0.8rem;
  font-size: var(--meta);
  letter-spacing: 0;
  color: var(--muted);
}

.slider-label {
  margin-top: 1.4rem;
  font-size: var(--meta);
  color: var(--muted);
}

/* range inputs: one hairline and a small square */

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 2rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--fg);
}

input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--fg);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5.5px;
  border: 0;
  border-radius: 0;
  background: var(--fg);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: var(--fg);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.ticks {
  position: relative;
  height: 2.6rem;
  margin-top: -0.4rem;
}

.tick {
  position: absolute;
  top: 0;
  left: calc(var(--x) * (100% - 12px) + 6px);
  font-size: calc(var(--meta) - 3px);
  color: var(--muted);
  white-space: nowrap;
}

.tick::before {
  content: "";
  display: block;
  width: 1px;
  height: 0.6rem;
  margin-bottom: 0.25rem;
  background: var(--line);
}

.hint {
  margin: 0;
  font-size: calc(var(--meta) - 3px);
  color: var(--muted);
}

.steps {
  display: flex;
  justify-content: space-between;
  margin-top: -0.2rem;
  font-size: var(--meta);
  color: var(--muted);
}

.steps [aria-current="true"] {
  color: var(--fg);
}

.step-note {
  min-height: 4.2em;
  margin: 1rem 0 0;
  font-size: var(--body);
  line-height: 1.3;
}

/* 03 numbers */

.charts {
  display: grid;
  gap: calc(var(--gap) * 1.2);
}

.chart {
  margin: 0;
}

.chart h3 {
  margin: 0 0 0.4rem;
  font-size: var(--body);
  font-weight: 400;
}

.chart .what {
  max-width: 46rem;
  margin: 0 0 1.2rem;
  font-size: var(--meta);
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 15rem;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: var(--meta);
}

.row svg {
  display: block;
  width: 100%;
  height: 14px;
}

.row .vals {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: calc(var(--meta) - 2px);
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 0.9rem;
  height: 0.6rem;
  margin-right: 0.45rem;
  vertical-align: baseline;
}

/* 04 process */

.method {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.method li {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.method li::before {
  content: counter(step, decimal-leading-zero);
  font-size: calc(var(--meta) - 2px);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.method h3 {
  margin: 0.4rem 0 0.5rem;
  font-size: var(--body);
  font-weight: 400;
}

.method p {
  margin: 0;
  font-size: var(--meta);
  color: var(--muted);
}

/* 05 credits */

.credits {
  margin-top: 1.5rem;
}

.credits summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 1.15rem;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  background: var(--pill-bg);
  font-size: var(--meta);
  cursor: pointer;
  list-style: none;
  transition: background-color var(--dur-1) var(--ease);
}

.credits summary::-webkit-details-marker {
  display: none;
}

.credits summary:hover {
  background: var(--pill-hover);
}

.credits ol {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: calc(var(--meta) - 2px);
}

.credits li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 2fr) minmax(0, 1.5fr) 4.5rem 5.5rem;
  gap: 1rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}

.credits li > :nth-child(1),
.credits li > :nth-child(4) {
  color: var(--muted);
}

/* footer and dock, as on the portfolio */

.site-footer {
  padding: 4.5rem 0 8rem;
  font-size: var(--meta);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1.3fr) minmax(10rem, 1.4fr) auto;
  gap: 2rem 3rem;
  align-items: start;
}

.site-footer .footer-label {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: calc(var(--meta) - 4px);
}

.site-footer a,
.site-footer p {
  display: block;
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.footer-end {
  text-align: right;
}

.social-link {
  transition: color var(--dur-1) var(--ease);
}

.dock {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 1rem);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.35rem 1.15rem;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--fg);
  font: inherit;
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.pill:hover {
  background: var(--pill-hover);
}

.pill:active {
  transform: scale(0.97);
}

.pill:has(.avatar) {
  padding-left: 0.3rem;
}

.avatar {
  display: block;
  flex: none;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
  overflow: hidden;
  transform: translateZ(0);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

.dock-short,
.dock-icon {
  display: none;
}

.dock-icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* small screens */

@media (max-width: 800px) {
  .band {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .realm-head {
    grid-template-columns: 2rem 1fr auto;
  }

  .realm-head .share {
    grid-column: 1 / -1;
  }

  .strip {
    grid-template-columns: repeat(8, 1fr);
  }

  .specimen {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 5.5rem 1fr;
  }

  .row .vals {
    grid-column: 2;
    text-align: left;
  }

  .credits li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-end {
    text-align: left;
  }

  .pill {
    min-height: 2.75rem;
    padding: 0.2rem 0.55rem;
    gap: 0;
    font-size: 0.85rem;
  }

  .pill-home {
    padding: 0.18rem 0.7rem 0.18rem 0.18rem;
    gap: 0.4rem;
  }

  .dock-label {
    display: none;
  }

  .pill-home .dock-label {
    display: inline;
  }

  .dock-short,
  .dock-icon {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
