/* ============================================================
   Portfolio site layer — page layout only.
   All color, type, and component anatomy come from the vendored
   brand files (tokens.css / components.css). Hierarchy ladder
   (locked with Don, Lab 0b): Part 2.4rem > Area 1.8 > Card name
   1.35 > subpage body heading 1.1.
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.7; }

.page-wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
:root { --gutter: 5.2rem; }
@media (max-width: 640px) { :root { --gutter: 3.2rem; } }

/* ---- Masthead ---- */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--rule);
}
.masthead-identity {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.masthead-dot { width: 26px; height: 26px; } /* licensed exception to the <20px empty-disc rule (PLAN.md) */
.masthead-name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 1.35rem; letter-spacing: -0.01em;
}
.masthead-right { display: flex; align-items: center; gap: 18px; }
.masthead-tagline { color: var(--ink-soft); }
@media (max-width: 640px) { .masthead-tagline { display: none; } }

/* ---- Eyebrows & kickers ---- */
.eyebrow { display: inline-block; margin-bottom: 0.5rem; }
.eyebrow-area { color: var(--accent); }
.kicker { display: inline-block; color: var(--ink-mute); margin-bottom: 0.2rem; }

/* ---- Hero & overview ---- */
.hero { padding: 2.6rem 0 1.8rem; }
.hero-title { font-size: clamp(2.05rem, 4.4vw, 3.1rem); letter-spacing: -0.015em; margin: 0 0 1.1rem; }
.hero-lede { font-size: 1.2rem; color: var(--ink-soft); max-width: none; margin: 0; }

.overview { border-top: 1px solid var(--rule); padding: 2rem 0 1.8rem; }
.overview-title { font-size: 1.5rem; margin: 0 0 0.7rem; }
.overview-subtitle { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 0.4rem; max-width: none; }
.tenets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; }
@media (max-width: 760px) { .tenets { grid-template-columns: 1fr; } }
.tenet {
  background: var(--surface); border: 1px solid var(--rule);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.tenet-label { display: block; margin-bottom: 0.4rem; }
.tenet-title { font-family: var(--font-serif); font-weight: 700; font-size: 1.12rem; margin: 0 0 0.45rem; line-height: 1.25; }
.tenet p { margin: 0; font-size: 0.98rem; color: var(--ink-soft); font-family: var(--font-serif); }
.essay-link { margin: 1.6rem 0 0; }

/* ---- Section tabs: one horizontal row, two-line buttons (Don's note #3) ---- */
.part-tabs {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg); border-top: 1px solid var(--rule);
  flex-wrap: nowrap; gap: 4px; padding-top: 6px;
}
.part-tabs button {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; padding: 8px 10px 10px;
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.25;
}
.part-tabs .tab-num { font-family: var(--font-serif); font-weight: 700; font-size: 0.92rem; color: var(--accent); letter-spacing: 0; }
.part-tabs .tab-title { font-size: 0.63rem; letter-spacing: 0.04em; }
@media (max-width: 720px) { .part-tabs .tab-title { font-size: 0.56rem; letter-spacing: 0.04em; } }

/* ---- L1: Part (tab panel) ---- */
.part { padding: 1.8rem 0 0.6rem; }
.part[hidden] { display: none; }
@media print {
  .part-tabs { display: none; }
  .part[hidden] { display: block; }
}
/* Numeral in accent, no eyebrow, baseline-aligned with the section heading (ballot #2). */
.part-head { display: flex; align-items: baseline; margin-bottom: 0.6rem; }
.part-numeral {
  font-family: var(--font-serif); font-weight: 700; font-size: 3.4rem; line-height: 0.9;
  color: var(--accent);
  flex: none; width: var(--gutter);
}
.part-titles { flex: 1; }
.part-title { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.012em; margin: 0; }
.part-lede { font-family: var(--font-serif); font-size: 1.1rem; color: var(--ink-soft); margin: 0.5rem 0 0; }

