/* Square Vize studio layer: interior page compositions, the three studio artworks and the four
   role journeys. Loaded after /styles.css on every page, so the rules here refine that baseline
   rather than repeat it. The shared shell (tokens, masthead, footer, actions) is /brand.css,
   loaded after this file; the homepage body is composed separately by /studio-home.css, loaded
   last. Nothing here targets the shell or the homepage.

   System: midnight ink on white, hairline rules, square-cut actions, one cobalt used for the
   mark, focus rings, current-page markers and small index numerals (tokens in /brand.css).
   Dense, legible detail over decoration. No cards-for-everything, no glow, no gradients.

   Hooks (set by src/views/layout.js from the route):
     body.is-<section>        is-services, is-service, is-woro, is-setup, is-enquire, is-about,
                              is-legal, is-journey, is-console, is-not-found
     body.art-<kind>          art-engineering | art-finance | art-formation, when the page
                              carries one of the studio artworks in its page head
     .studio-art.art-<kind>   reusable <figure> markup from studioArt() in layout.js
   A page renderer may place a `.studio-art` figure inside `.page-head`; the generated artwork
   then stands down in favour of the real image element. */

:root {
  /* Small labels and index numerals share one voice across the journeys and service pages. */
  --label-size: 0.74rem;
  --label-track: 0.06em;
}

/* The masthead, the navigation and the footer are styled in /brand.css. */

/* ---- Artwork ---------------------------------------------------------------------------- */
.studio-art { position: relative; margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius-l); background: var(--paper-2); }
.studio-art img { width: 100%; height: 100%; object-fit: cover; }
.studio-art.art-engineering { background: var(--art-engineering); }
.studio-art.art-finance { background: var(--art-finance); }
.studio-art.art-formation { background: var(--art-formation); }
.studio-art figcaption { position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 4px 10px; font-size: 0.75rem; color: var(--ink-2); background: color-mix(in srgb, var(--paper) 90%, transparent); border-radius: var(--pill); }

body.art-engineering { --page-art: url("/assets/studio/engineering.webp"); --page-art-tone: var(--art-engineering); }
body.art-finance { --page-art: url("/assets/studio/finance.webp"); --page-art-tone: var(--art-finance); }
body.art-formation { --page-art: url("/assets/studio/formation.webp"); --page-art-tone: var(--art-formation); }

/* ---- Page heads ------------------------------------------------------------------------- */
.page-head { padding-top: clamp(8px, 1.5vw, 20px); }
.page-head > .eyebrow:first-child::before, .page-hero .eyebrow::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; vertical-align: 1px; border-radius: 50%; background: var(--accent); }
.page-head h1 { max-width: 18ch; }
.page-head .lede { margin-bottom: 0.5em; }

/* Editorial head with artwork: copy on the left, a 3:2 artwork on the right, vertically
   centred against each other. Rows 1 and 7 are flexible so three to five copy elements all
   centre; the artwork spans every row. The e-invoicing head carries a fifth element (the link
   to its field check), which is why five explicit rows are mapped. */
body.art-engineering .page-head, body.art-finance .page-head, body.art-formation .page-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: 1fr auto auto auto auto auto 1fr;
  column-gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-bottom: clamp(28px, 4vw, 52px);
  margin-bottom: clamp(28px, 4vw, 52px);
  border-bottom: 1px solid var(--rule);
}
body.art-engineering .page-head > *, body.art-finance .page-head > *, body.art-formation .page-head > * { grid-column: 1; }
body.art-engineering .page-head > :nth-child(1), body.art-finance .page-head > :nth-child(1), body.art-formation .page-head > :nth-child(1) { grid-row: 2; }
body.art-engineering .page-head > :nth-child(2), body.art-finance .page-head > :nth-child(2), body.art-formation .page-head > :nth-child(2) { grid-row: 3; }
body.art-engineering .page-head > :nth-child(3), body.art-finance .page-head > :nth-child(3), body.art-formation .page-head > :nth-child(3) { grid-row: 4; }
body.art-engineering .page-head > :nth-child(4), body.art-finance .page-head > :nth-child(4), body.art-formation .page-head > :nth-child(4) { grid-row: 5; }
body.art-engineering .page-head > :nth-child(5), body.art-finance .page-head > :nth-child(5), body.art-formation .page-head > :nth-child(5) { grid-row: 6; }
body.art-engineering .page-head::after, body.art-finance .page-head::after, body.art-formation .page-head::after {
  content: "";
  grid-column: 2;
  grid-row: 1 / 8;
  align-self: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  background-color: var(--page-art-tone);
  background-image: var(--page-art);
  background-size: cover;
  background-position: center;
}
/* A real figure placed in the head by the renderer replaces the generated artwork. */
.page-head > .studio-art { grid-column: 2 !important; grid-row: 1 / 8 !important; align-self: center; }
.page-head:has(> .studio-art)::after { content: none; }
@media (max-width: 900px) {
  body.art-engineering .page-head, body.art-finance .page-head, body.art-formation .page-head { display: flex; flex-direction: column; align-items: stretch; }
  body.art-engineering .page-head::after, body.art-finance .page-head::after, body.art-formation .page-head::after { aspect-ratio: 16 / 9; margin-top: 22px; }
  .page-head > .studio-art { aspect-ratio: 16 / 9; margin-top: 22px; }
}

