/* ===================================
   Work Page Styles (stylesWK.css)
   Child pages for case studies
   =================================== */

/* -------------------------
   Theme + tokens
-------------------------- */

:root {
  --accent: #6e5b98;
  --accent-soft: rgba(110, 91, 152, 0.12);
  --accent-muted: rgba(110, 91, 152, 0.6);

  --container: 1100px;
  --pad-x: clamp(22px, 5vw, 72px);
  --section-pad: clamp(40px, 6vw, 80px);
  --header-hint: 84px;

  --serif: 'Playfair Display', ui-serif, Georgia, serif;
  --sans:
    'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
  --condensed:
    'Roboto Condensed', ui-sans-serif, system-ui, -apple-system, Segoe UI,
    Roboto, Helvetica, Arial;

  --kicker: 13px;
  --title: 26px;
  --body: 18px;

  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --rule: rgba(26, 26, 26, 0.1);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.08);

  scroll-behavior: smooth;
}

@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] {
    --bg: #0a0a0a;
    --surface: #0f0f0f;
    --ink: #f5f5f5;
    --muted: rgba(245, 245, 245, 0.65);
    --rule: rgba(245, 245, 245, 0.12);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

html[data-theme='dark'] {
  --bg: #0a0a0a;
  --surface: #0f0f0f;
  --ink: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.65);
  --rule: rgba(245, 245, 245, 0.12);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

html[data-theme='light'] {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --rule: rgba(26, 26, 26, 0.1);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* -------------------------
   Base
-------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--container), 100%);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* -------------------------
   Sticky header
-------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pad-x);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 48px;
  height: 48px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  position: relative;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--muted);
  transition: color 220ms ease;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 1px;
  background: var(--accent);
  transition: width 200ms ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav a:hover::after {
  width: 100%;
}

/* Current / ON state (non-clickable) */
.nav a.is-current,
.nav a[aria-current='page'] {
  color: var(--ink);
  cursor: default;
  pointer-events: none;
}

.nav a.is-current::after,
.nav a[aria-current='page']::after {
  width: 100%;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 220ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent-muted);
  background: var(--accent-soft);
}

.theme-icon {
  font-size: 16px;
  line-height: 1;
}

/* -------------------------
   Case Study Header Strip
-------------------------- */

.case-study-strip {
  width: 100%;
  background: rgba(42, 42, 42, 0.92);
  backdrop-filter: blur(12px);
  padding: clamp(32px, 5vh, 50px) 0;
  position: relative;
  z-index: 2;
  margin-bottom: 0;
}

html[data-theme='dark'] .case-study-strip,
html[data-theme='auto'] .case-study-strip {
  background: rgba(20, 20, 20, 0.92);
}

@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] .case-study-strip {
    background: rgba(20, 20, 20, 0.92);
  }
}

