/* ==========================================================================
   PROOF — Shared components
   Small, reusable building blocks used across kit, demo and template pages.
   Everything reads from tokens.css, so all classes follow the active
   preset/theme automatically.

   Contents
     1. Layout helpers        .container
     2. Type helpers          .display .t-* .lead .eyebrow .meta .mono .hand
     3. Buttons               .btn .btn--primary .btn--secondary .btn--sm
     4. Image placeholders    .ph .ph__label .ph--<ratio>
     5. Marks & labels        .stamp .availability .dot .mark
     6. Kit section heads     .section-head .section-intro
     7. Conversion notes      .conversion-note
     8. Page chrome           .progress .cursor-label .kit-pill
   ========================================================================== */

/* 1. Layout helpers ------------------------------------------------------ */
.container {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 56px);
}

/* 2. Type helpers -------------------------------------------------------- */

/* Display face with preset-driven weight, case and tracking */
.display {
  margin: 0;
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  text-transform: var(--d-case);
  letter-spacing: var(--d-track);
}

/* Fluid size steps (pair with .display) */
.t-mega    { font-size: var(--t-mega);    line-height: .88; }
.t-display { font-size: var(--t-display); line-height: .92; text-wrap: balance; }
.t-h1      { font-size: var(--t-h1);      line-height: 1; }
.t-h2      { font-size: var(--t-h2);      line-height: 1.05; }
.t-h3      { font-size: var(--t-h3);      line-height: 1.15; }

.lead {
  margin: 0;
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: 34em;
  text-wrap: pretty;
}

/* Mono, uppercase, tracked — section kickers ("K07 — Elements") */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Mono metadata line ("role=status · 5 s · pauses on hover") */
.meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

.meta--xs { font-size: 11px; }
.meta--sm { font-size: 13px; }

.mono  { font-family: var(--f-mono); }
.hand  { font-family: var(--f-hand); }
.muted { color: var(--muted); }

/* 3. Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-size: 17px;
  white-space: nowrap;
  text-decoration: none;
  text-underline-offset: 5px;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

a.btn--primary:hover,
button.btn--primary:not(:disabled):hover {
  background: var(--accent-text);
  color: var(--on-accent);
}

.btn--secondary {
  padding: 13px 22px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
}

.btn--secondary:hover {
  color: var(--ink);
}

.btn--sm {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
}

.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
  background: var(--line);
  color: var(--muted);
}

.btn--secondary:disabled,
.btn--secondary[aria-disabled="true"] {
  opacity: .35;
}

/* 4. Image placeholders --------------------------------------------------
   Striped frame standing in for real photography. Replace the whole .ph
   element with an <img> or <picture> (keep the aspect ratio to avoid CLS).
   Ratio: use a modifier or set  style="--ratio: 5/4". */
.ph {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  aspect-ratio: var(--ratio, 3/2);
  background: repeating-linear-gradient(135deg, var(--ph) 0 10px, var(--ph-stripe) 10px 11px);
  filter: var(--img-filter);
  border-radius: var(--radius);
}

.ph--1x1   { --ratio: 1/1; }
.ph--4x5   { --ratio: 4/5; }
.ph--3x2   { --ratio: 3/2; }
.ph--16x9  { --ratio: 16/9; }
.ph--239x1 { --ratio: 2.39/1; }
.ph--9x16  { --ratio: 9/16; }
.ph--frame { --ratio: var(--frame-ratio); }   /* follows the preset */

.ph__label {
  padding: 3px 6px;
  background: var(--ph);
  color: var(--ph-ink);
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.35;
}

/* 5. Marks & labels ------------------------------------------------------ */

/* Rubber stamp ("Approved", "On the list") */
.stamp {
  display: inline-block;
  padding: 4px 9px;
  border: 2px solid var(--accent);
  background: var(--canvas);
  color: var(--accent-text);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(var(--tilt, -5deg));   /* per instance: style="--tilt:-4deg" */
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .8) 80%, #000 96%);
          mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .8) 80%, #000 96%);
}

