/* =============================================================
   craig-morris-shared.css
   Shared design tokens + case-study component styles.
   All four case-study pages link to this file.
   Per-page overrides (--accent colour, body gradient, etc.)
   live in a tiny <style> block inside each page's <head>.
   ============================================================= */

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  --bg:         #111111;
  --surface:    #181818;
  --surface-up: #222222;
  --border:     #282828;
  --border-up:  #363636;

  --text:       #f2f2f2;
  --text-body:  #c0c0c0;
  --text-muted: #7a7a7a;
  --text-dim:   #484848;

  --red:        #c32e2e;
  --sky-blue:   #46b0fd;
  --blue:       #3c9fd4;
  --green:      #a2e81c;
  --teal:       #2ec3b3;
  --purple:     #a05be6;
  --yellow:     #c1d553;
  --orange:     #e8921c;

  /* accent is set per-page via an inline :root override */
  --accent-dim:         color-mix(in srgb, var(--accent), #080808 90%);
  --accent-hover:       color-mix(in srgb, var(--accent), transparent 94%);
  --accent-transparent: color-mix(in srgb, var(--accent), transparent 85%);

  --hero-bg:    color-mix(in srgb, var(--accent), #ffffff 50%);
  --hero-text:  color-mix(in srgb, var(--accent), #000000 90%);
  --hero-muted: color-mix(in srgb, var(--accent), #080808 60%);

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Jost', system-ui, sans-serif;

  --size-display: clamp(3.2rem, 8vw, 6.5rem);
  --size-h1:      clamp(2.2rem, 5.5vw, 3.6rem);
  --size-h2:      clamp(1.7rem, 2.3vw, 2.5rem);
  --size-h3:      clamp(1.2rem, 1.8vw, 1.4rem);
  --size-h4:      clamp(0.9rem, 1.2vw, 1.1rem);
  --size-body:    clamp(1.1rem, 1.1vw, 1.3rem);
  --size-caption: clamp(1.1rem, 1.0vw, 1.1rem);

  --max:      840px;
  --max-wide: 1040px;
  --pad-x:    48px;
  --radius:   5px;
  --transition-duration: 0.3s;
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  padding-top: 52px; /* clear fixed site-nav */
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-weight: 300;
}
/* Ensure sections/anchors aren't hidden under the fixed nav */
.cs-section, .cs-overview, footer { scroll-margin-top: 60px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ── HERO ───────────────────────────────────────────────────────── */
.cs-hero {
  background: var(--hero-bg) radial-gradient(ellipse 90% 90% at 50% 0%, color-mix(in srgb, var(--accent), #ffffff 60%) 0%, var(--hero-bg) 70%);
  padding: 56px var(--pad-x) 0;
  height:fit-content;
  max-height:750px;
  padding-bottom: 55px;
}

.cs-hero-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.cs-hero-copy { width: 100%; }

.cs-kicker {
  font-family: var(--serif);
  font-size: var(--size-display);
  font-weight: 600;
  font-style: italic;
  color: var(--hero-text);
  letter-spacing: -0.03em;
}

.cs-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hero-muted);
  margin-bottom: 18px;
  width: 100%;
}

.cs-hero h1 {
  font-family: var(--serif);
  font-size: var(--size-h1);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--hero-text);
  margin-bottom: 18px;
}

.cs-hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--hero-muted);
  font-weight: 300;
}

.cs-tagline {
  font-family: var(--sans);
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--hero-muted);
  max-width: 600px;
  line-height: 1.7;
}

.cs-tagline strong {
  font-weight: 600;
  color: var(--hero-text);
}

.cs-hero-image {
  width: 100%;
  max-width: var(--max-wide);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  display:flex;
  justify-content:center;
}

.cs-hero-image img {
  width:75%;
  max-width: var(--max-wide);
  height: auto;
  display: block;
  max-width:497px;
  max-height:300px;
}


/* ── SHARED SECTION STRUCTURE ───────────────────────────────────── */
.cs-section {
  border-top: 1px solid var(--border);
  padding: 56px var(--pad-x);
}

.cs-section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.cs-overview { background: var(--surface); }

/* ── OVERVIEW ────────────────────────────────────────────────────── */
.cs-overview-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.cs-overview-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  border-top: 1px solid var(--border);
  padding: 26px 0;
}

.cs-overview-label {
  font-family: var(--sans);
  font-size: var(--size-h4);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.3;
  margin-bottom: 12px;
  display: block;
  translate: 0 6px;
}

.cs-overview-content {
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── SECTION HEADERS ────────────────────────────────────────────── */
.cs-section-header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 32px;
}

