/* Examples page. Loaded after styles.css and built from the same kit:
   sky, white paper objects, hairlines, blue for "done" or "chosen". */

/* Hero */

.ex-hero .sky-open { --sky-pad-b: clamp(56px, 6vw, 88px); }
.sky-open .ex-note { color: var(--on-sky-muted); }

.ex-note {
  max-width: 640px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-2);
}

.ex-disclosure {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink-2);
}

.matrix .ex-disclosure { margin-top: 5px; }

/* The department: the whole project at a glance, then three examples */

.found {
  padding-block: 0 0;
  scroll-margin-top: 84px;
}

.found h2 {
  max-width: 16em;
  margin-top: clamp(40px, 4.5vw, 64px);
  font-size: clamp(2rem, 1.1rem + 2.9vw, 3.75rem);
  line-height: 1.04;
}

.glance {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(40px, 4.5vw, 64px);
}

.glance li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 26, 38, 0.2);
}

.glance strong {
  font-size: clamp(1.1875rem, 1rem + 0.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.glance li > span:last-child {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
  text-wrap: pretty;
}

.found-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 3vw, 48px);
  margin-top: clamp(32px, 4vw, 56px);
  padding: clamp(14px, 2.6vw, 36px);
}

.matrix {
  margin: 0;
  padding: clamp(20px, 2.2vw, 30px) clamp(16px, 2vw, 28px) clamp(12px, 1.4vw, 20px);
}

.matrix figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 18px 8px;
}

