/* Strickerei Ahlfeld. Seitenstil. Die Engine-Klassen (.sc-*, [data-sc-*])
   bleiben unangetastet; hier stehen Marke, Spalten, Werk und Requisiten. */
:root {
  --sc-canvas:     #EAECE3;
  --sc-surface:    #E1E4D8;
  --sc-ink:        #23281C;
  --sc-ink-soft:   #535846;
  --sc-accent:     #A63D2A;
  --sc-accent-ink: #F7F4EC;
  --sc-font-display: "Young Serif", Georgia, serif;
  --sc-font-text:    "Mulish", system-ui, sans-serif;
  --sc-font-mono:    "Mulish", system-ui, sans-serif;
  --sc-shadow-color: 40 30% 22%;
  --krapp-tief: #6E2418;
  --holz: #B98B57;
  --papier: #F5F6EF;
  --leine: 30vh;           /* faden.js setzt die echte Höhe der Leine in px */
  color-scheme: light;
}
html { background: var(--sc-canvas); scrollbar-color: #b9b29f var(--sc-canvas); }
body { font-family: var(--sc-font-text); background: var(--sc-canvas); color: var(--sc-ink); }
::selection { background: var(--sc-accent); color: var(--sc-accent-ink); }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 4px; }
input { caret-color: var(--sc-accent); }
.zahl { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--sc-ink); }

.sc-grain { opacity: .05; mix-blend-mode: multiply; }
[data-sc-progress] { height: 3px; }

/* Anzeige: Young Serif hat nur einen Schnitt; Größe und enge Laufweite tragen. */
.sc-display {
  font-family: var(--sc-font-display);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.04;
  color: var(--sc-ink);
}
.sc-display--xl { font-size: clamp(2.5rem, 1.4rem + 2.9vw, 4.1rem); }
.sc-display--lg { font-size: clamp(2rem, 1.3rem + 2.1vw, 3.3rem); line-height: 1.06; }
.sc-body { color: var(--sc-ink-soft); font-size: var(--sc-t-lg); line-height: 1.58; }
.sc-lede { font-family: var(--sc-font-display); font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); line-height: 1.3; letter-spacing: -.01em; }
@media (max-width: 700px) {
  .sc-display--xl { font-size: clamp(2.1rem, 1.3rem + 4.2vw, 2.7rem); }
  .sc-display--lg { font-size: clamp(1.7rem, 1.2rem + 2.6vw, 2.15rem); }
  .sc-body { font-size: 1.03rem; line-height: 1.55; }
}

/* ---------- Kopf: nur die Wortmarke ---------- */
.kopf {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--sc-z-chrome); padding: 22px var(--sc-gutter) 30px; pointer-events: none;
  background: linear-gradient(var(--sc-canvas) 45%, color-mix(in oklab, var(--sc-canvas) 0%, transparent));
}
.wortmarke {
  pointer-events: auto; display: inline-flex; align-items: baseline; gap: .45em;
  font: 400 1.32rem/1 var(--sc-font-display); color: var(--sc-ink); text-decoration: none; letter-spacing: -.01em;
}
.wortmarke small { font: 700 .72rem/1 var(--sc-font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--sc-accent); }

/* ---------- Das Werk (festes SVG über allen Akten) ---------- */
.werk {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; overflow: visible;
}
.werk.ist-ruhig { transition: opacity 320ms var(--sc-ease-out); }

