/* ============================================================
   DREAMFILL TECH — CASE STUDIES PAGE PREMIUM STYLES
   cs-pg-* prefix · Light Theme Only · Inherits design tokens
   ============================================================ */

/* ─── HERO ──────────────────────────────────────────────── */
.csp-hero {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 80px;
  background: linear-gradient(158deg, #FDFAF6 0%, #F9F4EE 44%, #F5EDE3 100%);
  position: relative; overflow: hidden;
  min-height: 72vh; display: flex; align-items: center;
}

.csp-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(198,157,116,0.2) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 70% 50%, black 26%, transparent 64%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 50%, black 26%, transparent 64%);
  pointer-events: none; z-index: 0;
}

.csp-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(216,184,143,0.12) 0%, rgba(148,41,3,0.04) 40%, transparent 68%);
  pointer-events: none; z-index: 0;
}

.csp-hero .container { position: relative; z-index: 1; }

.csp-hero-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 56px; align-items: center;
}

.csp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--r-full);
  background: rgba(148,41,3,0.06); border: 1px solid rgba(148,41,3,0.13);
  font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-primary);
  margin-bottom: 22px;
}

.csp-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4.5vw, 3.75rem);
  font-weight: 800; letter-spacing: -0.045em; line-height: 1.05;
  color: var(--text-primary); margin-bottom: 22px;
}

.csp-hero-title span {
  background: linear-gradient(135deg, var(--brand-primary) 15%, var(--brand-secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.csp-hero-desc {
  font-size: 1.0625rem; color: var(--text-muted);
  line-height: 1.8; max-width: 460px; margin-bottom: 36px;
}

.csp-hero-pills {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-top: 24px; border-top: 1px solid var(--border-default);
}

.csp-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  background: #FFFFFF; border: 1px solid var(--border-default);
  font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  transition: all var(--t-fast);
}

.csp-pill:hover { border-color: var(--border-brand); background: var(--brand-pale); color: var(--brand-primary); }
.csp-pill i { color: var(--brand-secondary); font-size: 0.8rem; }

/* Hero visual — enterprise architecture nodes */
.csp-hero-visual {
  position: relative; height: 460px;
  display: flex; align-items: center; justify-content: center;
}

.csp-arch {
  position: relative; width: 340px; height: 340px;
}

/* Central hub */
.csp-arch-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  border: 2px solid rgba(148,41,3,0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 8px 32px rgba(148,41,3,0.24), 0 0 0 10px rgba(148,41,3,0.06);
  z-index: 4;
}

.csp-arch-hub::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(148,41,3,0.15); animation: spin-ring 16s linear infinite;
}

.csp-arch-hub i { color: #fff; font-size: 1.5rem; }
.csp-arch-hub span { color: rgba(255,255,255,0.9); font-family: var(--font-heading); font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

/* SVG lines behind nodes */
.csp-arch-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

.csp-arch-line {
  stroke: rgba(198,157,116,0.3); stroke-width: 1.5;
  stroke-dasharray: 5 4; fill: none;
  animation: dash-move 4s linear infinite;
}

/* Satellite nodes */
.csp-arch-node {
  position: absolute; width: 64px; height: 64px; border-radius: 50%;
  background: #FFFFFF; border: 1.5px solid var(--border-default);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 8px 24px rgba(17,17,16,0.06); z-index: 3;
  transition: all 0.32s var(--ease-out); cursor: default;
}

.csp-arch-node:hover { border-color: var(--border-brand); background: var(--brand-pale); transform: scale(1.12); }
.csp-arch-node i { font-size: 1rem; color: var(--brand-primary); }
.csp-arch-node span { font-family: var(--font-heading); font-size: 0.58rem; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.05em; }

/* 6 nodes around the hub — in a circle */
.csp-arch-node-1 { top:  0%;   left: 50%; transform: translate(-50%, 0);    animation-delay: 0s; }
.csp-arch-node-2 { top: 15%;  right: 0%;  transform: translate(0, 0);        animation-delay: .5s; }
.csp-arch-node-3 { bottom: 15%; right: 0%; transform: translate(0, 0);       animation-delay: 1s; }
.csp-arch-node-4 { bottom: 0%;  left: 50%; transform: translate(-50%, 0);    animation-delay: 1.5s; }
.csp-arch-node-5 { bottom: 15%; left: 0%;  transform: translate(0, 0);       animation-delay: 2s; }
.csp-arch-node-6 { top: 15%;   left: 0%;   transform: translate(0, 0);       animation-delay: 2.5s; }

/* floating stat cards */
.csp-hero-float {
  position: absolute; background: #FFFFFF;
  border: 1px solid rgba(229,221,214,0.75); border-radius: 12px;
  padding: 9px 13px; box-shadow: 0 12px 36px rgba(17,17,16,0.08);
  display: flex; align-items: center; gap: 9px; z-index: 5;
}

.csp-hf-1 { top: 10%; left: -14%; animation: float-y 5.5s ease-in-out infinite; }
.csp-hf-2 { bottom: 12%; right: -12%; animation: float-y 6.2s ease-in-out infinite 1.8s; }

.csp-hf-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-pale); border: 1px solid var(--border-brand); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: var(--brand-primary); flex-shrink: 0; }
.csp-hf-text strong { display: block; font-family: var(--font-heading); font-size: 0.76rem; font-weight: 700; color: var(--text-primary); }
.csp-hf-text span   { display: block; font-size: 0.66rem; color: var(--text-muted); }

/* ─── CASE STUDY GRID ─────────────────────────────────── */
.csp-grid-section {
  padding: var(--space-12) 0;
  background: linear-gradient(180deg, #FDFAF6 0%, #F8F2EB 100%);
  position: relative; overflow: hidden;
}

.csp-grid-section::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(198,157,116,0.1) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.5; pointer-events: none;
}

.csp-grid-hdr {
  text-align: center; margin-bottom: var(--space-8); position: relative; z-index: 1;
}

/* ── BENTO LAYOUT ── */
.csp-bento {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px;
  position: relative; z-index: 1;
}

/* ── BASE CASE CARD ── */
.csc-card {
  background: #FFFFFF; border: 1px solid var(--border-default);
  border-radius: 20px; padding: 28px 26px;
  display: flex; flex-direction: column; gap: 0;
  position: relative; overflow: hidden;
  transition: border-color 0.32s var(--ease-out), box-shadow 0.32s var(--ease-out), transform 0.32s var(--ease-out);
  will-change: transform;
}

.csc-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-out); border-radius: 20px 20px 0 0;
}

