/* yugusaa tools: eine Lochwand, an der jedes Tool als Anhänger hängt. */

:root {
  --board: #2B4FD8;        /* lackierte Lochwand */
  --board-hole: #1B36A3;   /* Löcher in der Wand */
  --board-shadow: rgba(8, 18, 82, .38);
  --paper: #FBFAF6;        /* Anhänger und Schild */
  --ink: #161821;
  --ink-soft: #545868;
  --steel: #C9CED9;
  --steel-dark: #7E8597;
  --focus: #FFC423;
  --live: #16A34A;

  --hole-gap: 32px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --board: #15204A;
    --board-hole: #0A1130;
    --board-shadow: rgba(0, 0, 0, .45);
    --paper: #ECEAE3;
    --ink-soft: #4C5060;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  background-color: var(--board);
  background-image: radial-gradient(circle, var(--board-hole) 3.5px, transparent 4.2px);
  background-size: var(--hole-gap) var(--hole-gap);
  background-position: calc(var(--hole-gap) / 2) calc(var(--hole-gap) / 2);
}

.wall {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 40px) 48px;
}

/* ---------- Schild (Banner) ---------- */

.sign {
  position: relative;
  background: var(--paper);
  border-radius: 28px;
  padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 64px) clamp(28px, 4vw, 48px);
  box-shadow: 10px 14px 0 var(--board-shadow);
  overflow: hidden;
}

.screw {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--steel) 45%, var(--steel-dark));
}
.screw::after { /* Schlitz */
  content: "";
  position: absolute;
  inset: 6px 2px;
  background: var(--steel-dark);
  border-radius: 1px;
  transform: rotate(var(--r, 35deg));
}
.screw:nth-child(1) { top: 18px; left: 18px; }
.screw:nth-child(2) { top: 18px; right: 18px; --r: -20deg; }
.screw:nth-child(3) { bottom: 18px; left: 18px; --r: 70deg; }
.screw:nth-child(4) { bottom: 18px; right: 18px; --r: 10deg; }

.sign-owner {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 600;
  font-variation-settings: "opsz" 24;
  color: var(--ink-soft);
}

.sign-title {
  margin: 0 0 0 -0.05em;
  font-size: clamp(6rem, 24vw, 17rem);
  line-height: .78;
  font-weight: 800;
  font-stretch: 75%;
  font-variation-settings: "opsz" 96, "wdth" 75;
  letter-spacing: -0.045em;
  color: var(--board);
  padding-bottom: .06em;
}

@media (prefers-color-scheme: dark) {
  .sign-title { color: #2B4FD8; }
}

.sign-lead {
  margin: clamp(16px, 2.5vw, 28px) 0 0;
  max-width: 34ch;
  font-size: clamp(1.125rem, 2.2vw, 1.5rem);
  line-height: 1.35;
  font-weight: 500;
  font-variation-settings: "opsz" 24;
}

@media (min-width: 860px) {
  .sign {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 48px;
    align-items: end;
  }
  .sign-owner { grid-column: 1 / -1; }
  .sign-lead {
    justify-self: end;
    max-width: 27ch;
    margin: 0 0 .4em;
  }
}

/* ---------- Haken und Anhänger ---------- */

.hooks {
  list-style: none;
  margin: clamp(56px, 8vw, 88px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 72px clamp(28px, 4vw, 48px);
}

.hook {
  position: relative;
  padding-top: 14px;
}

/* der Metallhaken, auf dem der Anhänger hängt */
.hook::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 32px; /* Mitte des Lochs: 14px Abstand + 14px + 13px */
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--steel) 40%, var(--steel-dark) 85%);
  box-shadow: 2px 3px 0 var(--board-shadow);
}

.tag {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 420px;
  padding: 12px;
  overflow: hidden;
  background: #14102A;
  color: #fff;
  text-decoration: none;
  border-radius: 24px;
  box-shadow: 8px 12px 0 var(--board-shadow);
  transform-origin: 50% 27px;
  transform: rotate(var(--tilt, 0deg));
}

