/* About · layout: intro, collage, timeline, tools (docs/about-spec.md). Needs tokens.css, shell.css, thread.css,
   story.css (the knot). Desktop rows at 1288 and above (About's own breakpoint, §4); 901–1287 uses the tablet
   arrangements with desktop values; the shell's 900 and 600 for tablet and mobile.
   Stage A: everything at rest. Stage B (§13): the motion, only under html.about-motion (set by about-early.js;
   no JS or reduced motion: the Stage A page). */

.about {
  --case: var(--color-bg-ink); /* the knots fill in ink (Portfolio-Rules §6) */
}
/* The page wrapper clips overflow, so the fallen photo (hidden, but its transform still counts) never lengthens
   the page (§13.4). clip, not hidden: no scroll container, so the sticky nav and the desktop pin keep working */
[data-thread-root] { overflow: clip; }
.about :where(p, h1, h2, ul, li, figure) { margin: 0; }
.about ul { padding: 0; list-style: none; }
.about .sec { color: var(--color-text-secondary); }
.about .pri { color: var(--color-text-primary); }

/* ---------- Intro (§3) · stacked by default (901–1287 with desktop values, tablet, mobile) ---------- */
.about-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rh-block);
  padding: var(--hero-top) var(--in-page-x) var(--rh-chapter); /* top: hero/top (Update 17 Nov 2026) */
}

/* Text column: fills its column (784 / 746 / 350, §0); a container, so the h1 can shrink to it */
.about-text {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--rh-elements-block); /* Update 16 Nov 2026 (section E): Intro · body */
  width: 100%;
}

/* The h1: two blocks; the written breaks never change. Where a line doesn't fit, the size shrinks in the Figma
   proportion: min(Site/Chapter, column / k) (§3.2). k = 10.42: the widest line, "and now I build systems"
   (the first line of the last sentence on desktop and mobile), measured 583.3 px at 56 (10.417 em, the same at 40
   and 28). It fits at 1288 (column 632), so in practice the size only shrinks below 390 (26.9 px at 320) */
.about-h1 {
  --k-h1: 10.42;
  display: flex;
  flex-direction: column;
  gap: var(--rh-element);
  font-size: min(var(--type-chapter), 100cqi / var(--k-h1));
}
.about-h1__block,
.about-h1__line { display: block; }

/* "I dress in black." carries the underline; the tracking given back as padding (shell spec §5) */
.about-mark {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding-inline-end: 0.045em;
  white-space: nowrap;
}
/* Mark · Underline: 2 beyond the word on each side, 8 tall, top 55 / 43 / 31 below the word's top (§3.3);
   in em of the Figma size, so it follows the fluid h1 */
.about-mark__line {
  position: absolute;
  z-index: -1;
  left: -2px;
  top: calc(1em * 55 / 56);
  width: calc(100% + 4px);
  height: 8px;
  overflow: visible;
}

/* ---------- The collage (§3.4) · one drawing at 480 × 657, scaled by --k from its top-left ---------- */
.about-collage {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rh-block);
  width: 100%;
  padding-top: var(--rh-tight);
}
.about-canvas {
  --k: 1;
  position: relative;
  flex: none;
  width: calc(480px * var(--k));
  height: calc(657px * var(--k));
}
.about-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 480px;
  height: 657px;
  transform: scale(var(--k));
  transform-origin: 0 0;
}
.about-stage > *,
.about-fall > * {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  transform-origin: 0 0;
}
.about-stage picture { display: block; }
.about-stage img {
  position: absolute;
  display: block;
  max-width: none;
}

/* 1 · Painting (Figma crop 74.05% × 82% from 12.77% / 8.33%) */
.about-painting {
  width: 480px;
  height: 657px;
  overflow: hidden;
}
.about-painting img {
  left: -82.78px;
  top: -66.74px;
  width: 648.21px;
  height: 801.22px;
}

/* 2 · Photo (Figma crop 62.06% × 55.50% from 18.97% / 12.66%), a 5 px white frame inside it, above the image.
   The file's own aspect (0.723) is kept, never stretched to Figma's 0.706 (Eden, 11 Nov): the image covers the
   Figma box, centred, about 4 px trimmed on each side */
.about-photo {
  width: 221.32px;
  height: 280.3px;
  overflow: hidden;
  transform: matrix(0.9301, -0.3672, 0.3672, 0.9301, 21.31, 94.31);
}
.about-photo img {
  left: -67.66px;
  top: -63.93px;
  width: 356.63px;
  height: 505.08px;
  object-fit: cover;
}
.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 5px solid var(--color-bg-page);
}

/* The fall group (§13.3.1): the photo and both tapes, moved as one by about.js; at rest the identity */
.about-fall {
  width: 0;
  height: 0;
  will-change: transform;
}

/* 3, 4 · Tapes: white at 70%, decorative. Tape 2's fill and curl sit on its inner element (§13.3.1) */
.about-tape {
  height: 22.26px;
  background: var(--color-bg-page);
  opacity: 0.7;
}
.about-tape--2 {
  width: 80.46px;
  background: none;
  opacity: 1;
  transform: matrix(-0.183, 0.9831, -0.9831, -0.1829, 50.61, 68.35);
}
.about-tape--2 > i {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-bg-page) 70%, transparent); /* white at 70%: opacity is the peel's */
  transform-origin: 50% 100%;
}
.about-tape--1 {
  width: 80.47px;
  transform: matrix(0.9903, 0.1392, -0.1392, 0.9903, 178.81, 13.05);
}

