/* ─────────────────────────────────────────────────────────────────
   APP0110 Labs — Case-study page styles
   Loaded AFTER doc-styles.css, which it extends rather than replaces.

   WHY A SEPARATE FILE: doc-styles.css is shared by privacy.html,
   terms.html and engagement.html — calm, 720px, document-focused
   pages. A case study is a marketing surface: it needs full-width
   screenshots, stat tiles and card grids that would be dead weight
   on the legal pages. Keeping them here leaves that shared chrome
   untouched.

   HOW IT COMPOSES: the article carries BOTH classes —
   `class="doc-container cs-container"`. Every `.doc-container h1/h2/p/ul`
   typography rule still applies; `.cs-container` only widens the
   measure (this file loads later, so equal-specificity wins on order).
   Text runs are then pulled back to a readable measure with `.cs-prose`,
   which lets figures use the full width.

   All colour comes from the existing Cosmos/Apollo theme tokens, so
   the page follows the theme toggle for free.
   ───────────────────────────────────────────────────────────────── */

/* Widen the shared container; prose is re-narrowed per block below. */
.cs-container {
  max-width: 1060px;
}

/* Readable measure for text. Matches doc-styles' 720px so the case
   study reads identically to the legal pages where it is prose. */
.cs-prose {
  max-width: 720px;
}

/* ── Hero ───────────────────────────────────────────────────────── */

.cs-lede {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.6;
  color: var(--doc-body-color);
  margin-bottom: 1.5rem !important;
}

.cs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: 2.5rem;
}
.cs-hero-meta a {
  color: var(--doc-link-color);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--glow-rgb), 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cs-hero-meta a:hover {
  color: var(--doc-link-hover);
  border-bottom-color: currentColor;
}
.cs-hero-meta .cs-dot {
  color: var(--orbit-glow);
  opacity: 0.5;
}

/* ── Figures ────────────────────────────────────────────────────── */

.cs-figure {
  margin: 2.25rem 0 2.75rem;
}
.cs-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(var(--glow-rgb), 0.22);
  /* Lifts the screenshot off the painterly mesh so it reads as an
     artifact rather than page furniture. */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 50px -12px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .cs-figure img {
  border-color: rgba(184, 146, 59, 0.30);
  box-shadow: 0 18px 50px -18px rgba(60, 44, 12, 0.35);
}
.cs-figcaption {
  margin-top: 0.85rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--silver);
  text-align: center;
}

/* Screenshot paired with its explanation. Image first on mobile so the
   reader sees the artifact before the description. */
.cs-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
  margin: 2.25rem 0 2.75rem;
}
@media (min-width: 900px) {
  .cs-split { grid-template-columns: 1.15fr 1fr; gap: 2.75rem; }
  .cs-split.cs-split-flip .cs-split-media { order: 2; }
}
.cs-split .cs-figure { margin: 0; }
.cs-split-body h3 { margin-top: 0 !important; }
.cs-split-body p:last-child { margin-bottom: 0; }

/* Phone screenshot — constrained so it never dominates the row. */
.cs-figure.cs-figure-phone img {
  max-width: 260px;
  margin: 0 auto;
  border-radius: 18px;
}

/* ── Stat tiles ─────────────────────────────────────────────────── */

.cs-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2.25rem 0 2.75rem;
  padding: 0 !important;
  list-style: none;
}
@media (min-width: 760px) {
  .cs-stats { grid-template-columns: repeat(4, 1fr); }
}
.cs-stat {
  background: var(--card-gradient);
  border: 1px solid var(--doc-callout-border);
  border-radius: 6px;
  padding: 1.35rem 1.1rem;
  text-align: center;
  margin: 0 !important;
}
.cs-stat-num {
  display: block;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  line-height: 1.1;
  color: var(--stellar-white);
  /* Tabular figures so the four tiles align optically. */
  font-variant-numeric: tabular-nums;
}
.cs-stat-label {
  display: block;
  margin-top: 0.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--silver);
  line-height: 1.45;
}

/* ── Card grid (what we built) ──────────────────────────────────── */

.cs-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.75rem 0 2.5rem;
  padding: 0 !important;
  list-style: none;
}
@media (min-width: 760px) {
  .cs-cards { grid-template-columns: repeat(2, 1fr); }
}
.cs-card {
  background: var(--doc-callout-bg);
  border: 1px solid var(--doc-callout-border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  margin: 0 !important;
}
.cs-card h4 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--stellar-white);
  margin-bottom: 0.5rem;
}
.cs-card p {
  font-size: 0.95rem;
  margin-bottom: 0 !important;
}

