/* ClearView Window Cleaning: index.css. The home page only; builds on site.css and its scales.
   Order: the opening, the visit and its drawing, the stops, the last stop.
   Key: --hc the side of the hero drawing, --hx its distance from the photograph's left edge. */

/* ---------- the opening ---------- */

/* The drawn corner is laid so its blue junction sits on the photograph's bottom edge: glass above, on the picture;
   sill and track below, on the slate, where the sentence and the action stand beside them. */
.cleop { --hc: 6rem; --hx: var(--s2); }
.cleop > .cledn { grid-area: 3 / 1 / 4 / 3; }
.cleop > .clemt { grid-area: 4 / 1 / 5 / 3; padding-inline-start: calc(var(--hx) + var(--hc) + var(--s3)); }
.cleop > .clepic > img, .cleop > .clepic > video { block-size: clamp(9rem, 24vh, 14rem); }

/* clehc (hero corner): the section drawing over the photograph's lower left; two fifths of it hang below the edge */
.clehc { position: absolute; inset-inline-start: var(--hx); inset-block-end: calc(var(--hc) * -.4); inline-size: var(--hc); block-size: var(--hc); max-inline-size: none; overflow: visible; pointer-events: none; }

/* cleul (underlay): a white stroke under an ink one, so the drawing reads over a picture; clebj (blue junction): the square where glass meets sill */
.cleul { fill: none; stroke: var(--c3); stroke-width: 7; stroke-linecap: square; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }
.clebj { fill: var(--c4); stroke: var(--c3); stroke-width: 2; vector-effect: non-scaling-stroke; }

@media (min-width: 40rem) {
  .cleop { --hc: 10rem; --hx: var(--s5); }
  .cleop > .clepic > img, .cleop > .clepic > video { block-size: clamp(12rem, 42vh, 26rem); }
}
@media (min-width: 56rem) {
  .cleop { --hc: 12rem; grid-template-columns: minmax(0, 1fr) auto; }
  .cleop > .cledn { grid-area: 3 / 2 / 4 / 3; }
  .cleop > .clemt { grid-area: 3 / 1 / 4 / 2; }
}
@media (min-width: 72rem) {
  .cleop { --hc: 15rem; }
}

/* ---------- the visit ---------- */

/* clevs (visit): the five stops in order; on a phone its left edge is the spine, on a desk it carries the one drawing */
.clevs { position: relative; display: flex; flex-direction: column; border-inline-start: .1875rem solid var(--c2); }

/* clevd (visit drawing): the one section, stretched to the height of the five stops; desk only */
.clevd { display: none; }

/* cledh (dashed): a thin broken line for travel, offsets and light */
.cledh { fill: none; stroke: var(--c2); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }

/* clenk (node stroke): a junction drawn as a square-capped point so it stays square when the drawing stretches; clenu (node underlay): its white edge */
.clenk, .clenu { fill: none; stroke-linecap: square; vector-effect: non-scaling-stroke; }
.clenu { stroke: var(--c3); stroke-width: 15; }
.clenk { stroke: var(--c2); stroke-width: 11; transition: stroke var(--d1); }
.picked .clenk { stroke: var(--c4); }

/* clest (stop): one stage of the visit; its head sits on the top edge, where the leader arrives; stops follow each other closely */
.clest { display: flex; flex-direction: column; gap: var(--s4); min-inline-size: 0; padding-block-end: clamp(2rem, 5vh, 3rem); padding-inline-start: var(--s5); }
.clest:nth-of-type(even) { padding-inline-start: var(--s6); }
.clest .clepic > img { block-size: clamp(13rem, 44vh, 23rem); }

/* the facts of a stop: each label a plate no wider than its word, hung by a stub from one leader line */
.clest .clefx { display: grid; grid-template-columns: minmax(0, 1fr); align-items: baseline; gap: var(--s2); border-inline-start: .1875rem solid var(--c2); padding-inline-start: var(--s5); }
.clest .clefx > div { display: contents; }
.clest .clefx dt { position: relative; justify-self: start; min-inline-size: 0; line-height: 1.3; }
.clest .clefx dt::before { content: ""; position: absolute; inset-inline-end: 100%; inset-block-start: calc(50% - .0625rem); inline-size: var(--s5); block-size: .125rem; background: var(--c2); }
.clest .clefx dd { padding-block-end: var(--s2); }

/* clejh (junction head): number and heading; on a phone a stub steps out from the spine to meet it */
.clejh { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.clejh > h2 { flex: 1 1 10rem; min-inline-size: 0; }
.clejh::before { content: ""; position: absolute; inset-block-start: 0; inset-inline-end: 100%; inline-size: var(--s5); block-size: .1875rem; background: var(--c2); transition: background-color var(--d1); }
.clest:nth-of-type(even) .clejh::before { inline-size: var(--s6); }
.clejh.picked::before { background: var(--c4); }

/* clejn (junction number): the numbered plate at the end of a leader; blue while its stage is in view */
.clejn { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 2.75rem; block-size: 2.75rem; background: var(--c3); color: var(--c2); font: 400 var(--t3)/1 var(--f2); transition: background-color var(--d1), color var(--d1); }
.clejh.picked .clejn { background: var(--c4); color: var(--c3); }

/* clepr (pair): the two faces of the pane, side by side when there is room */
.clepr { display: flex; flex-wrap: wrap; gap: var(--s5); }
.clepr > .clent { flex: 1 1 12rem; }

/* clepa (part): the name of a part as a link on its plate, at touch size */
.clepa { display: inline-flex; align-items: center; align-self: flex-start; min-block-size: 2.75rem; font-size: var(--t2); line-height: 1.2; }

/* clewy (ways on): the links out of a stop to its page */
.clewy { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); }
.clewy a { display: inline-flex; align-items: center; min-block-size: 2.75rem; }

@media (min-width: 40rem) {
  .clest .clefx { grid-template-columns: max-content minmax(0, 1fr); gap: var(--s3) var(--s4); }
  .clest .clefx dd { padding-block-end: 0; }
}

@media (min-width: 60rem) {
  .clevs { display: grid; grid-auto-rows: 1fr; border-inline-start: 0; }
  .clevd { display: block; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 11rem; block-size: 100%; max-inline-size: none; overflow: visible; pointer-events: none; }
  .clest, .clest:nth-of-type(even) { padding-inline-start: 11rem; }
  .clejh::before { display: none; }
  .clest:nth-of-type(even) > .clesd { flex-direction: row-reverse; }
  .clest:nth-of-type(even) .clepic { flex-grow: 1.3; }
}

/* ---------- the last stop ---------- */

/* clels (last stop): where the drawing ends and the email begins, running the width */
.clels { display: flex; flex-direction: column; gap: var(--s5); }
.clels .clesd { align-items: flex-end; }