.csc-card:hover::before { transform: scaleX(1); }
.csc-card:hover { border-color: var(--border-gold); box-shadow: 0 32px 80px rgba(17,17,16,0.1), 0 8px 24px rgba(148,41,3,0.06); transform: translateY(-6px); }

/* Grid placement — Rows:
   Row 1: Case 1 (span 7 featured) + Case 2 (span 5)
   Row 2: Case 3 (span 4) + Case 4 (span 5) + Case 5 (span 3)  — reorder for variety
   Row 3: Case 6 (span 12 full width editorial) */
.csc-card:nth-child(1) { grid-column: span 7; }
.csc-card:nth-child(2) { grid-column: span 5; }
.csc-card:nth-child(3) { grid-column: span 4; }
.csc-card:nth-child(4) { grid-column: span 5; }
.csc-card:nth-child(5) { grid-column: span 3; }
.csc-card:nth-child(6) { grid-column: span 12; }

/* Featured card enhancements */
.csc-card:nth-child(1) {
  background: linear-gradient(150deg, #FEF8F4 0%, #FDFAF6 55%, #FFFFFF 100%);
  border-color: rgba(148,41,3,0.12); padding: 36px 34px;
}

.csc-card:nth-child(1)::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 280px; height: 280px;
  background: radial-gradient(ellipse at top right, rgba(148,41,3,0.055), transparent 65%);
  pointer-events: none;
}

.csc-card:nth-child(6) {
  background: linear-gradient(120deg, #FDFAF6 0%, #FFFFFF 60%);
  border-color: rgba(198,157,116,0.22);
  flex-direction: row; align-items: flex-start; gap: 56px; padding: 36px 40px;
}

/* ── CARD ELEMENTS ── */
.csc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }

.csc-industry {
  font-family: var(--font-heading); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-secondary);
  display: flex; align-items: center; gap: 6px;
}

.csc-industry i { font-size: 0.85rem; color: var(--brand-primary); }

.csc-num {
  font-family: var(--font-heading); font-size: 0.68rem; font-weight: 700;
  color: rgba(198,157,116,0.55); letter-spacing: 0.06em; flex-shrink: 0;
}

.csc-title {
  font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700;
  letter-spacing: -0.028em; line-height: 1.25; color: var(--text-primary);
  margin-bottom: 20px; transition: color var(--t-fast);
}

