/* ═══════════════════════════════════════════════════════════
   jstnh.design — shared stylesheet
   Sections:
     1. Tokens + Reset
     2. Navigation
     3. Footer
     4. Shared CTA block
     5. Focus visible + Keyframes + Reduced motion
     6. Homepage
     7. Case study page
     8. About page
     9. Responsive
   ═══════════════════════════════════════════════════════════ */


/* ── 1. TOKENS + RESET ── */

/* Webfonts — local files from assets/fonts/ */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-VariableFont.ttf") format("truetype-variations");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Italic-VariableFont.ttf") format("truetype-variations");
  font-weight: 100 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/IBMPlexSerif-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/IBMPlexSerif-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/IBMPlexSerif-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/IBMPlexSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/IBMPlexSerif-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/IBMPlexSerif-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-LightItalic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Surface */
  --jh-ink:         #04020F;
  --jh-navy:        #0E1A26;
  --jh-navy-2:      #0D1620;
  --jh-navy-3:      #162030;

  /* Cream / light */
  --jh-paper:       #F5F0E8;
  --jh-paper-2:     #FBF8F2;
  --jh-mint:        #C8E8E0;
  --jh-mint-soft:   #E2F1ED;

  /* Brand accents */
  --jh-cyan:        #BFE1EB;
  --jh-cyan-soft:   #D6EDF4;
  --jh-teal:        #3A7A8E;
  --jh-teal-deep:   #28586A;

  /* Foreground on dark */
  --jh-fg-1:        #F5F0E8;
  --jh-fg-2:        #B0C8D4;
  --jh-fg-3:        #7C8B99;
  --jh-fg-4:        #5A6A78;

  /* Foreground on light */
  --jh-ink-1:       #0E1A26;
  --jh-ink-2:       #3B4856;
  --jh-ink-3:       #6E7A86;
  --jh-ink-4:       #C2C7CD;

  /* Tints */
  --jh-cyan-22:     rgba(191,225,235,0.22);
  --jh-teal-10:     rgba(58,122,142,0.10);
  --jh-teal-30:     rgba(58,122,142,0.30);
  --jh-paper-06:    rgba(245,240,232,0.06);
  --jh-paper-15:    rgba(245,240,232,0.15);

  /* Borders */
  --jh-border-soft: rgba(176,200,212,0.12);
  --jh-border-mid:  rgba(176,200,212,0.22);
  --jh-border-hair: rgba(255,255,255,0.04);

  /* Type families */
  --jh-font-serif:  "IBM Plex Serif", "DM Serif Display", Georgia, "Times New Roman", serif;
  --jh-font-sans:   "IBM Plex Sans", "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --jh-font-mono:   "DM Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale */
  --jh-size-display: clamp(40px, 5.5vw, 72px);
  --jh-size-h1:      clamp(34px, 4.2vw, 56px);
  --jh-size-h2:      clamp(28px, 3.4vw, 46px);
  --jh-size-h3:      clamp(20px, 2.0vw, 26px);
  --jh-size-h4:      clamp(16px, 1.4vw, 18px);
  --jh-size-large-p: clamp(16px, 1.6vw, 22px);
  --jh-size-body:    16px;
  --jh-size-small:   13px;
  --jh-size-micro:   11px;
  --jh-size-eyebrow: 11px;

  /* Line heights */
  --jh-lh-tight: 1.05;
  --jh-lh-snug:  1.2;
  --jh-lh-body:  1.6;
  --jh-lh-loose: 1.75;

  /* Letter spacing */
  --jh-track-eyebrow: 0.18em;
  --jh-track-tag:     0.12em;
  --jh-track-tight:   -0.02em;

  /* Spacing scale (8pt base) */
  --jh-s-1:  4px;
  --jh-s-2:  8px;
  --jh-s-3:  12px;
  --jh-s-4:  16px;
  --jh-s-5:  20px;
  --jh-s-6:  24px;
  --jh-s-7:  32px;
  --jh-s-8:  40px;
  --jh-s-9:  56px;
  --jh-s-10: 72px;
  --jh-s-11: 96px;

  /* Radius */
  --jh-r-xs:   4px;
  --jh-r-sm:   8px;
  --jh-r-md:   12px;
  --jh-r-lg:   16px;
  --jh-r-xl:   20px;
  --jh-r-2xl:  28px;
  --jh-r-pill: 999px;

  /* Shadows */
  --jh-shadow-1:  0 1px 2px rgba(4,2,15,0.20);
  --jh-shadow-2:  0 4px 16px rgba(4,2,15,0.28);
  --jh-shadow-3:  0 12px 40px rgba(4,2,15,0.40);
  --jh-glow-cyan: 0 0 0 1px rgba(191,225,235,0.22), 0 8px 32px rgba(191,225,235,0.06);

  /* Motion */
  --jh-ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --jh-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --jh-dur-fast: 180ms;
  --jh-dur-base: 280ms;
  --jh-dur-slow: 450ms;
}

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