.matrix figcaption strong {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.matrix svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.matrix .matrix-compact { display: none; max-width: 340px; margin-inline: auto; }

.matrix .m-axis { font-size: 13px; fill: var(--muted); }
.matrix .m-start { font-size: 13px; font-weight: 500; fill: var(--accent-text, var(--accent)); }
.matrix .m-dot text { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.matrix .m-dot circle { fill: #fff; stroke: rgba(15, 26, 38, 0.3); stroke-width: 1.25; }
.matrix .m-dot text { fill: var(--text-2); }
.matrix .m-quick circle { stroke: var(--ink); stroke-width: 1.5; }
.matrix .m-quick text { fill: var(--ink); }
.matrix .m-built circle { fill: var(--accent); stroke: #fff; stroke-width: 2.5; }
.matrix .m-built text { fill: #fff; }

.found-list { padding-block: 4px; }

.found-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 14px;
  padding: 13px 4px;
  border-top: 1px solid rgba(15, 26, 38, 0.12);
}

.found-list li:first-child { border-top: 0; }

.found-list strong {
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.found-list a strong {
  text-decoration: underline;
  text-decoration-color: rgba(15, 26, 38, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.found-list p {
  margin-top: 2px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-2);
  text-wrap: pretty;
}

.found-list .pill { margin-top: 1px; padding: 4px 10px; font-size: 12.5px; }
.found-list .pill-grey { background: rgba(255, 255, 255, 0.7); }

.found-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.25px solid rgba(15, 26, 38, 0.3);
  border-radius: 50%;
  background: #fff;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.found-n.found-quick { border-color: var(--ink); color: var(--ink); }
.found-n.found-built { border-color: var(--accent); background: var(--accent); color: #fff; }

.forward-title {
  margin-top: clamp(48px, 5vw, 72px);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);
  letter-spacing: -0.02em;
}

.dept-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dept-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px 10px 13px;
  border: 1px solid rgba(15, 26, 38, 0.08);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.dept-tab:hover { border-color: rgba(15, 26, 38, 0.3); color: var(--ink); }

.dept-tab[aria-current="true"],
.dept-tab[aria-current="true"]:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.pick-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 188px;
  padding: 26px 28px 24px;
  color: var(--ink);
  transition: box-shadow 200ms ease, transform 200ms var(--ease);
}

.pick-card:hover { color: var(--ink); transform: translateY(-2px); }

.pick-card strong {
  font-size: clamp(1.25rem, 1.05rem + 0.55vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
  text-wrap: balance;
}

.pick-owner {
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.pick-card[aria-current="true"] { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

.pick-card[aria-current="true"]::after {
  content: "";
  position: absolute;
  top: -9px;
  right: 22px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.2 11.2l3.2 3.2 6.4-6.4'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 0 0 3px #fff;
}

/* With JS, one department and one story show at a time.
   Without it, everything is on the page and the links are plain anchors. */
.js .dept-block:not(.is-shown) { display: none; }
.js .story:not(.is-active) { display: none; }

/* Story header */

.story {
  padding-top: clamp(72px, 8vw, 120px);
  scroll-margin-top: 24px;
}

html:not(.js) .dept-block + .dept-block { margin-top: clamp(72px, 8vw, 120px); }
html:not(.js) .story + .story { border-top: 1px solid var(--line); margin-top: clamp(72px, 8vw, 120px); }

.story-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: start;
  gap: clamp(32px, 5vw, 88px);
}

.story-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 20px;
}

.story h2 {
  max-width: 15em;
  font-size: clamp(2rem, 1.1rem + 2.9vw, 3.75rem);
  line-height: 1.04;
}

.story .lead { max-width: 620px; }

.facts {
  margin: 0;
  padding: 8px 28px;
}

.facts > div { padding: 18px 0; }
.facts > div + div { border-top: 1px solid var(--line); }

.facts dt {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.tags li {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-tint);
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink-2);
}

.journey-intro {
  max-width: 620px;
  margin: 0 auto clamp(28px, 3vw, 40px);
  text-align: center;
}

.journey-intro h3 { font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem); letter-spacing: -0.02em; }

.journey-intro p {
  margin-top: 10px;
  color: var(--text-2);
  text-wrap: pretty;
}

/* The rail: a floating index of the eight steps */

.story-body { margin-top: clamp(40px, 5vw, 72px); }

.rail {
  position: sticky;
  top: 80px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scroll-padding-inline: 8px;
  margin-inline: auto;
  padding: 7px 8px 7px 20px;
  border: 1px solid rgba(15, 26, 38, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: var(--shadow-sm);
}

.rail-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail ol { display: flex; flex: none; gap: 4px; }
.rail li.rail-gap { margin-left: 12px; }

.rail a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.rail a:hover { background: var(--grey-tint); color: var(--ink); }

.rail a[aria-current="true"],
.rail a[aria-current="true"]:hover { background: var(--ink); color: #fff; }

html:not(.js) .rail { display: none; }

/* The journey: your people on one side, HandoverAI on the other,
   and what gets handed on travelling down the line between them. */

.journey { position: relative; }

.journey::before,
.journey::after {
  content: "";
  position: absolute;
  top: 0;
  /* Ends inside the last row of chips, so the line finishes on a result. */
  bottom: 18px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--track);
}

.journey::after {
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
}

.phase {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-block: clamp(40px, 5vw, 64px) clamp(32px, 4vw, 48px);
}

.phase h3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 34px 15px;
  border: 1px solid rgba(15, 26, 38, 0.08);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: clamp(1.1875rem, 1rem + 0.5vw, 1.5rem);
  text-align: center;
}

.phase small {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(72px, 9vw, 128px) minmax(0, 1fr);
  padding-bottom: clamp(48px, 5vw, 72px);
  scroll-margin-top: 150px;
}

.step:last-child { padding-bottom: 0; }

.step-head {
  grid-column: 1 / -1;
  justify-self: center;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 6px 18px 8px;
  background: #fff;
}

.step-node {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(15, 26, 38, 0.16);
  border-radius: 50%;
  background: #fff;
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.step-head h4 {
  margin: 0;
  font-size: clamp(1.125rem, 1rem + 0.35vw, 1.3125rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.lane {
  position: relative;
  grid-row: 2;
  align-self: start;
  padding: 22px 26px 24px;
  border: 1px solid rgba(15, 26, 38, 0.08);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.lane-people { grid-column: 1; }

.lane-ai {
  grid-column: 3;
  background: linear-gradient(180deg, #EEF2FA 0%, #F6F8FD 100%);
}

/* A short tie from each card to the line. */
.lane::after {
  content: "";
  position: absolute;
  top: 34px;
  width: clamp(36px, 4.5vw, 64px);
  height: 1px;
  background: rgba(15, 26, 38, 0.22);
}

.lane-people::after { left: 100%; }
.lane-ai::after { right: 100%; }

.lane-who {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
}

.lane-ai .lane-who { color: var(--ink-2); }

.lane p {
  font-size: 16.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.step-out {
  grid-column: 1 / -1;
  justify-self: center;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
  margin-top: 24px;
}

.step-out li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px 8px 9px;
  border: 1px solid rgba(15, 26, 38, 0.08);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
}

.step-out svg { flex: none; }

/* The line fills, and each number turns blue, as it passes the middle of the
   screen. Tied to scroll position, so it needs no script. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .journey::after {
      animation: line-fill 1ms linear both;
      animation-timeline: view(block 50% 50%);
      animation-range: cover 0% cover 100%;
    }

    .step-node {
      animation: node-pass 1ms linear both;
      animation-timeline: view(block 50% 50%);
      animation-range: cover 0% cover 40%;
    }
  }
}

@keyframes line-fill {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes node-pass {
  from { border-color: rgba(15, 26, 38, 0.16); background: #fff; color: var(--ink); }
  to { border-color: var(--accent); background: var(--accent); color: #fff; }
}

/* Story end */

.story-end {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
  margin-top: clamp(24px, 3vw, 40px);
  padding: clamp(14px, 2.6vw, 36px);
}

.story-end .obj { padding: clamp(24px, 2.6vw, 36px); }
.story-end h3 { margin-top: 18px; }

.story-end p {
  margin-top: 10px;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.story-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  margin-top: clamp(40px, 5vw, 64px);
}

.next-link {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 40em;
  text-align: right;
  text-wrap: balance;
}

.next-link strong {
  font-size: clamp(1.1875rem, 1rem + 0.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-color: rgba(15, 26, 38, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* Responsive */

@media (max-width: 1100px) {
  .found-panel { grid-template-columns: minmax(0, 1fr); }
  .matrix { max-width: 640px; }
  .story-head { grid-template-columns: minmax(0, 1fr); }
  .facts { max-width: 560px; }
}

@media (max-width: 960px) {
  /* Departments scroll sideways instead of wrapping into a block. */
  .dept-tabs {
    flex-wrap: nowrap;
    margin-inline: calc(var(--gutter) * -1);
    padding: 2px var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .dept-tabs::-webkit-scrollbar { display: none; }
  .dept-tab { scroll-snap-align: center; }

  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .pick-cards { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pick-card { min-height: 0; padding: 22px 24px 20px; }
}

@media (max-width: 820px) {
  .journey-intro { margin-inline: 0; text-align: left; }

  .rail { top: 76px; padding-left: 8px; }
  .rail-title { display: none; }
  .rail a { width: 44px; height: 44px; }

  /* The line moves to the left edge and the two lanes stack. */
  .journey::before,
  .journey::after { left: 21px; }

  .phase { justify-content: flex-start; }
  .phase h3 { align-items: flex-start; padding: 12px 24px 13px; border-radius: 22px; text-align: left; }

  .step {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 60px;
  }

  .step-head {
    justify-self: start;
    flex-direction: row;
    gap: 16px;
    margin: 0 0 4px -60px;
    padding: 6px 0;
    background: none;
  }

  .step-node { box-shadow: 0 0 0 6px #fff; }

  .lane,
  .lane-ai { grid-column: 1; grid-row: auto; margin-top: 12px; padding: 18px 20px 20px; }
  .lane::after { display: none; }

  .step-out { justify-self: start; justify-content: flex-start; margin-top: 16px; }

  .story-end { grid-template-columns: minmax(0, 1fr); }

  .story-next { flex-direction: column-reverse; align-items: flex-start; }
  .next-link { align-items: flex-start; text-align: left; }
}

@media (max-width: 640px) {
  .matrix { padding-inline: 8px; }
  .matrix .matrix-wide { display: none; }
  .matrix .matrix-compact { display: block; }
  .matrix-compact .m-axis,
  .matrix-compact .m-start,
  .matrix-compact .m-dot text { font-size: 18px; }
}

/* Touch screens: larger step dots and list links. */
@media (pointer: coarse) {
  .rail a { width: 44px; height: 44px; }
  .found-list a { display: inline-block; padding-block: 10px; margin-block: -10px; }
  .next-link { padding-block: 8px; }
}

/* Eight 44px dots with their gaps need 422px of rail, which a phone of up to
   about 460px cannot give, so up to 520px every step shares the width as a
   grid of 44px-tall capsules whose end corners (radius 22, six pixels in) sit
   concentric to the pill's own ends and never cross them. */
@media (max-width: 520px) {
  .rail { width: 100%; padding: 5px 6px; }
  .rail ol { flex: 1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
  .rail li.rail-gap { margin-left: 0; }
  .rail a { width: 100%; height: 44px; border-radius: 22px; }
}

@media (max-width: 420px) {
  .found-list li { grid-template-columns: 28px minmax(0, 1fr); }
  .found-list .pill { grid-column: 2; justify-self: start; margin-top: 6px; }
}