.csc-card:hover .csc-title { color: var(--brand-primary); }

.csc-card:nth-child(1) .csc-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.035em; }
.csc-card:nth-child(6) .csc-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; }

/* ── CHALLENGE / SOLUTION / OUTCOME LAYERS ── */
.csc-layers { display: flex; flex-direction: column; gap: 12px; flex: 1; margin-bottom: 20px; }

.csc-layer {
  display: flex; flex-direction: column; gap: 4px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--bg-beige); border: 1px solid rgba(241,235,227,0.9);
  transition: background var(--t-fast), border-color var(--t-fast);
}

.csc-card:hover .csc-layer { border-color: rgba(229,221,214,0.9); }

.csc-layer.outcome {
  background: linear-gradient(90deg, rgba(148,41,3,0.04), rgba(198,157,116,0.07));
  border-color: var(--border-brand);
}

.csc-card:hover .csc-layer.outcome { background: linear-gradient(90deg, rgba(148,41,3,0.07), rgba(198,157,116,0.11)); }

.csc-layer-hdr {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-heading); font-size: 0.66rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-light); margin-bottom: 3px;
}

.csc-layer-hdr i { font-size: 0.7rem; }
.csc-layer.challenge .csc-layer-hdr { color: #B45309; }
.csc-layer.solution  .csc-layer-hdr { color: #1D4ED8; }
.csc-layer.outcome   .csc-layer-hdr { color: var(--brand-primary); }
.csc-layer.challenge .csc-layer-hdr i { color: #B45309; }
.csc-layer.solution  .csc-layer-hdr i { color: #1D4ED8; }
.csc-layer.outcome   .csc-layer-hdr i { color: var(--brand-primary); }

.csc-layer-text {
  font-size: 0.855rem; color: var(--text-muted); line-height: 1.65;
}

.csc-card:nth-child(1) .csc-layer-text, .csc-card:nth-child(6) .csc-layer-text { font-size: 0.9rem; }

/* ── VISUAL MODULE (topic-specific HTML/CSS visual) ── */
.csc-visual {
  margin-bottom: 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-beige); border: 1px solid var(--border-default);
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color var(--t-fast);
}

.csc-card:hover .csc-visual { border-color: rgba(198,157,116,0.35); }

.csc-vis-row {
  display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted);
}

.csc-vis-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  animation: pulse-green 3s infinite;
}

.csc-vis-dot.green { background: #10B981; }
.csc-vis-dot.blue  { background: #3B82F6; animation-delay: .6s; }
.csc-vis-dot.gold  { background: var(--brand-secondary); animation-delay: 1.2s; }
.csc-vis-dot.red   { background: var(--brand-primary); animation-delay: 1.8s; }

.csc-vis-bar-wrap { flex: 1; height: 4px; background: var(--border-default); border-radius: 3px; overflow: hidden; }
.csc-vis-bar { height: 100%; border-radius: 3px; }
.csc-vis-bar.green { background: linear-gradient(90deg, #10B981, #34D399); }
.csc-vis-bar.blue  { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.csc-vis-bar.gold  { background: linear-gradient(90deg, var(--brand-secondary), var(--brand-highlight)); }
.csc-vis-bar.brand { background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary)); }
.csc-vis-label { font-family: var(--font-heading); font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }

/* ── RESULT BADGES ── */
.csc-badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-default);
}

.csc-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 7px;
  font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
  transition: all 0.25s var(--ease-out);
}

.csc-badge.green { color: #059669; background: #ECFDF5; border: 1px solid #D1FAE5; }
.csc-badge.brand { color: var(--brand-dark); background: rgba(148,41,3,0.07); border: 1px solid rgba(148,41,3,0.15); }

.csc-card:hover .csc-badge.green { background: #D1FAE5; }
.csc-card:hover .csc-badge.brand { background: rgba(148,41,3,0.11); }

.csc-badge i { font-size: 0.75rem; }

/* Card 6 full-width layout specifics */
.csc-card:nth-child(6) .csc-body { flex: 1; }
.csc-card:nth-child(6) .csc-visual-side {
  flex: 0 0 280px; display: flex; flex-direction: column; gap: 10px;
  justify-content: center; align-self: stretch;
}

.csc-compliance-stack {
  background: #FFFFFF; border: 1px solid var(--border-default);
  border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}

.csc-comp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(241,235,227,0.7); font-size: 0.8rem;
}

.csc-comp-row:last-child { border-bottom: none; }

.csc-comp-icon { width: 28px; height: 28px; border-radius: 7px; background: var(--brand-pale); border: 1px solid var(--border-brand); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: var(--brand-primary); flex-shrink: 0; }
.csc-comp-label { flex: 1; color: var(--text-muted); font-weight: 500; }
.csc-comp-status { font-family: var(--font-heading); font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #059669; background: #ECFDF5; }

/* ─── CTA ─────────────────────────────────────────────── */
.csp-cta-section { padding: var(--space-8) 0; background: #FFFFFF; }

.csp-cta-inner {
  background: linear-gradient(145deg, var(--brand-primary) 0%, #7B2203 55%, var(--brand-dark) 100%);
  border-radius: 24px; padding: 60px 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px; position: relative; overflow: hidden;
  box-shadow: 0 24px 64px rgba(148,41,3,0.28), 0 8px 24px rgba(148,41,3,0.14);
}

.csp-cta-inner::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 100% 0%, black 28%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, black 28%, transparent 70%);
  pointer-events: none;
}

.csp-cta-inner::after {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(216,184,143,0.14) 0%, transparent 65%);
  pointer-events: none;
}

.csp-cta-text { position: relative; z-index: 1; max-width: 560px; }

.csp-cta-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px; border-radius: var(--r-full);
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255,255,255,0.85); margin-bottom: 18px;
}

