/* ch-front.css: the front matter (cover with the portrait; about page with the bio and the project
   index). Loaded after css/book.css. Scoped to #cover and #about; tokens from book.css only. Motion
   follows book-scroll-motion: transform, opacity and stroke dashes, pending states under html.mo. */

/* ------------------------------------------------------------------ COVER */
#cover .cover-body { grid-template-areas: "kick kick" "name emblem" ". tblock"; row-gap: var(--s4); }
#cover .cover-kicker { position: relative; flex-wrap: wrap; row-gap: 6px; border-bottom: 0; }
/* the two rules are drawn as the board opens: the kicker rule runs out, then the rule under the name */
#cover .cover-kicker::after, #cover .cover-line::before { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--line); transform-origin: 0 50%; }
#cover .cover-kicker::after { bottom: 0; }
#cover .cover-line::before { top: 0; }
.mo #cover:not(.open) .cover-kicker::after, .mo #cover:not(.open) .cover-line::before { transform: scaleX(0); }
.mo #cover.open .cover-kicker::after { transition: transform 1.1s var(--ease) .1s; }
.mo #cover.open .cover-line::before { transition: transform .9s var(--ease) .7s; }
#cover .cover-kicker span + span { color: var(--ink); letter-spacing: .2em; }
#cover .cover-name { align-self: center; }
#cover .cover-name svg { max-height: 46svh; }
#cover .cover-line { position: relative; margin-top: var(--s5); padding-top: var(--s3); max-width: none; font-size: clamp(19px, 1.7vw, 25px); }
/* the portrait, mounted: as wide as the window's height allows, so the cover stays one screen */
#cover .cover-emblem { width: min(100%, 380px, calc((100svh - 330px) * .74)); min-width: 210px; }
#cover .cover-portrait { order: 0; width: 100%; transform: rotate(1.2deg); }
#cover .cover-tblock { width: min(100%, 380px); }
#cover .cover-tblock > div { grid-template-columns: 7.6em minmax(0, 1fr); }
/* the print settles onto the board as it opens (transform only, never a fade: it is the LCP image) */
.mo #cover:not(.open) .cover-portrait { transform: translateY(16px) rotate(-1.5deg); }
.mo #cover.open .cover-portrait { transition: transform 1.2s var(--ease) .3s; }

/* ------------------------------------------------------------------ ABOUT */
#about .title-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); min-height: 0; padding-top: var(--s4); }
#about .about-photo { order: 0; width: min(100%, 380px); transform: rotate(-1deg); }
#about .about-photo .mount .print { aspect-ratio: 471 / 517; }
#about .bio-col { max-width: 36em; }
#about .bio-kicker { margin: 0 0 var(--s3); }
#about .bio-name { margin-bottom: var(--s5); }
#about .bio { font-size: clamp(20px, 1.75vw, 26px); line-height: 1.5; max-width: 25em; }

/* the project index: four plates, each a link to its chapter */
#about .pindex { margin-top: var(--s7); }
#about .pindex:focus { outline: none; }
#about .pindex-h { margin: 0 0 var(--s4); padding-bottom: 10px; border-bottom: 1.5px solid var(--line); font: 600 12px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); }
#about .pindex-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 36px); }
#about .pindex-list a { display: grid; align-content: start; gap: 8px; height: 100%; padding: 10px 10px 14px; border: 1px solid var(--line-2); text-decoration: none; transition: border-color .2s, background-color .2s; }
#about .pindex-list a:hover, #about .pindex-list a:focus-visible { border-color: var(--ink); background: rgba(216,232,255,.06); }
#about .pi-frame { display: block; --ar: 4 / 3; margin-bottom: 6px; }
#about .pi-frame .print { display: block; }
#about .pi-frame img { transition: transform .5s var(--ease); }
#about .pindex-list a:hover .pi-frame img { transform: scale(1.04); }
#about .pi-no { display: flex; justify-content: space-between; font: 500 11.5px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
#about .pi-pg { color: var(--ink); font-weight: 600; }
#about .pi-t { font: 700 clamp(22px, 2vw, 30px)/1 var(--f-disp); text-transform: uppercase; letter-spacing: .03em; }
#about .pi-s { font: 400 15px/1.4 var(--f-body); color: var(--ink-2); }
#about .pindex-end { display: flex; flex-wrap: wrap; gap: 0 28px; margin: var(--s4) 0 0; }
#about .pindex-end a { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); font: 600 13px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--line-2); }
#about .pindex-end a:hover { border-bottom-color: var(--ink); }
#about .pindex-end b { color: var(--ink-2); font-weight: 500; }

/* the "Scroll to open" cue moves left where the title block reaches the middle */
@media (max-width: 1100px) {
  #cover .cover-cue { left: var(--pad-x); transform: none; align-items: flex-start; }
  #about .pindex-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ PHONE */
@media (max-width: 760px) {
  #cover .cover-body { grid-template-areas: "kick" "name" "emblem" "tblock"; }
  #cover .cover-kicker { flex-direction: column; }
  #cover .cover-kicker span + span { display: block; }
  #cover .cover-line { margin-top: var(--s4); font-size: 19px; }
  #cover .cover-emblem { width: min(78%, 320px); min-width: 0; justify-self: center; }
  #cover .cover-tblock { width: auto; }

  #about .title-body { grid-template-columns: minmax(0, 1fr); }
  #about .about-photo { width: min(82%, 320px); }
  #about .bio { font-size: 19px; }
  #about .pindex-list { gap: 14px; }
  #about .pindex-list a { padding: 8px 8px 12px; }
  #about .pi-s { font-size: 14px; }
}
@media (max-width: 400px) {
  #about .pindex-list { grid-template-columns: minmax(0, 1fr); }
  #about .pindex-list a { grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "img no" "img t" "img s"; column-gap: 12px; row-gap: 4px; align-items: start; }
  #about .pi-frame { grid-area: img; margin: 0; }
  #about .pi-no { grid-area: no; }
  #about .pi-t { grid-area: t; }
  #about .pi-s { grid-area: s; }
}
