/* ==========================================================================
   wirkco.de — Referenzen (portfolio)
   Scoped under `.refx` so the shared class names used here (container, section,
   eyebrow, btn, tag) never leak into or override the base stylesheet.
   Design system and tokens are the same as style.css; only the case tints and
   --radius-lg are added locally.
   ========================================================================== */

.refx {
  --t-orbis: #f4efe6;
  --t-brain: #ede9fe;
  --t-sofgo: #1c1917;
  --t-clinic: #ecfdf5;
  --t-mama: #fdf2f8;
  --radius-lg: 16px;
}

/* Keep anchored case cards clear of the sticky site header. */
.refx [id] { scroll-margin-top: 96px; }

/* --------------------------------------------------------------------------
   Base elements (scoped)
   -------------------------------------------------------------------------- */
.refx img { display: block; max-width: 100%; }
.refx a { color: inherit; text-decoration: none; }
.refx h1,
.refx h2,
.refx h3,
.refx h4 { color: var(--text-primary); margin: 0; font-weight: 600; }
.refx h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.12; letter-spacing: -0.032em; }
.refx h3 { font-size: 1.15rem; line-height: 1.2; letter-spacing: -0.02em; }
.refx p { margin: 0; }

.refx .container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.refx .section { padding: var(--section-y) 0; }
.refx .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.refx .eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent-primary); }
.refx .eyebrow.on-dark { color: #94a3b8; }
.refx .eyebrow.on-dark::before { background: var(--accent-secondary); }
.refx .lead { max-width: 620px; margin-top: 16px; font-size: 1.02rem; }
.refx .mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.refx .tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.refx .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.refx .link {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.refx .link:hover { color: var(--accent-primary-hover); }
.refx .link svg { transition: transform 0.2s; }
.refx a:hover .link svg,
.refx .link:hover svg { transform: translateX(3px); }
.refx .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-button);
}
.refx .btn:hover { background: var(--accent-primary-hover); }
.refx .btn.ghost {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.refx .card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.refx a.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   Media frames
   -------------------------------------------------------------------------- */
.refx .browser {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 40px -18px rgba(15, 23, 42, 0.25);
}
.refx .browser .bar {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
}
.refx .browser .bar i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.refx .browser .bar span { margin-left: 10px; font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); }
.refx .browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.refx .stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.refx .stage:has(.phones) { align-items: flex-start; }
.refx .phones { display: flex; gap: 4%; justify-content: center; align-items: flex-start; width: 100%; padding: 22px 6% 0; }
.refx .phones img { width: 30%; border-radius: 12px 12px 0 0; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.35); }
.refx .phones img:nth-child(2) { margin-top: -10px; }

/* Neutral abstract panel for cases without publishable screenshots. */
.refx .panel-abstract {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--t-clinic);
  overflow: hidden;
}
.refx .panel-abstract::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(5, 150, 105, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}
.refx .panel-abstract .ico-lg {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #a7f3d0;
  display: grid;
  place-items: center;
  color: #047857;
  box-shadow: 0 12px 30px -12px rgba(5, 150, 105, 0.5);
}

/* --------------------------------------------------------------------------
   Homepage block: compact table (variant D)
   -------------------------------------------------------------------------- */