.breadcrumb {
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 220ms ease;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.case-study-title {
  margin: 0 0 12px 0;
  font-family: 'Cairo Play', var(--sans);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.case-study-subtitle {
  margin: 0 0 20px 0;
  font-family: var(--condensed);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  max-width: 70ch;
}

.case-study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.case-study-meta strong {
  color: #ffffff;
  font-weight: 500;
}

/* -------------------------
   Hero SVG Section
-------------------------- */

.section {
  padding: var(--section-pad) 0;
}

.case-study-hero {
  padding: 0 0 var(--section-pad) 0;
}

.hero-figure {
  margin: 0;
}

.hero-svg {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

/* -------------------------
   Table of Contents
-------------------------- */

.case-study-toc {
  padding-top: 0;
  padding: clamp(20px, 3vh, 32px) 0;
}

.toc-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.toc-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px; /* tighter gap since padding is on the links */
}

.toc-links a {
  font-family: 'Cairo Play', var(--sans);
  font-size: 16px;
  font-weight: 700; /* ← Cairo Play earns its keep here */
  color: var(--ink);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid transparent; /* ← reserves space so border doesn't shift layout on hover */
  transition:
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.toc-links a:hover {
  background: var(--accent-soft);
  border-color: var(--accent-muted);
  color: var(
    --accent
  ); /* ← text nudges to accent too, but background carries it */
}

/* -------------------------
   Content Sections
-------------------------- */

.case-study-content {
  padding-top: var(--section-pad);
}

.content-article {
  max-width: 820px;
  margin: 0 auto;
}

.content-block {
  margin-bottom: clamp(50px, 8vh, 80px);
  scroll-margin-top: calc(var(--header-hint) + 20px);
}

.block-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.block-title {
  margin: 0 0 20px 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.3;
  color: var(--ink);
}

.block-subtitle {
  margin: 32px 0 16px 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(18px, 3vw, 22px);
  line-height: 1.4;
  color: var(--ink);
}

.block-subtitle-nested {
  margin: 26px 0 14px 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(16px, 2.4vw, 18px);
  line-height: 1.4;
  color: var(--accent);
}

.block-text {
  margin: 0 0 20px 0;
  font-family: var(--condensed);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
}

.block-text:last-child {
  margin-bottom: 0;
}

.block-text strong {
  font-weight: 500;
  color: var(--ink);
}

/* -------------------------
   Opening Block
-------------------------- */

.opening-block {
  width: 100%;
  margin-bottom: clamp(20px, 4vh, 40px); /* ← controls the gap to the article */
  padding-top: 20px; /* ← changed: space after the top rule */
  padding-bottom: 0;
  border-top: 3px solid var(--accent); /* ← thick accent above intro text "this initiative..." */
  border-bottom: none; /* ← remove, last <li> carries it */
}

.opening-lead {
  margin: 0 0 32px 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  max-width: 72ch;
}

.shifts-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.shifts-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--condensed);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.9;
}

.shifts-list li:last-child {
  border-bottom: 2px solid var(--accent); /* ← the last under Perception */
}

.shift-label {
  font-family: 'Cairo Play', var(--sans); /* ← changed: Cairo Play */
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 3px;
}

@media (max-width: 580px) {
  .shifts-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* -------------------------
   Callouts
-------------------------- */

.callout {
  margin: 32px 0;
  padding: 24px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

.callout-title {
  margin: 0 0 16px 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.callout-list {
  margin: 0;
  padding-left: 24px;
  font-family: var(--condensed);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.callout-list li {
  margin: 12px 0;
}

.callout-reflection {
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border-left: 3px solid var(--rule);
}

/* -------------------------
   Insight Cards
-------------------------- */

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.insight-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 880px) {
  .insight-grid-3 {
    grid-template-columns: 1fr;
  }
}

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

.insight-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.insight-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 50%;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.insight-title {
  margin: 0 0 8px 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.insight-desc {
  margin: 0;
  font-family: var(--condensed);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.9;
}

/* -------------------------
   Rhythm List
-------------------------- */

.rhythm-list {
  margin: 32px 0;
  display: grid;
  gap: 16px;
}

.rhythm-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  align-items: center;
}

@media (max-width: 580px) {
  .rhythm-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.rhythm-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  color: #a0a0a8;
  flex-shrink: 0;
}

.rhythm-day svg {
  width: 24px;
  height: 24px;
  stroke: #a0a0a8;
  flex-shrink: 0;
}

.rhythm-title {
  margin-bottom: 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.rhythm-desc {
  font-family: var(--condensed);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.9;
}

/* -------------------------
   Impact Metrics
-------------------------- */

.impact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 32px 0;
}

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

.impact-card {
  padding: 28px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.impact-metric {
  font-family: 'Cairo Play', var(--sans);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 0;
}

.impact-label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 0;
}

.impact-desc {
  font-family: var(--condensed);
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

/* -------------------------
   Navigation
-------------------------- */

.case-study-nav {
  padding: clamp(32px, 5vh, 50px) 0;
  border-top: 1px solid var(--rule);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-back {
  font-size: 14px;
  color: var(--muted);
  transition: color 220ms ease;
}

.nav-back:hover {
  color: var(--accent);
}

.nav-next-prev {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-size: 14px;
  color: var(--ink);
  transition: color 220ms ease;
}

.nav-link:hover {
  color: var(--accent);
}

/* -------------------------
   Footer
-------------------------- */

.site-footer {
  padding: 32px 0 44px 0;
  border-top: 1px solid var(--rule);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.social-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  transition: all 220ms ease;
}

.social-icon:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

.footer-copy {
  color: var(--muted);
}

/* -------------------------
   Floating Back-to-Top
-------------------------- */

.fab-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-decoration: none;
  z-index: 12000;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  color: var(--muted);
  transition: all 220ms ease;
}

.fab-top:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-4px);
}

.fab-top span {
  font-size: 20px;
  line-height: 1;
}

/* -------------------------
   Sprint Pair
   Two-up cards for Sprint 1 / Sprint 2 in Execution section
-------------------------- */

.sprint-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0 32px 0;
}

@media (max-width: 640px) {
  .sprint-pair {
    grid-template-columns: 1fr;
  }
}

.sprint-card {
  padding: 24px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.sprint-eyebrow {
  font-family: 'Cairo Play', var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.sprint-title {
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 12px;
}

.sprint-desc {
  font-family: var(--condensed);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.85;
  margin: 0;
}

/* -------------------------
   Highlights Block
-------------------------- */

.highlights-block {
  margin-bottom: clamp(40px, 6vh, 60px);
}

/* -------------------------
   Responsive
-------------------------- */

@media (max-width: 760px) {
  :root {
    --header-hint: 110px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px var(--pad-x);
  }

  .nav {
    gap: 16px;
  }

  .case-study-strip {
    padding: clamp(24px, 4vh, 36px) 0;
  }

  .case-study-meta {
    flex-direction: column;
    gap: 12px;
  }

  .footer-meta {
    flex-wrap: wrap;
  }

  .fab-top {
    right: 16px;
    bottom: 16px;
  }

  .nav-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-next-prev {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .footer-meta {
    row-gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* -------------------------
   Purple section rule
   mirrors the border-top on .opening-block
   use between container-level blocks
-------------------------- */

.section-rule-accent {
  width: 100%;
  height: 1px;
  background: var(--accent);
  margin: clamp(32px, 5vh, 48px) 0 clamp(48px, 7.5vh, 72px) 0;
}

/* -------------------------
   Artifact Figure + Modal
   Reusable pattern — add data-artifact to any <figure>
   and follow it with a sibling .artifact-modal
-------------------------- */

.artifact-figure {
  margin: 36px 0 0 0;
}

/* Thumb — sits at .container level so width = TOC width naturally */
.artifact-thumb {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--rule);
  cursor: zoom-in;
  background: var(--surface);
}

.artifact-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  filter: grayscale(100%);
  transition: filter 300ms ease;
  display: block;
}

.artifact-thumb:hover .artifact-img,
.artifact-thumb:focus .artifact-img {
  filter: grayscale(40%);
}

/* Hover overlay */
.artifact-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0);
  transition: background 300ms ease;
  pointer-events: none;
}

.artifact-overlay svg {
  width: 28px;
  height: 28px;
  stroke: #ffffff;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.artifact-overlay span {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ffffff;
  opacity: 0;
  transition: opacity 280ms ease;
}

.artifact-thumb:hover .artifact-overlay,
.artifact-thumb:focus .artifact-overlay {
  background: rgba(0, 0, 0, 0.28);
}

.artifact-thumb:hover .artifact-overlay svg,
.artifact-thumb:focus .artifact-overlay svg {
  opacity: 1;
  transform: scale(1);
}

.artifact-thumb:hover .artifact-overlay span,
.artifact-thumb:focus .artifact-overlay span {
  opacity: 1;
}

/* Color override — opt specific thumbnails out of grayscale */
.artifact-img--color {
  filter: none;
}

.artifact-thumb:hover .artifact-img--color,
.artifact-thumb:focus .artifact-img--color {
  filter: none;
}

/* Caption */
.artifact-caption {
  margin-top: 10px;
  font-family: var(--condensed);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
}

/* ---- Modal ---- */

.artifact-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.artifact-modal[hidden] {
  display: none;
}

.artifact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.artifact-modal-frame {
  position: relative;
  z-index: 1;
  max-width: min(1100px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.artifact-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 20, 20, 0.9);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 200ms ease,
    border-color 200ms ease;
}

.artifact-modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.artifact-modal-close svg {
  width: 16px;
  height: 16px;
}

.artifact-modal-scroll {
  overflow: auto;
  max-height: calc(100vh - 120px);
  border-radius: 10px;
  cursor: zoom-out;
}

.artifact-modal-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.artifact-modal-caption {
  font-family: var(--condensed);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
  margin: 0;
}

/* -------------------------
   Artifact — horizontal scroll variant
   Used for wide diagrams where breadth is the message
-------------------------- */

.artifact-thumb--scroll {
  height: 280px;
  cursor: default;
  overflow: hidden;
  /* Light blue sampled from diagram border */
  background: #ddeaf7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artifact-scroll-track {
  /* Center image when narrower than container */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-muted) transparent;
}

.artifact-scroll-track:active {
  cursor: grabbing;
}

.artifact-scroll-track::-webkit-scrollbar {
  height: 4px;
}

.artifact-scroll-track::-webkit-scrollbar-track {
  background: transparent;
}

.artifact-scroll-track::-webkit-scrollbar-thumb {
  background: var(--accent-muted);
  border-radius: 999px;
}

.artifact-img--scroll {
  /* Natural size — let it breathe inside the blue container */
  width: auto;
  height: 90%;
  max-width: none;
  object-fit: unset;
  filter: none;
  transition: none;
  flex-shrink: 0;
  margin: 0 auto;
}

/* Right-edge fade — signals more content to the right */

.artifact-scroll-track--website {
  display: block;
  overflow: hidden;
}

.artifact-img--website-preview {
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: unset;
  object-position: top left;
  filter: none;
  transition: none;
  display: block;
}

.artifact-scroll-fade {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(to right, transparent, #ddeaf7);
  pointer-events: none;
  border-radius: 0 10px 10px 0;
  transition: opacity 300ms ease;
}

.artifact-thumb--scroll:hover .artifact-scroll-fade {
  opacity: 0.5;
}

.artifact-thumb--scroll .artifact-overlay {
  pointer-events: none;
}

/* -------------------------
   Lightbox viewer
-------------------------- */

.lightbox .artifact-modal-backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  width: 92vw;
  height: 88vh;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7);
}

/* Toolbar */
.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: #111111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.lightbox-title {
  font-family: var(--condensed);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.lightbox-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
  text-decoration: none;
}