/* ---- L2: Area ---- */
.area { border-top: 1px solid var(--rule); padding: 2.6rem 0; }
.part .area:first-of-type { border-top: none; margin-top: 1.6rem; }
.area-head { display: flex; align-items: flex-start; margin-bottom: 1.2rem; }
.area-numeral {
  font-family: var(--font-serif); font-weight: 700; font-size: 1.9rem; line-height: 1;
  color: var(--accent); opacity: 0.65;
  flex: none; width: var(--gutter); padding-top: 0.3rem;
}
.area-titles { flex: 1; padding-top: 0.15rem; }
.area-title { font-size: clamp(1.45rem, 2.4vw, 1.85rem); letter-spacing: -0.01em; margin: 0; }
.area-body { margin-left: var(--gutter); }
@media (max-width: 640px) { .area-body { margin-left: 0; } }

/* ---- Standardized paragraph text (Don, 2026-08-26): one size and rhythm
   for area ledes, approach text, and all card prose; furniture does the
   differentiating. ---- */
.area-lede, .approach p, .card-vp, .card-body, .card-body p,
.flows .flow-desc, .suite-blurb {
  font-size: 1.04rem; line-height: 1.62;
}
.flows .flow-name { font-size: 1rem; }

/* ---- L3a: problem lede (margin-to-margin, serif) ---- */
.area-lede { color: var(--ink-soft); margin: 0 0 1.3rem; max-width: none; }

/* ---- L3b: solution approach (canon label-topped callout; margin-to-margin, serif) ---- */
.approach { border-top: 2px solid var(--accent); padding-top: 0.5rem; margin: 0 0 1.4rem; }
.approach-label { display: block; margin-bottom: 0.15rem; }
.approach p { margin: 0; color: var(--ink-soft); font-family: var(--font-serif); }

/* ---- Feature row: card and exhibit split 1/2 + 1/2, exhibit unframed (Don, 2026-08-13) ---- */
.feature-row { display: flex; gap: 1.4rem; align-items: center; margin: 0 0 1.1rem; }
.feature-row .card--feature { flex: 1 1 0; min-width: 0; margin: 0; }
.feature-row--solo .card--feature { flex: 1 1 100%; }
.feature-exhibit {
  flex: 1 1 0; min-width: 0; margin: 0;
  display: flex; flex-direction: column; justify-content: center;
}
/* Exhibits are document artifacts: they always render on the light paper
   plate (#FBF8F1 = Trusted light bg). Invisible in light mode, a clean
   sheet in dark mode — no per-image dark variants needed. */
.feature-exhibit img { width: 100%; height: auto; display: block; cursor: zoom-in; background: #FBF8F1; border-radius: var(--radius); padding: 8px; }
.feature-exhibit .wb-figcap { margin-top: 0.6rem; }
@media (max-width: 760px) { .feature-row { flex-direction: column; } }

/* Stacked layout: feature + suite cards share a left column beside a tall exhibit */
.stack-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.stack-col .card { margin: 0; }

/* Suite or prominent card + exhibit: card at 2/3, exhibit at 1/3 */
.suite-row { display: flex; gap: 1.4rem; align-items: center; margin: 0 0 1.1rem; }
.suite-row > .card { flex: 2 1 0; min-width: 0; margin: 0; }
.suite-row--solo > .card { flex: 1 1 100%; }
.suite-exhibit { flex: 1 1 0; }
@media (max-width: 760px) { .suite-row { flex-direction: column; } }

/* ---- Exhibit lightbox: canon modal anatomy, max-fit to the window ----
   The card always fills the viewport minus a buffer; the graphic scales UP
   or down to the largest size that fits (no scrolling), caption below,
   uniform 20px margin. */
.lightbox .wb-modal {
  width: calc(100vw - 48px);
  height: calc(100vh - 48px);
  max-width: none; max-height: none;
  overflow: hidden; padding: 20px;
  display: flex; flex-direction: column;
}
.lightbox .wb-modal img {
  display: block; flex: 1 1 auto; min-height: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #FBF8F1; border-radius: var(--radius); /* paper plate, see exhibit note */
}
.lightbox .wb-modal .wb-figcap { margin: 10px 0 0; flex: none; text-align: center; }
/* Metric columns inside feature cards: explicit stacks (tile_split controls the break) */
.feature-tiles { display: flex; gap: 12px 20px; }
.feature-tiles-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
/* Number and label sit as columns, so a wrapped label aligns under itself */
.feature-tiles .wb-tile { display: flex; align-items: baseline; gap: 8px; }
.feature-tiles .wb-tile .num { flex: none; }
.feature-tiles .wb-tile .brand-label { line-height: 1.3; }

/* ---- L3c: project card ---- */
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin: 0 0 1.1rem;
}
.card-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.35rem; color: var(--accent); margin: 0.3rem 0 0.6rem; line-height: 1.15; letter-spacing: -0.01em; }
.card-name a { color: inherit; text-decoration: none; }
.card-name a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.card-vp { margin: 0 0 0.9rem; max-width: none; color: var(--ink-soft); }
.card-body { max-width: none; color: var(--ink-soft); }
.card-body p { margin: 0 0 0.8rem; }
.card-body p:last-child { margin-bottom: 0; }
.card .wb-tiles--summary { margin: 1rem 0; }
.card .wb-link-arrow { margin-top: 0.4rem; display: inline-block; }
.card .demo-facade, .card .demo-live-btn { margin-top: 1rem; display: inline-block; }
.card .demo-facade { display: block; }