/* ---------- Maschenmarkierer als Navigation ---------- */
.marker { position: fixed; inset: 0 auto auto 0; z-index: 25; pointer-events: none; }
.marker a {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: flex; align-items: center; gap: 10px; min-height: 30px; padding-right: 6px;
  color: var(--sc-ink-soft); text-decoration: none; font: 600 .82rem/1 var(--sc-font-text); letter-spacing: .01em;
  white-space: nowrap; will-change: transform, opacity;
  transition: color 160ms var(--sc-ease-out), opacity 240ms var(--sc-ease-out);
}
.marker i {
  position: relative; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid currentColor; translate: -8px 0;
}
.marker i::after { /* der Schlitz im Ring, an dem man ihn öffnet */
  content: ""; position: absolute; right: -4px; top: 3px; width: 5px; height: 3px; background: var(--sc-canvas); rotate: -40deg;
}
.marker a.ist-offen i { border-style: dashed; opacity: .7; }
.marker a.ist-hier { color: var(--sc-accent); }
.marker a.ist-hier i { background: color-mix(in oklab, var(--sc-accent) 18%, transparent); }
.marker span { translate: -8px 0; }
@media (hover: hover) and (pointer: fine) { .marker a:hover { color: var(--sc-ink); } }
.marker.ohne-text span { opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .marker span { display: none; } .marker a { min-height: 32px; padding: 0 8px 0 0; } }

/* ---------- Spalten: Text immer links vom Werk ---------- */
.buehne { background: transparent; }
.spalte {
  position: absolute; z-index: var(--sc-z-copy); left: var(--sc-gutter); top: 0; bottom: 0;
  width: min(40rem, 44vw); display: grid; align-items: center;
}
.spalte > [data-sc-cue] { grid-area: 1 / 1; }
.spalte--schmal { width: min(30rem, 33vw); align-items: start; padding-top: clamp(6rem, 18vh, 11rem); }
.zeile .sc-body, .held__sub { margin-top: var(--sc-5); max-width: 36ch; }
.held h1 { max-width: 17ch; }

.feld { margin-top: var(--sc-6); display: grid; gap: 8px; max-width: 24rem; }
.feld label { font-weight: 700; font-size: .95rem; color: var(--sc-ink); }
.feld input {
  font: 400 1.6rem/1 var(--sc-font-display); letter-spacing: .14em; text-transform: uppercase;
  width: 9.5rem; padding: 12px 14px; border-radius: 6px; color: var(--sc-ink);
  background: var(--papier); border: 1.5px solid color-mix(in oklab, var(--sc-ink) 40%, transparent);
  box-shadow: inset 0 2px 4px hsl(var(--sc-shadow-color) / .1);
  transition: border-color 160ms var(--sc-ease-out);
}
.feld input::placeholder { color: #6f725f; letter-spacing: .06em; }
.feld input:focus { border-color: var(--sc-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--sc-accent) 25%, transparent); }
.feld small { color: var(--sc-ink-soft); font-size: .9rem; line-height: 1.45; max-width: 32ch; }
.feld--schmal { margin-top: var(--sc-5); }

/* ---------- Die Wolle: Leine mit Bildern in Schlaufen ---------- */
.buehne--leine { overflow: clip; }
.leine {
  position: absolute; left: 0; top: calc(var(--leine) - 16px);
  display: flex; align-items: flex-start; gap: clamp(1.5rem, 3.4vw, 3.6rem);
  padding-inline: var(--sc-gutter) 8vw;
}
.leine__kopf { flex: none; width: min(26rem, 76vw); padding-top: 40px; }
.leine__kopf .sc-body { margin-top: var(--sc-5); }
.leine__ende { flex: none; width: min(22rem, 70vw); padding-top: 70px; }
.haenger { flex: none; margin: 0; width: clamp(13rem, 19vw, 18.5rem); display: grid; justify-items: center; }
.haenger .schlaufe { width: 60px; height: 64px; margin-bottom: -6px; position: relative; z-index: 1; }
.haenger img {
  width: 100%; height: auto; aspect-ratio: 1000 / 1340; object-fit: cover; border-radius: 3px;
  box-shadow: 0 2px 3px hsl(var(--sc-shadow-color) / .18), 0 18px 34px -12px hsl(var(--sc-shadow-color) / .38);
  rotate: var(--neig, -1.2deg);
}
.haenger:nth-of-type(2n) img { --neig: 1.4deg; }
.haenger figcaption { margin-top: 18px; color: var(--sc-ink-soft); font-size: .98rem; line-height: 1.5; max-width: 30ch; justify-self: start; }
@media (max-width: 860px) {
  .haenger { width: 62vw; }
  .leine__kopf { padding-top: 34px; }
}