html, body {
  min-height: 100vh;
  background: var(--jh-navy);
  color: var(--jh-fg-1);
  font-family: var(--jh-font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ── 2. NAVIGATION ── */

.nav {
  padding: 36px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.nav--fade-in {
  opacity: 0;
  animation: fadeIn 500ms var(--jh-ease-out) 200ms forwards;
}

.wordmark {
  font-family: var(--jh-font-serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--jh-fg-1);
  text-decoration: none;
}

.wordmark span { color: var(--jh-fg-3); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--jh-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  text-decoration: none;
  transition: color var(--jh-dur-base) var(--jh-ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--jh-fg-1); }


/* ── 3. FOOTER ── */

.footer {
  padding: 32px 56px;
  border-top: 1px solid var(--jh-border-soft);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.footer-ack {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--jh-fg-3);
  max-width: 460px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.footer-links a {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  text-decoration: none;
  transition: color var(--jh-dur-base) var(--jh-ease);
}

.footer-links a:hover { color: var(--jh-fg-1); }


/* ── 4. SHARED CTA BLOCK ── */

.cta-block {
  padding-top: 28px;
  border-top: 1px solid var(--jh-border-soft);
  margin-bottom: 64px;
}

.cta-text {
  font-family: var(--jh-font-serif);
  font-weight: 300;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--jh-fg-2);
  margin-bottom: 20px;
  text-wrap: pretty;
}

.cta-link {
  font-family: var(--jh-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--jh-dur-base) var(--jh-ease);
}

.cta-link:hover { opacity: 0.72; }


/* ── 5. FOCUS VISIBLE + KEYFRAMES + REDUCED MOTION ── */

:focus-visible {
  outline: 2px solid var(--jh-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

@keyframes fadeIn { to { opacity: 1; } }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes lineReveal { to { opacity: 1; transform: translateY(0); } }

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes thinkDot {
  0%, 60%, 100% { opacity: 0; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-4px); }
}

@keyframes photoDrift {
  0%   { transform: translate(0%,    0%)    scale(1.00); }
  25%  { transform: translate(-1.5%, 0.8%)  scale(1.02); }
  50%  { transform: translate(-2.5%, -1%)   scale(1.04); }
  75%  { transform: translate(-1%,   -2%)   scale(1.03); }
  100% { transform: translate(0.5%,  -0.5%) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay:    0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay:    0.01ms !important;
  }
  [class*="reveal"],
  .hook-line, .who-label, .branch-btn,
  .nav--fade-in, .back-btn, .branch-eyebrow,
  .word, .branch-body, .cs-item, .cta-block,
  .cs-reveal, .section-reveal,
  .cs-stat, .cs-image-row > .cs-visual, .cs-image-grid > .cs-visual {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ── 6. HOMEPAGE ── */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 56px 96px;
  max-width: 800px;
  position: relative;
  z-index: 2;
}

/* Hook lines */
.hook {
  font-family: var(--jh-font-serif);
  font-weight: 100;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  margin-bottom: 56px;
}

.hook-line {
  display: block;
  opacity: 0;
  transform: translateY(10px);
}

.hook-line.reveal {
  animation: lineReveal 600ms var(--jh-ease-out) forwards;
}

/* Cursor */
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--jh-cyan);
  vertical-align: text-bottom;
  margin-left: 3px;
  opacity: 0;
  border-radius: 1px;
}

.cursor.blink {
  animation: cursorBlink 500ms step-end 3;
}

.cursor.on  { opacity: 1; }
.cursor.off { opacity: 0; }

/* Who label + options */
.who-label {
  font-family: var(--jh-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  margin-bottom: 16px;
  opacity: 0;
}

.who-label.reveal {
  animation: fadeInUp 400ms var(--jh-ease-out) forwards;
}

.branch-options {
  display: flex;
  flex-direction: column;
}

.branch-btn {
  font-family: var(--jh-font-serif);
  font-weight: 300;
  font-size: clamp(18px, 2.2vw, 26px);
  color: var(--jh-fg-2);
  background: none;
  border: none;
  border-bottom: 1px solid var(--jh-border-soft);
  padding: 18px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: color var(--jh-dur-base) var(--jh-ease),
              border-color var(--jh-dur-base) var(--jh-ease);
  width: 100%;
  opacity: 0;
}

.branch-btn.reveal {
  animation: fadeInUp 400ms var(--jh-ease-out) forwards;
}

.branch-btn::before {
  content: '→';
  font-family: var(--jh-font-mono);
  font-size: 14px;
  color: var(--jh-fg-4);
  transition: color var(--jh-dur-base) var(--jh-ease),
              transform var(--jh-dur-base) var(--jh-ease-out);
  display: inline-block;
}

.branch-btn:hover {
  color: var(--jh-fg-1);
  border-bottom-color: rgba(191,225,235,0.3);
}

.branch-btn:hover::before {
  color: var(--jh-cyan);
  transform: translateX(5px);
}

/* Opening hide */
.opening {
  transition: opacity var(--jh-dur-slow) var(--jh-ease),
              transform var(--jh-dur-slow) var(--jh-ease-out);
}

.opening.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

/* Thinking state */
.thinking {
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 64px;
}

.thinking.active { display: flex; }

.thinking-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--jh-cyan);
  opacity: 0;
  animation: thinkDot 1.2s var(--jh-ease) infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

/* Branch content */
.branch-content { display: none; }
.branch-content.active { display: block; }

.back-btn {
  font-family: var(--jh-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 64px;
  padding: 0;
  transition: color var(--jh-dur-base) var(--jh-ease);
  opacity: 0;
  animation: fadeIn 300ms var(--jh-ease-out) 100ms forwards;
}

.back-btn:hover { color: var(--jh-fg-1); }

.branch-eyebrow {
  font-family: var(--jh-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-cyan);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeIn 300ms var(--jh-ease-out) 200ms forwards;
}

.branch-heading {
  font-family: var(--jh-font-serif);
  font-weight: 300;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--jh-fg-1);
  margin-bottom: 28px;
  max-width: 640px;
  min-height: 1.2em;
}

/* Streamed words */
.word {
  display: inline;
  opacity: 0;
  transition: opacity 120ms ease;
}

.word.visible { opacity: 1; }

.branch-body {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.7;
  color: var(--jh-fg-2);
  max-width: 580px;
  margin-bottom: 48px;
  text-wrap: pretty;
  opacity: 0;
}

.branch-body a {
  color: var(--jh-cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity var(--jh-dur-fast) var(--jh-ease);
}

.branch-body a:hover { opacity: 0.72; }

/* Case study list */
.cs-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 56px;
}

.cs-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--jh-border-soft);
  text-decoration: none;
  opacity: 0;
  transition: border-color var(--jh-dur-base) var(--jh-ease);
}

.cs-item:hover { border-bottom-color: rgba(191,225,235,0.28); }
.cs-item:hover .cs-title { color: var(--jh-fg-1); }
.cs-item:hover .cs-arrow { color: var(--jh-cyan); transform: translateX(4px); }

.cs-meta { display: flex; flex-direction: column; gap: 5px; }

.cs-tag {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
}

.cs-title {
  font-family: var(--jh-font-serif);
  font-weight: 400;
  font-size: 17px;
  color: var(--jh-fg-2);
  transition: color var(--jh-dur-base) var(--jh-ease);
}

.cs-arrow {
  font-size: 15px;
  color: var(--jh-fg-4);
  transition: color var(--jh-dur-base) var(--jh-ease),
              transform var(--jh-dur-base) var(--jh-ease-out);
}

/* Background canvas */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Photography layer */
.bg-photo-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 2s ease-out 0.5s forwards;
}

