/* ============================================================
   Datplay — case study page shared styles
   Pulls in the same design tokens as the main site.
   ============================================================ */

:root {
  --bg: #fafaf7;
  --bg-soft: #f3f1ec;
  --bg-card: #ffffff;
  --ink: #14171f;
  --ink-soft: #4a5160;
  --ink-mute: #7a8294;
  --line: #e7e3d9;
  --line-soft: #efece4;
  --brand-blue: #2566c8;
  --brand-blue-deep: #1d3f8f;
  --brand-violet: #6a3aa8;
  --brand-magenta: #a23399;
  --brand-soft: #ece4f7;
  --accent: #6a3aa8;
  --accent-soft: #ece4f7;
  --accent-deep: #4a228a;
  --green: #1f8a5b;
  --green-soft: #d8efde;
  --yellow: #f5c443;
  --yellow-soft: #fff1c9;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-xl: 36px;
  --shadow-s: 0 1px 2px rgba(20,23,31,0.04), 0 2px 6px rgba(20,23,31,0.04);
  --shadow-m: 0 4px 14px rgba(20,23,31,0.06), 0 12px 32px rgba(20,23,31,0.05);
  --shadow-l: 0 18px 50px rgba(20,23,31,0.08);
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgba(250, 250, 247, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 44px; width: auto; display: block; mix-blend-mode: multiply; }
.nav-links {
  display: flex; gap: 28px; align-items: center;
  font-size: 14px; color: var(--ink-soft);
}
.nav-links a { transition: color .2s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-violet) 60%, var(--brand-magenta) 100%);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 14px rgba(106,58,168,0.25);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(106,58,168,0.35); }
.nav-toggle { display: none; background: none; border: none; padding: 8px; color: var(--ink); }
.nav-toggle svg { width: 22px; height: 22px; }

/* ===== HERO ===== */
.cs-hero {
  position: relative;
  padding: 70px 0 90px;
  overflow: hidden;
}
.cs-hero::before {
  content: "";
  position: absolute; top: -200px; right: -150px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(162,51,153,0.16), transparent 65%);
  border-radius: 50%; z-index: 0;
}
.cs-hero::after {
  content: "";
  position: absolute; bottom: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,102,200,0.14), transparent 65%);
  border-radius: 50%; z-index: 0;
}
.cs-hero-inner { position: relative; z-index: 1; }
.cs-crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-mute);
  margin-bottom: 20px;
}
.cs-crumbs a { color: var(--ink-mute); }
.cs-crumbs a:hover { color: var(--ink); }
.cs-crumbs .sep { opacity: 0.5; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cs-tag {
  background: var(--brand-soft);
  color: var(--accent-deep);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cs-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 20px;
  max-width: 900px;
}
.cs-hero .lede {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-soft);
  max-width: 780px;
}

.cs-strip {
  margin-top: 50px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 26px;
  box-shadow: var(--shadow-m);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.cs-stat .n {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-magenta) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.cs-stat .l { color: var(--ink-mute); font-size: 13px; margin-top: 4px; }

/* ===== SECTIONS ===== */
section.cs-section { padding: 70px 0; position: relative; }
section.cs-section.alt { background: var(--bg-soft); }
.cs-head { margin-bottom: 40px; max-width: 780px; }
.eyebrow {
  display: inline-block;
  color: var(--accent-deep);
  background: var(--brand-soft);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.cs-head h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.cs-head p { color: var(--ink-soft); font-size: 16px; }

.prose { max-width: 820px; color: var(--ink-soft); font-size: 16px; }
.prose p { margin-bottom: 14px; }
.prose ul { margin: 0 0 14px 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); font-weight: 700; }

/* ===== MODULE / FEATURE GRID ===== */
.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}
.module {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 22px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.module:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.module .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-weight: 700;
}
.module h4 { font-size: 16px; margin-bottom: 6px; }
.module p { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

/* ===== ARCHITECTURE ===== */
.arch-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 26px;
  box-shadow: var(--shadow-s);
  overflow-x: auto;
}
.arch-wrap svg { width: 100%; height: auto; min-width: 700px; display: block; }
.arch-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.arch-legend .sw {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ===== TECH STACK ===== */
.tech-groups { display: grid; gap: 26px; }
.tech-group h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 700;
  margin-bottom: 12px;
}
.tech-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-chips .chip {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.tech-chips .chip.pill { border-radius: 999px; background: var(--brand-soft); color: var(--accent-deep); border-color: transparent; font-weight: 600; }

/* ===== SCREENSHOTS ===== */
.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.shot {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  transition: transform .25s ease, box-shadow .25s ease;
}
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.shot-frame {
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(45deg, rgba(20,23,31,0.03) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, var(--brand-soft) 0%, #f0f5ff 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mute);
  font-size: 13px;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.shot-frame::before {
  content: "";
  position: absolute; top: 12px; left: 12px;
  display: flex; gap: 6px;
  width: 60px; height: 12px;
  background:
    radial-gradient(circle at 6px 6px, #ff6058 0 5px, transparent 5px),
    radial-gradient(circle at 24px 6px, #ffbd2e 0 5px, transparent 5px),
    radial-gradient(circle at 42px 6px, #28c941 0 5px, transparent 5px);
}
/* When an inline SVG mockup fills the frame, drop the placeholder chrome */
.shot-frame:has(svg.mockup) {
  padding: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.55), transparent 55%),
    linear-gradient(135deg, #eef2fb 0%, #f6ecf5 100%);
}
.shot-frame:has(svg.mockup)::before { display: none; }
.shot-frame svg.mockup {
  width: 100%;
  height: 100%;
  display: block;
}
.shot-caption {
  padding: 14px 18px 18px;
  font-size: 13px;
  color: var(--ink-soft);
}
.shot-caption .title { font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ===== IMPACT ===== */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.impact-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 22px;
  text-align: center;
}
.impact-card .val {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-magenta) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}
.impact-card .lbl { font-size: 13px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

/* ===== RELATED / CTA ===== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.related {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.related:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: var(--brand-violet); }
.related .rt-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-deep); font-weight: 700; margin-bottom: 8px; }
.related h4 { font-size: 16px; margin-bottom: 6px; }
.related p { font-size: 13.5px; color: var(--ink-soft); }
.related .rt-arrow { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--brand-violet); font-weight: 700; }

.cta-band {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-violet) 60%, var(--brand-magenta) 100%);
  color: #fff;
  padding: 46px 40px;
  border-radius: var(--radius-l);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-top: 30px;
}
.cta-band h3 { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -0.02em; }
.cta-band p { color: rgba(255,255,255,0.85); font-size: 15px; margin-top: 6px; max-width: 500px; }
.cta-band .btn {
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  background: #fff;
  color: var(--accent-deep);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .2s ease, box-shadow .2s ease;
  border: none;
}
.cta-band .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,0.2); }

/* ===== FOOTER ===== */
footer {
  padding: 60px 0 32px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.foot-mini {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--ink-mute);
}
.foot-mini img { height: 40px; mix-blend-mode: multiply; }
.foot-mini nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-mini nav a:hover { color: var(--ink); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .cs-strip { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: repeat(2, 1fr); }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .modules { grid-template-columns: 1fr; }
  .cs-strip { grid-template-columns: 1fr 1fr; padding: 20px; }
  section.cs-section { padding: 50px 0; }
  .cs-hero { padding: 40px 0 60px; }
  .cta-band { padding: 30px 24px; flex-direction: column; align-items: flex-start; }
}
