@font-face {
  font-family: "AzBuk Thin";
  src: url("../../kraftwerk/glyphen/fonts/xor-azbuk-thin.woff2?v=051") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101317;
  --panel: #181d23;
  --ink: #f0f2f3;
  --muted: #adb7c3;
  --line: #323b45;
  --accent: #8be1d5;
  --journal-font: "AzBuk Thin", ui-monospace, Consolas, monospace;
  font-family: var(--journal-font);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.58;
}
body, :where(h1, h2, h3, p, a, button, summary, figcaption, time, dt, dd, code) {
  /* Glyphen shifts the silhouettes by +0.28 and -0.22 cells. One cell is 1/8 em. */
  text-shadow: .035em .035em 0 #2b2d34, -.0275em -.0275em 0 #e9e9e9;
}
a { color: var(--accent); text-underline-offset: .23em; text-decoration-thickness: 1px; }
a:hover { color: #d0faf3; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; z-index: 3; top: .5rem; left: .5rem; padding: .5rem .8rem; background: var(--bg); transform: translateY(-200%); }
.skip:focus { transform: none; }
.shell { width: min(100% - 3rem, 73rem); margin-inline: auto; }
.site-bar { border-bottom: 1px solid var(--line); }
.site-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem 1.75rem; flex-wrap: wrap; padding-block: .95rem; }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.site-links, .contents, .entry-links, .figure-links { display: flex; align-items: baseline; gap: .4rem 1.25rem; flex-wrap: wrap; }
.site-links a { color: var(--muted); text-decoration: none; }
.site-links a:hover { color: var(--ink); text-decoration: underline; }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 3vw, 3rem);
  align-items: center;
  padding-block: clamp(2.8rem, 7vw, 6.2rem) 2.7rem;
}
.intro-motif { display: grid; justify-items: center; gap: .65rem; justify-self: center; width: min(100%, 24rem); }
.intro-motif img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.journal-version { display: block; margin-bottom: .65rem; color: var(--muted); font-size: .9rem; }
.intro h1, .entry h2 { margin: 0; font-weight: 700; line-height: 1.04; letter-spacing: normal; text-wrap: balance; }
.intro h1 { font-size: clamp(2.85rem, 7vw, 6.6rem); max-width: 14ch; }
.intro-copy > p { max-width: 40rem; margin: 1.3rem 0 1.7rem; color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.3rem); }
.contents { font-size: .94rem; gap: .6rem; }
.contents a { color: var(--ink); border: 1px solid var(--line); padding: .38rem .73rem; text-decoration: none; }
.contents a:hover { border-color: var(--accent); }
.entry { padding-block: 2.5rem 3.35rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.entry:last-child { padding-bottom: max(3rem, 8vh); }
.entry-heading { max-width: 52rem; margin-bottom: 1.4rem; }
.entry-meta { margin: 0 0 .62rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font: .85rem/1.4 var(--journal-font); color: var(--accent); }
.entry-meta time { color: var(--muted); }
.entry h2 { font-size: clamp(2rem, 5vw, 3.8rem); }
.entry-heading > p:last-child { color: var(--muted); max-width: 73ch; margin: .9rem 0 0; }
figure { min-width: 0; margin: 0; }
.image-link { display: block; background: #0b0e12; border: 1px solid var(--line); }
.image-link:hover { border-color: var(--accent); }
figure :is(img, video) { display: block; width: 100%; height: auto; }
figure [data-media-failed] { display: none; }
.journal-media-failure { display: block; padding: 1.2rem; color: var(--muted); }
.image-link video { pointer-events: none; }
figcaption { padding-top: .56rem; }
.figure-name { display: block; font-weight: 700; }
figcaption p { margin: .35rem 0 .6rem; color: var(--muted); }
.figure-links { gap: .22rem .85rem; font-size: .89rem; margin-top: .2rem; }
.figures, .axis-wall, .axis-side { display: grid; gap: clamp(.75rem, 1.7vw, 1.35rem); align-items: start; }
.axis-wall { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.totem-preview-pair { display: flex; gap: .75rem; }
.totem-preview-pair img { width: auto; height: min(25rem, 78vw); }
.frame-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.concept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
details { margin-top: 1.2rem; border: 1px solid var(--line); background: var(--panel); }
summary { color: var(--accent); padding: .68rem 1rem; cursor: pointer; font-weight: 700; }
summary:hover { color: var(--ink); }
details[open] > summary { border-bottom: 1px solid var(--line); }
.recipe { padding: .85rem 1rem 1rem; }
.recipe > p { max-width: 74ch; margin: 0 0 .75rem; }
.recipe > p:last-child { margin-bottom: 0; }
.entry-links { font-size: .95rem; }
.palette-block h3 { font-size: 1.08rem; margin: 1.35rem 0 .6rem; }
.palette-block h3:first-child { margin-top: 0; }
.palette-notes { margin: 0 0 1rem; }
.palette-notes div { display: grid; grid-template-columns: 7rem 1fr; padding: .22rem 0; gap: .2rem .7rem; }
.palette-notes dt { font-weight: 700; }
.palette-notes dd { margin: 0; color: var(--muted); }
code { font-family: var(--journal-font); font-size: .9em; }
@media (max-width: 55rem) {
  .intro { grid-template-columns: minmax(0, 1fr); }
  .intro-motif { width: min(84%, 20rem); }
}
@media (max-width: 45rem) {
  .shell { width: calc(100% - 2rem); }
  .axis-wall { grid-template-columns: 1fr; }
  .axis-side, .frame-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .concept-grid { grid-template-columns: 1fr; gap: 1.65rem; }
}
@media (max-width: 26rem) {
  .site-links { gap: .35rem .75rem; }
  .intro h1 { font-size: 2.6rem; }
  .entry { padding-block: 2.25rem; }
  figcaption { padding-top: .4rem; }
  .recipe, summary { padding-inline: .72rem; }
  .palette-notes div { grid-template-columns: 1fr; }
}

.image-viewer {
  box-sizing: border-box;
  width: min(98vw, 100rem);
  max-height: 95vh;
  max-height: 95dvh;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: contain;
}
.image-viewer::backdrop { background: rgb(0 0 0 / 82%); }
.viewer-shell { background: var(--bg); color: var(--ink); }
.viewer-info { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; padding: .55rem .85rem; }
.viewer-info p { flex-basis: 100%; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.viewer-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.viewer-toolbar button {
  position: relative;
  isolation: isolate;
  width: 120px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.viewer-toolbar button::before, .viewer-toolbar button::after {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 0;
  clip-path: polygon(0 50%, 9px 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 9px 100%);
}
.viewer-toolbar button::before { background: var(--line); }
.viewer-toolbar button::after { inset: 1px; background: var(--bg); }
.viewer-toolbar button:hover::before, .viewer-toolbar button:focus-visible::before { background: var(--accent); }
.viewer-toolbar button { width: auto; min-width: 7.5rem; padding-inline: .8rem; }
.viewer-stage { display: grid; place-items: center; min-height: min(32vh, 14rem); }
.viewer-stage :is(img, video) { display: block; max-width: 100%; max-height: 80vh; max-height: 80dvh; object-fit: contain; }
.image-viewer[data-view-natural-size]:not(.viewer-expanded) .viewer-stage {
  display: flex; align-items: flex-start; overflow: auto; max-height: 80vh; max-height: 80dvh;
}
.image-viewer[data-view-natural-size]:not(.viewer-expanded) .viewer-stage img {
  flex: none; max-width: none; max-height: none; margin-inline: auto;
}
#viewer-error { padding-inline: .85rem; }
.image-viewer.viewer-expanded {
  inset: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; border: 0;
}
.viewer-expanded .viewer-shell, .viewer-shell:fullscreen {
  box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: auto;
}
.viewer-expanded .viewer-stage { flex: 1 0 5rem; min-height: 0; position: relative; }
.viewer-expanded .viewer-stage :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
.image-viewer[data-key^="from-mayatnik/"] .viewer-stage img { image-rendering: pixelated; }
@media (max-width: 38rem) {
  .viewer-toolbar, .viewer-info { gap: .35rem .65rem; padding: .45rem .6rem; }
  .viewer-toolbar button { min-width: 0; }
}

#journal-access, #journal-login button, #archive-retry { font: inherit; color: inherit; background: #202631; border: 1px solid #566372; cursor: pointer; padding: .35em .7em; }
#journal-login { color: #e8edf1; background: #171b22; border: 1px solid #586979; max-width: min(24rem, 90vw); }
#journal-login::backdrop { background: #000b; }
#journal-login input { display: block; font: inherit; margin: .6em 0; width: 100%; box-sizing: border-box; }
