/* case.css: the invetty case study. Loaded after site.css.
   The page speaks in the app's own voice: Ubuntu + DM Sans, indigo and beige. */

/* the whole page sits on invetty's indigo, with white text */
.case {
  --c-bg: #2C2D44;
  --c-ink: #FFFFFF;
  --c-muted: #CFCBE3;
  --c-label: #E9CDB0;
  --c-line: #44476E;
  --c-soft: #3D3F66;
  --c-card: #37395A;
  --indigo: #2C2D44;
  --indigo-2: #3D3F66;
  --beige: #E9CDB0;
  --cream: #F3E9DE;
  --lilac: #CFCBE3;
  --lilac-2: #A9A6C6;
  --head: 'Ubuntu', 'DM Sans', sans-serif;
  --body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--body);
}
.case h1, .case h2, .case h3, .case blockquote { font-family: var(--head); }

/* ---------- header ---------- */
.c-hero {
  position: relative; border-radius: 0 0 8px 8px;
  background: var(--indigo); color: var(--cream);
  padding: 0 var(--gutter);
}
.c-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 30px 0 0; font-family: var(--sans); color: #fff;
}
.c-nav .wordmark { font-size: 21px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 64px; font-size: 15px; color: var(--lilac); }
.c-title { display: flex; align-items: center; gap: 22px; margin-top: 28px; }
.c-title img { width: 84px; height: 84px; }
.c-title h1 { margin: 0; font-weight: 500; font-size: clamp(64px, 9vw, 128px); line-height: .95; color: var(--cream); }
.c-lede { margin: 22px 0 0; font-size: clamp(19px, 1.8vw, 24px); color: var(--lilac); }
.c-credits { margin: 12px 0 0; max-width: 640px; font-size: 16px; color: var(--lilac); }
.c-hero-shot { width: 100%; height: auto; margin-top: 48px; }

