/* Homepage additions: one section-head grammar, How I work, and the
   About / Experience / Skills block with the portrait held on the left. */

/* ---------- section heads: eyebrow above the title, every section ---------- */
.sec-head, .work__head { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .9rem; flex-wrap: nowrap; }
.sec-head .eyebrow, .work__head .eyebrow { order: -1; }
.sec-head .eyebrow, .work__head .eyebrow, .stmt .eyebrow, .contact > .eyebrow {
  font: 500 .75rem/1 ui-monospace, "Geist Mono", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-muted); font-style: normal; }

/* ---------- How I work ---------- */
.ap { --ap-ink: #3b3834; --ap-soft: #ece7de; --ap-ac: #6e5b47; }
.ap__head, .ap__grid {
  width: min(1080px, calc(100vw - 2 * var(--pad)));
  margin-left: calc(50% - min(1080px, calc(100vw - 2 * var(--pad))) / 2);
}
.ap__head .ap__soft { color: var(--fg-faint); }
.ap__grid { list-style: none; padding: 0; margin-top: clamp(1rem, 2vw, 1.5rem); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border); }
.ap__item { display: flex; flex-direction: column; padding: 2.25rem 1.75rem 2rem; border-left: 1px solid var(--border); }
.ap__item:first-child { border-left: 0; padding-left: 0; }
.ap__item:last-child { padding-right: 0; }
/* every drawing the same height, whatever the column width */
.ap__vis { display: block; height: clamp(104px, 10.5vw, 132px); width: auto; max-width: 100%; aspect-ratio: 320 / 160; overflow: visible; }
.ap__vis .s { fill: none; stroke: var(--ap-ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ap__vis .f { fill: var(--ap-soft); stroke: var(--ap-ink); stroke-width: 1.5; stroke-linejoin: round; }
.ap__vis .a { fill: none; stroke: var(--ap-ac); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ap__vis .ad { fill: none; stroke: var(--ap-ac); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linecap: round; }
.ap__vis .d { fill: none; stroke: var(--ap-ink); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linecap: round; }
.ap__vis .af { fill: var(--ap-ac); }
.ap__vis .muted { opacity: .4; }
.ap__vis text { font: 500 11px/1 ui-monospace, "Geist Mono", Menlo, monospace; fill: var(--fg-muted); }
.ap__vis text.ac { fill: var(--ap-ac); }
.ap__vis text.on { fill: #fff; font-weight: 600; }
.ap__n { margin-top: 1.75rem; font: 500 .8125rem/1 ui-monospace, "Geist Mono", Menlo, monospace; color: var(--ap-ac); }
.ap__t { margin-top: .8rem; font-family: var(--font-serif); font-weight: 400; font-size: 1.45rem; line-height: 1.15; letter-spacing: -.01em; }
.ap__p { margin-top: .6rem; font-size: .95rem; line-height: 1.55; color: var(--fg-muted); }
.ap__link { margin-top: auto; padding-top: 1.1rem; align-self: flex-start; font-size: .85rem; font-weight: 500; color: var(--fg); text-decoration: none; }
.ap__link span[aria-hidden] { display: inline-block; color: var(--ap-ac); transition: transform .3s var(--ease); }
.ap__link:hover span[aria-hidden] { transform: translateX(3px); }
.ap__link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }

/* the drawings trace themselves in once, when the section comes into view */
.js .ap__grid .ap__vis .s, .js .ap__grid .ap__vis .a { stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.4s var(--ease); }
.js .ap__grid.in .ap__vis .s, .js .ap__grid.in .ap__vis .a { stroke-dashoffset: 0; }
.js .ap__grid .ap__item:nth-child(2) .ap__vis * { transition-delay: .12s; }
.js .ap__grid .ap__item:nth-child(3) .ap__vis * { transition-delay: .24s; }
.js .ap__grid .ap__item:nth-child(4) .ap__vis * { transition-delay: .36s; }
@media (prefers-reduced-motion: reduce) { .js .ap__grid .ap__vis .s, .js .ap__grid .ap__vis .a { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; } }

@media (max-width: 960px) {
  .ap__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap__item:nth-child(3) { border-left: 0; padding-left: 0; }
  .ap__item:nth-child(2) { padding-right: 0; }
  .ap__item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .ap__vis { height: 120px; }
}
@media (max-width: 600px) {
  .ap__grid { grid-template-columns: 1fr; }
  .ap__item, .ap__item:nth-child(n) { border-left: 0; padding: 2rem 0; }
  .ap__item + .ap__item { border-top: 1px solid var(--border); }
}

/* ---------- About, Experience, Skills: portrait held, the rest scrolls ---------- */
.prof { width: min(1080px, calc(100% - 2 * var(--pad))); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); column-gap: clamp(2.5rem, 6vw, 5.5rem); align-items: start; }
.prof__aside { position: sticky; top: 6.5rem; margin-top: clamp(3.5rem, 8vw, 6rem); }
.prof__photo { width: 100%; }
.prof__main > .sec { padding-block: clamp(2.5rem, 5vw, 4rem); }
.prof__main > .sec:first-child { padding-top: clamp(3.5rem, 8vw, 6rem); }
/* the block ends at the last Skills rule, so the photo lets go (and scrolls
   away with it) the moment its bottom meets that line; the breathing room
   after it is a margin outside the block */
.prof__main > .sec:last-child { padding-bottom: 0; }
.prof { margin-bottom: clamp(3.5rem, 8vw, 6rem); }

/* experience: the company's mark, greyed like the client strip, over the dates */
.xp__when { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; }
/* every mark one flat muted tone, so a yellow logo and a black one read the same */
/* sized to a box, not a height: a wide wordmark fills the width, a stacked
   mark-over-name fills the height, so all four carry the same weight */
.xp__logo { display: block; height: auto; width: auto; max-height: 40px; max-width: 76px; object-fit: contain; object-position: left center;
  filter: brightness(0); opacity: .5; }
.xp__wordmark { font-family: var(--font-serif); font-size: 1.3rem; line-height: 26px; color: var(--fg-faint); white-space: nowrap; }
.xp__dates { display: block; }

@media (max-width: 760px) {
  .prof { grid-template-columns: 1fr; width: auto; max-width: var(--narrow); padding-inline: var(--pad); }
  .prof__aside { position: static; }
  .prof__photo { max-width: 210px; }
  .prof__main > .sec:first-child { padding-top: 2rem; }
}

/* ---------- phones: How I work two by two, smaller ---------- */
@media (max-width: 600px) {
  .ap__grid { grid-template-columns: 1fr 1fr; }
  .ap__item, .ap__item:nth-child(n) { padding: 1.4rem .85rem 1.3rem; border-left: 1px solid var(--border); border-top: 0; }
  .ap__item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .ap__item:nth-child(even) { padding-right: 0; }
  .ap__item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .ap__item + .ap__item { border-top: 0; }
  .ap__item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .ap__vis { height: 64px; }
  .ap__n { margin-top: 1rem; font-size: .7rem; }
  .ap__t { margin-top: .45rem; font-size: 1.08rem; line-height: 1.18; }
  .ap__p { margin-top: .4rem; font-size: .8rem; line-height: 1.45; }
  .ap__link { padding-top: .75rem; font-size: .78rem; }
}

/* ---------- phones: Experience, logo left and text right ---------- */
@media (max-width: 640px) {
  .xp__row { grid-template-columns: 56px 1fr; gap: .9rem; padding-block: 1.1rem; align-items: start; }
  .xp__when { gap: .4rem; padding-top: .1rem; font-size: .66rem; line-height: 1.3; }
  .xp__logo { max-width: 52px; max-height: 28px; }
  .xp__wordmark { font-size: 1rem; line-height: 20px; }
  .xp__co { font-size: .95rem; }
  .xp__role { font-size: .85rem; }
  .xp__note { font-size: .8rem; line-height: 1.5; margin-top: .35rem; }
}

/* =============================================================
   One page column: How I work and About/Experience sit in the same
   reading column as Case studies and In motion (no break-out). How I
   work becomes a 2 x 2 so each drawing keeps its size; the portrait
   column narrows so the text keeps a good measure.
   ============================================================= */
.ap__head, .ap__grid { width: auto; margin-left: 0; }
@media (min-width: 601px) {
  .ap__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap__item:nth-child(odd) { border-left: 0; padding-left: 0; padding-right: 1.75rem; }
  .ap__item:nth-child(even) { padding-right: 0; padding-left: 1.75rem; }
  .ap__item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .ap__vis { height: 120px; }
}
@media (min-width: 761px) {
  .prof { width: min(calc(var(--narrow) - 2 * var(--pad)), calc(100% - 2 * var(--pad)));
    grid-template-columns: minmax(0, 190px) minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 3rem); }
}

/* How I work on one line (wide screens): four slim columns in the page
   column, each drawing filling its column, type stepped down a notch */
@media (min-width: 900px) {
  .ap__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ap__item, .ap__item:nth-child(n) { padding: 1.75rem 1.1rem 1.5rem; border-top: 0; border-left: 1px solid var(--border); }
  .ap__item:first-child { border-left: 0; padding-left: 0; }
  .ap__item:last-child { padding-right: 0; }
  .ap__vis { width: auto; height: 68px; max-width: 100%; }
  .ap__n { margin-top: 1.25rem; font-size: .75rem; }
  .ap__t { margin-top: .6rem; font-size: 1.15rem; line-height: 1.18; text-wrap: balance; }
  .ap__p { margin-top: .5rem; font-size: .84rem; line-height: 1.5; }
  .ap__link { font-size: .8rem; padding-top: 1rem; }
  .ap__t { min-height: 2.36em; }
  .ap__vis text:not(.on) { display: none; }
}

/* experience: smaller marks, and where each role was based under its dates */
.xp__logo { max-height: 32px; max-width: 62px; }
.xp__place { margin-top: .2rem; font-size: .82rem; color: var(--fg-faint); }
@media (max-width: 640px) {
  .xp__logo { max-width: 44px; max-height: 22px; }
  .xp__place { font-size: .78rem; }
}
