/* CaseModel website - css/p-pages.css
   The blocks the nine pages are made of, around their figures. On the overview: the hero's mark, the line from "A case is
   connections" to its page, and the eight parts as doors to their pages (What CaseModel does). On each feature page: its
   head (its words beside its own part of the briefing) and its foot (the part before, the part after, and a briefing).
   A door is one thing to press: the whole card or panel is the link, and it lifts a little under the pointer or the focus.
   Every door's arrow is the same arrow. What this file adds of its own carries the prefix pp-. */

:root {
  /* an arrow, as a shape: a shaft and an open head, two pixels thick in a box 16 by 12 */
  --pp-arrow: polygon(0 41.67%, 76.06% 41.67%, 53.66% 11.78%, 62.5% 0, 100% 50%, 62.5% 100%, 53.66% 88.22%, 76.06% 58.33%, 0 58.33%);
}

/* ---- the hero: the gathering mark on the right, drawn by the stage inside this box ---- */
.hero-grid > .hero-stage { position: relative; align-self: center; width: 100%; max-width: 680px; justify-self: end; }
@media (max-width: 1020px) {
  .hero-grid > .hero-stage { justify-self: center; width: min(100%, 520px); }
}
/* a phone held sideways: the words and the mark side by side, the mark on the right and at the top, so the first screen
   holds both */
@media (max-width: 1020px) and (max-height: 500px) and (orientation: landscape) {
  .hero-grid > .hero-stage { order: 0; align-self: start; margin-top: 8px; }
}

/* ---- the line that leads from the case's connections to the page where they are joined ---- */
.bridge-go { margin: clamp(28px, 3.6vw, 44px) 0 0; }
.bridge-go a { display: inline-block; padding: 15px 22px 15px 20px; border: 1px solid var(--azure-6); border-radius: var(--r-2);
  background: rgb(255 255 255 / .9); color: var(--azure-11); font: 700 16px/1.35 var(--font-display); letter-spacing: -0.01em; text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease), box-shadow .25s var(--ease); }
.bridge-go a::after, .wd-go::after, .pf-nav span::after { content: ''; flex: none; width: 16px; height: 12px; background: currentColor; clip-path: var(--pp-arrow); transition: transform .25s var(--ease); }
.bridge-go a::after { display: inline-block; margin: -2px 0 0 14px; vertical-align: middle; }      /* it follows the last word, wherever the line breaks */
@media (hover: hover) {
  .bridge-go a:hover { border-color: var(--brand-azure); background: var(--sky-2); color: var(--azure-12); box-shadow: var(--shadow-2); }
  .bridge-go a:hover::after { transform: translateX(4px); }
}

/* ---- What CaseModel does: four groups, each its number, name and line beside its parts. A part is a door to its page:
   its piece of the briefing at the top (a button of its own, pressable over the door), its name, its line, and the way in. ---- */
.wd { border-top: 2px solid var(--brand-navy); }
.wd-group { display: grid; grid-template-columns: clamp(220px, 20vw, 290px) minmax(0, 1fr); gap: clamp(28px, 3.4vw, 52px); padding: clamp(30px, 3.4vw, 44px) 0; border-bottom: 1px solid var(--border-row); }
.wd-group:last-child { border-bottom: 0; padding-bottom: 0; }
.wd-k { min-width: 0; }
.wd-k span { display: flex; align-items: center; gap: 10px; width: fit-content; color: var(--azure-11); font: 500 13.5px/1 var(--font-mono); }
.wd-k span::before { content: ''; width: 8px; height: 8px; background: var(--brand-azure); }
.wd-group:nth-child(2) .wd-k span::before { background: var(--brand-azure-deep); }
.wd-group:nth-child(3) .wd-k span::before { background: var(--brand-navy); }
.wd-group:nth-child(4) .wd-k span::before { background: var(--brand-sky); }
.wd-k b { display: block; margin-top: 14px; color: var(--brand-navy); font: 800 clamp(23px, 2vw, 29px)/1.1 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
.wd-k p { max-width: 17em; margin: 12px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.5; }
/* a group's parts share its row between them: three take a third each, two a half each, and one alone takes the whole row
   with its picture beside its words, so no row is left with an empty place in it. On a phone, one column. */
.wd-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: stretch; }
@media (min-width: 641px) {
  .wd-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
  .wd-card { grid-column: span 2; }
  .wd-card:first-child:nth-last-child(2), .wd-card:first-child:nth-last-child(2) + .wd-card { grid-column: span 3; }
  .wd-card:only-child { grid-column: 1 / -1; }
}

.wd-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 8px 8px 20px; border: 1px solid var(--border); border-radius: var(--r-3); background: #ffffff; box-shadow: var(--shadow-1); }
.js .wd .wd-card { transition: opacity .9s var(--ease) var(--rd, 0ms), transform .9s var(--ease) var(--rd, 0ms), translate .3s var(--ease), box-shadow .3s var(--ease), border-color .2s; }
/* the part's piece of the briefing: its picture, over the door and pressed on its own */
.wd-card .wd-play { position: relative; z-index: 2; display: block; flex: none; width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; margin: 0 0 18px; padding: 0;
  border: 0; border-radius: var(--r-2); background: var(--sky-4); box-shadow: 0 0 0 1px var(--slate-5); overflow: hidden; text-align: left; }