.bg-photo {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  background-image:
    linear-gradient(160deg,
      #0a1824 0%,
      #0e2030 18%,
      #06111a 38%,
      #122434 55%,
      #081218 72%,
      #0d1e2c 88%,
      #040d14 100%
    );
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  mix-blend-mode: luminosity;
  animation: photoDrift 55s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-photo-2 {
  animation-duration: 75s;
  animation-direction: alternate-reverse;
  opacity: 0.28;
  background-image:
    linear-gradient(220deg,
      #06101a 0%,
      #0d2030 20%,
      #081520 40%,
      #14283a 60%,
      #04101c 80%,
      #0a1c2a 100%
    );
}


/* ── 7. CASE STUDY PAGE ── */

.cs-page { position: relative; z-index: 2; }

.cs-back {
  display: block;
  font-family: var(--jh-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  text-decoration: none;
  padding: 0 56px;
  margin-bottom: 64px;
  transition: color var(--jh-dur-base) var(--jh-ease);
}
.cs-back:hover { color: var(--jh-fg-1); }

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.cs-tag-pill {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
}
.cs-tag-pill:not(:last-child) { margin-right: 14px; }
.cs-tag-pill:not(:last-child)::after {
  content: '/';
  margin-left: 14px;
  color: var(--jh-fg-4);
}

.cs-headline {
  font-family: var(--jh-font-serif);
  font-weight: 100;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--jh-fg-1);
  max-width: 840px;
  margin-bottom: 32px;
  text-wrap: balance;
}

.cs-context {
  font-family: var(--jh-font-sans);
  font-weight: 300;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
  color: var(--jh-fg-2);
  max-width: 640px;
  margin-bottom: 64px;
  text-wrap: pretty;
}

.cs-visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--jh-navy-3);
  border-radius: var(--jh-r-xl);
  margin-bottom: 64px;
  overflow: hidden;
  position: relative;
}
.cs-visual img, .cs-visual video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-diagram > .cs-visual img { object-fit: contain; background: var(--jh-navy-3); }
.cs-visual--placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--jh-border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--jh-border-soft) 1px, transparent 1px);
  background-size: 40px 40px;
}

