/* Portfolio ("pf") and Working Models ("wm"): see pm.js. Section heights come from their content (no vh heights,
 * no sticky or scroll-linked parts); the editorial tokens (--ed-*) and type (.ed-h2, .ed-eyebrow) are editorial.css's. */
html[data-ed="pf"], html[data-ed="wm"] { --pm-gap: clamp(4rem, 2.6rem + 3vw, 5.5rem); }
[data-ed="pf"] .ed-block[id], [data-ed="wm"] .ed-block[id], [data-ed="wm"] .pm-model,
[data-ed="pf"] [data-pm-tabs] { scroll-margin-top: calc(var(--ed-top) + 24px); }
.pm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-pm-gone] { display: none !important; }

/* ---------- sections: content height, 64–88px rhythm ---------- */
[data-ed="pf"] [data-ed-host], [data-ed="wm"] [data-ed-host] { padding-top: var(--pm-gap) !important; padding-bottom: var(--pm-gap) !important; min-height: 0 !important; }
[data-ed="pf"] [data-ed-host] > .ed-host, [data-ed="wm"] [data-ed-host] > .ed-host { margin: 0 !important; }
[data-ed="pf"] .marketing-page-section[data-landing-hero], [data-ed="wm"] .marketing-page-section[data-landing-hero] { padding-bottom: var(--pm-gap) !important; min-height: 0 !important; }
[data-ed="pf"] [data-marketing-closing-cta], [data-ed="wm"] [data-marketing-closing-cta] { min-height: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
[data-ed="pf"] [data-marketing-closing-cta] > .container-lev, [data-ed="wm"] [data-marketing-closing-cta] > .container-lev { padding-top: calc(var(--pm-gap) + 1rem) !important; padding-bottom: calc(var(--pm-gap) + 1rem) !important; }

/* ---------- hero ---------- */
html[data-ed="pf"] [data-ed-herocol] > p.marketing-eyebrow, html[data-ed="wm"] [data-ed-herocol] > p.marketing-eyebrow { order: -2; }
html[data-ed="pf"] [data-ed-herocol] > p.marketing-lead, html[data-ed="wm"] [data-ed-herocol] > p.marketing-lead { max-width: 40rem !important; }
html[data-ed="wm"] [data-ed-herocol] { max-width: 56rem; }
/* Portfolio and Models: text left, the compact plate right (≥1024px); on phones text and buttons first, the plate after */
@media (min-width: 1024px) {
  html[data-ed="pf"] [data-landing-hero] > .container-lev, html[data-ed="wm"] [data-landing-hero] > .container-lev:has([data-ed-stage]) { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3rem 4rem; align-items: center; }
  html[data-ed="pf"] [data-landing-hero] > .container-lev > div:nth-child(2), html[data-ed="wm"] [data-landing-hero] > .container-lev > div:nth-child(2) { margin-top: 0 !important; }
}
html[data-ed="pf"] [data-ed-stage], html[data-ed="wm"] [data-ed-stage] { border-radius: 14px; }
html[data-ed="pf"] [data-ed-stage] .ed-visual, html[data-ed="wm"] [data-ed-stage] .ed-visual { padding: clamp(.75rem, 2vw, 1.5rem); }
/* Models: the orrery is a square sheet (studio kind 'square'), a little narrower than its column */
html[data-ed="wm"] [data-ed-stage] .ed-visual { --ar: 1 / 1; --arm: 1 / 1; }
html[data-ed="wm"] [data-ed-stage] .ed-scene { max-width: 34rem; margin-inline: auto; }
html[data-ed="pf"] [data-landing-hero] .marketing-hero-title { max-width: 16ch !important; }

/* ---------- shared heads ---------- */
.pm-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem 4rem; align-items: end; }
.pm-h2 { margin-top: 0; max-width: 24ch; }
.pm-intro { font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem); line-height: 1.6; color: color-mix(in oklab, var(--foreground) 80%, transparent); max-width: 40rem; text-wrap: pretty; }
.pm-body { font-size: 1.02rem; line-height: 1.62; color: var(--ed-mute); text-wrap: pretty; }
.pm-h3 { margin-top: 0; max-width: 26ch; }
.pm-h4, .pm-xname, .pm-mname { font-size: 1.16rem; line-height: 1.3; letter-spacing: -.012em; font-weight: 500; color: var(--foreground); text-wrap: balance; }
@media (max-width: 1023px) { .pm-head { grid-template-columns: 1fr; } }

/* ---------- P2 tabs ---------- */
.pm-aud { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.pm-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.pm-tab {
  min-height: 3rem; padding: .7rem 1rem; border: 1px solid var(--ed-faint); border-radius: 10px; background: transparent;
  color: var(--ed-mute); font: inherit; font-size: 1rem; font-weight: 500; text-align: left; cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.pm-tab:hover { color: var(--foreground); border-color: var(--ed-soft); }
.pm-tab[aria-selected="true"] { color: var(--background); background: var(--foreground); border-color: var(--foreground); }
.pm-tab:focus-visible, .pm-role-btn:focus-visible, .pm-link:focus-visible, .pm-panel:focus-visible { outline: 2px solid var(--foreground); outline-offset: 3px; }
@media (max-width: 760px) { .pm-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pm-tab { text-align: center; } }
.pm-panel { margin-top: 1rem; padding: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--ed-rule); border-radius: 14px; background: var(--ed-card); }
.pm-panel[hidden] { display: none; }
.pm-panel-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 4rem; }
@media (max-width: 1023px) { .pm-panel-head { grid-template-columns: 1fr; } }
.pm-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: clamp(1.75rem, 3vw, 2.5rem); padding-top: clamp(1.5rem, 2.5vw, 2rem); border-top: 1px solid var(--ed-rule); }
.pm-areas p { margin-top: .5rem; font-size: .98rem; line-height: 1.58; color: var(--ed-mute); text-wrap: pretty; }
@media (max-width: 860px) { .pm-areas { grid-template-columns: 1fr; } }
.pm-note { margin-top: clamp(1.5rem, 2.5vw, 2rem); padding-top: 1.1rem; border-top: 1px dashed var(--ed-faint); font-size: .98rem; line-height: 1.55; color: color-mix(in oklab, var(--foreground) 78%, transparent); max-width: 52rem; }
/* the editor: every panel open so each line can be edited */
html[data-pm-edit] .pm-panel[hidden], html[data-pm-edit] .pm-role-body[hidden] { display: block; }