.refx .d-table {
  margin-top: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.refx .d-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1.6fr) minmax(0, 1fr) 150px 28px;
  gap: 24px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--border-subtle);
  transition: background 0.2s;
}
.refx .d-row:first-child { border-top: 0; }
.refx .d-row:hover { background: #f8fafc; }
.refx .d-row .thumb {
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.refx .d-row .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.refx .d-row .thumb.ph { align-items: flex-start; }
.refx .d-row .thumb.ph img { width: 56%; height: auto; margin-top: 8px; border-radius: 6px 6px 0 0; }
.refx .d-row .thumb.abstract {
  background: var(--t-clinic);
  align-items: center;
  justify-content: center;
  color: #047857;
}
.refx .d-row h3 { font-size: 1rem; }
.refx .d-row .sub { font-size: 0.85rem; margin-top: 2px; }
.refx .d-row .res b {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.refx .d-row .res small { font-size: 0.76rem; color: var(--text-muted); line-height: 1.3; display: block; }
.refx .d-row .go { color: var(--text-muted); }
.refx .d-row:hover .go { color: var(--accent-primary); }
.refx .d-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1.6fr) minmax(0, 1fr) 150px 28px;
  gap: 24px;
  padding: 12px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
}
.refx .d-head span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Referenzen page
   -------------------------------------------------------------------------- */
.refx .p-hero {
  background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  position: relative;
}
.refx .p-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(250, 250, 249, 0.55), var(--bg-primary) 92%);
  pointer-events: none;
}
.refx .p-hero .container { position: relative; z-index: 1; }
.refx .p-hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-top: 20px;
  max-width: 820px;
}
.refx .p-hero h1 em { font-style: normal; color: var(--accent-primary); }
.refx .p-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.refx .p-stats div { padding: 20px 22px; border-left: 1px solid var(--border-subtle); }
.refx .p-stats div:first-child { border-left: 0; }
.refx .p-stats b {
  display: block;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}
.refx .p-stats small { font-size: 0.8rem; color: var(--text-muted); }
.refx .p-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; margin-top: 28px; }
.refx .p-grid .a-card { grid-column: span 3; }
.refx .p-grid .a-card.wide { grid-column: span 6; display: grid; grid-template-columns: 1.3fr 1fr; }
.refx .p-grid .a-card.wide .stage { height: auto; min-height: 340px; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.refx .a-card { display: flex; flex-direction: column; overflow: hidden; }
.refx .a-card .stage { height: 250px; }
.refx .a-card .body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.refx .a-card .meta { display: flex; justify-content: space-between; align-items: center; }
.refx .a-card .num { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.refx .a-card p { font-size: 0.92rem; }
.refx .a-card .foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}
.refx .metric-line {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  gap: 8px;
  align-items: center;
}
.refx .metric-line::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.refx .kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
.refx .kpis div { background: #fff; padding: 14px; }
.refx .kpis b {
  display: block;
  color: var(--text-primary);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.1;
}
.refx .kpis small { font-size: 0.75rem; color: var(--text-muted); line-height: 1.3; display: block; margin-top: 4px; }

/* CTA panel at the end of the Referenzen page */
.refx .cta {
  margin-top: 24px;
  background: var(--bg-ink);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background-image: radial-gradient(ellipse at 100% 0%, rgba(234, 88, 12, 0.25), transparent 50%);
}
.refx .cta h3 { color: #fff; font-size: 1.6rem; letter-spacing: -0.03em; }
.refx .cta p { color: #94a3b8; margin-top: 6px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .refx .d-head { display: none; }
  .refx .d-row { grid-template-columns: 96px 1fr; gap: 6px 16px; }
  .refx .d-row .thumb { grid-row: span 3; height: 96px; }
  .refx .d-row .go { display: none; }
  .refx .p-grid .a-card,
  .refx .p-grid .a-card.wide { grid-column: span 6; }
  .refx .p-grid .a-card.wide { display: flex; }
  .refx .p-grid .a-card.wide .stage { min-height: 260px; border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .refx .p-stats { grid-template-columns: repeat(2, 1fr); }
  .refx .p-stats div:nth-child(3) { border-left: 0; }
  .refx .p-stats div:nth-child(n + 3) { border-top: 1px solid var(--border-subtle); }
}

@media (max-width: 640px) {
  .refx .a-card .stage { height: 210px; }
  .refx .kpis { grid-template-columns: 1fr 1fr 1fr; }
  .refx .kpis div { padding: 10px; }
  .refx .kpis b { font-size: 1.05rem; }
  .refx .cta { padding: 28px; }
}