.lightbox-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.lightbox-btn--download {
  margin-left: 4px;
  border-color: var(--accent-muted);
  color: var(--accent);
}

.lightbox-btn--download:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-btn--close {
  margin-left: 4px;
}

.lightbox-btn--close:hover {
  background: rgba(220, 60, 60, 0.15);
  border-color: rgba(220, 60, 60, 0.4);
  color: #ff6b6b;
}

.lightbox-zoom-level {
  font-family: var(--condensed);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  min-width: 38px;
  text-align: center;
}

/* Scrollable canvas */
.lightbox-canvas {
  flex: 1;
  overflow: auto;
  padding: 24px;
  cursor: grab;
  background: #1a1a1a;
  /* Checkerboard to make transparency visible */
  background-image:
    linear-gradient(45deg, #222 25%, transparent 25%),
    linear-gradient(-45deg, #222 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222 75%),
    linear-gradient(-45deg, transparent 75%, #222 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0px;
}

.lightbox-canvas:active {
  cursor: grabbing;
}

.lightbox-img {
  display: block;
  /* Native size — user scrolls/zooms to navigate */
  width: auto;
  height: auto;
  max-width: none;
  transform-origin: top left;
  transition: transform 150ms ease;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  user-select: none;
}

/* -------------------------
   Accordion rhythm cards
-------------------------- */

.rhythm-list--accordion {
  gap: 12px;
}

.rhythm-accordion {
  display: block;
  padding: 0;
  overflow: hidden;
  transition:
    box-shadow 200ms ease,
    background 200ms ease;
  cursor: default;
}

.rhythm-accordion:hover {
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

html[data-theme='dark'] .rhythm-accordion:hover,
html[data-theme='auto'] .rhythm-accordion:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.rhythm-accordion.is-open {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Header row — the tap/click/hover target */
.rhythm-header {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 20px;
  padding: 20px;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 580px) {
  .rhythm-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .rhythm-header .rhythm-day {
    display: none;
  }
}

/* Override title font to Cairo Play */
.rhythm-accordion .rhythm-title {
  font-family: 'Cairo Play', var(--sans);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 4px;
}

/* Chevron */
.rhythm-chevron {
  width: 20px;
  height: 20px;
  stroke: #5f9000;
  flex-shrink: 0;
  transition: transform 300ms ease;
}

.rhythm-accordion.is-open .rhythm-chevron {
  transform: rotate(180deg);
}

/* Accordion body — height animated via JS */
.rhythm-accordion-body {
  height: 0;
  overflow: hidden;
  transition: height 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.rhythm-accordion-inner {
  padding: 0 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Mockup image */
.rhythm-mockup {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  display: block;
}

/* Spec link */
.rhythm-spec-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 200ms ease;
  align-self: flex-start;
}

.rhythm-spec-link:hover {
  opacity: 0.75;
}

/* -------------------------
   Wiki strip modal
-------------------------- */

.wiki-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wiki-modal[hidden] {
  display: none;
}

.wiki-modal .wiki-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.wiki-modal-frame {
  position: relative;
  z-index: 1;
  width: 92vw;
  height: 88vh;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden; /* canvas handles its own scroll */
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7);
}

/* Lightweight toolbar */
.wiki-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px;
  background: #111111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.wiki-modal-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wiki-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.wiki-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.wiki-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.wiki-btn--close:hover {
  background: rgba(220, 60, 60, 0.15);
  color: #ff6b6b;
}

.wiki-zoom-label {
  font-family: var(--condensed);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  min-width: 40px;
  text-align: center;
  cursor: pointer;
}

.wiki-zoom-label:hover {
  color: #ffffff;
}

/* Scrollable canvas */
.wiki-modal-canvas {
  flex: 1;
  overflow: hidden; /* JS switches to 'auto' when zoomed past fit */
  padding: 32px;
  background: rgba(15, 15, 15, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wiki-modal-img {
  display: block;
  width: 100%; /* fit to canvas width by default */
  height: auto;
  max-width: 100%; /* never exceed canvas width */
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
  /* Width overridden by JS only when zooming in past fit */
}

/* -------------------------
   Shared utility: flush top padding
-------------------------- */
.section--flush-top {
  padding-top: 0 !important;
}

/* -------------------------
   Artifact placeholders
-------------------------- */

.artifact-placeholder {
  width: 100%;
  min-height: 240px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, var(--rule));
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent-soft) 48%, var(--surface)) 0%,
      var(--surface) 100%
    );
  box-shadow: var(--shadow);
  display: grid;
  align-content: start;
  gap: 18px;
}

.artifact-placeholder--tall {
  min-height: 320px;
}

.placeholder-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'Cairo Play', var(--sans);
}

.placeholder-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.3;
  color: var(--ink);
}

