/* ============================================================
   casestudy.css — shared styles for all case study pages
   ============================================================ */

/* ---- TOKENS ---- */
:root {
  --bg:          #0F0D0B;
  --bg-2:        #171410;
  --bg-3:        #1C1916;
  --fg:          #F0EDE8;
  --fg-muted:    #888880;
  --fg-dim:      #555550;
  --accent:      #E8A838;
  --accent-2:    #2ABFBF;
  --grid-color:  rgba(255, 240, 200, 0.045);
  --side-pad:    clamp(1.5rem, 8vw, 7rem);
  --section-pad: clamp(3.5rem, 7vw, 6rem);
  --max-w:       860px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Epilogue', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute; top: -40px; left: 1rem;
  background: var(--accent); color: var(--bg);
  padding: 0.5rem 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.75rem;
  text-decoration: none; z-index: 100; transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---- NAV ---- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1.2rem, 3vw, 1.8rem) var(--side-pad);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.site-nav.scrolled {
  background: rgba(15, 13, 11, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-back {
  font-family: 'DM Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted); text-decoration: none;
  display: flex; align-items: center; gap: 0.5rem;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1.8rem; }
.nav-right a {
  font-family: 'DM Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted); text-decoration: none;
  transition: color 0.2s;
}
.nav-right a:hover { color: var(--accent-2); }
.nav-right .nav-icon {
  display: flex; align-items: center;
  letter-spacing: 0; text-transform: none;
}
.nav-right .nav-icon svg { width: 16px; height: 16px; }
.nav-right .nav-divider { width: 1px; height: 14px; background: var(--fg-dim); }

/* ---- HERO ---- */
.cs-hero {
  min-height: 82vh; display: flex; flex-direction: column;
  justify-content: flex-end; position: relative; overflow: hidden;
  padding: clamp(6rem, 12vw, 10rem) var(--side-pad) clamp(3rem, 6vw, 5rem);
}
.cs-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
}
.cs-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, var(--bg) 100%);
}
.cs-hero-content { position: relative; z-index: 1; max-width: 780px; }

.cs-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
  opacity: 0; animation: fade-up 0.6s ease forwards 0.1s;
}
.cs-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 900;
  line-height: 1.02; letter-spacing: -0.03em; color: var(--fg);
  margin-bottom: 1.2rem;
  opacity: 0; animation: fade-up 0.7s ease forwards 0.2s;
}
.cs-subtitle {
  font-size: clamp(1rem, 1.9vw, 1.2rem); font-weight: 300;
  line-height: 1.65; color: var(--fg-muted); max-width: 600px;
  margin-bottom: 2.5rem;
  opacity: 0; animation: fade-up 0.6s ease forwards 0.35s;
}
.cs-meta {
  display: flex; flex-wrap: wrap; gap: 2rem;
  opacity: 0; animation: fade-up 0.6s ease forwards 0.45s;
}
.cs-meta-item { display: flex; flex-direction: column; gap: 0.25rem; }
.cs-meta-label {
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-dim);
}
.cs-meta-value { font-size: 0.88rem; font-weight: 500; color: var(--fg); }

/* ---- BODY WRAPPER ---- */
.cs-body {
  max-width: calc(var(--max-w) + var(--side-pad) * 2);
  margin: 0 auto; padding: 0 var(--side-pad);
}

/* ---- SECTIONS ---- */
.cs-section {
  padding: var(--section-pad) 0;
  border-top: 1px solid rgba(255, 240, 200, 0.055);
}
.section-label {
  font-family: 'DM Mono', monospace; font-size: 0.67rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.55rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700;
  letter-spacing: -0.02em; color: var(--fg);
  margin-bottom: clamp(1.2rem, 2.5vw, 2rem); line-height: 1.15;
}
.subsection-title {
  font-size: 1.1rem; font-weight: 600; color: var(--fg);
  margin-bottom: 0.9rem; margin-top: 2.5rem; letter-spacing: -0.01em;
}
.body-text {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem); font-weight: 300;
  line-height: 1.82; color: var(--fg-muted); max-width: 660px;
}
.body-text + .body-text { margin-top: 1.1rem; }
.body-text strong { color: var(--fg); font-weight: 500; }

