/* About: the masthead. The opening photo, the team (four cards of name and portrait, a pop-up
   with the full portrait), the principles band, and the home/services close and footer.
   Tokens come from ../css/site.css; the nav from ../css/nav.css. Where site.css styles a bare
   .row h3 or .principle, these rules use longer selectors so they win. */

.nav { position: sticky; top: 0; z-index: 20; }
/* The principles band is 100vw wide; clip, do not scroll, the overhang. */
main { overflow-x: clip; }

/* ---- Opening: the shared rules live in ../css/nav.css; only the photo is About's. ---- */
.open__img { background-image: url("../assets/img/about-meadow.jpg"); }

/* ---- Team: a compact grid of four cards, name above its portrait. The name button is the keyboard
   target for the pop-up; the whole card is the mouse target. No scroll spotlight: there is no active
   row state, so no name is ever left dimmed. ---- */
.team-sec { gap: 48px; padding: 96px var(--margin); }
/* The same two-column opening as Who we work with: heading left, one statement right, so the team
   reads as part of the page rather than a block dropped in on its own. */
.team-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--gap, 24px); align-items: baseline; margin-bottom: 64px; }
.team-head .prose { font: 400 32px/44px var(--font); color: var(--ink); margin: 0; max-width: 26em; }
.team { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.team .row { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 0; cursor: pointer; }
.team .row::before { display: none; }
.team .row .name { margin: 0 0 8px; font: var(--t-display); letter-spacing: -.03em; text-align: center; white-space: nowrap; color: var(--ink);
  font-size: clamp(40px, 4.2vw, 60px); line-height: 1.1; }
.name__btn { position: relative; display: inline-block; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; }
.name__btn::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left center; transition: transform 300ms var(--ease); }
.row__role { min-height: 16px; margin: 4px 0 16px; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: #666; text-align: center; }
.thumb { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.thumb .ph { width: 100%; aspect-ratio: 3 / 4; }
.thumb .ph__img { transition: opacity .4s ease, transform 400ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .team .row:hover .name__btn::after { transform: scaleX(1); }
  .team .row:hover .thumb .ph__img { transform: scale(1.03); }
}
.name__btn:focus-visible::after { transform: scaleX(1); }
.name__btn:focus-visible { outline: none; }
.team .row:has(.name__btn:focus-visible) .thumb .ph { outline: 2px solid var(--ink); outline-offset: 4px; }
@media (max-width: 760px) {
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 32px; }
  /* The opening stacks on phones, as .who does; the names below keep their display size (--t-display). */
  .team-head{ grid-template-columns: minmax(0, 1fr); row-gap: 16px; margin-bottom: 40px; }
  .team-head .prose { font: 400 24px/34px var(--font); }
  .team-sec { padding: 48px var(--margin); }
}

/* ---- Portrait (the thumbnail and the pop-up portrait) ---- */
.ph { display: block; position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; isolation: isolate; background: #3a4538; }
/* The empty state: a soft grass-toned grain field until a photo loads. */
.ph__field { position: absolute; inset: 0; background: radial-gradient(120% 100% at 30% 20%, #8c9a86 0%, #5f6d5b 52%, #384236 100%); }
.ph__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); opacity: 0; transition: opacity .4s ease; }
.ph.has-photo .ph__img { opacity: 1; }
/* The initial shows only in the pop-up's empty state (the thumbnail has none). */
.ph__initial { position: absolute; inset: 0; display: grid; place-items: center; font: 600 160px/1 var(--font); color: rgba(255, 255, 255, .4); transition: opacity .4s ease; }
.ph.has-photo .ph__initial { opacity: 0; }
.ph__grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .12; mix-blend-mode: overlay; pointer-events: none; }
/* The four-colour meridian is gone from every portrait. On a face it read as decoration, and it made
   the photo compete with the name; black and white alone carries the person. */
.ph__line { display: none; }

/* ---- Principles band: Night, no image. Each row is number, heading and body, with the heading and the
   body on one baseline (the number sits above the heading, in its own grid row). A coloured stem marks
   each row at the left edge: colour is used here because it ties a principle back to the discipline it
   came from, which the photograph never did. ---- */
.principles-band { position: relative; box-sizing: border-box; width: 100vw;
  margin: 0 calc(50% - 50vw); padding: 160px var(--margin); display: grid; gap: 48px;
  color: var(--paper); background: var(--ink); }
.principles-band .label { color: rgba(255, 255, 255, .85); margin: 0; }
.principles { display: grid; }
.principles-band .principle { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--gap); row-gap: 16px; align-items: baseline; padding: 64px 0 64px 48px; margin: 0; }
.principles-band .principle + .principle { border-top: 1px solid rgba(255, 255, 255, .18); }
.principles-band .principle::before { display: none; }
/* The stem runs the full height of the row, including its padding, so the hairline is held at both ends.
   It is a faint track only: the colour lives in .fill, which about.js scales down as you scroll. */