/* Caption: both texts hug their text (§0) */
.about-cap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rh-tight);
}
.about-cap > p { width: fit-content; }
.about-cap__br { display: none; }

/* ---------- How I got here (§6) ---------- */
.about-path { padding: 0 var(--in-page-x); }
.about-row {
  display: flex;
  align-items: flex-start;
  gap: var(--grid-gutter);
}
.about-knotcol {
  display: flex;
  flex: none;
  justify-content: center;
  width: var(--knot-column);
  padding-top: var(--space-4);
}
.about-labels__text {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: var(--space-16);
  row-gap: var(--space-4); /* where the two don't fit on one line (320–360) they stack, both at the content start
                              (a line with one item starts at the left under space-between); Eden, 11 Nov, preview */
  min-width: 0;
}
.about-stops {
  display: flex;
  flex-direction: column;
  gap: var(--rh-section);
  padding-top: var(--rh-section);
}
/* Stop, stacked: label, headline, body (headline to body 24 / 24 / 16) */
.about-stop__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--rh-tight);
  min-width: 0;
}
.about-stop__body { padding-top: var(--rh-tight); }

/* ---------- What I work with (§7) · desktop and tablet: By hand · centred knot · On screen ---------- */
.about-tools {
  position: relative;
  padding: var(--rh-chapter) var(--in-page-x) 0;
}
/* The turn anchor (§5.1): the line moves across at the middle of the section's top padding */
.about-turn {
  position: absolute;
  left: 0;
  top: calc(var(--rh-chapter) / 2);
  width: 0;
  height: 0;
}
.about-tools__row {
  display: flex;
  align-items: flex-start;
  gap: var(--rh-elements-block); /* Update 16 Nov 2026 (section E): What I work with */
}
.about-tools__group {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--rh-element);
  min-width: 0;
}
.about-tools__group--hand {
  align-items: flex-end;
  text-align: right;
}
.about-tools__list {
  display: flex;
  flex-direction: column;
  gap: var(--rh-element);
}
.about-tools__group--hand .about-tools__list { align-items: flex-end; }
.about-tools__knotcol {
  display: flex;
  flex: none;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  width: 56px;
}

/* ---------- Stage B · motion (§13), only under html.about-motion ---------- */
/* The collage stays above what follows (the photo falls over it), below the sticky nav */
.about-motion .about-intro {
  position: relative;
  z-index: 2;
}

/* Load (§13.2): headline, underline, then the collage with its caption; once (about-loaded after it) */
@keyframes about-rise {
  from { transform: translateY(0.25em); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes about-draw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes about-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.about-motion .about-h1 { animation: about-rise 0.6s ease 0.2s both; }
.about-motion .about-mark__line { animation: about-draw 0.7s cubic-bezier(0.5, 0, 0.2, 1) 0.65s both; }
.about-motion .about-collage { animation: about-fade 0.8s ease 1.45s both; }
.about-loaded .about-h1,
.about-loaded .about-mark__line,
.about-loaded .about-collage { animation: none; }

/* Stops (§13.6): grey (the review build's graphite, #8e8e94 = --color-line-hand, Eden 11 Nov) until the stop's
   knot is reached, then the Figma colours; both ways, 0.5 s. The labels stay secondary */
.about-motion .about-stop__title,
.about-motion .about-stop__body {
  color: var(--color-line-hand);
  transition: color 0.5s ease;
}
.about-motion .about-stop:has(.knot[data-reached]) .about-stop__title { color: var(--color-text-primary); }
.about-motion .about-stop:has(.knot[data-reached]) .about-stop__body { color: var(--color-text-secondary); }

/* ---------- Desktop ≥ 1288: the intro row and the stop rows (§3.1, §6.2) ---------- */
@media (min-width: 1288px) {
  .about-intro {
    flex-direction: row;
    align-items: center;
    gap: var(--rh-block);
  }
  .about-text {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .about-collage {
    flex: none;
    width: 528px;
    padding-right: var(--space-48);
  }
  .about-stop__content {
    flex-direction: row;
    gap: var(--grid-gutter);
  }
  .about-stop__label {
    flex: none;
    width: 200px;
    padding-top: var(--space-8);
  }
  .about-stop__title {
    flex: none;
    width: 520px;
  }
  .about-stop__body {
    flex: 1;
    min-width: 0;
    padding-top: var(--space-4);
  }
}

/* ---------- Tablet 601–900 ---------- */
@media (max-width: 900px) {
  .about-mark__line { top: calc(1em * 43 / 40); }
}

/* ---------- Mobile ≤ 600 ---------- */
@media (max-width: 600px) {
  .about-mark__line { top: calc(1em * 31 / 28); }
  .about-canvas { --k: 0.6875; } /* below 390 about.js sets min(0.6875, column / 480) */
  .about-cap__br { display: inline; }

  /* Tools: knot column 24 (on the thread column, centred on both lists) · By hand, then On screen */
  .about-tools__row {
    display: grid;
    grid-template-columns: var(--knot-column) minmax(0, 1fr);
    column-gap: var(--rh-elements-block);
    row-gap: var(--rh-block);
  }
  .about-tools__knotcol {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: auto;
  }
  .about-tools__group--hand,
  .about-tools__group--screen { grid-column: 2; }
  .about-tools__group--hand {
    grid-row: 1;
    align-items: flex-start;
    text-align: left;
  }
  .about-tools__group--screen { grid-row: 2; }
  .about-tools__group--hand .about-tools__list { align-items: flex-start; }
}