.cs-image-full {
  margin-bottom: 64px;
}
.cs-image-full > .cs-visual {
  margin-bottom: 0;
}

.cs-image-row {
  display: flex;
  gap: 24px;
  margin-bottom: 64px;
}
.cs-image-row > .cs-visual {
  flex: 1 1 0;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--jh-dur-slow) var(--jh-ease-out),
              transform var(--jh-dur-slow) var(--jh-ease-out);
}
.cs-reveal.visible .cs-image-row > .cs-visual { opacity: 1; transform: none; }
.cs-image-row > .cs-visual:nth-child(1) { transition-delay: 0ms; }
.cs-image-row > .cs-visual:nth-child(2) { transition-delay: 60ms; }
.cs-image-row > .cs-visual:nth-child(3) { transition-delay: 120ms; }
.cs-image-row > .cs-visual:nth-child(4) { transition-delay: 180ms; }

.cs-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 64px;
}
.cs-image-grid > .cs-visual {
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--jh-dur-slow) var(--jh-ease-out),
              transform var(--jh-dur-slow) var(--jh-ease-out);
}
.cs-reveal.visible .cs-image-grid > .cs-visual { opacity: 1; transform: none; }
.cs-image-grid > .cs-visual:nth-child(1) { transition-delay: 0ms; }
.cs-image-grid > .cs-visual:nth-child(2) { transition-delay: 60ms; }
.cs-image-grid > .cs-visual:nth-child(3) { transition-delay: 120ms; }
.cs-image-grid > .cs-visual:nth-child(4) { transition-delay: 180ms; }

.cs-diagram {
  max-width: 640px;
  margin: 0 auto 64px;
}
.cs-diagram > .cs-visual {
  margin-bottom: 0;
  aspect-ratio: 4 / 3;
}

.cs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--jh-border-soft);
}
.cs-col-label {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  margin-bottom: 16px;
}
.cs-col-body {
  font-family: var(--jh-font-sans);
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.7;
  color: var(--jh-fg-2);
  text-wrap: pretty;
}

