/* ============================================================
   Project packets in the joshuawells.com compartment system (Sep 17 2026).
   Grey ground, white rounded sheets, a dark pill nav the width of the
   sheets, the facts band, full-pill controls, the site footer. Loaded AFTER
   each packet's own <style>, so it owns the skeleton (nav, hero, band,
   sheets, footer, labels) and the packet keeps its content rules (ledgers,
   hour lists, bars, Q&A). Selectors run at body.pk specificity so they win
   over any skeleton rule a packet still carries.
   Source of truth for the look: src/styles/global.css, blocks
   "The rest of the site as compartments" and "the floating pill nav".
   ============================================================ */
:root {
  /* the house tokens, so a packet that predates one of them still renders the system */
  --fb: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ink: oklch(21% 0.004 260); --tint: oklch(95.9% 0.004 260); --paper: oklch(97.5% 0.003 260); --paper-2: #FFFFFF;
  --muted: oklch(46% 0.008 260); --rule: oklch(90% 0.005 260); --rule-soft: oklch(94% 0.004 260);
  --snes-red: #FF3B30; --snes-orange: #FF9500; --snes-gold: #FFCC00; --snes-green: #34C759; --snes-blue: #007AFF; --snes-purple: #AF52DE;
  --g: 20px; --r-sheet: 40px; --r-panel: 28px; --r-inner: 18px; --sheet-w: 1180px;
  --r-key: 999px; --r-chip: 999px; --r-card: var(--r-inner);
  --lip: oklch(86% 0.006 260); --lip-ink: oklch(9% 0.004 260);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.42, 1);
  --nav-h: 58px;
}
@media (max-width: 720px) { :root { --g: 12px; --r-sheet: 26px; --r-panel: 22px; --r-inner: 14px; } }

html { scroll-padding-top: calc(var(--nav-h) + 40px); }
html, body.pk { overflow-x: clip; }
body.pk { background: var(--tint); padding: 0 var(--g) var(--g); min-height: 100dvh; }
.pk-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
body.pk > * { max-width: var(--sheet-w); margin-left: auto; margin-right: auto; }

/* ---- the pill nav: one dark object above a light page ---- */
.pk-nav {
  position: sticky; top: 24px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(var(--sheet-w), 100%);
  margin: 24px auto 0; padding: 9px 10px 9px 26px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(19, 20, 24, 0.96);
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.55);
  color: #F5F5F7;
  transition: width 0.7s var(--ease-spring);
}
html.is-scrolled .pk-nav { width: min(calc(var(--sheet-w) - 220px), calc(100% - 220px)); }
.pk-mark { display: inline-flex; align-items: baseline; text-decoration: none; color: inherit; flex: none; }
.pk-wordmark {
  font-family: var(--fb); font-weight: 700; font-size: 19px; line-height: 1;
  letter-spacing: -0.022em; font-variation-settings: 'opsz' 32; white-space: nowrap;
  display: inline-flex; align-items: baseline; color: #F5F5F7;
}
.pk-dot { display: inline-block; width: 6px; height: 6px; margin-left: 6px; background: var(--snes-red); flex: none; }
.pk-nav .st-chip {
  margin-left: auto; font-family: var(--fb); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: rgba(245, 245, 247, 0.72); background: rgba(255, 255, 255, 0.08); padding: 7px 14px; border-radius: 999px; white-space: nowrap;
}
.pk-cta {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 10px 16px; border-radius: 999px;
  background: #F5F5F7; color: #111114; text-decoration: none;
  font-size: 13.5px; font-weight: 560; letter-spacing: -0.005em; line-height: 1;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.16s, background-color 0.2s;
}
.pk-cta:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 3px 0 rgba(255, 255, 255, 0.35); }
.pk-cta:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(255, 255, 255, 0.35); }
.pk-cta span { transition: transform 0.2s var(--ease-out); }
.pk-cta:hover span { transform: translateX(3px); }

/* ---- the hero sits on the ground, 8px inside the sheet edge ---- */
.pk-hero { padding: 72px 8px 36px; }
.pk-hero .client-logo { display: block; width: min(300px, 70%); height: auto; margin: 0 0 30px; }
.pk-hero h1 {
  font-family: var(--fb); font-variation-settings: 'opsz' 32; font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem); letter-spacing: -0.04em; line-height: 1.02;
  max-width: 22ch; margin: 0 0 22px; text-wrap: balance;
}
.pk-hero .proj-meta {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 26px;
  font-family: var(--fb); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--muted); font-feature-settings: 'tnum';
}
.pk-hero .proj-meta b { color: var(--ink); font-weight: 600; }
.pk-hero .lede { font-size: 1.12rem; line-height: 1.55; max-width: 64ch; margin: 0 0 14px; color: var(--ink); }
.pk-hero .lede:last-child { margin-bottom: 0; }
.pk-hero .lede b { font-weight: 650; }