.principles-band .principle::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: rgba(255, 255, 255, .12); transform: scaleY(1); transform-origin: top center; }
.principles-band .principle:nth-child(1) { --stem: var(--strategy); }
.principles-band .principle:nth-child(2) { --stem: var(--design); }
.principles-band .principle:nth-child(3) { --stem: var(--software); }
.principles-band .principle .principle__no { grid-column: 1; grid-row: 1; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .85); margin: 0; }
.principles-band .principle h3 { grid-column: 1; grid-row: 2; font: 600 40px/48px var(--font); letter-spacing: -.02em; color: var(--paper); margin: 0; }
.principles-band .principle .principle__body { grid-column: 2; grid-row: 2; font: 400 20px/30px var(--font); color: rgba(255, 255, 255, .85); margin: 0; max-width: 36em; }
@media (max-width: 760px) {
  .principles-band { padding: 96px var(--margin); }
  .principles-band .principle { grid-template-columns: minmax(0, 1fr); padding-left: 24px; }
  .principles-band .principle .principle__no { grid-column: 1; grid-row: 1; }
  .principles-band .principle h3 { grid-column: 1; grid-row: 2; font: 600 28px/36px var(--font); }
  .principles-band .principle .principle__body { grid-column: 1; grid-row: 3; }
}
/* One continuous line runs down the left edge and draws with the scroll (about.js). Each row's colour
   fills its own stem, so the line reads blue, then coral, then green. Rows not yet reached sit at .6. */
.principles-band .principle + .principle::after,
.principles-band .principle + .principle .fill { top: -1px; }
.principles-band .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; z-index: 1;
  background: var(--stem); transform: scaleY(var(--p, 1)); transform-origin: top center; will-change: transform; }
.principles-band .principle { transition: opacity 400ms var(--ease); }
.pr-live .principles-band .principle:not(.is-reached) { opacity: .6; }

/* ---- Who we work with: label left, one large statement right. The sentence is the section, so it
   carries display scale and ink; at 26em it breaks into four readable lines on desktop instead of
   running the full width as a paragraph. ---- */
.who { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.who__label { margin: 0; }
.who__copy { display: grid; gap: 16px; }
.who .prose { font: 400 32px/44px var(--font); color: var(--ink); margin: 0; max-width: 26em; }
/* A bracketed line is a placeholder, never copy: about.js flags it, and it is hidden here. */
.who [data-placeholder] { display: none; }
@media (max-width: 760px) {
  .who { grid-template-columns: minmax(0, 1fr); }
  .who .prose { font: 400 24px/34px var(--font); }
}

/* ---- Close: the home and services close (Night, point-cloud terrain, footer inside the black) ---- */
/* Close and night footer: shared rules in ../css/nav.css. */



/* Chief: the grain filter's <svg> sat inline at the top of <body>, making a 24px line box that pushed
   the whole header down on About only. Defs take no space. */
body > svg:first-child { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- Founder card (approved Nov 13 prototype). A centred card over the page: the photo is a large left
   column, the text is the right column. liquid.js draws the open and the close as SVG and the flying
   photo; these rules only hold the states it needs and fade the text in once the card has settled. ---- */
html.pop-open { overflow: hidden; }
.pop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 0;
  background: rgba(0, 0, 0, .42); opacity: 0; visibility: hidden; }
.pop.is-open, .pop.is-closing { visibility: visible; }
.pop.is-open { opacity: 1; transition: opacity 320ms linear; }
/* The backdrop fades over the same 520 ms the close takes (liquid.js), so both finish together. */
.pop.is-closing { opacity: 0; transition: opacity 520ms cubic-bezier(.4, 0, .2, 1); }
.pop__panel { position: relative; box-sizing: border-box; width: 86vw; max-width: 1400px; height: 84vh; max-height: none;
  overflow-y: auto; background: var(--paper); color: var(--ink); border-radius: 24px; padding: 40px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: stretch;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18); }
