/* ==========================================================================
   ABOUT · THE EDITORIAL PORTRAIT & LIVING EXPERTISE TABS
   html[data-about="tabs-a"]  Study A · Soft Editorial Chapters
   html[data-about="tabs-b"]  Study B · Organic Editorial Chapters
   Both set html[data-ab-layout="tabs"]. Everything here is scoped to that attribute (or to .ab__bg,
   which is hidden everywhere else). Tokens are read, never changed.

   · one authentic portrait (the existing transparent cutout; the original photograph is untouched)
   · Sarah's supplied abstract artwork behind the profile, unchanged and static, placed by eye around the
     real layout (desktop: the whole landscape, never stretched; one column: an art-directed crop of it)
   · three expertise chapters: a one-open-at-a-time disclosure set (scripts/about.js), Conflict fluency
     open first; the studies differ only in the chapter surfaces
   · no drawn symbols, no morphing, no scroll-driven states, no pointer responses
   ========================================================================== */

.ab__bg { display: none; }

html[data-ab-layout="tabs"] #about {
  --abt-base: #FCECE5;            /* the artwork's own canvas (sampled: 251–253 / 235–237 / 227–231) */
  --abt-ink: var(--light-text);
  --abt-soft: var(--light-text-soft);
  background: var(--abt-base);
}

/* ---------- the artwork ------------------------------------------------------------ */
/* Sized and placed in units of the content width (cqw), so the composition holds from 1100 px to 1920 px:
   the landscape is shown whole (never stretched, aspect ratio kept), its edges dissolve into the matching
   base colour, and it never passes under the chapters' text. */
