/* ─── CASE STUDY PAGES: Design System Override ─── */

/* ─── LAYOUT ─── */
html { scroll-behavior: smooth; height: auto !important; scroll-padding-top: 104px; }
body { overflow: visible !important; height: auto !important; }
#cloud-canvas, .cursor, .particles, .fog-container { display: none; }
body, body * { cursor: auto !important; }
a, button, [role="button"], .case-nav-link, .cs-back { cursor: pointer !important; }

.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 16px 32px;
  background: linear-gradient(180deg, var(--bg) 60%, transparent 100%);
  opacity: 1; transform: none;
}

/* ─── HERO ─── */
.cs-hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 112px 40px 56px;
  border-bottom: 1px solid var(--rule);
}

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px 6px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 34px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.cs-back:hover { color: var(--accent); transform: translateX(-3px); }
.cs-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.case-header { flex-shrink: unset; text-align: left; padding: 0; }

.case-label {
  display: block;
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 18px;
}

.case-title {
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-size: clamp(34px, 5.6vw, 74px);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--fg);
  text-wrap: balance;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 28px;
  text-transform: uppercase;
}
.case-meta-divider { opacity: 0.3; padding: 0 10px; }

.case-visit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ice);
  border: 1px solid var(--rule-strong);
  padding: 12px 22px;
  border-radius: 2px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.case-visit:hover {
  border-color: #FFA83A;
  color: #C6D6F5;
  transform: translateY(-2px);
}

/* ─── OVERVIEW STRIP ─── */
.case-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  width: 100%;
}

.case-section:has(> .case-overview) { padding-top: 0; padding-bottom: 0; }

.case-overview-item {
  padding: 28px 24px 28px 0;
  border: none;
  border-right: 1px solid var(--rule);
  background: none;
  border-radius: 0;
}
.case-overview-item:last-child { border-right: none; }

.case-overview-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.case-overview-value {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── CONTENT SECTIONS ─── */
.case-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 40px;
  border-bottom: 1px solid var(--rule);
}

.case-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}

.case-section-title {
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-size: clamp(20px, 2.4vw, 31px);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--fg);
  text-wrap: balance;
}

.case-section-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 68ch;
  text-wrap: pretty;
}

/* ─── STEPS: clean list style ─── */
.case-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 32px;
}

.case-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
  padding: 24px 0;
  border: none;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-top-color 0.2s;
}
.case-step:hover { border-top-color: rgba(255, 168, 58, 0.25); background: none; }

.case-step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 6px;
}

/* h3 is the correct level under the section h2; h4 retained so the
   older case studies keep their styling until they're migrated. */
.case-step-content h3,
.case-step-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: #EEF4FF;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.case-step-content p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* ─── SCREENSHOTS ─── */
.case-screenshot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 32px;
}

.case-screenshot-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.case-screenshot {
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s;
}
.case-screenshot:hover { border-color: rgba(255, 168, 58, 0.3); }

@media (hover: none) {
  .case-visit:hover, .case-cta-btn:hover, .cs-back:hover { transform: none; }
}

.case-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0.6;
  padding: 10px 14px;
}

/* ─── IMPACT STATS ─── */
.case-impact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 32px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.case-impact-stat {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  background: rgba(126, 158, 224, 0.03);
}
.case-impact-stat:last-child { border-right: none; }

.impact-val {
  display: block;
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: 8px;
}

.impact-lbl {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── PROJECT NAV ─── */
.case-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 920px;
  margin: 0 auto 80px;
  padding: 0 40px;
  border-top: 1px solid var(--rule);
}

.case-nav-spacer { flex: unset; }

.case-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 32px 0;
  text-decoration: none;
  border: none;
  border-radius: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: opacity 0.2s;
}
.case-nav-link:last-child { text-align: right; }
.case-nav-link:hover { opacity: 0.75; border: none; background: none; box-shadow: none; transform: none; }

.case-nav-label {
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #FFA83A;
}

.case-nav-title {
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #EEF4FF;
}


/* ─── CLIENT MESSAGES ───
   A transcript of what the client actually sent, not a mocked-up phone
   screenshot. Message-shaped enough to read as messages, but set in the
   site's own type so it does not cosplay someone else's chat app. */
.case-messages {
  margin: 28px 0 0;
  padding: 22px 22px 20px;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  background: var(--strata);
  border-radius: 2px;
}

.case-messages-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.case-messages-label { color: var(--accent); }
.case-messages-meta { color: var(--dim); }