/* ── Stack / spec list ──────────────────────────────────────────── */

.cs-spec {
  margin: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--doc-rule);
}
.cs-spec-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--doc-rule);
}
@media (min-width: 700px) {
  .cs-spec-row { grid-template-columns: 200px 1fr; gap: 1.5rem; }
}
.cs-spec-key {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--orbit-glow);
  opacity: 0.9;
}
.cs-spec-val {
  color: var(--doc-body-color);
  font-size: 0.98rem;
}

/* ── Work index (work.html) ─────────────────────────────────────── */

.cs-work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2.5rem 0 0;
  padding: 0 !important;
  list-style: none;
}
@media (min-width: 860px) {
  .cs-work-grid { grid-template-columns: repeat(2, 1fr); }
}

/* The whole card is one link — bigger target, and it keeps the anchor
   text brand-led ("ExoVzn · storm-intelligence platform") rather than a
   bare "read more". */
.cs-work-card {
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  border: 1px solid var(--doc-callout-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--doc-callout-bg);
  color: inherit;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
/* doc-styles.css underlines every `.doc-container a`. That rule is right for
   inline prose links and wrong for a card whose entire surface is the anchor —
   without this the title, description and CTA all render underlined.
   TWO THINGS MAKE THIS FIDDLY, both worth knowing before "simplifying" it:
     1. SPECIFICITY. `.doc-container a` is (0,1,1); a bare `.cs-work-card` is
        (0,1,0) and LOSES. The selector must be at least as specific, hence
        qualifying it with the container.
     2. text-decoration PROPAGATES from the anchor to its in-flow descendants
        and cannot be cancelled by the child. Setting `none` on .cs-work-title
        computes to "none" and still renders underlined, because the line is
        painted by the ancestor <a>. It has to be killed ON THE ANCHOR.
   Scoped here rather than weakening the global rule, which the legal pages
   depend on for their prose links. */
.doc-container a.cs-work-card,
.doc-container a.cs-work-card * {
  text-decoration: none;
}
.cs-work-card:hover {
  border-color: rgba(var(--glow-rgb), 0.5);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .cs-work-card:hover {
  box-shadow: 0 16px 40px -20px rgba(60, 44, 12, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  .cs-work-card { transition: border-color 0.25s ease; }
  .cs-work-card:hover { transform: none; }
}

.cs-work-card img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--doc-rule);
}
.cs-work-body {
  padding: 1.4rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}
.cs-work-eyebrow {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orbit-glow);
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.cs-work-title {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--stellar-white);
  margin-bottom: 0.6rem;
}
.cs-work-desc {
  font-size: 0.95rem;
  color: var(--doc-body-color);
  margin-bottom: 1rem !important;
}
.cs-work-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  list-style: none;
}
.cs-work-facts li {
  margin: 0 !important;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--doc-rule);
  border-radius: 3px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--silver);
}
.cs-work-more {
  margin-top: auto;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--doc-link-color);
}
.cs-work-card:hover .cs-work-more { color: var(--doc-link-hover); }

/* ── Closing CTA ────────────────────────────────────────────────── */

.cs-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--doc-callout-bg);
  border: 1px solid var(--doc-callout-border);
  border-radius: 8px;
  text-align: center;
}
.cs-cta h2 {
  margin-top: 0 !important;
}

/* .btn-primary is defined in index.html's inline stylesheet, which the doc
   pages do not load — doc-styles.css carries only its :focus-visible rule,
   so the class alone renders as a bare link here. Ported verbatim from
   index.html (lines ~843-871) so the CTA matches the landing page exactly
   and still follows the theme tokens. */
.cs-cta .btn-primary {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 2.25rem;
  background: linear-gradient(135deg, var(--orbit-blue), var(--earth-blue));
  color: #fff;
  border: none;
  border-radius: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}
.cs-cta .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--orbit-glow), var(--orbit-blue));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cs-cta .btn-primary:hover::before { opacity: 1; }
.cs-cta .btn-primary:hover {
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.4);
  transform: translateY(-2px);
}
/* Keep the label above the ::before wash. */
.cs-cta .btn-primary > span,
.cs-cta .btn-primary { isolation: isolate; }
.cs-cta .btn-primary { z-index: 0; }
.cs-cta .btn-primary::before { z-index: -1; }
@media (prefers-reduced-motion: reduce) {
  .cs-cta .btn-primary { transition: none; }
  .cs-cta .btn-primary:hover { transform: none; }
}

/* Reduced motion: nothing here animates, but keep image rendering
   crisp when the OS scales things down. */
.cs-figure img,
.cs-stat {
  image-rendering: auto;
}