/* ---- SCREEN COMPONENTS ---- */
.screens-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
  margin-top: 1.5rem; margin-bottom: 1rem;
}
.screens-2x2 {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
  margin-top: 1.5rem;
}
.screens-row-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-bottom: 1rem;
}
.screens-carousel {
  display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}
.screens-carousel::-webkit-scrollbar { height: 4px; }
.screens-carousel::-webkit-scrollbar-track { background: var(--bg-3); }
.screens-carousel::-webkit-scrollbar-thumb { background: var(--fg-dim); border-radius: 2px; }
.carousel-slide {
  flex: 0 0 clamp(220px, 44vw, 320px); scroll-snap-align: start;
}
.screen-wrap {
  background: var(--bg-2); border: 1px solid rgba(255, 240, 200, 0.06);
  border-radius: 4px; overflow: hidden;
}
.screen-wrap img { width: 100%; display: block; transition: transform 0.4s ease; }
.screen-wrap:hover img { transform: scale(1.025); }
.screen-caption {
  padding: 0.65rem 0.85rem;
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.1em; color: var(--fg-dim);
  border-top: 1px solid rgba(255, 240, 200, 0.04);
}
.screen-wrap-full {
  background: var(--bg-2); border: 1px solid rgba(255, 240, 200, 0.06);
  border-radius: 4px; overflow: hidden; margin-top: 1.5rem;
}
.screen-wrap-full img { width: 100%; display: block; }
.screen-wrap-full + .screen-wrap-full { margin-top: 1rem; }

/* ---- OUTCOME STRIP ---- */
.outcome-strip {
  margin: 0; padding: clamp(2rem, 4vw, 3rem) 0;
  background: var(--bg-2);
  border-top: 1px solid rgba(255, 240, 200, 0.055);
  border-bottom: 1px solid rgba(255, 240, 200, 0.055);
}
.outcome-inner {
  max-width: calc(var(--max-w) + var(--side-pad) * 2);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}
.outcome-label {
  font-family: 'DM Mono', monospace; font-size: 0.63rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 0.7rem;
}
.outcome-marker {
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); flex-shrink: 0; padding-top: 0.15rem;
}
.outcome-text {
  font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 300;
  line-height: 1.6; color: var(--fg); max-width: 700px;
}
.outcome-text strong { font-weight: 600; color: var(--accent); }
/* Muted variant (TeamReach) */
.outcome-text.muted {
  font-size: clamp(0.92rem, 1.5vw, 1rem);
  color: var(--fg-muted); max-width: none;
}
.outcome-text.muted strong { color: var(--fg); font-weight: 500; }

/* ---- FINDINGS ---- */
.findings-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.finding-card {
  background: var(--bg-2); border: 1px solid rgba(255, 240, 200, 0.06);
  border-radius: 4px; padding: 1.4rem 1.5rem;
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 1rem; align-items: start;
}
.finding-num {
  font-family: 'DM Mono', monospace; font-size: 1.5rem;
  font-weight: 300; color: var(--accent); opacity: 0.38; line-height: 1.1;
}
.finding-title { font-size: 0.95rem; font-weight: 600; color: var(--fg); margin-bottom: 0.4rem; }
.finding-desc { font-size: 0.88rem; font-weight: 300; line-height: 1.72; color: var(--fg-muted); }
.finding-quote {
  margin-top: 0.6rem; font-style: italic; font-size: 0.84rem; color: var(--fg-dim);
  border-left: 2px solid rgba(42, 191, 191, 0.28); padding-left: 0.75rem;
}

/* ---- PROTOTYPE / VIDEO / BOARD EMBEDS ---- */
.proto-wrap,
.board-wrap {
  margin-top: 2.5rem; background: var(--bg-2);
  border: 1px solid rgba(255, 240, 200, 0.06); border-radius: 4px; overflow: hidden;
}
.proto-wrap iframe {
  width: 100%; aspect-ratio: 16 / 9; height: auto;
  min-height: 320px; max-height: 560px;
  border: none; display: block;
}
.board-wrap iframe {
  width: 100%; aspect-ratio: 4 / 3; height: auto;
  min-height: 280px; max-height: 500px;
  border: none; display: block;
}
.proto-label,
.board-label {
  padding: 0.85rem 1.1rem;
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-dim); border-top: 1px solid rgba(255, 240, 200, 0.04);
  display: flex; align-items: center; gap: 0.5rem;
}
.board-label { padding: 0.75rem 1rem; }
.proto-dot,
.board-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.proto-dot { background: var(--accent-2); }
.board-dot { background: var(--accent); }