.wd-card .wd-play[data-state="on"], .wd-card .wd-play[data-state="held"] { box-shadow: 0 0 0 2px var(--brand-azure); }      /* its part is playing */
.wd-card h3 { margin: 0 12px; font-size: clamp(19.5px, 1.55vw, 22px); font-weight: 800; line-height: 1.18; letter-spacing: -0.025em; }
.wd-card .wd-play[hidden] + h3 { margin-top: 16px; }                 /* while there is no briefing to play, the name heads the card */
.wd-card h3 a { color: var(--brand-navy); text-decoration: none; outline: none; }
.wd-card h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: var(--r-3); }      /* the whole card is the way in */
.wd-card h3 a:focus-visible::after { outline: 2px solid var(--brand-azure); outline-offset: 3px; }
.wd-card > p { margin: 10px 12px 0; color: var(--text-2); font-size: 15.5px; line-height: 1.5; }
.wd-go { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; margin: auto 12px 0; padding-top: 18px; color: var(--azure-11); font: 700 14.5px/1.2 var(--font-display); text-decoration: none; }
@media (hover: hover) {
  .wd-card:hover { translate: 0 -4px; border-color: var(--brand-azure); box-shadow: var(--shadow-3); }
  .wd-card:hover h3 a { color: var(--azure-11); }
  .wd-card:hover .wd-go { color: var(--azure-12); }
  .wd-card:hover .wd-go::after { transform: translateX(4px); }
}
.wd-card:has(:focus-visible) { translate: 0 -4px; border-color: var(--brand-azure); box-shadow: var(--shadow-3); }
/* a part with the row to itself: its picture on the left, its words beside it, its way in at the foot of the words */
@media (min-width: 641px) {
  .wd-card:only-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); column-gap: clamp(20px, 2.6vw, 36px); align-items: start; padding: 8px; }
  .wd-card:only-child .wd-play { grid-row: 1 / span 3; margin: 0; }
  .wd-card:only-child h3 { grid-column: 2; margin: clamp(12px, 1.8vw, 24px) 16px 0 0; font-size: clamp(21px, 1.9vw, 27px); }
  .wd-card:only-child > p { grid-column: 2; margin: 12px 16px 0 0; font-size: 16px; }
  .wd-card:only-child .wd-go { grid-column: 2; align-self: end; margin: 0 16px 12px 0; }
  .wd-card:only-child .wd-play[hidden] ~ * { grid-column: 1 / -1; margin-left: 12px; }
}

/* ---- a feature page's head: its words, about two fifths, beside its own part of the briefing ---- */
.ph { position: relative; padding: clamp(124px, 12vw, 176px) 0 clamp(24px, 3.4vw, 52px); }
.ph::before { content: ''; position: absolute; inset: 0; z-index: -2; background: radial-gradient(52% 62% at 74% 46%, var(--sky-3), transparent 72%); }      /* a glow behind the picture, gone before the head ends */
.ph-in { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); gap: clamp(32px, 3.6vw, 56px); align-items: center; }
.ph-copy { min-width: 0; container-type: inline-size; }
/* the page's title: as large as the site's section headings or a little larger, and never so large in its column that a
   phrase of eight letters' widths (its longest, "Every page, read.") has to break */
.ph-h { font-size: clamp(38px, 4.6vw, 64px); font-size: clamp(38px, min(5.4vw, 12.4cqi), 72px); font-weight: 800; line-height: 1.01; letter-spacing: -0.042em; text-wrap: balance; }
.ph-h > span { display: inline-block; }      /* a title in two sentences breaks between them first */
.ph-lede { max-width: 30em; margin: 26px 0 0; color: var(--text-2); font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; }
.ph .rl { max-width: 30em; margin-top: 26px; }
.ph-film { min-width: 0; }
/* a held story next (the build): it brings its own lead-in, the room above its first step, so the head adds none */
.ph:has(+ .story) { padding-bottom: 0; }

/* ---- a feature page's foot: the part before and the part after as two doors, then a quiet line and a briefing ---- */
.pf { position: relative; padding: clamp(8px, 1.6vw, 24px) 0 clamp(72px, 8vw, 120px); }
.pf-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.pf-nav a { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 28px; min-width: 0; min-height: clamp(150px, 13vw, 196px);
  padding: clamp(22px, 2.6vw, 34px) clamp(22px, 2.8vw, 38px); border: 1px solid var(--border); border-radius: var(--r-3); background: #ffffff; box-shadow: var(--shadow-1);
  color: var(--brand-navy); text-decoration: none; transition: translate .3s var(--ease), box-shadow .3s var(--ease), border-color .2s, background .2s; }