/* ---------- body: process rail + content ---------- */
.c-body {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 56px;
  width: min(1376px, 100% - 2 * var(--gutter)); margin: 104px auto 0;
}
.rail { position: sticky; top: 24px; align-self: start; font-size: 15px; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail a {
  display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: var(--pane); text-decoration: none; color: var(--c-ink);
  transition: background-color .25s ease, color .25s ease;
}
.rail a:hover { background: var(--c-soft); }
.rail a[aria-current] { background: var(--beige); color: var(--indigo); }

.c-sec { scroll-margin-top: 24px; }
.c-sec + .c-sec { margin-top: 128px; }
.label { margin: 0; font-size: 14px; font-weight: 500; color: var(--c-label); }
.c-sec h2 { margin: 0; font-weight: 500; font-size: clamp(32px, 3vw, 40px); line-height: 1.1; }
.c-sec > p:not([class]) { max-width: 680px; margin: 20px 0 0; }
.question { margin: 0; font-family: var(--head); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.3; max-width: 880px; }

.tiles { display: grid; gap: 16px; margin-top: 16px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.first { margin-top: 40px; }
.tile { padding: 26px; border-radius: var(--pane); background: var(--c-card); }
.tile.dark { background: var(--beige); color: var(--indigo); }
.tile.soft { background: var(--c-soft); }
.tile h3 { margin: 0; font-weight: 500; font-size: 21px; line-height: 1.3; }
.tile p { margin: 10px 0 0; font-size: 16px; }
.tile p.label { margin: 0; }
.tile .stat { margin: 0; font-family: var(--head); font-size: 64px; font-weight: 500; line-height: 1; }
.tile .stat + p { color: var(--c-muted); font-size: 15px; margin-top: 12px; }
.tile.dark .stat + p { color: #4D3B33; }
.tile blockquote { margin: 0; font-size: 22px; line-height: 1.4; }
.tile figcaption { margin-top: 14px; font-size: 14px; color: var(--c-muted); }

.persona { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 16px; margin-top: 40px; }
.persona .who { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.persona h3 { margin: 0; font-size: 32px; line-height: 1.1; }
.persona .meta { margin: 6px 0 0; font-size: 15px; color: var(--c-muted); }
.tile .hmw { margin: 0; padding: 20px; border-radius: var(--pane); background: var(--beige); color: var(--indigo); font-size: 18px; line-height: 1.45; }
.conflicts { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; font-size: 16px; }
.conflicts li { padding: 14px; border-radius: var(--pane); background: var(--c-soft); }
.conflicts b { font-weight: 600; }

/* journey map: zooms under the cursor */
.journey { position: relative; display: block; margin-top: 16px; border-radius: var(--pane); overflow: hidden; cursor: zoom-in; }
.journey img { width: 100%; height: auto; }
.lens {
  position: absolute; width: 280px; height: 190px; pointer-events: none;
  border-radius: var(--pane);
  box-shadow: 0 18px 40px rgba(38, 39, 63, 0.3); background-repeat: no-repeat; background-color: #fff;
}
.journey-cap { margin-top: 10px; font-size: 14px; color: var(--c-muted); }

/* ---------- before / after, with the testing chat ---------- */
.pair {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 3fr); gap: 32px; align-items: center;
  margin-top: 16px; padding: 32px; border-radius: 8px; background: var(--c-card); color: var(--cream);
}
.pair:first-of-type { margin-top: 40px; }
.pair-shots {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
  padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit;
}
.pair-shots:focus-visible { outline: 2px solid var(--beige); outline-offset: 8px; border-radius: 8px; }
.pair-shots figure { margin: 0; }
.pair-shots figcaption { margin-top: 10px; font-size: 13px; color: var(--lilac-2); }
.pair-shots img { width: 100%; height: auto; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.pair.is-talking .pair-shots figure:last-child img { transform: translateY(-4px); }
.pair h3 { margin: 0; font-weight: 500; font-size: clamp(22px, 2vw, 28px); line-height: 1.2; }
.chat { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; min-height: 230px; }
.msg { max-width: 92%; transition: opacity .35s ease, transform .4s cubic-bezier(.2, .8, .2, 1); }
.msg p { margin: 0; padding: 13px 16px; border-radius: var(--pane); font-size: 15px; line-height: 1.45; }
.msg.them { align-self: flex-start; }
.msg.them p { background: #4A4D7E; color: var(--cream); border-bottom-left-radius: 2px; }
.msg.us { align-self: flex-end; text-align: right; }
.msg.us p { background: var(--beige); color: var(--indigo); border-bottom-right-radius: 2px; text-align: left; }
.chat .stack { display: grid; }
.chat .stack > * { grid-area: 1 / 1; }
.typing {
  align-self: start; justify-self: start; display: inline-flex; gap: 5px;
  padding: 14px 16px; border-radius: var(--pane); border-bottom-left-radius: 2px; background: #4A4D7E;
  transition: opacity .2s ease;
}
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--lilac); animation: bob 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.pair:not(.is-talking) .msg { opacity: 0; transform: translateY(10px); }
.pair.is-talking .typing { opacity: 0; }
.pair.is-talking .msg.us { transition-delay: .45s; }

/* ---------- outcome ---------- */
.final { margin-top: 32px; padding: clamp(20px, 3vw, 40px); border-radius: 8px; background: var(--c-card); }
.final img { width: 100%; height: auto; }
.flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.flow { margin: 0; }
.flow-frame { position: relative; display: grid; place-items: center; padding: 32px 0; border-radius: 8px; background: var(--c-card); }
.flow video { height: min(560px, 62vw); width: auto; aspect-ratio: 484 / 1000; border-radius: 13% / 6.3%; background: #000; }
.flow-toggle {
  position: absolute; right: 14px; bottom: 14px; width: 44px; height: 44px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 4px; border: 0; color: #fff;
  background: rgba(28, 29, 50, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.flow-toggle svg { width: 16px; height: 16px; }
.flow-toggle .i-play { display: none; }
.flow-toggle.is-paused .i-play { display: block; }
.flow-toggle.is-paused .i-pause { display: none; }
.flow figcaption { margin-top: 10px; font-size: 14px; color: var(--c-muted); }
.tile ul { margin: 14px 0 0; padding-left: 20px; font-size: 16px; }
.tile li + li { margin-top: 10px; }

.next {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: min(1376px, 100% - 2 * var(--gutter)); height: 47px; margin: 128px auto 0; padding: 0 20px;
  border-radius: var(--pane); background: var(--c-soft); color: var(--c-ink); text-decoration: none;
  font-family: var(--sans); font-size: 16px; transition: background-color .2s ease;
}
.next:hover { background: #4A4D7E; }
.next:hover span:last-child { text-decoration: underline; text-underline-offset: 5px; }
.next .k { color: var(--c-muted); }

.c-foot { margin-top: 96px; background: #0E1A38; color: #fff; font-family: var(--sans); }
.c-foot .wrap { padding: 72px 0 40px; }
.c-foot-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.c-foot .hi { margin: 0; font-family: var(--script); font-size: 48px; line-height: 1.3; }
.c-foot .email { display: inline-block; margin-top: 8px; font-size: 20px; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.c-foot .mini { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 15px; color: var(--night-muted); }
.c-foot .mini i { width: 28px; height: 28px; border-radius: 50%; background: #0A1128; box-shadow: inset 0 0 0 6px #0A1128, inset 0 0 0 7px #2A3560, inset 0 0 0 11px #0A1128, inset 0 0 0 12px #2A3560; }
.c-foot-bottom { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 72px; font-size: 14px; color: var(--night-muted); }
.c-foot-bottom a { color: #fff; }

@media (max-width: 1000px) {
  .c-body { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .chat { min-height: 0; }
}
@media (max-width: 700px) {
  .tiles.three, .tiles.two, .persona, .flows { grid-template-columns: minmax(0, 1fr); }
  .c-title img { width: 60px; height: 60px; }
  .pair { padding: 20px; }
  .lens { display: none; }
}