/* ---- NEXT STEPS ---- */
.next-list { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.8rem; }
.next-item {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.9rem; align-items: start;
  padding: 1.2rem 1.4rem; background: var(--bg-2);
  border: 1px solid rgba(255, 240, 200, 0.06); border-radius: 4px;
}
.next-num { font-family: 'DM Mono', monospace; font-size: 1.3rem; font-weight: 300; color: var(--accent); opacity: 0.35; line-height: 1.3; }
.next-text { font-size: 0.93rem; font-weight: 300; line-height: 1.75; color: var(--fg-muted); }
.next-text strong { color: var(--fg); font-weight: 500; }

/* ---- REFLECTIONS ---- */
.reflection-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.reflection-item { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.8rem; align-items: start; }
.reflection-arrow { font-family: 'DM Mono', monospace; color: var(--fg-dim); font-size: 0.85rem; line-height: 1.82; }
.reflection-text { font-size: 0.95rem; font-weight: 300; line-height: 1.8; color: var(--fg-muted); }
.reflection-text strong { color: var(--fg); font-weight: 500; }

/* ---- FIDELITY BLOCKS ---- */
.fidelity-block { margin-top: 2.5rem; }
.fidelity-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.fidelity-badge {
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.28rem 0.65rem; border-radius: 2px;
}
.fidelity-badge.lo  { color: var(--fg-dim);   background: var(--bg-3);                 border: 1px solid rgba(255, 240, 200, 0.08); }
.fidelity-badge.mid { color: var(--accent-2); background: rgba(42, 191, 191, 0.07);    border: 1px solid rgba(42, 191, 191, 0.2); }
.fidelity-badge.hi  { color: var(--accent);   background: rgba(232, 168, 56, 0.07);   border: 1px solid rgba(232, 168, 56, 0.2); }
.fidelity-desc { font-size: 0.84rem; font-weight: 300; color: var(--fg-muted); line-height: 1.5; margin-bottom: 1rem; }
.fidelity-divider {
  display: flex; align-items: center; gap: 0.75rem; margin: 2rem 0;
}
.fidelity-divider::before, .fidelity-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255, 240, 200, 0.055);
}
.fidelity-divider-text {
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-dim); white-space: nowrap;
}

/* ---- FIDELITY SWITCHER ---- */
.fidelity-switcher { margin-top: 2rem; }
.fidelity-tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(255, 240, 200, 0.07);
}
.fidelity-tab {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 1.1rem 0.75rem;
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; margin-bottom: -1px;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.4;
}
.fidelity-tab:hover { opacity: 0.7; }
.fidelity-tab.active { border-bottom-color: rgba(255, 240, 200, 0.35); opacity: 1; }
.fidelity-tab-desc {
  font-family: 'DM Mono', monospace; font-size: 0.58rem;
  letter-spacing: 0.1em; color: var(--fg-dim); text-transform: uppercase;
}
.fidelity-panels { padding-top: 1.25rem; }
.fidelity-panel { display: none; }
.fidelity-panel.active { display: block; animation: panelFadeIn 0.2s ease; }
@keyframes panelFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.usability-note {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.1em; color: var(--fg-dim); text-transform: uppercase;
  margin-bottom: 0.9rem;
}