/* Service detail: breadcrumb eyebrow, title, lede, descriptor chip and, on e-invoicing, the
   link to its field check. Hierarchy: crumb, then title, then one line of what it is for. */
.is-service .page-head .eyebrow { font-size: var(--label-size); letter-spacing: var(--label-track); text-transform: uppercase; }
.is-service .page-head .eyebrow a { color: var(--ink); }
.is-service .page-head h1 { max-width: 16ch; }
.is-service .page-head p.mono.small { display: inline-block; margin-top: 4px; padding: 5px 11px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--surface); color: var(--ink-2); font-size: 0.8rem; }
.is-service .page-head > .btn { justify-self: start; margin-top: 14px; }
.is-service .service-page { padding-top: clamp(24px, 3vw, 40px); }
.is-service .service-main h2 { font-size: 1.2rem; }
.is-service .service-side .panel .eyebrow { font-size: var(--label-size); letter-spacing: var(--label-track); text-transform: uppercase; }

/* Woro sits on the dark plate; the artwork border and chip follow the plate rules. */
.is-woro .page-head::after { border-color: var(--plate-rule); }
.is-woro .page-head { border-bottom-color: var(--plate-rule); }
.is-woro .woro-page > .section { padding-top: clamp(24px, 3vw, 40px); }

/* About: the narrow reading column widens just enough to hold the head's artwork. */
.is-about .section.narrow { max-width: 1040px; }
.is-about .section.narrow > :not(.page-head) { max-width: 740px; }
.is-about .section.narrow > h2 { margin-top: 1.6em; font-size: 1.35rem; }
.is-about table.spec tbody th { width: 30%; }

/* Legal pages and status pages keep a quiet text-only head. */
.is-legal .page-head, .is-enquire .page-head, .is-setup .page-head { padding-bottom: clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--rule); }
.is-legal .page-head p.small.mono { margin: 0; color: var(--ink-3); }
.status-page h1 { max-width: 16ch; }

/* ---- Services index: three groups, each with its own artwork beside the rows ---------------- */
.is-services .page-head { padding-bottom: clamp(20px, 3vw, 32px); margin-bottom: 0; }
.is-services .page-head h1 { max-width: 16ch; }
.service-group { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(28px, 5vw, 72px); row-gap: 0; }
.service-group > * { grid-column: 2; }
.service-group::before { content: ""; grid-column: 1; grid-row: 1 / span 3; align-self: start; position: sticky; top: calc(var(--head-h) + 20px); width: 100%; aspect-ratio: 3 / 2; border: 1px solid var(--rule); border-radius: var(--radius-l); background: var(--paper-2) center / cover no-repeat; }
.service-group[aria-labelledby="g-engineer"]::before { background-color: var(--art-engineering); background-image: url("/assets/studio/engineering.webp"); }
.service-group[aria-labelledby="g-operate"]::before { background-color: var(--art-finance); background-image: url("/assets/studio/finance.webp"); }
.service-group[aria-labelledby="g-establish"]::before { background-color: var(--art-formation); background-image: url("/assets/studio/formation.webp"); }
.service-group h2 { margin-bottom: 0.3em; }
.service-group > .lede { margin-bottom: 1.2em; }
.service-group .service-list { border-top: 1px solid var(--rule); }
.service-group .service-row:first-child { border-top: 0; }
.service-row .index { color: var(--ink-3); font-size: 1rem; line-height: 1.5; padding-top: 2px; }
.is-services .note { margin-top: clamp(24px, 4vw, 40px); }
@media (max-width: 900px) {
  .service-group { grid-template-columns: 1fr; }
  .service-group > * { grid-column: 1; }
  .service-group::before { grid-row: 1; position: static; aspect-ratio: 16 / 9; margin-bottom: 22px; }
}