html[data-ab-layout="tabs"] .ab { container-type: inline-size; isolation: isolate; }
html[data-ab-layout="tabs"] .ab__bg {
  display: block;
  position: absolute; z-index: -1;
  left: var(--abt-x, -25cqw); top: var(--abt-y, calc(12.5rem - 32cqw)); width: var(--abt-w, 138cqw);   /* set by eye at 1440, checked 900–2560 */
  pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, #000 0, #000 84%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, #000 0, #000 84%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}
html[data-ab-layout="tabs"] .ab__bg img { display: block; width: 100%; height: auto; }
html[data-ab-layout="tabs"] #about .scope { position: relative; z-index: 1; }

/* the elements of the other studies that are not used here */
html[data-ab-layout="tabs"] .ab__form,
html[data-ab-layout="tabs"] .ab__motif,
html[data-ab-layout="tabs"] .ab__art,
html[data-ab-layout="tabs"] .ab__field { display: none; }

/* ---------- the portrait ------------------------------------------------------------ */
html[data-ab-layout="tabs"] .ab__photo {
  aspect-ratio: 5 / 6;
  border-radius: 0;
  /* the jacket runs off the photograph's bottom and left edges: it settles into the artwork there */
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%), linear-gradient(to right, transparent 0, #000 9%);
          mask-image: linear-gradient(to bottom, #000 82%, transparent 100%), linear-gradient(to right, transparent 0, #000 9%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}
html[data-ab-layout="tabs"] .ab__photo img { object-position: 50% 9%; }

/* ==========================================================================
   DESKTOP · a stationary two-column composition (no sticky: the chapters are chosen, not scrolled)
   ========================================================================== */
@media (min-width: 900px) {
  html[data-ab-layout="tabs"] .ab {
    --ab-name: clamp(2.75rem, 1.4rem + 3.3vw, 5.25rem);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "lead lede" "lead list";
    grid-template-rows: auto 1fr;
    column-gap: clamp(3.5rem, 1.5rem + 5vw, 8rem);
    align-items: start;
  }
  html[data-ab-layout="tabs"] .ab__lead { grid-area: lead; }
  html[data-ab-layout="tabs"] .ab__identity { margin-bottom: clamp(1.5rem, 0.75rem + 1.4vw, 2.5rem); }
  html[data-ab-layout="tabs"] .ab__name-cred { margin-top: 0.42em; }
  /* the portrait is sized in the same units as the artwork (cqw of the content width), so the two keep
     their relationship from 900 px to the widest layout */
  html[data-ab-layout="tabs"] .ab__portrait { width: 39cqw; margin-left: 3.2cqw; }
  html[data-ab-layout="tabs"] .ab__lede { grid-area: lede; padding-top: clamp(2.25rem, 1rem + 3vw, 4.5rem); }
  html[data-ab-layout="tabs"] .ab__list { grid-area: list; margin-top: clamp(2.25rem, 1.25rem + 2vw, 3.5rem); max-width: 40rem; }
}

/* ==========================================================================
   THE CHAPTERS · shared structure (A and B differ only in their surfaces, below)
   ========================================================================== */
html[data-ab-layout="tabs"] .ab-d { position: relative; padding: 0; border: 0; min-height: 0; }
html[data-ab-layout="tabs"] .ab-d + .ab-d { margin-top: clamp(0.625rem, 0.4rem + 0.4vw, 0.875rem); }
html[data-ab-layout="tabs"] .ab-d::before { content: none; }

/* before the script has built the chapters (or without it), every description is simply shown */
html[data-ab-layout="tabs"] .ab:not(.ab--acc) .ab-d { padding: 1.1rem 1.35rem 1.35rem; }
html[data-ab-layout="tabs"] .ab:not(.ab--acc) .ab-d__mark .ab-glyph { display: none; }

html[data-ab-layout="tabs"] .ab-d__title { margin: 0; padding: 0; font-size: inherit; color: var(--abt-ink); overflow: visible; }
html[data-ab-layout="tabs"] .ab-d__btn {
  display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; column-gap: 0.5rem;
  width: 100%; margin: 0; padding: clamp(1rem, 0.8rem + 0.4vw, 1.25rem) clamp(1.1rem, 0.8rem + 0.8vw, 1.6rem);
  border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
  font: inherit; -webkit-tap-highlight-color: transparent;
  border-radius: inherit;
}
html[data-ab-layout="tabs"] .ab-d__btn[aria-disabled="true"] { cursor: default; }
html[data-ab-layout="tabs"] .ab-d__btn:focus { outline: none; }
html[data-ab-layout="tabs"] .ab-d__btn:focus-visible { outline: 2px solid var(--light-focus); outline-offset: 3px; }
html[data-ab-layout="tabs"] .ab-d__btn .ab-d__num { align-self: center; padding-top: 0.15em; transition: color 360ms var(--ease-quiet); }
html[data-ab-layout="tabs"] .ab-d__btn .ab-d__title-in {
  font-family: var(--font-display); font-weight: 360; line-height: 1.12;
  font-size: clamp(1.5rem, 1.05rem + 1.05vw, 2.25rem);
  color: var(--abt-soft); transition: color 360ms var(--ease-quiet);
}
html[data-ab-layout="tabs"] .ab-d.is-open .ab-d__title-in,
html[data-ab-layout="tabs"] .ab-d__btn:hover .ab-d__title-in,
html[data-ab-layout="tabs"] .ab-d__btn:focus-visible .ab-d__title-in { color: var(--abt-ink); }
html[data-ab-layout="tabs"] .ab-d.is-open .ab-d__num { color: var(--c-orange); }

/* the open / closed indicator: a small circle with a plus that becomes a minus */
html[data-ab-layout="tabs"] .ab-d__ind {
  position: relative; width: 1.75rem; height: 1.75rem; flex: none;
  border: 1px solid rgb(20 18 21 / 0.28); border-radius: 50%;
  transition: border-color 360ms var(--ease-quiet), background-color 360ms var(--ease-quiet);
}
html[data-ab-layout="tabs"] .ab-d__ind::before,
html[data-ab-layout="tabs"] .ab-d__ind::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0.625rem; height: 1.25px; margin: -0.6px 0 0 -0.3125rem;
  background: var(--abt-ink); border-radius: 1px;
  transition: transform 420ms var(--ease-reveal), background-color 360ms var(--ease-quiet);
}
html[data-ab-layout="tabs"] .ab-d__ind::after { transform: rotate(90deg); }
html[data-ab-layout="tabs"] .ab-d.is-open .ab-d__ind::after { transform: rotate(90deg) scaleX(0); }
html[data-ab-layout="tabs"] .ab-d__btn:hover .ab-d__ind { border-color: rgb(20 18 21 / 0.5); }
html[data-ab-layout="tabs"] .ab-d.is-open .ab-d__ind { border-color: var(--c-orange); }
html[data-ab-layout="tabs"] .ab-d.is-open .ab-d__ind::before { background: var(--c-orange); }

/* the expansion: grid rows 0fr → 1fr (no height measuring, no jumps), with a short opacity and rise */
html[data-ab-layout="tabs"] .ab--acc .ab-d__panel {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 440ms var(--ease-in-out), visibility 0s linear 440ms;
}
html[data-ab-layout="tabs"] .ab--acc .ab-d.is-open .ab-d__panel {
  grid-template-rows: 1fr; visibility: visible;
  transition: grid-template-rows 440ms var(--ease-in-out), visibility 0s linear 0s;
}
html[data-ab-layout="tabs"] .ab-d__panel-in { min-height: 0; overflow: hidden; }
html[data-ab-layout="tabs"] .ab-d__panel-in .ab-d__desc {
  margin: 0; max-width: 42ch;
  padding: 0 clamp(1.1rem, 0.8rem + 0.8vw, 1.6rem) clamp(1.25rem, 1rem + 0.6vw, 1.6rem) calc(clamp(1.1rem, 0.8rem + 0.8vw, 1.6rem) + 2.75rem);
  font-size: var(--fs-lede); line-height: 1.6; color: var(--abt-soft);
}
html[data-ab-layout="tabs"] .ab--acc .ab-d:not(.is-open) .ab-d__desc { opacity: 0; transform: translateY(-6px); }
html[data-ab-layout="tabs"] .ab--acc .ab-d.is-open.is-in .ab-d__desc { opacity: 1; transform: none; }
html[data-ab-layout="tabs"] .ab--acc .ab-d__desc {
  transition: opacity 300ms var(--ease-quiet) calc(var(--d, 0ms) + 120ms), transform 420ms var(--ease-reveal) calc(var(--d, 0ms) + 60ms);
}
html[data-ab-layout="tabs"] .ab--acc .ab-d:not(.is-open) .ab-d__desc { transition-delay: 0ms; transition-duration: 180ms, 260ms; }

@media (prefers-reduced-motion: reduce) {
  html[data-ab-layout="tabs"] .ab--acc .ab-d__panel,
  html[data-ab-layout="tabs"] .ab--acc .ab-d.is-open .ab-d__panel,
  html[data-ab-layout="tabs"] .ab--acc .ab-d__desc,
  html[data-ab-layout="tabs"] .ab-d,
  html[data-ab-layout="tabs"] .ab-d *,
  html[data-ab-layout="tabs"] .ab-d::after { transition: none !important; }
}

/* ==========================================================================
   STUDY A · SOFT EDITORIAL CHAPTERS
   tinted ivory surfaces, a fine border, softly rounded; the open chapter warms and an orange marker
   stands at its edge
   ========================================================================== */
html[data-about="tabs-a"] .ab-d {
  background: rgb(255 249 245 / 0.78);
  border: 1px solid rgb(20 18 21 / 0.11);
  border-radius: 1rem;
  transition: background-color 420ms var(--ease-quiet), border-color 420ms var(--ease-quiet);
}
html[data-about="tabs-a"] .ab-d:hover { border-color: rgb(20 18 21 / 0.2); }
html[data-about="tabs-a"] .ab-d.is-open { background: rgb(255 241 232 / 0.94); border-color: rgb(20 18 21 / 0.16); }
html[data-about="tabs-a"] .ab-d::after {
  content: ""; position: absolute; left: -1px; top: clamp(1.15rem, 0.95rem + 0.4vw, 1.4rem); width: 2px; height: 1.75rem;
  background: var(--c-orange); border-radius: 0 2px 2px 0;
  transform: scaleY(0); transform-origin: 50% 0; transition: transform 420ms var(--ease-reveal);
}
html[data-about="tabs-a"] .ab-d.is-open::after { transform: scaleY(1); }

/* ==========================================================================
   STUDY B · ORGANIC EDITORIAL CHAPTERS
   the same structure; the surfaces carry a soft asymmetry, and the open chapter relaxes into a more
   curved shape with a partial echo of the artwork's coral at its outer corner
   ========================================================================== */
html[data-about="tabs-b"] .ab-d {
  overflow: hidden;
  background: rgb(255 249 245 / 0.8);
  border: 1px solid rgb(20 18 21 / 0.1);
  border-radius: 1.6rem 0.7rem 1.4rem 0.8rem / 1.3rem 0.8rem 1.6rem 0.9rem;
  transition: background-color 440ms var(--ease-quiet), border-color 440ms var(--ease-quiet), border-radius 520ms var(--ease-in-out);
}
html[data-about="tabs-b"] .ab-d:hover { border-color: rgb(20 18 21 / 0.2); }
html[data-about="tabs-b"] .ab-d.is-open {
  background: rgb(255 244 237 / 0.95);
  border-color: rgb(232 120 80 / 0.32);
  border-radius: 2.4rem 0.9rem 3.2rem 1.1rem / 1.9rem 1rem 3rem 1.3rem;
}
/* the colour echo: a fragment of the artwork's coral, tucked into the open chapter's lower outer corner */
html[data-about="tabs-b"] .ab-d::after {
  content: ""; position: absolute; z-index: -1; right: -7%; bottom: -52%; width: 31%; height: 88%;
  background: #F9C6AE; opacity: 0;
  border-radius: 58% 42% 55% 45% / 52% 60% 40% 48%;
  transform: translate(6%, 10%) rotate(-8deg); transition: opacity 520ms var(--ease-quiet), transform 700ms var(--ease-reveal);
}
html[data-about="tabs-b"] .ab-d { isolation: isolate; }
html[data-about="tabs-b"] .ab-d.is-open::after { opacity: 0.55; transform: none; }
html[data-about="tabs-b"] .ab-d.is-open .ab-d__ind { background: var(--c-orange); }
html[data-about="tabs-b"] .ab-d.is-open .ab-d__ind::before { background: #fff; }

/* ==========================================================================
   THE CLOSING NOTE · on the same base colour: a quiet divider with a short orange run, an understated
   heading, two balanced columns. Same words, same order.
   ========================================================================== */
html[data-ab-layout="tabs"] #about .scope {
  margin-top: clamp(4rem, 2.5rem + 5vw, 7rem);
  padding: clamp(2.25rem, 1.5rem + 2vw, 3.25rem) 0 0;
  border: 0; border-radius: 0; border-top: 1px solid var(--light-rule);
  background: none;
}
html[data-ab-layout="tabs"] #about .scope::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 5rem; height: 1.5px; background: var(--c-orange);
}
html[data-ab-layout="tabs"] #about .scope__title {
  margin: 0 0 clamp(1.5rem, 1rem + 1vw, 2.25rem);
  font-size: clamp(1.375rem, 1.1rem + 0.6vw, 1.75rem); font-weight: 360;
}
@media (min-width: 900px) {
  html[data-ab-layout="tabs"] #about .scope__cols { column-gap: clamp(3.5rem, 1.5rem + 5vw, 8rem); }
  html[data-ab-layout="tabs"] #about .scope__cols p { max-width: 46ch; }
}