/* ---------- P3a logo wall: one square per organisation (marks: logos.js, painted in the text colour) ---------- */
.pm-logos-head .pm-h2 { margin-top: 1rem; }
.pm-logos { list-style: none; margin: clamp(2.25rem, 4vw, 3.25rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .5rem; }
.pm-logo { position: relative; aspect-ratio: 1; border: 1px solid var(--ed-faint); border-radius: 10px; color: color-mix(in oklab, var(--foreground) 70%, transparent); transition: color .25s, border-color .25s; }
.pm-logo:hover { color: var(--foreground); border-color: var(--ed-soft); }
.pm-logo > span {
  position: absolute; left: 50%; top: 50%; width: var(--w); height: var(--h); transform: translate(-50%, -50%); background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
/* the wall and the working-together area are two sections in one template section: the same gap and a rule between */
[data-ed="pf"] .ed-blk-logos + .ed-blk-together { margin-top: var(--pm-gap); padding-top: var(--pm-gap); border-top: 1px solid var(--ed-rule); }
@media (max-width: 1199px) { .pm-logos { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 899px) { .pm-logos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 559px) { .pm-logos { gap: .375rem; } .pm-logo { border-radius: 8px; } .pm-logo > span { transform: translate(-50%, -50%) scale(1.18); } }

/* ---------- P3 together ---------- */
.pm-together { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 4rem; align-items: end; }
.pm-together .pm-h2 { margin-top: 1rem; }
.pm-together-copy .pm-body { font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem); color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.pm-link { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.25rem; font-weight: 500; color: var(--foreground); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.pm-link:hover { text-decoration-thickness: 2px; }
@media (max-width: 1023px) { .pm-together { grid-template-columns: 1fr; } }

/* ---------- M2 six models ---------- */
.pm-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(2.25rem, 4vw, 3.25rem); align-items: start; }
@media (max-width: 1100px) { .pm-models { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .pm-models { grid-template-columns: 1fr; } }
.pm-model { display: flex; flex-direction: column; gap: .85rem; padding: clamp(1.35rem, 2.2vw, 1.75rem); border: 1px solid var(--ed-rule); border-radius: 14px; background: var(--ed-card); }
.pm-mname { font-size: clamp(1.3rem, 1.15rem + .4vw, 1.55rem); }
.pm-n { font-family: var(--ed-mono); font-size: .8em; color: var(--ed-mute); font-weight: 400; letter-spacing: 0; }
.pm-out { padding-top: .85rem; border-top: 1px solid var(--ed-rule); }
.pm-out p:last-child { margin-top: .35rem; font-size: .98rem; line-height: 1.55; color: color-mix(in oklab, var(--foreground) 82%, transparent); }
.pm-role { border-top: 1px solid var(--ed-rule); }
.pm-role-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0 .1rem; background: none; border: 0; color: var(--foreground); font: inherit; font-family: var(--ed-mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-align: left; }
.pm-plus { position: relative; width: 12px; height: 12px; flex: none; }
.pm-plus::before, .pm-plus::after { content: ""; position: absolute; left: 0; top: 5.5px; width: 12px; height: 1px; background: currentColor; transition: transform .2s; }
.pm-plus::after { transform: rotate(90deg); }
.pm-role-btn[aria-expanded="true"] .pm-plus::after { transform: rotate(0); }
.pm-role-body p { padding-top: .75rem; font-size: .98rem; line-height: 1.58; color: var(--ed-mute); text-wrap: pretty; }

/* ---------- M3 examples ---------- */
.pm-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(2.25rem, 4vw, 3.25rem); }
@media (max-width: 860px) { .pm-examples { grid-template-columns: 1fr; } }
.pm-example { padding: clamp(1.35rem, 2.2vw, 1.75rem); border: 1px solid var(--ed-rule); border-radius: 14px; }
.pm-example .pm-body { margin-top: .6rem; }
.pm-tag { display: inline-block; margin-bottom: 1rem; font-family: var(--ed-mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--foreground); border: 1px solid var(--ed-soft); border-radius: 999px; padding: 4px 10px; }
.pm-foot { margin-top: 1.25rem; font-size: .92rem; line-height: 1.5; color: var(--ed-mute); }

/* ---------- M4 B4B ---------- */
.pm-b4b-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem 4rem; align-items: end; }
.pm-b4b-head .ed-h2 { margin-top: 1rem; }
@media (max-width: 1023px) { .pm-b4b-head { grid-template-columns: 1fr; } }
.pm-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: clamp(2rem, 3.5vw, 3rem); padding-top: clamp(1.5rem, 2.5vw, 2rem); border-top: 1px solid var(--ed-rule); }
.pm-principles .pm-xname { margin-top: .6rem; }
.pm-principles .pm-body { margin-top: .45rem; }
@media (max-width: 860px) { .pm-principles { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { .pm-tab, .pm-plus::before, .pm-plus::after { transition: none; } }