/* Einmalige Lade-Animation; app.js entfernt die Klasse danach, damit das
   Ende des Hover-Schwingens die Animation nicht neu startet. */
.tag.is-hanging {
  animation: hang 900ms cubic-bezier(.3, 1.5, .5, 1) both;
  animation-delay: calc(var(--i, 0) * 110ms + 150ms);
}

/* das gestanzte Loch, mit einer Öse aus Glas */
.tag::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: var(--board-hole);
  box-shadow:
    inset 2px 3px 0 rgba(0, 0, 0, .3),
    0 0 0 6px rgba(255, 255, 255, .28),
    0 0 0 7px rgba(255, 255, 255, .45);
}

.tag:not(.is-hanging):hover { animation: swing 1100ms ease-out; }

.tag:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 6px;
}

/* Screenshot der Seite als Hintergrund */
.tag-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  place-items: center;
  background: var(--accent, var(--board));
}
.tag-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 600ms cubic-bezier(.2, .7, .2, 1);
}
.tag-bg::after { /* abdunkeln nach unten, damit die Glasscheibe lesbar bleibt */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 8, 24, 0) 30%, rgba(10, 8, 24, .55) 100%);
}
.tag:hover .tag-bg img,
.tag:focus-visible .tag-bg img { transform: scale(1.05); }

.tag-initial {
  font-size: 7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .9);
  font-variation-settings: "opsz" 96, "wdth" 75;
}

/* Glasscheibe */
.tag-glass {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    0 12px 32px rgba(6, 4, 20, .35);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tag-glass { background: rgba(20, 16, 42, .82); }
}

.tag-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tag-name {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  font-variation-settings: "opsz" 64, "wdth" 85;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}

.tag-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .88);
  text-transform: capitalize;
}
.tag-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
}
.tag-status-live::before { background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.tag-status-beta::before { background: #FBBF24; }

.tag-desc {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .86);
  max-width: 40ch;
}

.tag-host {
  margin: 14px 0 0;
  font-weight: 600;
  color: var(--accent, #fff);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: transparent;
  transition: text-decoration-color 150ms;
}
.tag:hover .tag-host,
.tag:focus-visible .tag-host { text-decoration-color: currentColor; }

/* freier Haken */
.hook-free .free-text {
  margin: 0;
  height: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 32px 32px;
  border: 3px dashed rgba(255, 255, 255, .45);
  border-radius: 24px;
  color: rgba(255, 255, 255, .88);
  font-size: 1.0625rem;
  font-weight: 500;
}

.note {
  grid-column: 1 / -1;
  color: #fff;
  font-size: 1.125rem;
}

/* ---------- Fuß ---------- */

.foot {
  margin-top: 72px;
  color: rgba(255, 255, 255, .8);
  font-size: .9375rem;
}
.foot p { margin: 0; }

/* ---------- Bewegung ---------- */

@keyframes hang {
  0%   { opacity: 0; transform: translateY(-28px) rotate(calc(var(--tilt, 0deg) - 9deg)); }
  40%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }
}

@keyframes swing {
  0%   { transform: rotate(var(--tilt, 0deg)); }
  20%  { transform: rotate(calc(var(--tilt, 0deg) + 4deg)); }
  45%  { transform: rotate(calc(var(--tilt, 0deg) - 2.5deg)); }
  70%  { transform: rotate(calc(var(--tilt, 0deg) + 1deg)); }
  100% { transform: rotate(var(--tilt, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .tag, .tag.is-hanging, .tag:not(.is-hanging):hover { animation: none; }
  .tag-bg img { transition: none; }
}

@media (max-width: 520px) {
  .screw { width: 11px; height: 11px; }
  .screw::after { inset: 4.5px 1.5px; }
  .screw:nth-child(1), .screw:nth-child(2) { top: 14px; }
  .screw:nth-child(3), .screw:nth-child(4) { bottom: 14px; }
  .screw:nth-child(1), .screw:nth-child(3) { left: 14px; }
  .screw:nth-child(2), .screw:nth-child(4) { right: 14px; }
}

@media (max-width: 640px) {
  .hook-free .free-text { min-height: 200px; }
}