.pop__close { position: absolute; z-index: 2; top: 24px; right: 24px; width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .06); color: var(--ink); font-size: 0; cursor: pointer; transition: background .2s; }
.pop__close:hover { background: rgba(0, 0, 0, .12); }
.pop__close span { font: 400 24px/1 var(--font); }
.pop__close:focus:not(:focus-visible) { outline: none; }
.pop__ph { width: auto; height: calc(84vh - 80px); aspect-ratio: 3 / 4; border-radius: 14px; }
.pop__text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding-top: 24px; }
.pop__ph, .pop__text { opacity: 0; transform: translate3d(0, 8px, 0); }
.pop.is-open .pop__ph { opacity: 1; transform: none; transition: opacity 360ms var(--ease) 120ms, transform 360ms var(--ease) 120ms; }
.pop.is-open .pop__text { opacity: 1; transform: none; transition: opacity 360ms var(--ease) 180ms, transform 360ms var(--ease) 180ms; }
/* Liquid states (liquid.js): the card is painted by the SVG while it moves, so the real panel is hidden. */
.pop.liq-run .pop__panel, .pop.liq-close .pop__panel { visibility: hidden; }
.pop.liq-run .pop__ph, .pop.liq-done .pop__ph { opacity: 1; transform: none; transition: none !important; }
.pop.liq-run .pop__text { opacity: 0; transform: translate3d(0, 8px, 0); transition: none !important; }
.pop.liq-done .pop__text { transition-delay: 0ms !important; transition-duration: 280ms !important; }
.pop__name { font: var(--t-display); letter-spacing: -.02em; margin: 0; }
/* The four-colour bar grows 200 ms after the card has settled (liq-done). Width 0 otherwise. */
.pop__bar { display: block; width: 0; height: 4px; margin-top: 16px; border-radius: 2px;
  background: linear-gradient(90deg, var(--strategy), var(--design), var(--software), var(--result));
  transition: width 200ms var(--ease); }
