/* ==========================================================================
   ZenMode case study layer
   Sits on top of zenmode.css. Adds the portfolio case-study components:
   metrics, sub-nav, overview, insights, process, tokens, modes, modules,
   touchpoints, sticker sheet, PostHog analytics, reflections.
   ========================================================================== */

:root {
  --zen-base: #00c700;   /* Color-zen-base, brand focus / hover */
  --zen-dark: #007700;   /* color-zen-dark, solid brand buttons */
  --zen-neon: #24ff24;   /* dark-mode brand accent */
  --amber-mode: #ffbe55;
  --red-mode: #ff694c;
  --card: rgba(255,255,255,.022);
  --card-line: rgba(255,255,255,.1);
}

/* --- shared type helpers ------------------------------------------------- */
.lede { max-width: 620px; color: #9aa19a; font-size: clamp(17px,1.55vw,21px); line-height: 1.68; }
.mono-label { color: #747b74; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.section-alt { background: #0b0d0b; }
.section-line { border-top: 1px solid rgba(255,255,255,.06); }

/* --- hero metrics + sub nav --------------------------------------------- */
.case-metrics {
  display: grid; margin-top: 60px; gap: 1px;
  grid-template-columns: repeat(4,1fr);
  border: 1px solid var(--card-line); border-radius: 22px; overflow: hidden;
  background: var(--card-line);
}
.case-metric { padding: 26px 24px; background: #0a0c0a; }
.case-metric strong { display: block; font-family: "Manrope", sans-serif; font-size: clamp(26px,3vw,40px); font-weight: 500; letter-spacing: -.04em; }
.case-metric strong em { color: var(--zen-neon); font-style: normal; }
.case-metric span { display: block; margin-top: 8px; color: #7d847d; font-size: 12px; line-height: 1.5; }

.case-subnav {
  position: sticky; top: 88px; z-index: 40;
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 44px;
}
.case-subnav a {
  padding: 9px 15px; border: 1px solid var(--card-line); border-radius: 999px;
  color: #aab0aa; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .04em;
  background: rgba(9,11,9,.7); backdrop-filter: blur(12px);
  transition: color 180ms, border-color 180ms, background 180ms;
}
.case-subnav a:hover { color: #10130d; border-color: var(--zen-neon); background: var(--zen-neon); }

/* --- overview facts ------------------------------------------------------ */
.fact-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.fact-card { padding: 28px 26px; border: 1px solid var(--card-line); border-radius: 22px; background: var(--card); }
.fact-card span { color: var(--zen-neon); font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.fact-card strong { display: block; margin: 14px 0 10px; font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.fact-card p { margin: 0; color: #868d86; font-size: 14px; line-height: 1.62; }

/* --- big pull quote ------------------------------------------------------ */
.case-quote {
  margin: 42px 0 0; padding-left: 26px; border-left: 2px solid var(--zen-neon);
  font-family: "Manrope", sans-serif; font-size: clamp(24px,3vw,38px); font-weight: 500;
  line-height: 1.24; letter-spacing: -.03em; color: #eef2ea;
}
.case-quote small { display: block; margin-top: 18px; color: #7d847d; font-family: "DM Sans", sans-serif; font-size: 14px; font-weight: 400; letter-spacing: 0; }

.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 60px; align-items: start; }
.stack-copy p { color: #9aa19a; font-size: 17px; line-height: 1.72; }
.stack-copy p + p { margin-top: 18px; }

/* --- insight cards ------------------------------------------------------- */
.insight-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.insight-card { padding: 30px 28px; border: 1px solid var(--card-line); border-radius: 24px; background: var(--card); transition: border-color 220ms, transform 260ms var(--ease); }
.insight-card:hover { border-color: rgba(36,255,36,.4); transform: translateY(-4px); }
.insight-card b { color: var(--zen-neon); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.insight-card h3 { margin: 16px 0 10px; font-family: "Manrope", sans-serif; font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.insight-card p { margin: 0; color: #878e87; font-size: 14px; line-height: 1.62; }

/* --- process rail -------------------------------------------------------- */
.process-rail { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; }
.process-step { position: relative; padding: 26px 22px; border: 1px solid var(--card-line); border-radius: 20px; background: var(--card); }
.process-step span { color: var(--zen-neon); font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .12em; }
.process-step strong { display: block; margin: 14px 0 8px; font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 500; }
.process-step p { margin: 0; color: #868d86; font-size: 13px; line-height: 1.55; }

/* --- token board --------------------------------------------------------- */
.mode-switch { display: inline-flex; margin-top: 10px; padding: 4px; gap: 4px; border: 1px solid var(--card-line); border-radius: 999px; background: rgba(255,255,255,.03); }
.mode-switch button {
  padding: 8px 18px; border: 0; border-radius: 999px; cursor: pointer;
  color: #aab0aa; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .06em; background: transparent;
  transition: color 160ms, background 160ms;
}
.mode-switch button.is-active { color: #10130d; background: var(--zen-neon); }

.token-board { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 34px; }
.token-chip {
  overflow: hidden; border: 1px solid var(--card-line); border-radius: 18px; background: #0a0c0a;
  transition: transform 240ms var(--ease), border-color 200ms;
}
.token-chip:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.28); }
.token-swatch { height: 92px; border-bottom: 1px solid rgba(0,0,0,.35); }
.token-meta { padding: 16px 16px 18px; }
.token-meta code { color: #eef2ea; font-family: "JetBrains Mono", monospace; font-size: 13px; }
.token-meta .hex { display: block; margin-top: 4px; color: #747b74; font-family: "JetBrains Mono", monospace; font-size: 11px; text-transform: uppercase; }
.token-meta p { margin: 10px 0 0; color: #868d86; font-size: 12px; line-height: 1.5; }
/* dark-mode token values (default). data-token-mode="light" swaps them. */
[data-token-mode="light"] .swatch-bg-1 { background: #ffffff; }
[data-token-mode="light"] .swatch-bg-2 { background: #f5f5f5; }
[data-token-mode="light"] .swatch-surface { background: #ffffff; box-shadow: inset 0 0 0 1px #e5e5e5; }
[data-token-mode="light"] .swatch-text { background: #000000; }
[data-token-mode="light"] .swatch-text-2 { background: #525252; }
.swatch-bg-1 { background: #000000; }
.swatch-bg-2 { background: #1a1a1a; }
.swatch-surface { background: #1a1a1a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.swatch-text { background: #ffffff; }
.swatch-text-2 { background: #a3a3a3; }
.swatch-brand { background: #00c700; }
.swatch-brand-2 { background: #007700; }
.swatch-focus { background: #24ff24; }
.token-note { margin-top: 20px; color: #747b74; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.token-note a { color: var(--zen-neon); border-bottom: 1px solid rgba(36,255,36,.4); }

/* --- device / ambient modes --------------------------------------------- */
.mode-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.mode-card { position: relative; overflow: hidden; padding: 34px 30px 30px; border: 1px solid var(--card-line); border-radius: 26px; background: #0a0c0a; }
.mode-card .ring { width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--_c); box-shadow: 0 0 34px var(--_c); }
.mode-card--focus { --_c: var(--zen-base); }
.mode-card--reminder { --_c: var(--amber-mode); }
.mode-card--break { --_c: var(--red-mode); }
.mode-card h3 { margin: 26px 0 8px; font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.mode-card h3 small { display: block; margin-top: 4px; color: var(--_c); font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }
.mode-card p { margin: 0; color: #878e87; font-size: 14px; line-height: 1.62; }

/* --- modules ------------------------------------------------------------- */
.module-block { display: grid; grid-template-columns: 90px minmax(0,1fr) minmax(0,1fr); gap: 40px; align-items: center; padding: 46px 0; border-top: 1px solid rgba(255,255,255,.08); }
.module-block:last-child { border-bottom: 1px solid rgba(255,255,255,.08); }
.module-tag { font-family: "Manrope", sans-serif; font-size: 40px; font-weight: 500; color: var(--zen-neon); letter-spacing: -.04em; }
.module-body h3 { margin: 0 0 14px; font-family: "Manrope", sans-serif; font-size: clamp(26px,3vw,38px); font-weight: 500; letter-spacing: -.03em; line-height: 1.05; }
.module-body p { margin: 0; color: #9aa19a; font-size: 16px; line-height: 1.68; }
.module-flow { display: flex; flex-wrap: wrap; gap: 8px; }
.module-flow span { padding: 9px 13px; border: 1px solid var(--card-line); border-radius: 10px; color: #cfd4cd; font-family: "JetBrains Mono", monospace; font-size: 11px; background: rgba(255,255,255,.02); }
.module-flow i { align-self: center; color: #4c524c; font-style: normal; }

/* --- touchpoints (6) ----------------------------------------------------- */
.touchpoint-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.touchpoint { position: relative; overflow: hidden; padding: 30px 28px; min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--card-line); border-radius: 24px; background: var(--card); transition: border-color 220ms, transform 260ms var(--ease); }
.touchpoint:hover { border-color: rgba(36,255,36,.42); transform: translateY(-5px); }
.touchpoint .tp-num { color: var(--zen-neon); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.touchpoint h3 { margin: 0 0 8px; font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.touchpoint p { margin: 0; color: #868d86; font-size: 14px; line-height: 1.6; }
.touchpoint .tp-meta { margin-top: 18px; color: #6b716b; font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

/* --- sticker sheet (5 frame) --------------------------------------------- */
.sticker-sheet {
  display: grid; grid-template-columns: repeat(5,1fr); grid-auto-rows: 148px; gap: 14px;
  padding: 30px; border-radius: 30px;
  background: radial-gradient(circle at 30% 10%, #3bd923 0, #24d40e 40%, #b6e400 100%);
}
.sticker {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px; text-align: center; border-radius: 20px;
  font-family: "Manrope", sans-serif; font-weight: 600;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.sticker--wide { grid-column: span 2; }
.sticker--tall { grid-row: span 2; }
.sticker .emoji { font-size: 40px; line-height: 1; }
.sticker .cap { font-size: 13px; letter-spacing: -.01em; }
/* individual sticker looks */
.sticker--zen { background: #0c1a08; color: #cdfca6; border: 4px solid #0a1206; }
.sticker--zen .emoji { font-size: 58px; }
.sticker--buddy-y { background: radial-gradient(circle at 50% 35%, #ffe14d, #d4b400); color: #241f00; border: 4px solid #0d0b00; }
.sticker--buddy-g { background: radial-gradient(circle at 50% 35%, #0e2b08, #061405); color: #a6fc7a; border: 4px solid #041003; }
.sticker--mind { background: #fff; color: #0b1206; box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.sticker--mind .meter { display: flex; gap: 3px; margin-top: 4px; }
.sticker--mind .meter i { width: 6px; height: 22px; border-radius: 2px; background: linear-gradient(#2ecb12,#8ff05a); }
.sticker--quote { background: #050705; color: #eef2ea; }
.sticker--quote .cap { font-size: 15px; line-height: 1.3; }
.sticker--quote .cap b { color: var(--zen-neon); }
.sticker--code { background: #0c130b; color: #9df06f; border: 3px solid #fff; align-items: stretch; justify-content: flex-start; text-align: left; }
.sticker--code .dots { display: flex; gap: 5px; margin-bottom: 10px; }
.sticker--code .dots i { width: 9px; height: 9px; border-radius: 50%; }
.sticker--code .dots i:nth-child(1){ background:#ff694c;} .sticker--code .dots i:nth-child(2){ background:#ffbe55;} .sticker--code .dots i:nth-child(3){ background:#24ff24;}
.sticker--code code { font-family: "JetBrains Mono", monospace; font-size: 11px; line-height: 1.7; font-weight: 400; }
.sticker--code code b { color: #eef2ea; }
.sticker--crown { background: #0a1206; color: var(--zen-neon); border: 3px dashed rgba(36,255,36,.5); }
.sticker--crown .emoji { font-size: 44px; }
.sticker--foss { background: #fff; color: #0b1206; border: 4px solid #12b400; }
.sticker--foss .cap { font-size: 12px; letter-spacing: .04em; }
.sticker--vibes { background: #050705; color: #fff; }
.sticker--vibes b { color: var(--zen-neon); }
.sticker-caption { margin-top: 18px; text-align: center; color: #747b74; font-family: "JetBrains Mono", monospace; font-size: 12px; }
/* real sticker-sheet image frame */
.sticker-frame { margin: 0; overflow: hidden; border-radius: 30px; border: 1px solid var(--card-line); background: #46e000; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.sticker-frame img { display: block; width: 100%; height: auto; }
/* Play Store listing strip (screenshots, unaltered) */
.screens-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 48px; }
.screens-strip img { display: block; width: 100%; height: auto; aspect-ratio: 545 / 1080; object-fit: cover; border-radius: 22px; border: 1px solid var(--card-line); background: #46e000; box-shadow: 0 20px 60px rgba(0,0,0,.38); }
@media (max-width: 900px) {
  .screens-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(190px, 62%); overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
  .screens-strip img { scroll-snap-align: center; }
}

/* --- posthog analytics --------------------------------------------------- */
.ph-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.ph-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--card-line); border-radius: 999px; color: #cfd4cd; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.ph-badge i { width: 7px; height: 7px; border-radius: 50%; background: #f9bd2b; box-shadow: 0 0 12px #f9bd2b; }

.funnel-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; margin-top: 40px; }
.funnel-card { padding: 30px 28px; border: 1px solid var(--card-line); border-radius: 24px; background: var(--card); }
.funnel-card.is-primary { border-color: rgba(36,255,36,.35); background: rgba(36,255,36,.03); }
.funnel-card > span { color: var(--zen-neon); font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.funnel-card h3 { margin: 12px 0 6px; font-family: "Manrope", sans-serif; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.funnel-card > p { margin: 0 0 20px; color: #868d86; font-size: 14px; line-height: 1.6; }
.funnel-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.funnel-steps code { padding: 7px 10px; border-radius: 8px; color: #cbe8b6; font-family: "JetBrains Mono", monospace; font-size: 11px; background: rgba(36,255,36,.08); }
.funnel-steps code.or { background: transparent; color: #6b716b; padding: 7px 2px; }
.funnel-steps i { color: #4c524c; font-style: normal; }
.funnel-metric { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.funnel-metric b { color: #eef2ea; font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 500; }
.funnel-metric span { color: #7d847d; font-size: 12px; }
.funnel-metric .arrow { color: var(--zen-neon); }

/* event taxonomy table */
.event-table-wrap { margin-top: 40px; overflow-x: auto; border: 1px solid var(--card-line); border-radius: 20px; }
.event-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
.event-table thead th { padding: 16px 20px; text-align: left; color: #cfd4cd; font-family: "Manrope", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: #0e120d; border-bottom: 1px solid var(--card-line); }
.event-table tbody td { padding: 15px 20px; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,.06); color: #9aa19a; line-height: 1.5; }
.event-table tbody tr:last-child td { border-bottom: 0; }
.event-table tbody tr:hover td { background: rgba(255,255,255,.014); }
.event-table .ev { color: #cbe8b6; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.event-table .prop { display: inline-block; margin: 2px 3px 2px 0; padding: 3px 8px; border-radius: 6px; color: #b9c6b0; font-family: "JetBrains Mono", monospace; font-size: 11px; background: rgba(255,255,255,.04); }
.event-table .prop--none { color: #6b716b; background: transparent; padding-left: 0; }

/* --- reflections + closing ---------------------------------------------- */
.reflect-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.reflect-card { padding: 30px 28px; border: 1px solid var(--card-line); border-radius: 24px; background: var(--card); }
.reflect-card span { color: var(--zen-neon); font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.reflect-card p { margin: 14px 0 0; color: #9aa19a; font-size: 15px; line-height: 1.66; }

.closing-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 44px; }
.closing-links a {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px;
  border: 1px solid var(--card-line); border-radius: 999px; color: #eef2ea; font-family: "JetBrains Mono", monospace; font-size: 12px;
  transition: color 180ms, border-color 180ms, background 180ms, transform 220ms var(--ease);
}
.closing-links a:hover { transform: translateY(-3px); border-color: var(--zen-neon); }
.closing-links a.is-primary { color: #10130d; background: var(--zen-neon); border-color: var(--zen-neon); }

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
  .case-metrics { grid-template-columns: repeat(2,1fr); }
  .fact-grid, .insight-grid, .process-rail, .token-board, .mode-cards, .touchpoint-grid, .reflect-grid, .funnel-grid { grid-template-columns: repeat(2,1fr); }
  .two-col { grid-template-columns: 1fr; gap: 34px; }
  .module-block { grid-template-columns: 60px 1fr; gap: 20px 24px; }
  .module-block .module-flow { grid-column: 1 / -1; }
  .sticker-sheet { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 640px) {
  .case-metrics { grid-template-columns: 1fr 1fr; margin-top: 40px; }
  .fact-grid, .insight-grid, .process-rail, .token-board, .mode-cards, .touchpoint-grid, .reflect-grid, .funnel-grid { grid-template-columns: 1fr; }
  .case-subnav { position: static; }
  .module-block { grid-template-columns: 1fr; gap: 16px; }
  .module-tag { font-size: 30px; }
  .sticker-sheet { grid-template-columns: repeat(2,1fr); grid-auto-rows: 128px; padding: 18px; }
  .sticker--wide, .sticker--tall { grid-column: auto; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .insight-card:hover, .touchpoint:hover, .token-chip:hover, .closing-links a:hover { transform: none; }
}
