/* ============================================================
   KATSUBA — Projekt-Detailseiten (case pages)
   Builds on katsuba.css tokens & components.
   ============================================================ */

/* ---------------- Hero ---------------- */
.case-hero {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  padding-top: clamp(150px, 20svh, 220px);
  padding-bottom: clamp(40px, 5vw, 72px);
}

.case-hero .wrap {
  position: relative;
  z-index: 1;
}

/* soft accent glow peeking in from the top — echo of the main hero.
   Blur runs on a quarter-size core the GPU scales 4× (same trick as the
   hero circle) so the page paints fast on load. */
.case-glow {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(1200px, 130vw);
  aspect-ratio: 1;
  opacity: calc(var(--glow-opacity) * 0.4);
  transform: translate(-50%, -84%);
  pointer-events: none;
}

.case-glow::before {
  content: "";
  position: absolute;
  inset: 37.5%;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(calc((var(--glow-blur) + 50px) / 4));
  transform: scale(4);
}

@media (prefers-reduced-motion: no-preference) {
  .case-glow {
    animation: case-glow-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes case-glow-in {
  from {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -84%);
    opacity: calc(var(--glow-opacity) * 0.4);
  }
}

/* back pill — same recipe as the header nav buttons */
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 512px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  margin-bottom: clamp(36px, 5vw, 64px);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.case-back:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.case-back:active {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 0 1px var(--pressed-red);
}

.case-kicker {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.case-title {
  font-size: clamp(56px, 9vw, 112px);
  line-height: 1.02;
  text-transform: uppercase;
}

/* long names (domains etc.) get a smaller scale so they stay on one line */
.case-title.case-title-long {
  font-size: clamp(30px, 5.2vw, 68px);
  overflow-wrap: anywhere;
}

.case-lead {
  max-width: 800px;
  margin: 24px 0 0;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.45;
}

/* tags directly under the lead */
.case-tags {
  margin-top: clamp(24px, 3vw, 36px);
}

/* ---------------- Case images ---------------- */
.case-img {
  display: block;
  width: 100%;
  height: auto;
}

.case-img.framed {
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(13, 13, 13, 0.08);
}

/* small footnote under a cover card */
.case-note {
  margin: 14px 4px 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(13, 13, 13, 0.55);
  max-width: 760px;
}

/* Instagram slide gallery — 4:5 portrait cards */
.insta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.insta-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(13, 13, 13, 0.08);
}

/* ---------------- Cover frames ---------------- */
.case-slot { background: var(--navy); }

.slot-cover { aspect-ratio: 21 / 9; min-height: 240px; }
.slot-landscape { aspect-ratio: 4 / 3; }

.case-cover {
  background: var(--paper);
  padding-bottom: clamp(28px, 4vw, 48px);
}

/* ---------------- Body sections ---------------- */
.case-text {
  max-width: 760px;
  margin: 0 0 clamp(32px, 4vw, 48px);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  text-wrap: pretty;
}

.case-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.case-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-figure figcaption {
  font-size: 15px;
  color: rgba(13, 13, 13, 0.55);
}

/* ---------------- Logo gallery (Logos page) ---------------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 32px;
}

/* white mat + fine ink ring — same recipe as the "Galerie" card style */
.logo-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(13, 13, 13, 0.15);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.logo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(13, 13, 13, 0.15), 0 14px 36px rgba(27, 23, 28, 0.1);
}

.logo-card .cover-frame {
  aspect-ratio: 1;
  background: var(--pink);
}

.logo-card figcaption {
  padding: 16px 6px 6px;
  font-size: 15px;
  color: rgba(13, 13, 13, 0.6);
}

/* ---------------- Prev / next project ---------------- */
.case-nav {
  background: var(--pink);
}

.case-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}

.case-nav-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.case-nav-link.next {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}

.case-nav-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.5);
}

.case-nav-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 4.6vw, 52px);
  line-height: 1.1;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.case-nav-link:hover .case-nav-title {
  color: var(--accent);
}

.case-nav-link:active .case-nav-title {
  color: var(--pressed-red);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 700px) {
  .case-nav-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .case-nav-link.next {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
  }

}