/* ---- Grouped & listed: flows rows ---- */
.suite-blurb { margin: 0.3rem 0 0.4rem; color: var(--ink-soft); max-width: none; }
.flows { list-style: none; margin: 0.2rem 0 0; padding: 0; }
.flows li { padding: 0.85rem 0; border-top: 1px solid var(--rule); }
.flows li:first-child { border-top: none; padding-top: 0.3rem; }
.flow-name { font-family: var(--font-sans); font-weight: 700; margin-right: 0.15rem; }
.flow-desc { color: var(--ink-soft); font-family: var(--font-serif); }
.flows--bare { margin-top: 1rem; }
.flows--bare li:first-child { border-top: 1px solid var(--rule); }

/* ---- L3d: bridge — margin-ruled anatomy (ballot #6; margin-to-margin, serif) ---- */
.bridge {
  border-left: 2px solid var(--rule); padding-left: 1rem; margin: 1.5rem 0 0;
  font-family: var(--font-serif); font-style: italic; color: var(--ink-mute); font-size: 0.98rem;
}
.bridge-mark {
  display: block; font-style: normal; font-family: var(--font-sans); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.62rem; font-weight: 700; color: var(--accent);
  margin-bottom: 0.15rem;
}

/* ---- Close band ---- */
.close-band { background: var(--surface); border-top: 1px solid var(--rule); margin-top: 3rem; padding: 3rem 0; }
.close-title { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0.4rem 0 1.1rem; }
.close-body { font-size: 1.12rem; color: var(--ink-soft); max-width: none; margin: 0; }

/* ---- Project subpage ---- */
.wb-read { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.project-page { padding-top: 40px; }
.project-title { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 12px 0 14px; }
.project-vp { font-size: 1.06rem; color: var(--ink-soft); }
/* L4: subpage body headings — smallest heading tier */
.project-body h2 { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; margin: 1.8rem 0 0.5rem; }
.demo-block { margin: 36px 0; }
.demo-block .wb-sec-title { font-size: 1.1rem; }
.demo-facade { position: relative; }
.demo-poster { max-width: 100%; border: 1px solid var(--rule); border-radius: var(--radius); display: block; margin-bottom: 12px; }
.demo-frame { width: 100%; height: 640px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }

/* ---- Essay ---- */
.essay-page { padding-top: 40px; }
.essay-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 12px 0 20px; }
.essay-body { font-size: 1.04rem; }

/* ---- Footer ---- */
.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-top: 0;
  padding: 22px clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans); font-size: 0.78rem; color: var(--ink-mute);
}