/* ---- the band: secondary facts as a rounded strip of hairline cells ---- */
body.pk .counts {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
  margin: 30px 0 0; padding: 0; border-top: none;
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
  background: color-mix(in srgb, var(--ink) 2.5%, transparent);
  border-radius: 28px; overflow: hidden;
}
body.pk .count {
  border: none; border-left: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 0;
  background: transparent; padding: 20px 24px 18px; min-width: 0;
}
body.pk .count:first-child { border-left: none; }
body.pk .count .ms { font-size: 22px; color: var(--c, var(--muted)); display: block; margin-bottom: 12px; }
body.pk .count .n { font-family: var(--fb); font-variation-settings: 'opsz' 32; font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; font-feature-settings: 'tnum'; line-height: 1.1; }
body.pk .count .k { font-family: var(--fb); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); margin-top: 5px; line-height: 1.35; }
@media (max-width: 860px) {
  body.pk .counts { grid-auto-flow: row; grid-template-columns: 1fr 1fr; border-radius: 22px; }
  body.pk .count { border-left: none; border-top: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); padding: 16px 18px 14px; }
  body.pk .count:nth-child(-n+2) { border-top: none; }
  body.pk .count:nth-child(2n) { border-left: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); }
  body.pk .count:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: none; }
}

/* ---- every section is one white sheet ---- */
.pk-main { display: block; }
body.pk .sec, body.pk .phase {
  background: var(--paper-2); border-radius: var(--r-sheet);
  padding: 60px 56px 64px; margin: var(--g) 0 0; border: none;
  scroll-margin-top: calc(var(--nav-h) + 40px);
}
body.pk .sec > h2 {
  font-family: var(--fb); font-variation-settings: 'opsz' 32; font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; line-height: 1.18;
  max-width: 32ch; margin: 0 0 12px; text-wrap: balance;
}
body.pk h2 .lt { font-weight: 500; color: var(--muted); }
body.pk .sec-note { font-size: 1rem; line-height: 1.6; }

/* labels in the packet are Inter, sentence case: mono stays for data cells */
body.pk h3 .pill, body.pk .chip, body.pk .tag {
  font-family: var(--fb); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
  border-radius: 999px; padding: 4px 10px;
}
/* inner surfaces: tint panels with the panel radius, no 1px frames.
   packet.js adds .pk-panel to any framed white box inside a sheet. */
body.pk .script, body.pk .pk-panel {
  border: none !important; border-radius: var(--r-panel); background: var(--tint) !important; box-shadow: none;
}
body.pk .pk-panel .pk-panel { background: var(--paper-2) !important; border-radius: var(--r-inner); }

/* controls are keycap pills */
body.pk .btn, body.pk a.pill, body.pk button.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-radius: 999px; font-size: 14.5px; font-weight: 550; letter-spacing: -0.005em; line-height: 1;
  border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); text-decoration: none;
  box-shadow: 0 2px 0 var(--lip);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.16s, border-color 0.2s;
}
body.pk .btn:hover, body.pk a.pill:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--lip); border-color: var(--ink); }
body.pk .btn:active, body.pk a.pill:active { transform: translateY(1px); box-shadow: 0 0 0 var(--lip); }
body.pk .btn-primary, body.pk .btn.primary { background: var(--ink); color: var(--paper-2); border-color: var(--ink); box-shadow: 0 2px 0 var(--lip-ink); }
body.pk .btn-primary:hover, body.pk .btn.primary:hover { box-shadow: 0 3px 0 var(--lip-ink); }
body.pk input:not([type="checkbox"]):not([type="radio"]), body.pk textarea, body.pk select { border-radius: 14px; }

/* ---- the site footer ---- */
.pk-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 44px 8px 28px; font-family: var(--fb); font-size: 13px; color: var(--muted);
}
.pk-foot-brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pk-foot-logo { display: block; height: 32px; width: auto; }
.pk-foot-flag { display: inline-block; height: 14px; width: auto; vertical-align: -1px; margin-left: 6px; border-radius: 2px; }
.pk-foot-links { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.pk-foot a { color: var(--ink); text-decoration: none; font-weight: 500; border: none; }
.pk-foot a:hover { color: var(--snes-blue); }
.pk-foot .pk-foot-brand a { font-weight: 400; color: var(--muted); }

/* ---- tablets ---- */
@media (max-width: 960px) {
  body.pk .sec, body.pk .phase { padding: 44px 32px 48px; }
  .pk-hero { padding: 56px 8px 30px; }
}

/* ---- phones: the pill lives at the bottom, one container level ---- */
@media (max-width: 830px) {
  .pk-nav {
    position: fixed; top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: var(--g); right: var(--g); width: auto; margin: 0; padding: 8px 8px 8px 18px;
    max-width: none;
  }
  html.is-scrolled .pk-nav { width: auto; }
  .pk-nav .st-chip { display: none; }
  body.pk { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: 16px; }
  body.pk .sec { scroll-margin-top: 16px; }
  .pk-hero { padding: 36px 8px 24px; }
  .pk-hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
}
@media (max-width: 720px) {
  body.pk .sec, body.pk .phase { padding: 34px 20px 38px; }
  body.pk .sec > h2 { font-size: 1.45rem; }
  .pk-hero .lede { font-size: 1.04rem; }
  .pk-hero .client-logo { width: min(240px, 72%); margin-bottom: 22px; }
  /* one container level: panels inside the sheet become hairline rows */
  body.pk .script, body.pk .pk-panel:not(:has(img, video, iframe, .phone, .screen)) {
    background: transparent !important; border-radius: 0; padding: 18px 0 0; border-top: 1px solid var(--rule) !important; box-shadow: none;
  }
  body.pk .script + .script { margin-top: 18px; }
  .pk-foot { flex-direction: column; align-items: flex-start; gap: 16px; padding: 32px 8px 8px; }
  .pk-foot-brand { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pk-nav, .pk-cta { transition: none; } }