/* ---- Role journeys (/operations /technology /finance /founders) --------------------------- */
/* Role strip: the four mandates as one row under the masthead, current one underlined in the
   accent. Scrolls sideways on narrow screens instead of wrapping into a second row. */
.role-nav { border-bottom: 1px solid var(--rule); background: var(--surface); }
.role-nav-row { display: flex; align-items: stretch; gap: clamp(12px, 2vw, 24px); min-height: 48px; }
.role-nav-label { align-self: center; margin: 0; font-size: var(--label-size); font-weight: 500; letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.role-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.role-nav ul::-webkit-scrollbar { display: none; }
.role-nav a { display: inline-flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 48px; padding: 6px 12px; text-decoration: none; color: var(--ink-2); font-size: 0.92rem; font-weight: 500; line-height: 1.2; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s ease, border-color 0.15s ease; }
.role-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.role-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.role-nav a:focus-visible { outline-offset: -2px; border-radius: 0; }
.role-nav-who { font-size: 0.74rem; font-weight: 400; color: var(--ink-3); }
@media (max-width: 640px) { .role-nav-label { display: none; } .role-nav-who { display: none; } .role-nav a { padding: 0 10px; } }

/* Hero: copy beside one studio photograph. */
.page-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(36px, 6vw, 88px) clamp(32px, 5vw, 64px); }
.page-hero .eyebrow { max-width: 60ch; }
.page-hero-copy h1 { margin-bottom: 0.45em; max-width: 18ch; }
.journey-hero h1 { font-size: clamp(2.1rem, 1.15rem + 3.1vw, 3.6rem); }
.page-hero-copy .lede { margin-bottom: 0; }
.page-hero-copy .actions { margin: 1.5em 0 0.9em; }
/* The secondary action names a tool; its label may be long, so it wraps instead of forcing a
   horizontal scroll on narrow screens. */
.page-hero-copy .actions .btn.ghost { white-space: normal; text-align: center; line-height: 1.25; padding-block: 9px; }
.page-hero .hero-note { max-width: 46ch; margin: 0; }
@media (max-width: 900px) {
  .page-hero { grid-template-columns: 1fr; gap: 26px; padding-top: 28px; }
  .page-hero .studio-art { aspect-ratio: 16 / 9; }
}
@media (max-width: 480px) {
  .page-hero-copy .actions .btn { max-width: 100%; }
}

/* Facts strip: four rules that hold on every engagement, set as a ruled row. */
.journey-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(16px, 3vw, 40px); margin: 0 auto clamp(8px, 2vw, 24px); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.journey-facts > div { padding: 14px 0 16px; }
.journey-facts dt { font-size: var(--label-size); font-weight: 500; letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.journey-facts dd { margin: 0; font-size: 0.93rem; line-height: 1.45; color: var(--ink-2); max-width: 32ch; }
@media (max-width: 860px) { .journey-facts { grid-template-columns: 1fr 1fr; } .journey-facts > div { padding-block: 12px; } }
@media (max-width: 480px) { .journey-facts { grid-template-columns: 1fr; } .journey-facts > div + div { border-top: 1px solid var(--rule); } }

/* Body: a spec sheet. Each section is a two-column grid with a sticky heading column on the
   left and dense content on the right; one hairline between sections. */
.journey-body { max-width: var(--max); margin-inline: auto; }
.journey-section { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px clamp(28px, 5vw, 80px); padding: clamp(28px, 4vw, 52px) 0; border-top: 1px solid var(--rule); }
.journey-body > .journey-section:first-child { border-top: 0; }
.journey-section-head { align-self: start; position: sticky; top: calc(var(--head-h) + 20px); }
.journey-section-head .eyebrow { font-size: var(--label-size); letter-spacing: var(--label-track); text-transform: uppercase; margin-bottom: 0.7em; }
.journey-section-head .eyebrow::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; vertical-align: 1px; border-radius: 50%; background: var(--accent); }
.journey-section h2 { font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem); letter-spacing: -0.02em; margin: 0; max-width: 18ch; }
.journey-section-body { min-width: 0; }
.journey-section-body > p { max-width: var(--measure); }
.journey-section-body > :last-child { margin-bottom: 0; }
@media (max-width: 900px) {
  .journey-section { grid-template-columns: 1fr; gap: 14px; }
  .journey-section-head { position: static; }
  .journey-section h2 { max-width: 26ch; }
}