/* ==========================================================================
   ONE COLUMN · label · name · portrait · standfirst · chapters · note
   ========================================================================== */
@media (max-width: 899.98px) {
  html[data-ab-layout="tabs"] .ab { display: block; }
  html[data-ab-layout="tabs"] .ab__bg {
    left: var(--abt-nx, -30cqw); top: var(--abt-ny, 50cqw); width: var(--abt-nw, 150cqw);   /* the crop's coral rises beside the portrait, the cobalt underlines it */
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 78%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 0, #000 78%, transparent 100%);
  }
  html[data-ab-layout="tabs"] .ab__portrait { width: min(86%, 25rem); margin: clamp(1.75rem, 5vw, 2.5rem) 0 0 auto; }
  html[data-ab-layout="tabs"] .ab__lede { margin-top: clamp(2rem, 6vw, 3rem); }
  html[data-ab-layout="tabs"] .ab__list { margin-top: clamp(1.75rem, 5vw, 2.5rem); }
  html[data-ab-layout="tabs"] .ab-d { display: block; padding: 0; }
  html[data-ab-layout="tabs"] .ab-d + .ab-d { margin-top: 0.625rem; }
  html[data-ab-layout="tabs"] .ab-d__btn { padding: 1rem 1.1rem; min-height: 3.5rem; grid-template-columns: 2rem minmax(0, 1fr) auto; }
  html[data-ab-layout="tabs"] .ab-d__btn .ab-d__title-in { font-size: clamp(1.375rem, 1.1rem + 1.4vw, 1.75rem); }
  html[data-ab-layout="tabs"] .ab-d__panel-in .ab-d__desc { font-size: var(--fs-body); padding: 0 1.1rem 1.25rem calc(1.1rem + 2.5rem); }
  html[data-ab-layout="tabs"] .ab-d__title { margin: 0; }
}
@media (max-width: 899.98px) {
  html[data-about="tabs-b"] .ab-d::after { width: 26%; height: 70%; right: -8%; bottom: -46%; }
}
@media (max-width: 400px) {
  html[data-ab-layout="tabs"] .ab-d__panel-in .ab-d__desc { padding-left: 1.1rem; }
}

/* ==========================================================================
   ENTRANCE (html.ab-motion) · each chapter surface arrives whole, in order, after the portrait and name;
   the title no longer rises through a mask here (the heading holds a button and its focus ring)
   ========================================================================== */
html.ab-motion[data-ab-layout="tabs"] .ab-d:not(.is-in) { opacity: 0; transform: translateY(14px); }
html.ab-motion[data-ab-layout="tabs"] .ab-d:not(.is-in) .ab-d__title-in { transform: none; }
html.ab-motion[data-ab-layout="tabs"] .ab-d {
  transition: opacity 700ms var(--ease-quiet) var(--d, 0ms), transform 900ms var(--ease-reveal) var(--d, 0ms),
              background-color 420ms var(--ease-quiet), border-color 420ms var(--ease-quiet), border-radius 520ms var(--ease-in-out);
}
html.ab-motion[data-ab-layout="tabs"] .ab-d__title-in { transition: color 360ms var(--ease-quiet); }