.pop.liq-done .pop__bar { width: 48px; transition-delay: 200ms; }
.pop__role { margin: 24px 0 0; min-height: 16px; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: #666; }
.pop__desc { margin: 32px 0 0; font: 400 22px/32px var(--font); color: #3d3d3d; max-width: 34em; }
.pop__links { margin-top: 32px; display: flex; gap: 24px; font: var(--t-small); }
/* display:flex would beat the [hidden] attribute, so the empty state is held explicitly. */
.pop__links[hidden] { display: none; }
/* Skeletons: grey bars standing in for the role, bio and links while those are empty. */
.sk { display: block; }
.sk i { display: block; background: #EDEDED; border-radius: 4px; }
.sk--role { margin-top: 24px; width: 160px; height: 12px; background: #EDEDED; border-radius: 4px; }
.sk--bio { margin-top: 32px; max-width: 34em; width: 100%; display: grid; row-gap: 16px; }
.sk--bio i { height: 14px; }
.sk--bio i:nth-child(3) { width: 62%; }
.sk--links { margin-top: 32px; display: flex; gap: 24px; }
.sk--links i { width: 96px; height: 12px; }
/* A real value hides the skeleton that stands in for it. */
.pop__role:not([hidden]) + .sk--role,
.pop__desc:not([hidden]) + .sk--bio,
.pop__links:not([hidden]) + .sk--links { display: none; }
/* Next founder: pinned to the bottom of the right column. Button reset so it reads as the arrow link. */
.pop__foot { margin-top: auto; padding-top: 40px; }
.pop__next { margin: 0; padding: 0; border: 0; background: none; color: var(--ink); font: var(--t-small); cursor: pointer; }
/* Photo and text cross-fade on Next: out in 125 ms, swapped, back in 125 ms (no liquid replay). */
.pop.is-swap .pop__ph, .pop.is-swap .pop__text { opacity: 0 !important; transition: opacity 125ms linear !important; }
.pop.is-swap-in .pop__ph, .pop.is-swap-in .pop__text { transition: opacity 125ms linear !important; }
@media (prefers-reduced-motion: reduce) {
  .pop, .pop.is-open, .pop.is-closing { transition: opacity 150ms linear !important; }
  .pop__ph, .pop__text, .pop.is-open .pop__ph, .pop.is-open .pop__text {
    transform: none !important; transition: opacity 150ms linear !important; }
  .pop__bar, .pop.liq-done .pop__bar { width: 48px !important; transition: none !important; }
}
@media (max-width: 760px) {
  .pop__panel { width: calc(100vw - 32px); height: calc(100svh - 64px); padding: 16px; border-radius: 20px;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 20px; }
  .pop__ph { width: 100%; height: auto; aspect-ratio: 4 / 5; max-height: 52svh; }
  .pop__text { padding: 0 8px 8px; }
  .pop__name { font: 600 40px/44px var(--font); }
  .pop__close { top: 16px; right: 16px; background: rgba(255, 255, 255, .85); }
}
/* The prototype held these in liquid.html's inline style. index.html has no inline style, so the two
   layers liquid.js appends to <body> are styled here: the fixed SVG that paints the card, and the flying
   photo clone. Without them the SVG would sit in the page flow and the clone would not be placed. */
.liq { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 55; pointer-events: none; display: none; overflow: visible; }
.liq.is-on { display: block; }
.liq path { fill: var(--paper); filter: drop-shadow(0 -10px 32px rgba(0, 0, 0, .14)); }
.liq-fly { position: fixed; z-index: 60; margin: 0; aspect-ratio: auto !important; pointer-events: none; }
/* The floating logo island sat above the card's dim backdrop; it steps out while the card is open. */
html.pop-open .nav, html.pop-open .island { opacity: 0 !important; pointer-events: none !important; transition: opacity .2s; }

/* ---- Kassem, Nov 14 ----
   Team geometry: the heading and its line sit on the same four columns as the portraits (the line
   starts at Omar's photo edge), and the section gets the site's top rule like every other section.
   Names: bigger, sitting directly on the photo (no gap; these names have no descenders). */
.team-head { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; align-items: start; margin-bottom: 96px; }
.team-head .sec-title { grid-column: 1; }
.team-head .prose { grid-column: 2 / -1; max-width: none; }
.team .row .name { font-size: clamp(48px, 5.4vw, 84px); line-height: .9; margin: 0 0 -.06em; position: relative; z-index: 1; }
.row__role:empty { display: none; }
.team .row .name + .row__role:not(:empty) { margin: 8px 0 12px; }
.name__btn::after { display: none; }
@media (max-width: 760px) {
  .team-head { grid-template-columns: minmax(0, 1fr); row-gap: 16px; margin-bottom: 48px; }
  .team-head .sec-title, .team-head .prose { grid-column: 1; }
  .team .row .name { font-size: 36px; }
}

/* Card bar: wider, square ends, close under the name, the four colours drifting all the time. */
.pop__bar { height: 6px; margin-top: 10px; border-radius: 0; background-size: 300% 100%;
  background-image: linear-gradient(90deg, var(--strategy), var(--design), var(--software), var(--result), var(--strategy));
  animation: drift 3s linear infinite; }
.pop.liq-done .pop__bar { width: 120px; transition: width 420ms cubic-bezier(.22, 1, .36, 1) 120ms; }
@media (prefers-reduced-motion: reduce) { .pop__bar { animation: none; } .pop__bar, .pop.liq-done .pop__bar { width: 120px !important; } }

/* ---- Team recomposed (Kassem, Nov 14: "no flow"). One grid, one rhythm:
   - Every left edge is a photo edge: "Team" and Kassem's name on column 1's edge, the line on column 2's.
   - Names start at their photo's left edge (centred names each sat at a different x), sized so the
     longest fits with air, and sit on the photo.
   - Spacing on an 8px rhythm: 64 between intro and names, 96 above and below the section. ---- */
.team-sec { padding-top: 96px; padding-bottom: 96px; row-gap: 0; }
.team-head { align-items: baseline; margin-bottom: 64px; }
.team-head .prose { font: 400 28px/40px var(--font); max-width: 30em; }
.team .row .name { text-align: left; font-size: clamp(40px, 3.9vw, 60px); line-height: .92; letter-spacing: -.03em; margin: 0 0 -.05em; }
.team .name__btn { text-align: left; }
@media (max-width: 760px) {
  .team-sec { padding-top: 64px; padding-bottom: 64px; }
  .team-head { margin-bottom: 40px; }
  .team-head .prose { font: 400 20px/30px var(--font); }
  .team { row-gap: 40px; }
  .team .row .name { font-size: 30px; }
}
/* Principles leads with a real heading like every other section (Kassem, Nov 14: the 12px label read tiny). */
.principles-band .sec-title { color: var(--paper); }
