/* cases.css - page scoped styling for cases.html */

:root {
  --bg-main: #0b1220;
  --bg-card: rgba(255, 255, 255, 0.06);
  --text-main: #eaf2ff;
  --text-dim: #9fb3d9;
  --case-cyan: #4fd1ff;
  --case-blue: #4b7fff;
  --case-teal: #2dd4bf;
  --case-amber: #f5b24a;
  --case-glass: rgba(12, 24, 46, 0.72);
  --case-glass-soft: rgba(13, 30, 58, 0.48);
}

html.theme-dark {
  --bg-main: #0b1220;
  --bg-card: rgba(255, 255, 255, 0.06);
  --text-main: #eaf2ff;
  --text-dim: #9fb3d9;
}

html.theme-light {
  --bg-main: #f7f9fc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --text-main: #0e1a2b;
  --text-dim: #5c6b80;
}

.section {
  padding: 80px 0;
}

.card {
  border-radius: 18px;
  backdrop-filter: blur(12px);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background: var(--bg-card);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.title-xl {
  font-size: 48px;
  font-weight: 700;
}

.title-lg {
  font-size: 22px;
  font-weight: 600;
}

.text-sm {
  font-size: 14px;
  opacity: 0.8;
}

.text-dim {
  color: var(--text-dim);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
}

html.theme-light .card {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* ── Light theme overrides for case cards ── */
html.theme-light .case-card {
  background: linear-gradient(165deg, rgba(240, 245, 255, 0.92) 0%, rgba(230, 238, 250, 0.96) 42%, rgba(225, 233, 248, 0.98) 100%);
  border: 1px solid rgba(60, 130, 220, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html.theme-light .case-id {
  color: #1a5a8a;
  border-color: rgba(30, 100, 180, 0.35);
  background: rgba(220, 235, 255, 0.5);
}

html.theme-light .case-role {
  color: #1a6a9a;
}

html.theme-light .case-title {
  color: #0e1e35;
  text-shadow: none;
}

html.theme-light .case-meta {
  color: #4a6580;
}

html.theme-light .tool-pill {
  color: #1d3a5c;
  background: rgba(220, 235, 255, 0.7);
  border-color: rgba(60, 130, 220, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html.theme-light .case-narrative,
html.theme-light .case-dashboard {
  border-color: rgba(60, 130, 220, 0.18);
}

html.theme-light .case-narrative::after,
html.theme-light .case-dashboard::after {
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(30, 120, 220, 0.35) 0%, rgba(30, 120, 220, 0.12) 25%, rgba(30, 120, 220, 0.03) 55%, transparent 90%);
}

html.theme-light .case-narrative h4,
html.theme-light .dash-title {
  color: #1a6a9a;
}

html.theme-light .case-narrative li {
  color: #2a3d55;
}

html.theme-light .kpi {
  background: linear-gradient(180deg, rgba(235, 242, 255, 0.9) 0%, rgba(225, 235, 250, 0.95) 100%);
  border-color: rgba(60, 130, 220, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html.theme-light .kpi-val {
  color: #0e1e35;
  text-shadow: none;
}

html.theme-light .kpi-icon.amber {
  filter: drop-shadow(0 0 6px rgba(200, 140, 40, 0.5));
}

html.theme-light .kpi-icon.teal {
  filter: drop-shadow(0 0 6px rgba(20, 170, 150, 0.5));
}

html.theme-light .kpi-icon.green {
  filter: drop-shadow(0 0 6px rgba(40, 170, 80, 0.5));
}

html.theme-light .kpi-icon.blue {
  filter: drop-shadow(0 0 6px rgba(60, 120, 220, 0.5));
}

html.theme-light .bar-track {
  background: rgba(200, 215, 235, 0.6);
}

html.theme-light .tl-dot {
  background: #e8eff8;
  border-color: rgba(60, 130, 220, 0.3);
  box-shadow: 0 0 0 3px rgba(60, 130, 220, 0.1);
}

html.theme-light .tl-dot.half {
  background: linear-gradient(to left, #2dd4bf 50%, #e8eff8 50%);
  border-color: #2dd4bf;
}

html.theme-light .tl-text {
  color: #4a6580;
}

html.theme-light .timeline::before {
  box-shadow: 0 0 4px rgba(40, 180, 120, 0.25);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(79, 209, 255, 0.25);
  padding-bottom: 0.85rem;
}

.section-label {
  font-size: 0.8rem;
  color: #8be6ff;
  text-shadow: 0 0 18px rgba(79, 209, 255, 0.4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.section-index {
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--text-muted);
  opacity: 0.4;
  line-height: 1;
  user-select: none;
  font-weight: 700;
}

.cases {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.case-shell {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.case-card {
  background: linear-gradient(165deg, rgba(19, 42, 78, 0.72) 0%, rgba(8, 20, 38, 0.86) 42%, rgba(6, 14, 28, 0.94) 100%);
  border: 1px solid rgba(90, 167, 255, 0.36);
  border-radius: 18px;
  overflow: visible;
  position: relative;
  box-shadow: 0 18px 40px rgba(1, 10, 26, 0.55), inset 0 1px 0 rgba(129, 207, 255, 0.17);
  transition: none;
}

.case-card::before {
  content: none;
}

.case-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  gap: 0.35rem;
  align-items: start;
  padding: 1.5rem 1.5rem 0;
  border-bottom: none;
  background: transparent;
  position: relative;
  z-index: 1;
}

.case-id {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  display: inline-block;
  padding: 0.2rem 0.55rem;
  margin-bottom: 0;
  border: 1px solid rgba(142, 226, 255, 0.45);
  border-radius: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfeeff;
  background: rgba(8, 20, 38, 0.2);
}

.case-role {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: center;
  width: 100%;
  font-size: 0.78rem;
  color: #88d9ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0;
  font-weight: 700;
  text-align: left;
}

.case-title {
  grid-column: 1 / -1;
  grid-row: 4;
  width: 100%;
  white-space: nowrap;
  font-size: clamp(1.4rem, 2.15vw, 2.15rem);
  line-height: 1.12;
  color: #f1f8ff;
  text-shadow: 0 0 18px rgba(123, 203, 255, 0.18);
  margin-bottom: 0.4rem;
}

.case-meta {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  color: #9fb6d7;
  font-size: 1.02rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.case-meta span::before {
  content: "· ";
  opacity: 0.5;
}

.case-meta span:first-child::before {
  content: "";
}

.case-tools {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-content: start;
  width: 100%;
  max-width: 100%;
  justify-self: end;
  margin-right: 0px;

}

.tool-pill {
  font-size: 0.72rem;
  color: #d5e6ff;
  background: rgba(23, 42, 74, 0.82);
  border: 1px solid rgba(119, 170, 255, 0.26);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(150, 199, 255, 0.1);
}

.case-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.case-narrative {
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(90, 167, 255, 0.18);
  border-radius: 12px;
  margin: 0.75rem 0.75rem 1.5rem;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.case-narrative::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 100%;
  height: 32px;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(79, 209, 255, 0.7) 0%, rgba(60, 160, 255, 0.3) 25%, rgba(60, 160, 255, 0.08) 55%, transparent 90%);
  pointer-events: none;
  filter: blur(6px);
}

.case-narrative h4,
.dash-title {
  font-size: 0.75rem;
  color: #8ee2ff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.case-narrative ul {
  list-style: disc;
  list-style-position: outside;
  padding-left: 1.1rem;
  margin: 0;
  text-align: left;
  direction: ltr;
}

.case-narrative li {
  padding: 0.2rem 0;
  color: #d1def2;
  font-size: 1.02rem;
  text-align: left;
  direction: ltr;
}

.case-card .case-narrative ul,
.case-card .case-narrative li {
  text-align: left !important;
  direction: ltr !important;
}

.case-card .case-narrative ul {
  list-style-position: outside !important;
  padding-left: 1.1rem !important;
}

.case-narrative li::before {
  content: none;
}

.case-dashboard {
  padding: 1.35rem 0.9rem;
  border: 1px solid rgba(90, 167, 255, 0.18);
  border-radius: 12px;
  margin: 0.75rem 0.75rem 1.5rem;
  background: transparent;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.case-dashboard::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 100%;
  height: 32px;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(79, 209, 255, 0.7) 0%, rgba(60, 160, 255, 0.3) 25%, rgba(60, 160, 255, 0.08) 55%, transparent 90%);
  pointer-events: none;
  filter: blur(6px);
}

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 2rem;
}

.kpi {
  flex: 0 0 250px;
  width: 250px;
  border: 1px solid rgba(101, 169, 255, 0.24);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: linear-gradient(180deg, rgba(16, 33, 61, 0.84) 0%, rgba(11, 24, 44, 0.92) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(162, 214, 255, 0.08);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
  text-align: center;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  display: inline-block;
  flex: 0 0 32px;
}

.kpi-icon.amber {
  color: #f5b24a;
  stroke: #f5b24a;
  filter: drop-shadow(0 0 10px rgba(245, 178, 74, 0.95));
}

.kpi-icon.teal {
  color: #2dd4bf;
  stroke: #2dd4bf;
  filter: drop-shadow(0 0 10px rgba(45, 212, 191, 0.95));
}

.kpi-icon.green {
  color: #4ade80;
  stroke: #4ade80;
  filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.95));
}

.kpi-icon.blue {
  color: #60a5fa;
  stroke: #60a5fa;
  filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.95));
}

.kpi-icon.red {
  color: #e8716e;
  stroke: #e8716e;
  filter: drop-shadow(0 0 6px rgba(232, 113, 110, 0.5));
}

svg.kpi-icon {
  stroke-width: 2.1;
}

.bar-fill.amber {
  background: linear-gradient(90deg, #b87a1a, #f5a623);
}

.bar-fill.teal {
  background: linear-gradient(90deg, #0d9488, #2dd4bf);
}

.bar-fill.green {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.bar-fill.blue {
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}

.kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0;
  color: #ecf6ff;
  text-shadow: 0 0 18px rgba(126, 204, 255, 0.18);
}

.kpi-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Pie chart */
.pie-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.pie-chart {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pie-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pie-item strong {
  color: #ecf6ff;
  margin-left: 0.2rem;
}

.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bar-chart {
  margin-top: 1.35rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.bar-label {
  width: 140px;
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 7px;
  background: rgba(7, 22, 44, 0.84);
  border-radius: 4px;
  overflow: hidden;
  border: none;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transform-origin: left;
  animation: growBar 1s cubic-bezier(.23, 1, .32, 1) both;
}

.bar-fill.w-35 { width: 35%; }
.bar-fill.w-50 { width: 50%; }
.bar-fill.w-70 { width: 70%; }
.bar-fill.w-72 { width: 72%; }
.bar-fill.w-80 { width: 80%; }
.bar-fill.w-83 { width: 83%; }
.bar-fill.w-85 { width: 85%; }
.bar-fill.w-88 { width: 88%; }
.bar-fill.w-90 { width: 90%; }
.bar-fill.w-92 { width: 92%; }
.bar-fill.w-95 { width: 95%; }
.bar-fill.w-100 { width: 100%; }

@keyframes growBar {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.bar-val {
  width: 38px;
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.timeline {
  display: flex;
  margin-top: 0.85rem;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 2px;
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.08) 0%, rgba(74, 222, 128, 0.95) 50%, rgba(45, 212, 191, 0.08) 100%);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.45);
  border-radius: 2px;
}

.tl-step {
  flex: 1;
  text-align: center;
  z-index: 1;
}

.tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin: 0 auto 0.3rem;
  background: #0a1830;
  border: 2px solid rgba(99, 162, 240, 0.42);
  box-shadow: 0 0 0 3px rgba(29, 66, 121, 0.18);
}

.tl-dot.done {
  background: #2dd4bf;
  border-color: #2dd4bf;
}

.tl-dot.amber {
  background: #f5a623;
  border-color: #f5a623;
}

.tl-dot.half {
  background: linear-gradient(to right, #2dd4bf 50%, #0a1830 50%);
  border-color: #2dd4bf;
}

.tl-text {
  font-size: 0.62rem;
  color: #a5bfdf;
  line-height: 1.25;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .case-header {
    grid-template-columns: 1fr;
  }

  .case-id    { grid-column: 1; grid-row: 1; }
  .case-tools { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .case-meta  { grid-column: 1; grid-row: 3; }
  .case-role  { grid-column: 1; grid-row: 4; }
  .case-title { grid-column: 1; grid-row: 5; white-space: normal; }

  .case-body {
    grid-template-columns: 1fr;
  }

  .case-narrative {
    border-right: none;
    border-bottom: none;
  }

  .section-index {
    display: none;
  }

  .bar-label {
    width: 115px;
  }

  .case-shell {
    padding: 0 0.75rem;
  }

  .kpi {
    flex: 0 0 auto;
    width: auto;
    min-width: 120px;
  }
}

/* ── Gradient icon bubble ── */
.card-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.card-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: inherit;
}

.card-icon i {
  width: 26px;
  height: 26px;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* ── Services grid ── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

@media (max-width: 900px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: var(--bg-panel-inline, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(63, 193, 255, 0.18);
  border-radius: 12px;
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.service-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.service-card h4 {
  font-size: 1rem;
  margin: 0;
  color: var(--accent, #0a7cff);
  line-height: 1.3;
}

.service-card p {
  font-size: 0.875rem;
  color: var(--text-soft, #94a3b8);
  margin: 0;
  line-height: 1.55;
}

/* Service icon gradients */
.service-card:nth-child(1) .card-icon { background: linear-gradient(135deg, #0d3f6e 0%, #3fc1ff 100%); }
.service-card:nth-child(2) .card-icon { background: linear-gradient(135deg, #065f46 0%, #34d399 100%); }
.service-card:nth-child(3) .card-icon { background: linear-gradient(135deg, #164e63 0%, #22d3ee 100%); }
.service-card:nth-child(4) .card-icon { background: linear-gradient(135deg, #3b1d8a 0%, #a78bfa 100%); }
.service-card:nth-child(5) .card-icon { background: linear-gradient(135deg, #1e3a8a 0%, #60a5fa 100%); }
.service-card:nth-child(6) .card-icon { background: linear-gradient(135deg, #78350f 0%, #f59e0b 100%); }
.service-card:nth-child(7) .card-icon { background: linear-gradient(135deg, #831843 0%, #f472b6 100%); }
.service-card:nth-child(8) .card-icon { background: linear-gradient(135deg, #064e3b 0%, #34d399 100%); }

/* ── Competence grid ── */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

@media (max-width: 900px) {
  .comp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .comp-grid {
    grid-template-columns: 1fr;
  }
}

.comp-card {
  background: var(--bg-panel-inline, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.comp-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.comp-card h4 {
  font-size: 1rem;
  margin: 0;
  color: var(--accent, #0a7cff);
  line-height: 1.3;
}

.comp-card p {
  font-size: 0.875rem;
  color: var(--text-soft, #94a3b8);
  margin: 0;
  line-height: 1.6;
}

/* Comp icon gradients */
.comp-card:nth-child(1) .card-icon { background: linear-gradient(135deg, #0d3f6e 0%, #3fc1ff 100%); }
.comp-card:nth-child(2) .card-icon { background: linear-gradient(135deg, #065f46 0%, #34d399 100%); }
.comp-card:nth-child(3) .card-icon { background: linear-gradient(135deg, #312e81 0%, #818cf8 100%); }
.comp-card:nth-child(4) .card-icon { background: linear-gradient(135deg, #3b1d8a 0%, #a78bfa 100%); }
.comp-card:nth-child(5) .card-icon { background: linear-gradient(135deg, #78350f 0%, #f59e0b 100%); }
.comp-card:nth-child(6) .card-icon { background: linear-gradient(135deg, #881337 0%, #fb7185 100%); }