.pf-nav span { display: inline-flex; align-items: center; gap: 12px; color: var(--azure-11); font: 700 12.5px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.pf-nav b { color: var(--brand-navy); font: 800 clamp(24px, 2.5vw, 36px)/1.08 var(--font-display); letter-spacing: -0.035em; text-wrap: balance; }
.pf-prev span { flex-direction: row-reverse; }
.pf-prev span::after { transform: scaleX(-1); }
.pf-nav .pf-next { align-items: flex-end; text-align: right; border-color: var(--brand-navy); background: var(--brand-navy); box-shadow: var(--shadow-2); }
.pf-next span { color: var(--azure-6); }
.pf-next b { color: #ffffff; }
@media (hover: hover) {
  .pf-nav a:hover { translate: 0 -4px; border-color: var(--brand-azure); box-shadow: var(--shadow-3); }
  .pf-nav .pf-next:hover { border-color: var(--brand-navy); }
  .pf-prev:hover span::after { transform: scaleX(-1) translateX(4px); }
  .pf-next:hover span::after { transform: translateX(4px); }
}
.pf-nav a:focus-visible { outline-offset: 3px; translate: 0 -4px; box-shadow: var(--shadow-3); }
.pf-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 12px; margin-top: clamp(36px, 4.4vw, 56px); padding-top: clamp(24px, 2.8vw, 32px); border-top: 1px solid var(--border-row); }
.pf-cta p { flex: 1 1 18em; margin: 0; color: var(--text-2); font-size: clamp(17px, 1.35vw, 19px); line-height: 1.45; }

/* ---- narrower windows. Below 1240 px a group's name goes above its parts, so that three parts still have room. ---- */
@media (max-width: 1239px) {
  .wd-group { grid-template-columns: 1fr; gap: 22px; }
  .wd-k { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 6px 18px; }
  .wd-k b { margin: 0; }
  .wd-k p { grid-column: 2; max-width: 36em; margin: 0; }
}
@media (max-width: 1020px) {
  .ph-in { grid-template-columns: 1fr; gap: 36px; }
  .ph-lede, .ph .rl { max-width: 36em; }
}
/* a middling window: two to a row, and the third of three takes the next row to itself, as a part alone does */
@media (min-width: 641px) and (max-width: 960px) {
  .wd-card { grid-column: span 3; }
  .wd-card:nth-child(3):last-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); column-gap: 20px; align-items: start; padding: 8px; }
  .wd-card:nth-child(3):last-child .wd-play { grid-row: 1 / span 3; margin: 0; }
  .wd-card:nth-child(3):last-child h3 { grid-column: 2; margin: 12px 16px 0 0; }
  .wd-card:nth-child(3):last-child > p { grid-column: 2; margin: 10px 16px 0 0; }
  .wd-card:nth-child(3):last-child .wd-go { grid-column: 2; align-self: end; margin: 0 16px 12px 0; }
  .wd-card:nth-child(3):last-child .wd-play[hidden] ~ * { grid-column: 1 / -1; margin-left: 12px; }
}
@media (max-width: 640px) {
  .bridge-go a { padding: 12px 18px 12px 16px; font-size: 15.5px; }
  .wd-group { gap: 18px; padding: 28px 0; }
  .wd-k { grid-template-columns: auto minmax(0, 1fr); }
  .wd-k span { font-size: 14px; }
  .wd-k b { font-size: 22px; }
  .wd-k p { font-size: 15.5px; }
  .wd-card h3 { font-size: 20px; }
  .wd-card > p { font-size: 15.5px; }
  .wd-go { font-size: 15px; }
  .ph { padding: 104px 0 48px; }
  .ph-h { font-size: 38px; font-size: clamp(32px, 12.4cqi, 44px); line-height: 1.04; }
  .ph-lede { margin-top: 18px; font-size: 17.5px; }
  .ph-in { gap: 28px; }
  .pf-nav { grid-template-columns: 1fr; }
  .pf-next { order: -1; }
  .pf-nav a { min-height: 0; gap: 18px; padding: 22px 22px 24px; }
  .pf-nav b { font-size: 24px; }
  .pf-cta { flex-direction: column; align-items: stretch; }
  .pf-cta p { flex: none; }
  .pf-cta .btn { width: 100%; }
}

/* ---- readers who ask for less motion, more contrast, or paper ---- */
@media (prefers-reduced-motion: reduce) {
  .wd-card:hover, .wd-card:has(:focus-visible), .pf-nav a:hover, .pf-nav a:focus-visible { translate: none; }
}
@media (prefers-contrast: more) {
  .wd-card, .pf-prev { border-color: var(--slate-10); }
}
@media (forced-colors: active) {
  .bridge-go a::after, .wd-go::after, .pf-nav span::after { forced-color-adjust: none; background: currentColor; }
  .wd-card h3 a:focus-visible::after { outline-color: Highlight; }
}
@media print {
  .wd-play, .ph-film { display: none !important; }
  .ph-in, .wd-group { grid-template-columns: 1fr; }
}
