/* project.css — the look shared by the project pages that have their own
   design, on top of site.css. Each of those pages opens with a short
   animation (drawn and played by project-intro.js, plus the page's own
   script), then "In short" and "In detail".

   1 The intro   2 The drawing   3 In short   4 In detail

   A page using it links this after site.css, then its own stylesheet for
   anything only it needs:
     <link rel="stylesheet" href="/assets/css/project.css">
     <link rel="stylesheet" href="my-project.css"> */


/* 1. The intro --------------------------------------------------------------
   With JavaScript (.is-animated), the intro fills the window below the
   header and the animation plays in it once, ending on the heading.
   Without it, it's just the heading. */

.intro { position: relative; }

.intro-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 32rem;
  padding: 4rem 1.5rem;
}
.is-animated .intro-stage {
  height: calc(100svh - var(--above, 4.75rem));  /* the window, less the header (the script measures it) */
  min-height: 30rem;
  padding: 0;
  overflow: hidden;
}

/* The drawing fills the stage, under the heading. */
.intro-scene { display: none; }
.is-animated .intro-scene {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 45%;
}

.intro-title {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0;
  padding-inline: 1.5rem;
  text-align: center;
}
.intro-title .icon-tile { margin-bottom: 1.25rem; }
.intro-title .display { font-size: clamp(2.75rem, 1.4rem + 6vw, 6rem); }
.intro-title .standfirst { max-width: 34rem; margin-inline: auto; }

/* "Scroll" under the heading, and the Skip / Replay button in the corner. */
.intro-hint { display: none; }
.is-animated .intro-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  display: inline-flex;
  translate: -50% 0;
}
.intro-hint, .intro-control {
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.intro-hint .icon, .intro-control .icon { font-size: 1.125rem; }

.intro-control {
  position: absolute;
  z-index: 2;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
}
.intro-control[hidden] { display: none; }
.intro-control:hover { color: var(--text); background: var(--surface); }


/* The terminal line under some drawings: what the tool would print at that
   moment (statusLine() in project-intro.js fills it). Only shown while it
   plays. */
.intro-status { display: none; }
.is-animated .intro-status {
  position: absolute;
  z-index: 1;
  bottom: 4.5rem;
  left: 50%;
  display: block;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  translate: -50% 0;
}
.status-command { color: var(--muted); margin-right: 0.75rem; }
.status-command::before { content: '$ '; }
.status-lead { color: var(--accent); font-weight: 600; }


/* 2. The drawing ------------------------------------------------------------
   Thin lines in the text colour; dashed lines for anything planned or
   being built; the accent for what matters. Shapes are filled with the page
   colour so nearer lines hide farther ones. Lines stay the same width
   however big the drawing is shown. */

.intro-scene polygon, .intro-scene rect, .intro-scene circle, .intro-scene line {
  fill: var(--bg);
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.intro-scene path { fill: currentColor; stroke: none; }
.intro-scene path.outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Planned: where something is about to go. Built: a finished outline. */
.intro-scene .planned polygon { fill: none; stroke: var(--muted); stroke-dasharray: 5 6; }
.intro-scene .built polygon { fill: none; stroke: var(--accent); stroke-dasharray: 9 7; stroke-width: 1.8; }

/* Labels. Sizes are in the drawing's units, which show at about two thirds
   of a pixel on a desktop screen and less on a phone. */
.intro-scene text { fill: var(--muted); font-family: var(--font-mono); font-size: 16px; }
.intro-scene text.name { fill: var(--text); font-size: 22px; font-weight: 600; }
.intro-scene .accent { color: var(--accent); }
.intro-scene .muted { color: var(--muted); }


/* 3. In short ---------------------------------------------------------------- */

.in-short { padding-block: 5rem 2rem; }
.in-short .eyebrow, .in-detail .eyebrow { margin-bottom: 1.5rem; }

.point-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Four points: one column on phones, two by two, then four across. */
@media (min-width: 36rem) { .point-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 66rem) { .point-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.point {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.point h3 { margin: 1rem 0 0.375rem; font-size: 1.1875rem; line-height: 1.3; }
.point p { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 1px;
  margin: 1.25rem 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}
.stat-row div { display: flex; flex-direction: column-reverse; padding: 1.25rem 1.5rem; background: var(--bg); }
.stat-row dt { color: var(--muted); font-size: 0.875rem; }
.stat-row dd { margin: 0; color: var(--accent); font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }

/* Where it fits: the steps in order, with this project's lit up (.is-here).
   Two by two on narrow screens, four across on wide ones; each step is its
   tool over what it does, after an arrow. */
.pipeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 48rem) { .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pipeline li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.5rem; align-items: center; }
.pipeline-tool, .pipeline-job { grid-column: 2; }
.pipeline li:first-child { column-gap: 0; }
.pipeline li + li::before {
  grid-row: span 2;
  content: 'arrow_forward';
  color: var(--muted);
  font-family: 'Material Symbols Rounded';
  font-size: 1.25rem;
  font-feature-settings: 'liga';
}
.pipeline-tool { font-family: var(--font-display); font-weight: 600; }
.pipeline-job { color: var(--muted); font-size: 0.9375rem; }
.pipeline .is-here .pipeline-tool { color: var(--accent); }
/* The other steps link to their projects, looking like plain text until hovered. */
a.pipeline-tool { justify-self: start; text-decoration: none; }


/* 4. In detail --------------------------------------------------------------- */

.in-detail { padding-block: 3rem 1rem; }
.in-detail .prose > h2:first-child { margin-top: 0; }
.in-detail-back { margin-top: 3rem; }