.case-messages-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.case-message {
  max-width: 46ch;
  margin: 0;
  padding: 11px 15px;
  border-radius: 2px;
  background: rgba(126, 158, 224, 0.09);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (max-width: 700px) {
  .case-messages { padding: 18px 16px 16px; }
  .case-message { font-size: 14px; max-width: none; }
}

/* ─── FOOTER ───
   Was two lines of decorative text, which made every page below the home
   page a dead end. It now carries the same index the home page's contact
   panel does, so any page can reach any other. */
.site-footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 40px 64px;
  border-top: 1px solid var(--rule);
}

.footer-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 32px;
  text-align: left;
}

.footer-index-group { display: flex; flex-direction: column; gap: 2px; }

.footer-index-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 8px;
}

.footer-index a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 32px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-index a:hover { color: var(--accent); }
.footer-index a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.footer-index .ext { font-size: 0.85em; opacity: 0.7; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.footer-copy, .footer-tagline { font-size: inherit; color: inherit; opacity: 1; letter-spacing: inherit; }


@media (max-width: 700px) {
  .site-footer { padding: 36px 20px 48px; }
  .footer-index { grid-template-columns: 1fr; gap: 22px; }
}

/* ─── SCROLL ANIMATION ───
   The hidden start state is applied only once the reveal script has run and
   claimed it, so a blocked script, a failed CDN, or JS off all still render
   readable content. */
.js-reveal .anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-reveal .anim.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .js-reveal .anim { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ── Press feedback ──
   Declared after the reveal rules above, which set opacity and transform at
   the same specificity and would otherwise win. */
.case-visit:active,
.case-cta-btn:active,
.lp-btn:active { transform: scale(var(--press-scale)); transition-duration: var(--press-duration); }

.cs-back:active,
.case-nav-link:active,
.footer-index a:active,
.case-section-text a:active,
.case-related a:active { opacity: 0.62; transition-duration: var(--press-duration); }

.case-screenshot:active { transform: scale(var(--press-scale-lg)); transition-duration: var(--press-duration); }

/* ─── RESPONSIVE ─── */
@media (max-width: 700px) {
  .top-bar { padding: 12px 20px; }
  .cs-hero { padding: 88px 20px 40px; }
  .case-overview { grid-template-columns: 1fr 1fr; }
  .case-overview-item { padding-right: 16px; margin-right: 16px; }
  .case-section { padding: 40px 20px; }
  .case-screenshot-grid.two-col { grid-template-columns: 1fr; }
  .case-nav { padding: 0 20px; }
  .case-impact-stats { grid-template-columns: 1fr; }
  .case-impact-stat { border-right: none; border-bottom: 1px solid var(--rule); }
  .case-impact-stat:last-child { border-bottom: none; }
}

@media (min-width: 1024px) {
  .cs-hero { padding: 128px 80px 64px; max-width: 1080px; }
  .case-section { max-width: 1080px; padding: 64px 80px; }
  .case-nav { max-width: 1080px; padding: 0 80px; }
}

/* Contextual service links at the foot of a case study. Quieter than body
   copy: this is navigation, not part of the story. */
.case-related {
  font-size: 14px;
  padding-top: 22px;
  border-top: 1px solid rgba(126, 158, 224, 0.12);
}
.case-related a { color: #C6D6F5; }

/* ─── CLOSING CTA ───
   Booking prompt at the end of a case study. Deliberately quieter than the
   landing-page .final-cta: the case study has already done the persuading,
   so this only needs to be the obvious next step. */
.case-cta {
  max-width: 920px;
  margin: 0 auto;
  padding: 52px 40px 44px;
  text-align: center;
  /* No bottom rule: the .case-related line that follows carries its own
     border-top, and two rules 50px apart read as a mistake. */
}

.case-cta-title {
  font-family: var(--font-display); font-stretch: var(--display-wide);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #EEF4FF;
  margin: 0 0 12px;
}

.case-cta-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 26px;
}

.case-cta-text a {
  color: #C6D6F5;
  text-decoration: none;
  border-bottom: 1px solid rgba(198, 214, 245, 0.35);
  transition: border-color 0.2s;
}

.case-cta-text a:hover { border-color: rgba(198, 214, 245, 0.9); }

.case-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border-radius: 2px;
  background: var(--accent);
  color: #1A1103;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.case-cta-btn:hover { background: var(--accent-light); transform: translateY(-2px); }

.case-cta-btn:focus-visible { outline: 2px solid #FFC46B; outline-offset: 3px; }

.case-cta-alt {
  font-size: 13px;
  color: var(--dim);
  margin: 16px 0 0;
}

.case-cta-alt a { color: #C6D6F5; }

@media (max-width: 700px) {
  .case-cta { padding: 40px 20px 36px; }
  .case-cta-btn { width: 100%; }
}