.csp-cta-title { font-family: var(--font-heading); font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: #FFFFFF; margin-bottom: 14px; }
.csp-cta-desc { font-size: 1.0625rem; color: rgba(255,255,255,0.78); line-height: 1.72; }

.csp-cta-actions { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; min-width: 210px; }
.csp-cta-actions .btn-white { font-weight: 700; padding: 15px 30px; border-radius: 11px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); transition: all 0.28s var(--ease-out); white-space: nowrap; }
.csp-cta-actions .btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

.csp-cta-phone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 11px; border: 1px solid rgba(255,255,255,0.28); background: transparent;
  font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 600;
  color: rgba(255,255,255,0.88); text-decoration: none; transition: all 0.28s var(--ease-out);
}

.csp-cta-phone:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); color: #fff; transform: translateY(-1px); }

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .csp-hero { min-height: auto; padding-top: calc(var(--nav-h) + 52px); padding-bottom: 56px; }
  .csp-hero-grid { grid-template-columns: 1fr; text-align: center; gap: 44px; }
  .csp-hero-desc { margin: 0 auto 36px; }
  .csp-hero-pills { justify-content: center; }
  .csp-hero-visual { height: 320px; }
  .csp-hf-1 { left: 0; } .csp-hf-2 { right: 0; }

  .csp-bento { grid-template-columns: repeat(6, 1fr); }
  .csc-card:nth-child(1) { grid-column: span 6; }
  .csc-card:nth-child(2) { grid-column: span 6; }
  .csc-card:nth-child(3) { grid-column: span 3; }
  .csc-card:nth-child(4) { grid-column: span 3; }
  .csc-card:nth-child(5) { grid-column: span 6; }
  .csc-card:nth-child(6) { grid-column: span 6; flex-direction: column; gap: 0; }
  .csc-card:nth-child(6) .csc-visual-side { flex: none; width: 100%; }

  .csp-cta-inner { padding: 44px 40px; flex-direction: column; align-items: flex-start; gap: 32px; }
  .csp-cta-actions { flex-direction: row; width: 100%; }
}

@media (max-width: 768px) {
  .csp-bento { grid-template-columns: 1fr; }
  .csc-card:nth-child(n) { grid-column: span 1; }
  .csc-card:nth-child(1) { padding: 26px 22px; }
  .csc-card:nth-child(6) { padding: 26px 22px; flex-direction: column; gap: 0; }
  .csc-card:nth-child(6) .csc-visual-side { flex: none; width: 100%; }
  .csp-arch { width: 260px; height: 260px; }
  .csp-arch-hub { width: 78px; height: 78px; }
  .csp-arch-node { width: 52px; height: 52px; }
  .csp-hf-1, .csp-hf-2 { display: none; }
  .csp-cta-inner { padding: 36px 28px; border-radius: var(--r-lg); }
  .csp-cta-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  .csp-hero-title { font-size: 2rem; }
  .csc-card:nth-child(1) .csc-title { font-size: 1.2rem; }
  .csc-card:nth-child(6) .csc-title { font-size: 1.15rem; }
  .csp-cta-inner { padding: 28px 20px; }
  .csp-cta-title { font-size: 1.6rem; }
}