/* ---- PERSONAS ---- */
.personas-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem;
}
.persona-card {
  background: var(--bg-2); border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(255, 240, 200, 0.06); padding: 1.4rem;
}
/* Photo variant (Google Maps) */
.persona-card.has-photo { padding: 0; }
.persona-photo {
  width: 100%; aspect-ratio: 3/2; object-fit: cover;
  object-position: center 15%;
  display: block; filter: grayscale(25%) brightness(0.85);
}
.persona-body { padding: 1.4rem; }
.persona-num {
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.35rem;
}
.persona-name { font-size: 1.05rem; font-weight: 700; color: var(--fg); margin-bottom: 0.55rem; }
.persona-quote {
  font-size: 0.88rem; font-weight: 300; line-height: 1.7;
  color: var(--fg-muted); font-style: italic;
  border-left: 2px solid rgba(42, 191, 191, 0.35);
  padding-left: 0.8rem; margin-bottom: 1.1rem;
}
.persona-role {
  font-size: 0.84rem; font-weight: 300; color: var(--fg-muted);
  line-height: 1.65; margin-bottom: 1.1rem;
}
.persona-flow { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.flow-step {
  font-family: 'DM Mono', monospace; font-size: 0.58rem;
  letter-spacing: 0.08em; color: var(--fg-dim);
  background: var(--bg-3); border-radius: 2px; padding: 0.25rem 0.45rem;
}
.flow-step.goal {
  color: var(--accent-2); border: 1px solid rgba(42, 191, 191, 0.2);
  background: rgba(42, 191, 191, 0.05);
}
.flow-arrow { color: var(--fg-dim); font-size: 0.65rem; }

/* ---- DECISIONS GRID ---- */
.decisions-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem;
}
.decision-card {
  background: var(--bg-2); border: 1px solid rgba(255, 240, 200, 0.06);
  border-radius: 4px; padding: 1.4rem;
}
.decision-tag {
  font-family: 'DM Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 0.4rem;
}
.decision-title { font-size: 1rem; font-weight: 600; color: var(--fg); margin-bottom: 0.55rem; line-height: 1.3; }
.decision-desc { font-size: 0.88rem; font-weight: 300; line-height: 1.72; color: var(--fg-muted); }

/* ---- RESEARCH GOALS ---- */
.goals-list { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 0.75rem; }
.goal-item { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.75rem; align-items: start; }
.goal-marker { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--accent-2); padding-top: 0.28rem; }
.goal-text { font-size: 0.92rem; font-weight: 300; line-height: 1.75; color: var(--fg-muted); }
.goal-text strong { color: var(--fg); font-weight: 500; }

/* ---- USABILITY DIVIDER ---- */
.usability-divider {
  margin: 3rem 0;
  background: var(--bg-2); border: 1px solid rgba(42, 191, 191, 0.14);
  border-radius: 4px; padding: 1.6rem 1.8rem;
  display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: start;
}
.usability-icon {
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-2); padding-top: 0.1rem;
}
.usability-title { font-size: 0.95rem; font-weight: 600; color: var(--fg); margin-bottom: 0.35rem; }
.usability-meta { font-size: 0.84rem; font-weight: 300; color: var(--fg-muted); line-height: 1.65; }

/* ---- CONFIDENTIALITY NOTE ---- */
.confidentiality-note {
  margin-top: 1.2rem;
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.08em; color: var(--fg-dim); line-height: 1.6;
}

/* ---- FOOTER NAV ---- */
.cs-footer-nav {
  padding: var(--section-pad) var(--side-pad);
  border-top: 1px solid rgba(255, 240, 200, 0.055);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.footer-nav-link {
  font-family: 'DM Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted); text-decoration: none;
  display: flex; align-items: center; gap: 0.45rem; transition: color 0.2s;
}
.footer-nav-link:hover { color: var(--accent); }
.footer-copy { font-family: 'DM Mono', monospace; font-size: 0.63rem; letter-spacing: 0.12em; color: var(--fg-dim); }

/* ---- ANIMATIONS ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- RESPONSIVE: TABLET (≤ 768px) ---- */
@media (max-width: 768px) {
  .screens-row-3 { grid-template-columns: repeat(2, 1fr); }
  .personas-grid { grid-template-columns: 1fr; }
  .decisions-grid { grid-template-columns: 1fr; }
  .usability-divider { grid-template-columns: 1fr; gap: 0.6rem; }
  .nav-right { gap: 1.2rem; }
}

/* ---- RESPONSIVE: MOBILE (≤ 640px) ---- */
@media (max-width: 640px) {
  .screens-row,
  .screens-2x2,
  .screens-row-3 { grid-template-columns: 1fr; }
  .cs-meta { gap: 1.2rem; }
  .nav-right a:last-child { display: none; }
  .cs-footer-nav { flex-direction: column; align-items: flex-start; }
  .proto-wrap iframe,
  .board-wrap iframe { min-height: 220px; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cs-eyebrow, .cs-title, .cs-subtitle, .cs-meta { opacity: 1; transform: none; }
}