/* ---------- Das Etikett (flow) ---------- */
.etikett, .ribbeln { position: relative; z-index: 2; }
.spalte--fluss { position: relative; left: auto; top: auto; bottom: auto; display: block; margin-left: var(--sc-gutter); }
.etikett { padding-block: clamp(5rem, 10vw, 9rem) clamp(4rem, 8vw, 7rem); }
.angaben { margin: var(--sc-6) 0 0; display: grid; gap: 0; max-width: 34rem; }
.angaben div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 16px; padding: 12px 0; }
.angaben div + div { box-shadow: inset 0 1px 0 color-mix(in oklab, var(--sc-ink) 13%, transparent); }
.angaben dt { font-weight: 700; color: var(--sc-ink); }
.angaben dd { margin: 0; color: var(--sc-ink-soft); }
.etikett__haenge { margin-top: var(--sc-8); display: flex; align-items: flex-start; gap: clamp(1.5rem, 4vw, 3rem); }
.haenger--seite { width: clamp(11rem, 16vw, 15rem); }
.etikettband { display: grid; justify-items: center; padding-top: 24px; }
.schlaufe--klein { width: 48px; height: 52px; margin-bottom: -8px; position: relative; z-index: 1; }
.etikettband__stoff {
  position: relative; width: 11.5rem; padding: 18px 16px 14px; text-align: center; rotate: 2deg;
  color: #F4EEDF; background-color: #2F3526;
  background-image:
    repeating-linear-gradient(0deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(0 0 0 / .08) 0 1px, transparent 1px 3px);
  border-radius: 2px;
  box-shadow: 0 1px 2px hsl(var(--sc-shadow-color) / .3), 0 12px 24px -10px hsl(var(--sc-shadow-color) / .45), inset 0 1px 0 rgb(255 255 255 / .08);
}
.etikettband__stoff::before, .etikettband__stoff::after { /* umgeschlagene Kanten */
  content: ""; position: absolute; left: 6px; right: 6px; height: 1px; background: rgb(244 238 223 / .25);
}
.etikettband__stoff::before { top: 7px; } .etikettband__stoff::after { bottom: 7px; }
.etikettband__marke { margin: 0; font: 400 1.5rem/1 var(--sc-font-display); letter-spacing: .02em; }
.etikettband__faser { margin: 8px 0 12px; font-weight: 700; font-size: .86rem; letter-spacing: .06em; }
.pflege { width: 100%; height: auto; color: #F4EEDF; }

/* ---------- Aufribbeln (flow + kinetic) ---------- */
.ribbeln { padding-block: clamp(5rem, 12vw, 10rem) clamp(5rem, 10vw, 8rem); }
.ribbeln__titel { max-width: 13ch; }
.ribbeln .sc-stack { margin-top: var(--sc-6); max-width: 38ch; }
.textlink {
  color: var(--sc-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 6px;
  text-decoration-thickness: 2px; text-decoration-color: var(--sc-accent);
  transition: color 160ms var(--sc-ease-out);
}
@media (hover: hover) and (pointer: fine) { .textlink:hover { color: var(--sc-accent); } }

/* ---------- Schluss ---------- */
.schluss__text { margin-top: var(--sc-4); max-width: 38ch; }
.strickschrift {
  margin: var(--sc-5) 0 0; width: max-content; max-width: 100%; padding: 14px 16px 16px; rotate: -1.2deg;
  background:
    linear-gradient(rgb(35 40 28 / .05) 1px, transparent 1px) 0 0 / 100% 8px,
    var(--papier);
  border-radius: 2px;
  box-shadow: 0 1px 2px hsl(var(--sc-shadow-color) / .2), 0 14px 28px -12px hsl(var(--sc-shadow-color) / .4);
}
.strickschrift figcaption { font-size: .86rem; font-weight: 600; color: var(--sc-ink-soft); margin-bottom: 10px; }
.strickschrift figcaption b { color: var(--sc-ink); }
.strickschrift svg { display: block; height: auto; width: min(100%, 15rem); }
.schluss__knoepfe { margin-top: var(--sc-5); display: flex; flex-wrap: wrap; gap: 12px; }
.schluss__hinweis { margin-top: var(--sc-4); font-size: .9rem; color: var(--sc-ink-soft); max-width: 40ch; min-height: 2.6em; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px;
  border-radius: 6px; font: 700 1rem/1 var(--sc-font-text); white-space: nowrap; cursor: pointer;
  color: var(--sc-ink); background: transparent; border: 1.5px solid color-mix(in oklab, var(--sc-ink) 50%, transparent);
  transition: transform 140ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out);
}
.knopf:active { transform: translateY(1px) scale(.98); }
@media (hover: hover) and (pointer: fine) { .knopf:hover { border-color: var(--sc-accent); } }
/* Der volle Knopf trägt ein feines Maschenmuster, über das ein Licht läuft. */
.knopf--voll {
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--sc-accent-ink); background: var(--sc-accent); border-color: var(--sc-accent);
}
.knopf--voll::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .26) 50%, transparent 65%) -200% 0 / 200% 100% no-repeat,
    repeating-linear-gradient(60deg, rgb(0 0 0 / .08) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-60deg, rgb(0 0 0 / .08) 0 2px, transparent 2px 7px);
  animation: streif 4.8s var(--sc-ease-in-out) infinite;
}
@keyframes streif { 0%, 55% { background-position: -200% 0, 0 0, 0 0; } 100% { background-position: 200% 0, 0 0, 0 0; } }
@media (hover: hover) and (pointer: fine) { .knopf--voll:hover { background: #B4452F; } }
.knopf[disabled] { opacity: .55; cursor: default; }

.fuss { margin-top: var(--sc-5); font-size: .8rem; color: var(--sc-ink-soft); max-width: 44ch; }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .spalte { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; align-items: start; padding-top: 76px; }
  .spalte--schmal { width: auto; padding-top: 76px; }
  .held h1 { max-width: 12ch; }
  .zeile .sc-body, .held__sub { margin-top: var(--sc-3); }
  .feld { margin-top: var(--sc-4); gap: 6px; }
  .feld input { font-size: 1.3rem; padding: 9px 12px; width: 8rem; }
  .feld small { font-size: .85rem; }
  .spalte--fluss { margin-inline: var(--sc-gutter); }
  .etikett__haenge { margin-top: var(--sc-7); }
  .haenger--seite { width: 46vw; }
  .etikettband__stoff { width: 9.6rem; }
  .schluss .sc-display--lg { font-size: 1.65rem; }
  .schluss__text { font-size: .98rem; margin-top: 8px; }
  .strickschrift { margin-top: 12px; padding: 10px 12px 12px; }
  .strickschrift svg { width: 10.5rem; }
  .strickschrift figcaption { font-size: .8rem; margin-bottom: 6px; }
  .schluss__knoepfe { margin-top: 14px; gap: 8px; flex-direction: column; align-items: flex-start; }
  .knopf { min-height: 46px; }
  .schluss__hinweis { margin-top: 8px; font-size: .84rem; max-width: 24ch; }
  .fuss { margin-top: 10px; font-size: .76rem; max-width: 26ch; }
}
@media (max-width: 860px) and (max-height: 700px) {
  .schluss__text { display: none; }
  .zeile .sc-body { font-size: .98rem; }
}

@media (prefers-reduced-motion: reduce) {
  .knopf--voll::before { animation: none; }
  .haenger img, .etikettband__stoff, .strickschrift { rotate: 0deg; }
}
