/* linke-maschen.de */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d8;
  --ink: #1c1916;
  --ink-2: #48413a;
  --muted: #6f665c;
  --line: rgba(28, 25, 22, 0.14);
  --accent: #d63a2f;
  --accent-ink: #b02c22;
  --accent-soft: rgba(214, 58, 47, 0.16);
  --chart-bg: #fffdf9;

  --font-sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.12rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  --step-3: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);
  --step-hero: clamp(4rem, 0.8rem + 13.5vw, 11.5rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14110f;
    --paper-2: #1f1a17;
    --ink: #efe8dd;
    --ink-2: #cfc6ba;
    --muted: #a0968a;
    --line: rgba(239, 232, 221, 0.14);
    --accent: #ef5a4c;
    --accent-ink: #ff7d70;
    --accent-soft: rgba(239, 90, 76, 0.2);
    --chart-bg: #fbf7f1;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img { max-width: 100%; }

a {
  color: var(--accent-ink);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
  transition: color 0.2s, text-decoration-thickness 0.2s;
}
a:hover { text-decoration-thickness: 0.14em; }

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

::selection { background: var(--accent); color: #fff; }

.wrap {
  width: min(100% - 2 * var(--gutter), 1180px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font: 500 0.9375rem/1 var(--font-mono);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  width: 1.75rem;
  height: 0.875rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.nav {
  display: flex;
  gap: clamp(1rem, 2vw, 1.75rem);
  font-size: 0.9375rem;
}
.nav a {
  position: relative;
  padding: 0.35rem 0;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav a:hover,
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { transform: scaleX(1); }

@media (max-width: 859px) {
  html { scroll-padding-top: 1rem; }
  .topbar { position: static; }
  .topbar__inner {
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    padding-top: 0.9rem;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a:last-child { padding-right: 2rem; }
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  color: var(--muted);
  font: 500 var(--step--1)/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  margin: 0;
  font-size: var(--step-hero);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.05em;
  margin-left: -0.04em;
}

.hero__claim {
  margin: clamp(1.5rem, 3vw, 2rem) 0 0;
  font: 400 var(--step-2)/1.15 var(--font-serif);
  color: var(--ink-2);
  text-wrap: balance;
}
.hero__claim em {
  font-style: italic;
  color: var(--accent-ink);
}

.hero__media {
  margin: clamp(2.25rem, 5vw, 4rem) 0 0;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background: var(--paper-2);
}
.hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 40%;
}

@media (min-width: 720px) {
  .hero__media { aspect-ratio: 2 / 1; }
  .hero__media img { object-position: 50% 30%; }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "eyebrow eyebrow"
      "title claim"
      "media media";
    column-gap: 3rem;
  }
  .eyebrow { grid-area: eyebrow; }
  .hero__title { grid-area: title; }
  .hero__claim {
    grid-area: claim;
    align-self: end;
    margin: 0 0 0.35em;
    max-width: 17ch;
  }
  .hero__media { grid-area: media; }
}

/* yarn divider: a single strand of wool */
.yarn {
  width: min(100% - 2 * var(--gutter), 1180px);
  height: 14px;
  margin-inline: auto;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14' viewBox='0 0 40 14'%3E%3Cpath d='M0 7C6.5 1.5 13.5 1.5 20 7S33.5 12.5 40 7' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x left center / 40px 14px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14' viewBox='0 0 40 14'%3E%3Cpath d='M0 7C6.5 1.5 13.5 1.5 20 7S33.5 12.5 40 7' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x left center / 40px 14px;
  opacity: 0.85;
}

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem 3rem;
  padding-block: clamp(3.5rem, 8vw, 7rem);
}
.section + .section { border-top: 1px solid var(--line); }

.section__no {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--accent-ink);
  font: 500 var(--step--1)/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.section__head h2 {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

@media (min-width: 960px) {
  .section { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .section__head {
    position: sticky;
    top: 6rem;
    align-self: start;
  }
  .section--wide .gallery,
  .section--wide .gallery__more { grid-column: 1 / -1; }
}

.prose { max-width: 62ch; }
.prose p { margin: 0 0 1.1em; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 {
  margin: 2.4em 0 0.6em;
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.prose h3:first-child { margin-top: 0; }

.lead {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.callout {
  padding: 0.15em 0 0.15em 1.15em;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-weight: 550;
}

/* ---------- quotes ---------- */

.quote {
  position: relative;
  margin: 0 0 clamp(2.25rem, 5vw, 3.5rem);
}
.quote::before {
  content: "\201C";
  display: block;
  height: 0.42em;
  color: var(--accent);
  font: 400 calc(var(--step-2) * 2.8)/1 var(--font-serif);
}
.quote blockquote {
  margin: 0;
  font: italic 400 var(--step-2)/1.22 var(--font-serif);
  color: var(--ink);
  text-wrap: pretty;
}
.quote blockquote p { margin: 0; }
.quote figcaption {
  margin-top: 1.1rem;
  color: var(--muted);
  font: 500 var(--step--1)/1.4 var(--font-mono);
}
.quote figcaption::before { content: "— "; }
.quote cite { font-style: normal; }

@media (min-width: 960px) {
  .quote::before {
    position: absolute;
    left: -0.5em;
    top: -0.12em;
    height: auto;
  }
}

/* ---------- gallery ---------- */

.gallery {
  column-count: 2;
  column-gap: 0.75rem;
}
@media (min-width: 720px) { .gallery { column-count: 3; column-gap: 1rem; } }
@media (min-width: 1100px) { .gallery { column-count: 4; } }

.gallery__item {
  position: relative;
  display: block;
  margin: 0 0 0.75rem;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
  color: #fff;
  text-decoration: none;
  transform: translateZ(0);
}
@media (min-width: 720px) { .gallery__item { margin-bottom: 1rem; } }

.gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gallery__item:hover img { transform: scale(1.04); }

.gallery__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 0.9rem 0.8rem;
  background: linear-gradient(to top, rgba(10, 8, 6, 0.72), rgba(10, 8, 6, 0));
  font-size: 0.875rem;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.gallery__item:hover .gallery__cap,
.gallery__item:focus-visible .gallery__cap {
  opacity: 1;
  transform: none;
}
@media (hover: none) { .gallery__cap { display: none; } }

.gallery__item.is-extra { display: none; }
.gallery.is-expanded .gallery__item.is-extra { display: block; }

.gallery__more {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.3rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 550 0.9375rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button[hidden] { display: none; }

/* ---------- how-to ---------- */

.howto {
  display: grid;
  gap: 2rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
@media (min-width: 760px) {
  .howto {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }
}
.howto__img {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}
@media (min-width: 760px) {
  .howto__img { position: sticky; top: 6rem; }
}
.howto__img img { display: block; width: 100%; height: auto; }

.steps {
  margin: 1.6rem 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  margin-bottom: 1.1rem;
  padding-left: 2.6rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.3em;
  color: var(--accent-ink);
  font: 500 0.8125rem/1 var(--font-mono);
  letter-spacing: 0.04em;
}

.signoff {
  font: italic 400 var(--step-1)/1.3 var(--font-serif);
}

/* ---------- links ---------- */

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.links a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.links__title {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
  transition: color 0.2s;
}
.links__meta {
  color: var(--muted);
  font: 500 var(--step--1)/1 var(--font-mono);
  white-space: nowrap;
}
.links__meta::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.4em;
  color: var(--accent);
  transition: transform 0.25s;
}
.links a:hover .links__title { color: var(--accent-ink); }
.links a:hover .links__meta::after { transform: translate(2px, -2px); }

/* ---------- footer ---------- */

.footer {
  display: grid;
  gap: 0.35rem;
  padding-block: clamp(2.5rem, 5vw, 3.5rem) clamp(3rem, 6vw, 4.5rem);
  color: var(--ink-2);
}
.footer p { margin: 0; }
.footer__brand {
  margin-bottom: 0.4rem !important;
  color: var(--ink);
  font: 500 1rem/1 var(--font-mono);
}
.footer__small {
  max-width: 72ch;
  margin-top: 0.6rem !important;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.5;
}
.footer cite { font-style: italic; }

/* ---------- lightbox ---------- */

html.is-locked { overflow: hidden; }

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(12, 10, 9, 0.95);
  color: #f2ece3;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.4); }
.lightbox[open] {
  display: grid;
  place-items: center;
  animation: lb-in 0.25s ease-out;
}
@keyframes lb-in { from { opacity: 0; } }

.lightbox__figure {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  margin: 0;
  padding: 4.25rem 1rem 5.5rem;
}
.lightbox__figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 1400px);
  max-height: calc(100dvh - 11rem);
  border-radius: 6px;
  transition: opacity 0.25s;
}
.lightbox__figure img.is-loading { opacity: 0.25; }
.lightbox__figure figcaption {
  max-width: 60ch;
  min-height: 1.4em;
  color: #e7dfd3;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: center;
}
.lightbox__count {
  position: fixed;
  top: 1.45rem;
  left: 1.25rem;
  color: #b3a99c;
  font: 500 0.8125rem/1 var(--font-mono);
  letter-spacing: 0.06em;
}
.lightbox__btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox__btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox__close { top: 0.9rem; right: 1rem; }
.lightbox__prev,
.lightbox__next { bottom: 1.25rem; }
.lightbox__prev { left: calc(50% - 3.25rem); }
.lightbox__next { right: calc(50% - 3.25rem); }

@media (min-width: 860px) {
  .lightbox__figure { padding: 4rem 6rem 3rem; }
  .lightbox__figure img { max-height: calc(100dvh - 9rem); }
  .lightbox__prev,
  .lightbox__next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox__prev { left: 1.5rem; }
  .lightbox__next { right: 1.5rem; }
}

/* ---------- motion ---------- */

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