.stamp--animated {
  animation: proofStamp 500ms var(--ease) both;
}

/* Status dot */
.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* "● Booking from Nov 2026" */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-text);
  white-space: nowrap;
}

/* Hand-drawn SVG stroke, generated by Proof.mark() / [data-mark].
   The host element needs position: relative (use .has-mark). */
.has-mark {
  position: relative;
  display: inline-block;
}

.mark {
  position: absolute;
  max-width: none;   /* boxes are often wider than the host (overrides base svg rule) */
  overflow: visible;
  pointer-events: none;
}

.mark path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: proofDraw 700ms cubic-bezier(.4, 0, .2, 1) forwards;
}

.mark--static path {
  stroke-dashoffset: 0;
  animation: none;
}

/* 6. Kit section heads --------------------------------------------------- */
.section {
  margin-top: clamp(64px, 8vw, 112px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.section-head__no {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}

.section-head__title {
  margin: 0;
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  text-transform: var(--d-case);
  letter-spacing: var(--d-track);
  font-size: var(--t-h1);
  line-height: 1;
}

.section-intro {
  margin: 24px 0 32px;
  max-width: 40em;
  color: var(--muted);
  text-wrap: pretty;
}

/* 7. Conversion notes ----------------------------------------------------
   Designer annotations on demo pages. Hidden until the visitor presses
   the "Conversion notes" pill ([data-toggle-notes] → html.notes-on). */
.conversion-note {
  display: none;
  margin-top: 24px;
  margin-bottom: -8px;
}

.notes-on .conversion-note {
  display: block;
}

.conversion-note__box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 6px 20px;
  padding: 12px 16px;
  border: 1.5px dashed var(--info);
  background: var(--info-bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.conversion-note__label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--info);
}

/* 8. Page chrome --------------------------------------------------------- */

/* Scroll progress bar in CMYK + ink + accent bands.
   Fill width is set by proof.js on [data-progress]. */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  height: 4px;
  pointer-events: none;
}

.progress--thick {
  height: 6px;
}

.progress__fill {
  width: 0;
  height: 100%;
  overflow: hidden;
  transition: width 120ms linear;
}

.progress__bands {
  display: flex;
  width: 100vw;
  height: 100%;
}

.progress__bands > span {
  flex: 1;
}

.progress__bands > span:nth-child(1) { background: #00A0DC; }
.progress__bands > span:nth-child(2) { background: #E4007C; }
.progress__bands > span:nth-child(3) { background: #FFE500; }
.progress__bands > span:nth-child(4) { background: var(--ink); }
.progress__bands > span:nth-child(5) { background: var(--accent); }

/* Labeled cursor that follows the pointer (fine pointers only).
   Triggered by [data-cursor="Label"] on any element. */
.cursor-label {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  pointer-events: none;
  will-change: transform;
}

.cursor-label__text {
  padding: 5px 9px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Floating "PROOF Kit" pill on demo & template pages.
   Deliberately uses fixed colours so it looks the same in every preset. */
.kit-pill {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kit-pill__link,
.kit-pill__toggle {
  padding: 8px 12px;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5);
}

.kit-pill__link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #141414;
  color: #F5F2EB;
  letter-spacing: .06em;
  text-decoration: none;
}

.kit-pill__link:hover {
  color: #F5F2EB;
}

.kit-pill__link .dot {
  background: #D7261E;
}

.kit-pill__toggle {
  order: 2;
  border: 1px solid #141414;
  background: #F5F2EB;
  color: #141414;
  letter-spacing: .04em;
  cursor: pointer;
}

/* Bilingual content ([data-toggle-lang] in proof.js) */
[data-lang-only="de"] { display: none; }
[data-lang="de"] [data-lang-only="de"] { display: revert; }
[data-lang="de"] [data-lang-only="en"] { display: none; }