/* Single-column narrative block (e.g. an "Outcome" section) reusing
   the cs-col-label/cs-col-body pair outside of a cs-two-col grid. */
.cs-outcome {
  max-width: 640px;
  margin-bottom: 64px;
}
.cs-outcome .cs-col-body + .cs-col-body {
  margin-top: 16px;
}

/* Small muted attribution/disclosure note (e.g. client confidentiality). */
.cs-disclosure {
  font-family: var(--jh-font-sans);
  font-size: 13px;
  font-style: italic;
  color: var(--jh-fg-3);
  max-width: 640px;
  margin-bottom: 64px;
}

.cs-skills {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 64px;
}
.cs-skill-tag {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jh-cyan);
}
.cs-skill-tag:not(:last-child) { margin-right: 14px; }
.cs-skill-tag:not(:last-child)::after {
  content: '/';
  margin-left: 14px;
  color: var(--jh-fg-4);
}

.cs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 48px 0;
  border-top: 1px solid var(--jh-border-soft);
  border-bottom: 1px solid var(--jh-border-soft);
  margin-bottom: 64px;
}
.cs-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--jh-dur-slow) var(--jh-ease-out),
              transform var(--jh-dur-slow) var(--jh-ease-out);
}
.cs-reveal.visible .cs-stat { opacity: 1; transform: none; }
.cs-stat:nth-child(1) { transition-delay: 0ms; }
.cs-stat:nth-child(2) { transition-delay: 40ms; }
.cs-stat:nth-child(3) { transition-delay: 80ms; }
.cs-stat:nth-child(4) { transition-delay: 120ms; }
.cs-stat:nth-child(5) { transition-delay: 160ms; }
.cs-stat-value {
  font-family: var(--jh-font-serif);
  font-weight: 300;
  font-size: clamp(34px, 4.8vw, 60px);
  line-height: 1;
  color: var(--jh-fg-1);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cs-stat-label {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
}

.cs-pullquote {
  font-family: var(--jh-font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.45;
  color: var(--jh-fg-2);
  max-width: 680px;
  padding: 40px 0 40px 32px;
  border-left: 2px solid var(--jh-teal);
  margin-bottom: 80px;
}

.cs-next {
  display: flex;
  justify-content: flex-end;
  padding: 40px 0;
  border-top: 1px solid var(--jh-border-soft);
}
.cs-next-link {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-decoration: none;
  transition: opacity var(--jh-dur-base) var(--jh-ease);
}
.cs-next-link:hover { opacity: 0.72; }
.cs-next-label {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
}
.cs-next-title {
  font-family: var(--jh-font-serif);
  font-weight: 300;
  font-size: 18px;
  color: var(--jh-fg-2);
}

.cs-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 550ms var(--jh-ease-out), transform 550ms var(--jh-ease-out);
}
.cs-reveal.visible { opacity: 1; transform: translateY(0); }

.cs-container {
  max-width: 900px;
  padding: 64px 56px 80px;
  margin: 0 auto;
}


/* ── 8. ABOUT PAGE ── */

.about-container {
  max-width: 680px;
  padding: 64px 56px 96px;
  position: relative;
  z-index: 2;
}
.about-eyebrow {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  margin-bottom: 32px;
}
.about-headline {
  font-family: var(--jh-font-serif);
  font-weight: 100;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--jh-fg-1);
  margin-bottom: 48px;
  text-wrap: balance;
}
.about-section {
  margin-bottom: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--jh-border-soft);
}
.about-section-label {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  margin-bottom: 16px;
}
.about-body {
  font-family: var(--jh-font-sans);
  font-weight: 300;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.72;
  color: var(--jh-fg-2);
  text-wrap: pretty;
}
.about-body + .about-body { margin-top: 20px; }
.about-body a {
  color: var(--jh-cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity var(--jh-dur-fast) var(--jh-ease);
}
.about-body a:hover { opacity: 0.72; }
.about-thought-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 20px;
}
.about-thought-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--jh-border-soft);
  text-decoration: none;
  transition: border-color var(--jh-dur-base) var(--jh-ease);
}
.about-thought-link:hover { border-bottom-color: var(--jh-border-mid); }
.about-thought-link:hover .about-thought-title { color: var(--jh-fg-1); }
.about-thought-type {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jh-fg-3);
  min-width: 80px;
}
.about-thought-title {
  font-family: var(--jh-font-serif);
  font-weight: 300;
  font-size: 16px;
  color: var(--jh-fg-2);
  transition: color var(--jh-dur-base) var(--jh-ease);
}