/* The mandate: numbered accountabilities, index numerals in the accent. */
.mandate-list { list-style: none; counter-reset: mandate; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.mandate-list li { counter-increment: mandate; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 8px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.mandate-list li::before { content: counter(mandate, decimal-leading-zero); grid-column: 1; grid-row: 1 / span 2; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--accent-ink); padding-top: 5px; }
.mandate-list strong { grid-column: 2; display: block; font-weight: 600; margin-bottom: 2px; }
.mandate-list span { grid-column: 2; display: block; color: var(--ink-2); max-width: 60ch; }

/* Triggers: when this happens / what we do first. Subgrid keeps the two columns aligned across
   rows; browsers without subgrid stack each pair, which still reads correctly. */
.triggers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 0 clamp(16px, 3vw, 40px); margin: 0; }
.triggers > div { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; gap: 6px clamp(16px, 3vw, 40px); padding: 14px 0; border-top: 1px solid var(--rule); }
.triggers > div:last-child { border-bottom: 1px solid var(--rule); }
.triggers-head { font-size: var(--label-size); font-weight: 500; letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-3); border-top: 0 !important; padding-bottom: 8px !important; }
.triggers dt { font-weight: 600; color: var(--ink); }
.triggers dd { margin: 0; color: var(--ink-2); }
@media (max-width: 700px) {
  .triggers, .triggers > div { grid-template-columns: 1fr; }
  .triggers-head { display: none; }
  .triggers dd::before { content: "First step"; display: block; font-size: var(--label-size); font-weight: 500; letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-3); margin: 4px 0 2px; }
}

/* Evidence: ticked statements; links inside take the accent underline on hover. */
.evidence { margin: 0; }
.evidence li { max-width: 72ch; }
.evidence li:first-child { padding-top: 0; }
.evidence li:first-child::before { top: 8px; }
.journey-zones { margin: 22px 0 10px; min-width: 620px; }
.journey-zones th:first-child, .journey-zones td:first-child { font-weight: 500; }

/* Services: ruled rows, not cards. */
.journey-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 clamp(20px, 3vw, 40px); border-top: 1px solid var(--rule); }
.journey-service { display: flex; flex-direction: column; gap: 6px; padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.journey-service h3 { font-size: 1.08rem; margin: 0; }
.journey-service h3 a { text-decoration: none; }
.journey-service h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.journey-service p { margin: 0; }
.journey-service .link { margin-top: auto; padding-top: 12px; font-size: 0.92rem; }

/* Deliverables: deliverable, owner, handover. Stacks into labelled rows on narrow screens. */
.deliverables { font-size: 0.9rem; }
.deliverables th { font-size: var(--label-size); letter-spacing: var(--label-track); text-transform: uppercase; }
.deliverables th:nth-child(1) { width: 36%; }
.deliverables th:nth-child(2) { width: 30%; }
.deliverables td { padding-right: 18px; color: var(--ink-2); }
.deliverables td:first-child strong { display: block; color: var(--ink); font-weight: 600; }
.deliverables td:first-child .muted { font-size: 0.78rem; margin-top: 2px; }
@media (max-width: 700px) {
  .deliverables thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .deliverables tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .deliverables td { display: block; padding: 4px 0; border: 0; }
  .deliverables td:not(:first-child)::before { content: attr(data-label); display: block; font-size: var(--label-size); font-weight: 500; letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
}

/* Sourced note and closing band. */
.journey-body > .note { margin: clamp(24px, 3.5vw, 40px) 0 0; }
.journey-body > .note .eyebrow { font-size: var(--label-size); letter-spacing: var(--label-track); text-transform: uppercase; margin-bottom: 0.6em; }
.journey-body > .note .plain li { padding: 6px 0; }
.journey-body > .note + .journey-section { margin-top: clamp(24px, 3.5vw, 40px); }
.journey-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 32px; align-items: center; margin-top: clamp(8px, 2vw, 24px); padding: clamp(28px, 4vw, 44px) 0 0; border-top: 1px solid var(--ink); }
.journey-cta h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); letter-spacing: -0.025em; margin-bottom: 0.3em; }
.journey-cta p { margin-bottom: 0.4em; max-width: 52ch; }
.journey-cta p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .journey-cta { grid-template-columns: 1fr; }
  .journey-cta .btn { justify-self: start; }
}

/* ---- Motion, forced colours, print ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .role-nav a, .site-nav a, .foot-col a { transition: none; }
}
@media (forced-colors: active) {
  .role-nav a[aria-current="page"] { text-decoration: underline; }
  .journey-facts, .journey-cta, .mandate-list li, .triggers > div { border-color: CanvasText; }
}
@media print {
  .role-nav, .journey-cta .btn, .page-hero .actions { display: none !important; }
  .journey-section { grid-template-columns: 1fr; page-break-inside: avoid; }
  .journey-section-head { position: static; }
}
