/* 04 Canvas, case study template. Builds on style.css (tokens, viewport, world, chrome, toolbar). */

/* ---------- Top bar ---------- */
.chip.back { display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; }
.file-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  pointer-events: auto;
}
.file-title span { color: var(--grey); }
.file-title span::after { content: '/'; margin-left: 10px; color: var(--line); }

/* ---------- Layers panel ---------- */
.layers {
  position: fixed;
  left: var(--pad);
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  width: 220px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px 8px;
}
.layers-title { font-size: 0.8125rem; color: var(--grey); padding: 0 10px 8px; }
.layers ol { list-style: none; display: grid; gap: 1px; }
.layers button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  background: none;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--grey);
  transition: background 0.2s, color 0.2s;
}
.layers button::before {
  content: '';
  flex: none;
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.layers .is-shot button::before { border-radius: 0; background: linear-gradient(135deg, transparent 45%, currentColor 46%, currentColor 54%, transparent 55%); }
.layers .is-child button { padding-left: 28px; }
.layers button:hover { background: #1d1d1d; color: var(--white); }
.layers button[aria-current="step"] { background: var(--white); color: var(--black); }

/* ---------- Frames ---------- */
.cs-frame { position: absolute; display: block; margin: 0; }
.cs-card {
  display: block;
  background: var(--white);
  color: var(--black);
  padding: 56px 60px 60px;
  outline: 1px solid var(--line);
}
.cs-frame .label,
.cs-shot .label { display: block; }

.cs-kicker { display: block; color: #6b6b6b; font-size: 24px; margin-bottom: 14px; }
.cs-h1 {
  font-size: 118px;
  font-weight: 650;
  font-variation-settings: "wdth" 80;
  line-height: 0.92;
  letter-spacing: -0.02em;
  min-height: 0.92em; /* holds the line while the title is typed */
}
.cs-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 40px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid #e3e3e3;
  font-size: 24px;
}
.cs-meta dt { color: #6b6b6b; font-size: 19px; margin-bottom: 2px; }
.cs-meta dd { margin: 0; }

.cs-text h2 {
  font-size: 68px;
  font-weight: 650;
  font-variation-settings: "wdth" 80;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.cs-text p { font-size: 29px; line-height: 1.5; color: #1a1a1a; }
.cs-text p + p { margin-top: 22px; }
.cs-lede { font-size: 38px !important; line-height: 1.25 !important; letter-spacing: -0.01em; color: var(--black) !important; }
.cs-results { list-style: none; margin-top: 36px; border-top: 1px solid #e3e3e3; }
.cs-results li { font-size: 27px; line-height: 1.45; padding: 20px 0 20px 40px; border-bottom: 1px solid #e3e3e3; position: relative; }
.cs-results li::before { content: ''; position: absolute; left: 4px; top: 34px; width: 14px; height: 14px; background: var(--black); border-radius: 50%; }

.cs-shot { margin: 0; }
.cs-shot .art img { width: 100%; height: auto; }

/* Screens section: a masonry of fixed-width columns (built by tools/canvas-site/build_pages.py) */
.screens-grid { display: flex; gap: 56px; align-items: flex-start; }
.screens-col { display: grid; gap: 56px; width: 900px; flex: none; }

/* Phone screens, side by side */
.cs-phones { display: flex; gap: 32px; align-items: flex-start; }
.cs-frame.cs-phones { gap: 40px; }
.cs-phone { flex: 1; min-width: 0; margin: 0; }
.cs-phone .label { white-space: normal; }
.cs-phone .art { border-radius: 18px; }
.cs-phone .art img { width: 100%; height: auto; }

/* Next and previous project */
.cs-next-link { display: block; }
.cs-next-name {
  display: block;
  font-size: 96px;
  font-weight: 650;
  font-variation-settings: "wdth" 80;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
}
.cs-next-link .art { outline: 0; }
.cs-next-link:hover,
.cs-next-link:focus-visible { outline: 3px solid var(--white); outline-offset: 6px; }
.cs-prev { margin-top: 28px; font-size: 26px; color: var(--grey); }
.cs-prev a { color: var(--white); text-decoration: underline; text-underline-offset: 6px; }

/* Active stop gets a selection outline, as in a design tool */
.is-active > .cs-card,
.is-active .art { outline: 2px solid var(--white); outline-offset: 6px; }
.cs-end.is-active .art { outline: 0; }
.is-active .label { color: var(--white); }

/* Prototype connectors */
.noodles { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.noodles path { fill: none; stroke: var(--white); stroke-width: 3; }
.noodles .end { fill: var(--white); }
.noodles .start { fill: var(--black); stroke: var(--white); stroke-width: 3; }

/* ---------- Stepper ---------- */
.stepper .tb-group:first-child { align-items: center; }
.stepper button svg { display: block; }
.step-status {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 12.5rem;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}
.step-of { color: var(--grey); }
.step-name { margin-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Hidden before the intro runs */
.js:not(.doc-mode) .cs-frame,
.js:not(.doc-mode) .cs-screens { opacity: 0; }

/* ---------- Document mode (phones) ---------- */
.doc-mode body { overflow: auto; overscroll-behavior: auto; }
.doc-mode .viewport {
  position: static;
  overflow: visible;
  cursor: auto;
  touch-action: auto;
  background-attachment: fixed;
  padding: 84px 16px 110px;
}
.doc-mode .world { position: static; width: auto; height: auto; transform: none !important; display: grid; gap: 48px; }
.doc-mode .cs-frame,
.doc-mode .cs-screens { position: relative; left: auto !important; top: auto !important; width: auto !important; }
.doc-mode .noodles,
.doc-mode .leon,
.doc-mode .layers,
.doc-mode .tb-zoom,
.doc-mode .file-title { display: none; }
.doc-mode .cs-card { padding: 24px 20px 26px; }
.doc-mode .cs-kicker { font-size: 0.9375rem; margin-bottom: 6px; }
.doc-mode .cs-h1 { font-size: clamp(2.6rem, 13vw, 4rem); min-height: 0; }
.doc-mode .cs-meta { grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 24px; padding-top: 16px; font-size: 1rem; }
.doc-mode .cs-meta dt { font-size: 0.8125rem; }
.doc-mode .cs-text h2 { font-size: 2rem; margin-bottom: 12px; }
.doc-mode .cs-text p { font-size: 1.0625rem; }
.doc-mode .cs-text p + p { margin-top: 12px; }
.doc-mode .cs-lede { font-size: 1.375rem !important; }
.doc-mode .cs-results { margin-top: 20px; }
.doc-mode .cs-results li { font-size: 1rem; padding: 12px 0 12px 26px; }
.doc-mode .cs-results li::before { top: 20px; width: 9px; height: 9px; }
.doc-mode .cs-screens { padding: 24px 12px 16px; }
.doc-mode .sec-title { font-size: 1rem; top: -36px; }
.doc-mode .screens-grid { display: grid; gap: 24px; }
.doc-mode .screens-col { width: auto; gap: 24px; }
.doc-mode .cs-phones { gap: 12px; }
.doc-mode .cs-phone .art { border-radius: 10px; }
.doc-mode .cs-phone .lp { display: none; } /* the project name is already the page title */
.doc-mode .cs-prev { font-size: 0.9375rem; margin-top: 12px; }
.doc-mode .label { font-size: 0.8125rem; }
.doc-mode .cs-next-name { font-size: 2.6rem; margin-bottom: 18px; }
.doc-mode .stepper { justify-content: center; }
.doc-mode .step-status { min-width: 0; }
.doc-mode .is-active > .cs-card,
.doc-mode .is-active .art { outline: 1px solid var(--line); outline-offset: 0; }

/* 'Latest work' badge inside the white title card */
.cs-kicker .latest { position: relative; top: auto; right: auto; margin-left: 16px; vertical-align: middle; --spark-a: #111111; --spark-b: #e2a400; }
.cs-kicker .latest-pill { background: var(--black); color: var(--white); font-size: 18px; box-shadow: 0 10px 26px -12px rgba(226, 164, 0, 0.7); }
.doc-mode .cs-kicker .latest { margin-left: 10px; }
.doc-mode .cs-kicker .latest-pill { font-size: 0.75rem; padding: 4px 10px 4px 8px; gap: 5px; }
.doc-mode .cs-kicker .latest-pill svg { width: 11px; height: 11px; }