.placeholder-text {
  margin: 0;
  font-family: var(--condensed);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.92;
  max-width: 76ch;
}

.placeholder-list {
  margin: 0;
  padding-left: 20px;
  font-family: var(--condensed);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.placeholder-list li + li {
  margin-top: 6px;
}

.placeholder-note {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

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

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

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

.phase-card {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
}

.phase-label {
  margin: 0 0 8px 0;
  font-family: 'Cairo Play', var(--sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.phase-desc {
  margin: 0;
  font-family: var(--condensed);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

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

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

.concept-card {
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.concept-title {
  margin: 0 0 8px 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.concept-desc {
  margin: 0;
  font-family: var(--condensed);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 20px 0 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}

.meta-inline strong {
  color: var(--ink);
  font-weight: 600;
}


/* -------------------------
   Canopy case study additions
-------------------------- */

.hero-placeholder-label {
  margin: 14px 0 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.insight-grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
}

.phase-grid--two-up {
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.phase-card--large {
  align-items: flex-start;
  text-align: left;
  padding: 24px;
}

.mini-list {
  margin: 14px 0 0 0;
  padding-left: 20px;
  font-family: var(--condensed);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.mini-list li + li {
  margin-top: 6px;
}

.mini-list--impact {
  margin: 28px 0 8px 0;
}

.block-text--tight {
  margin-bottom: 12px;
}

.workstream-stack {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.workstream-item {
  padding-top: 4px;
}

.artifact-placeholder--compact {
  padding: 20px 22px;
  border-radius: 12px;
  min-height: auto;
}

.reflection-close {
  margin: 32px 0 0 0;
  padding: 22px 0 0 0;
  border-top: 1px solid var(--rule);
  font-family: 'Cairo Play', var(--sans);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--accent);
  max-width: 28ch;
}

@media (max-width: 880px) {
  .phase-grid--two-up,
  .insight-grid-2x2 {
    grid-template-columns: 1fr;
  }
}


/* Task model + system journey preview cards: no side fade, keep centered preview */
.artifact-thumb--scroll .artifact-overlay {
  pointer-events: auto;
}

/* Fit-view lightbox variant for preview diagrams */
.lightbox-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.lightbox-link svg {
  width: 16px;
  height: 16px;
}

.lightbox-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.lightbox-canvas--fit {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 32px;
}

.lightbox-img--fit {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(88vh - 110px);
  margin: 0 auto;
  transform: none !important;
}


/* -------------------------
   Phase 3 concept gallery modals
-------------------------- */

.concept-modal {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.concept-modal[hidden] {
  display: none;
}

.concept-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

.concept-modal-frame {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100vw - 48px));
  height: min(88vh, calc(100vh - 48px));
  background: #111111;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7);
}

.concept-modal-frame--lightbox {
  display: flex;
  flex-direction: column;
}

.concept-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: #111111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.concept-modal-title {
  font-family: var(--condensed);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.concept-modal-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.concept-modal-close {
  position: static;
}

.concept-modal-scroll {
  flex: 1;
  overflow: auto;
  padding: 24px;
  background: #1a1a1a;
  background-image:
    linear-gradient(45deg, #222 25%, transparent 25%),
    linear-gradient(-45deg, #222 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222 75%),
    linear-gradient(-45deg, transparent 75%, #222 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0px;
}

.concept-modal-scroll--lightbox {
  display: block;
}

.concept-modal-stage {
  display: block;
  margin: 0 auto;
}

.concept-modal-gallery {
  display: grid;
  gap: 20px;
}

.concept-modal-item {
  margin: 0;
}

.concept-modal-img {
  display: block;
  max-width: none;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.45);
}

.concept-modal-img--lightbox {
  width: auto;
}

@media (max-width: 720px) {
  .concept-modal {
    padding: 12px;
  }

  .concept-modal-frame {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    border-radius: 10px;
  }

  .concept-modal-toolbar {
    padding: 10px 12px;
  }

  .concept-modal-title {
    max-width: 42vw;
  }

  .concept-modal-scroll {
    padding: 16px;
  }
}



.hero-caption {
  margin: 12px 4px 0 4px;
  font-family: var(--condensed);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
}