/* ── 8B. WORK INDEX ── */

.cs-work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  row-gap: 56px;
  margin: 24px 0 96px;
}

/* Cards animate in via the parent .cs-reveal, staggered like .cs-stat.
   .cs-item already has opacity: 0 as its base state. */
.cs-work-grid .cs-item {
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 0;
  border-bottom: none;
  transform: translateY(10px);
  transition: opacity var(--jh-dur-slow) var(--jh-ease-out),
              transform var(--jh-dur-slow) var(--jh-ease-out);
}

/* Card thumbnail — a .cs-visual scaled to card context */
.cs-work-grid .cs-thumb {
  margin-bottom: 0;
  border: none;
}
.cs-item--soon .cs-thumb { opacity: 0.45; }

.cs-work-grid .cs-thumb img {
  transition: transform var(--jh-dur-slow) var(--jh-ease-out);
}
.cs-work-grid .cs-item:hover .cs-thumb img { transform: scale(1.045); }

/* Meta + arrow row beneath the thumbnail */
.cs-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.cs-reveal.visible .cs-work-grid .cs-item { opacity: 1; transform: none; }
.cs-work-grid .cs-item:nth-child(1) { transition-delay: 0ms; }
.cs-work-grid .cs-item:nth-child(2) { transition-delay: 40ms; }
.cs-work-grid .cs-item:nth-child(3) { transition-delay: 80ms; }
.cs-work-grid .cs-item:nth-child(4) { transition-delay: 120ms; }
.cs-work-grid .cs-item:nth-child(5) { transition-delay: 160ms; }
.cs-work-grid .cs-item:nth-child(6) { transition-delay: 200ms; }
.cs-work-grid .cs-item:nth-child(7) { transition-delay: 240ms; }
.cs-work-grid .cs-item:nth-child(8) { transition-delay: 280ms; }
.cs-work-grid .cs-item:nth-child(9) { transition-delay: 320ms; }
.cs-work-grid .cs-item:nth-child(10) { transition-delay: 360ms; }

/* Category tag row inside a card — reuse .cs-tags without its block margin */
.cs-work-grid .cs-tags {
  margin-bottom: 0;
  transition: opacity var(--jh-dur-base) var(--jh-ease);
}
.cs-work-grid .cs-item:hover .cs-tags { opacity: 0.5; }

/* Muted, non-clickable variant for case studies whose page isn't built yet.
   Muting is done via child colors, NOT container opacity — the global
   prefers-reduced-motion block forces opacity: 1 !important on .cs-item,
   which would un-mute an opacity-based treatment. */
.cs-item--soon { pointer-events: none; }
.cs-item--soon .cs-title { color: var(--jh-fg-3); }
.cs-item--soon .cs-tag-pill { color: var(--jh-fg-4); }

.cs-soon {
  font-family: var(--jh-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jh-fg-4);
  flex-shrink: 0;
}


/* ── 9. RESPONSIVE ── */

@media (max-width: 1024px) {
  .cs-image-row  { flex-wrap: wrap; }
  .cs-image-row > .cs-visual { flex: 1 1 calc(50% - 12px); }
  .cs-work-grid  { column-gap: 32px; }
}

@media (max-width: 768px) {
  .nav        { padding: 28px 24px; }
  .nav-links  { gap: 20px; }
  .footer     { padding: 28px 24px; flex-direction: column; align-items: flex-start; }
  .cs-container  { padding: 40px 24px 64px; }
  .cs-back       { padding: 0 24px; margin-bottom: 40px; }
  .cs-two-col    { grid-template-columns: 1fr; gap: 32px; }
  .cs-stats      { gap: 24px; }
  .about-container { padding: 40px 24px 72px; }
  .cs-image-row  { flex-direction: column; }
  .cs-image-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main { padding: 0 24px 72px; }
  .branch-btn { font-size: clamp(16px, 4vw, 22px); }
  .cs-work-grid { grid-template-columns: 1fr; }
}