.cs-num {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.8vw, 3rem);
  font-weight: 200;
  font-style: italic;
  color: var(--accent);
  opacity: 0.5;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.cs-section-title {
  font-family: var(--serif);
  font-size: var(--size-h2);
  font-weight: 200;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ── BODY TEXT ──────────────────────────────────────────────────── */
.cs-body {
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── PLAIN LIST ─────────────────────────────────────────────────── */
.cs-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-list li {
  padding-left: 20px;
  position: relative;
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.75;
}

.cs-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── COMPOUND LIST ──────────────────────────────────────────────── */
.cs-list-compound {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-list-compound li {
  padding-left: 20px;
  position: relative;
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.75;
  border-left: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-research-title {
  font-size: var(--size-h3);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

/* ── KEY DECISIONS (also used for outcomes and personas) ────────── */
.cs-decisions {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cs-decision {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-decision-title {
  font-size: var(--size-h3);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.cs-decision-body {
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.75;
}

/* ── OUTCOMES ───────────────────────────────────────────────────── */
.cs-outcome-label {
  font-size: var(--size-h4);
  font-weight: 600;
  color: var(--text);
}

.cs-outcome-body {
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.8;
}

/* ── PULL QUOTE ─────────────────────────────────────────────────── */
.cs-quote {
  border-left: 2px solid var(--accent);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0;
}

.cs-quote-text {
  font-family: var(--serif);
  font-size: var(--size-h3);
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  line-height: 1.55;
}

.cs-quote-attribution {
  font-family: var(--sans);
  font-size: var(--size-caption);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── IMAGE TREATMENTS ───────────────────────────────────────────── */
.cs-img-container {
	width:100%;
	display:flex;
	align-items:center;
	flex-direction: column;
}

.cs-img-full {
  width: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 28px;
  max-height:400px;
}

.cs-img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.cs-img-pair img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width:auto;
  max-height:400px;
}

.cs-img-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.cs-img-grid-2x2 img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cs-img-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.cs-img-gallery img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cs-device-pair {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}

.cs-device-pair figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-device-pair figcaption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-device-pair img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cs-device-pair figure:last-child img {
  max-height: 320px;
  width: auto;
}

/* ── CLICKABLE IMAGE HOVER ──────────────────────────────────────── */
.cs-img-full,
.cs-img-pair img,
.cs-img-grid-2x2 img,
.cs-img-gallery img,
.cs-device-pair img {
  cursor: zoom-in;
  transition:
    box-shadow var(--transition-duration),
    border-color var(--transition-duration);
}

.cs-img-full:hover,
.cs-img-pair img:hover,
.cs-img-grid-2x2 img:hover,
.cs-img-gallery img:hover,
.cs-device-pair img:hover {
  box-shadow: 0 4px 28px var(--accent-transparent);
  border-color: var(--border-up);
}

.cs-caption {
  font-size: var(--size-caption);
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 12px;
}

.cs-gap { margin-top: 28px; }

/* ── cs-quote-bubble ────────────────────────────────────────────── */
.cs-quote-container {
	display:flex;
	justify-content: center;
	width:100%;
}

.cs-quote-bubble {
  position: relative;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 65%);
  border-radius: 16px;
  border-bottom-left-radius: 4px;       /* flatten where the tail meets */
  padding: 24px 26px 20px;
  margin-bottom: 18px;                  /* clearance below the tail */
  max-width: 560px;
}

/* Tail — border layer (outer triangle, 1px larger) */
.cs-quote-bubble::before {
  content: '';
  position: absolute;
  bottom: -14px;
  left: -1px;                           /* flush with the left border */
  width: 0;
  height: 0;
  border-top: 14px solid color-mix(in srgb, var(--accent), transparent 65%);
  border-right: 14px solid transparent;
}

/* Tail — fill layer (inner triangle, flush with bubble bg) */
.cs-quote-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0px;
  width: 0;
  height: 0;
  border-top: 12px solid var(--accent-dim);
  border-right: 12px solid transparent;
  z-index: 1;
}

/* Opening decorative quote mark */
.cs-quote-bubble-text {
  font-family: var(--serif);
  font-size: var(--size-body);
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  line-height: 1.65;
  padding-top: 22px;
  position: relative;
}

.cs-quote-bubble-text::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: -3px;
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 700;
  font-style: normal;
  color: var(--accent);
  line-height: 1;
  opacity: 0.55;
}

/* Attribution line */
.cs-quote-bubble-attr {
  font-family: var(--sans);
  font-size: var(--size-h4);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 14px;
  opacity: 0.85;
}

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 26px var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

footer a {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  transition: color var(--transition-duration);
}

footer a:hover { color: var(--text-body); }

footer p {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── LIGHTBOX ───────────────────────────────────────────────────── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox-overlay.open { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  cursor: default;
  object-fit: contain;
  animation: lb-in var(--transition-duration) ease;
}

@keyframes lb-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: 1px solid var(--border-up);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: border-color var(--transition-duration), color var(--transition-duration);
}

.lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 680px) and (min-width: 420px) {
  :root { --pad-x: 26px; }
  .cs-overview-row { grid-template-columns: 1fr; gap: 8px; }
  .cs-img-pair, .cs-img-grid-2x2, .cs-img-gallery { grid-template-columns: 1fr; }
  .cs-device-pair { grid-template-columns: 1fr; }
  .cs-device-pair figure:last-child img { max-height: none; width: 100%; }
}

@media (max-width: 419px) {
  :root { --pad-x: 18px; }
  .cs-overview-row { grid-template-columns: 1fr; gap: 8px; }
  .cs-img-pair, .cs-img-grid-2x2, .cs-img-gallery { grid-template-columns: 1fr; }
  .cs-device-pair { grid-template-columns: 1fr; }
  .cs-device-pair figure:last-child img { max-height: none; width: 100%; }
  .cs-section-header { flex-direction: column; gap: 2px; }
  .cs-num { font-size: 2rem; }
}
