/* La Casita.

   The shape of the page is its own: a full-bleed picture, the title under it,
   and one column of reading underneath. The project is a story in two halves,
   an energy experiment and a build, so it wants a column you read down.

   What it takes from Primate Explorer, Spark Robotics and ZippyZoom is
   everything that makes them feel like one family: Lato, the teal, the
   charcoal hairline around every photograph, the grey centred footer, and the
   fullscreen button in the corner.

   One palette, always, and never the system's dark theme: the page is shown
   on a classroom projector as often as on a phone, and a dark theme would
   wash the microscope photographs out. */

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,400&display=swap');

:root {
  --ink:      #212121;
  --ink-2:    #45545a;
  --ink-3:    #6b7a80;
  --teal:     #226e93;
  --line:     #e0e0e0;
  --edge:     #2f3437;        /* the charcoal the other sites outline with */
  --paper:    #ffffff;
  --paper-2:  #f6f8f9;
  /* 1080px, which is the 1076px the other three sites run their content at.
     The column shape is this page's own; its width is the family's. */
  --col:      1080px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 22px/1.6 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

/* ---- the head --------------------------------------------------------- */

/* The opening photograph is the project in one frame: a first grader, a
   microscope, and the thing she found on the screen behind her. So it runs
   full width and the title sits under it rather than on top of it, where it
   would have to fight the picture for contrast. */

.hero img { width: 100%; }
.hero .titles {
  max-width: var(--col); margin: 0 auto;
  padding: 52px clamp(1rem, 5vw, 2rem) 0;
}
/* The title and the section headings are set exactly as Primate Explorer,
   Spark Robotics and ZippyZoom set theirs: teal, centred, 45px in the light
   weight, dropping to 32 and 30 on a narrow screen. */
.hero h1 {
  color: var(--teal); text-align: center;
  font-size: 45px; font-weight: 300; line-height: 1.15;
  letter-spacing: 0.5px; margin: 0 0 10px;
}
/* Who made it and where, one to a line, centred under the centred title. Set
   below the body size and tight: these two lines are a caption on the title,
   not a paragraph, and at the body size they argued with it. */
.hero .by {
  text-align: center;
  font-size: 19px; font-weight: 400; line-height: 1.45; color: var(--ink-3);
  margin: 12px 0 0;
}
.hero .by strong { color: var(--ink-2); font-weight: 700; }

/* The award. It is the first thing most people open this page to find out,
   so it gets a shape of its own rather than a third line of grey byline: a
   quiet gold ribbon with a medal on it, centred under the name. */
.award {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: max-content; max-width: 100%; margin: 20px auto 0;
  padding: 9px 22px;
  background: #fdf8ec; border: 1px solid #e7d6a8; border-radius: 999px;
  color: #8a6d1f; font-size: 17px; font-weight: 700; letter-spacing: 0.3px;
  text-align: center;
}
.award .medal { flex: none; display: flex; }
.award svg {
  width: 21px; height: 21px;
  fill: none; stroke: #b08d3e; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
@media (max-width: 479px) {
  .award { font-size: 15px; padding: 9px 16px; border-radius: 16px; }
}

/* ---- the column ------------------------------------------------------- */

.page {
  max-width: var(--col); margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
}
.page h2 {
  color: var(--teal); text-align: center;
  font-size: 45px; font-weight: 300; line-height: 1.2; letter-spacing: 0.5px;
  /* Every section opens on a hairline across the column, so the page reads
     as a run of chapters rather than one long scroll. The rule sits on the
     heading rather than between the sections, because an <hr> between them
     would be one more thing to remember to put in by hand. */
  border-top: 1px solid var(--line);
  padding-top: 2.6rem; margin: 3.4rem 0 22px;
}

@media (max-width: 479px) {
  .hero h1 { font-size: 32px; }
  .page h2 { font-size: 30px; }
}

.page p { margin: 1rem 0; }
.page a { color: #006580; }
.page a:hover { color: #007a93; }

/* The four things she used, on one line divided by dots. Four short nouns
   stacked down the left edge of a 1080px column left most of it empty. */
.kit { text-align: center; }

/* The two steps. Numbered by hand rather than by an <ol>, because the number
   is part of the look here and wants to be the size it is in the deck. */
.step { margin: 1.3rem 0; }
.step .n {
  display: block; margin-bottom: 0.15rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}
.step p { margin: 0; }

/* A guess, and then how it turned out. The two wrong guesses and the right
   one are all set the same way, so the page does not tip its hand before the
   reader gets there. */
.guess {
  background: var(--paper-2); border-left: 3px solid var(--teal);
  border-radius: 0 6px 6px 0;
  padding: 1.1rem 1.3rem; margin: 1.6rem 0;
}
.guess .lbl {
  display: block; margin-bottom: 0.25rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}
.guess p { margin: 0; font-size: 28px; font-weight: 300; line-height: 1.35; }
/* How the guess turned out. The same box as the guess itself, so a guess and
   its answer read as a pair, with its own label and a warmer bar down the
   side to tell the two apart at a glance. */
.guess.result { border-left-color: #c2410c; }

/* A photograph with its caption. The caption says what to look at, because a
   field of microbes means nothing to a reader who has never seen one. */
figure { margin: 1.9rem 0; }
/* The illustrations off the slides are tall portraits. At the full width of
   the column each one is taller than the screen, so a reader scrolls past a
   picture rather than seeing it. Capped and centred, they sit as pictures. */
figure.portrait img { max-width: min(440px, 100%); margin-inline: auto; }
/* The photographs carry no frame. Every one of them is a picture of a screen,
   already a bright rectangle with its own edges, and a border round it only
   adds a second edge beside the one the picture already has. */
/* A short line under the picture, centred on it. Plain weight: there is one
   caption per photograph here, not a grid of them needing to be told apart,
   so it can sit quietly. */
figcaption {
  /* Sitting right under the picture it belongs to. Several of these
     photographs are deck slides with white already baked into their lower
     edge, so any margin here reads as a gap twice the size it is. */
  margin-top: 4px;
  font-size: 15px; line-height: 1.5; color: var(--ink-3);
  text-align: center;
}

/* The offer of the deck itself, under the two films. */
.getit { text-align: center; font-size: 17px; color: var(--ink-3); margin-top: 1.6rem; }

/* The film. A 16:9 box that keeps its shape at every width, so the page does
   not jump as the frame loads. */
.film {
  position: relative; aspect-ratio: 16 / 9; margin: 1.4rem 0 0;
  overflow: hidden; background: #000;
}
.film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* The closing line from the last slide. It is the point of the whole project,
   so it gets the page to itself. */
.sendoff {
  text-align: center; margin: 3.4rem 0 0;
  padding: 2.2rem 1rem;
  /* Opens on a rule and closes on nothing: the footer draws its own line a
     moment later, and two of them with only air between read as a mistake. */
  border-top: 1px solid var(--line);
}
.sendoff p {
  color: var(--teal); font-weight: 300;
  /* One line on anything wider than a phone, so it is sized to fit the
     column rather than to a fixed number of pixels. */
  font-size: clamp(1.7rem, 4.6vw, 3rem); line-height: 1.25;
  letter-spacing: 0.5px; margin: 0;
}

/* ---- footer ----------------------------------------------------------- */
/* The same grey centred line the other sites end on. */

footer {
  /* The send-off above already ends on a generous run of white, so the footer
     takes none of its own on top. */
  border-top: 1px solid var(--line); padding: 20px 0 28px;
  color: #6b6b6b; font-size: 13px; line-height: 1.8; text-align: center;
}
footer .wrap { max-width: 1200px; margin: 0 auto; padding: 0 62px; }
@media (max-width: 700px) { footer .wrap { padding: 0 20px; } }
footer a { color: #6b6b6b; }

/* ---- fullscreen button ------------------------------------------------ */
/* The way a video player offers it: a quiet corner button that gets the
   browser's own furniture out of the way. Added by script, so a browser that
   cannot do it is never shown it. */

.fs {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 20;
  width: 2.5rem; height: 2.5rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: #5f6b70;
  border: 1px solid var(--edge); border-radius: 0.5rem;
  cursor: pointer; opacity: 0.55;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.fs svg {
  width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.fs:hover { opacity: 1; color: var(--teal); border-color: var(--teal); }
.fs:focus-visible { opacity: 1; outline: 2px solid var(--teal); outline-offset: 2px; }
@media print { .fs { display: none; } }


/* ---- cards ------------------------------------------------------------ */

/* A row of short boxes, as the deck sets out the project's three purposes
   and its four takeaways. They wrap to one column on a phone rather than
   shrinking, because a box narrower than its own heading is no use. */
.cards {
  display: grid; gap: 16px; margin: 1.6rem 0;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.cards .card {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; background: var(--paper);
}
.cards .card b {
  display: block; margin-bottom: 6px;
  color: var(--teal); font-size: 20px; font-weight: 700;
}
.cards .card p { margin: 0; font-size: 18px; color: var(--ink-2); }
/* A takeaway is a finding and then what she would do about it. */
.cards .card .act { display: block; margin-top: 8px; color: #b45309; font-size: 17px; }
.cards .card .act.good { color: #1d7a45; }

/* ---- the numbered procedure ------------------------------------------- */

.steps { list-style: none; counter-reset: step; margin: 1.6rem 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative; padding: 0 0 18px 56px;
  border-left: 1px solid var(--line); margin-left: 17px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
/* The number sits on the line, so the steps read as one run rather than as
   seven separate boxes. */
.steps li::before {
  content: counter(step);
  position: absolute; left: -17px; top: 0;
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--teal); font-size: 16px; font-weight: 700;
}
.steps li b { display: block; margin-bottom: 2px; font-size: 20px; }
.steps li span { color: var(--ink-2); }

/* ---- tables ----------------------------------------------------------- */

/* Real tables, not pictures of tables: they reflow, they can be read out,
   and the numbers stay sharp at any zoom. A wide one scrolls sideways inside
   its own box rather than stretching the page. */
.tablewrap { margin: 1.4rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 17px; }
caption {
  caption-side: top; text-align: left; padding-bottom: 10px;
  color: var(--ink-3); font-size: 16px;
}
th, td {
  padding: 9px 14px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
thead th {
  color: var(--ink-2); font-weight: 700; font-size: 15px;
  border-bottom: 1.5px solid var(--ink-3);
}
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) { background: var(--paper-2); }
tfoot td { font-weight: 700; border-bottom: 0; border-top: 1.5px solid var(--ink-3); }
.yes { color: #1d7a45; font-weight: 700; }
.no  { color: #c0392b; font-weight: 700; }
.unit { font-size: 15px; color: var(--ink-3); text-align: center; margin-top: 6px; }

/* ---- charts ----------------------------------------------------------- */

/* Drawn here as SVG rather than shipped as pictures, for the same reasons as
   the tables. One series needs no legend, because the title names it. */
figure.chart { margin: 1.8rem 0; }
figure.chart svg { width: 100%; height: auto; display: block; }
.chart .ttl {
  text-align: center; color: var(--teal); font-size: 20px; margin: 0 0 10px;
}
.chart text { font-family: inherit; }
.chart .lbl { font-size: 15px; fill: #45545a; }
.chart .val { font-size: 15px; fill: #45545a; font-variant-numeric: tabular-nums; }
.chart .axis { stroke: #cfd6d9; stroke-width: 1; }
.chart .note { text-align: center; color: var(--ink-3); font-size: 16px; margin: 8px 0 0; }
/* Identity is never colour alone: the legend names each series beside its
   swatch, and the bars are grouped in a fixed order besides. */
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  margin: 10px 0 0; font-size: 16px; color: var(--ink-2);
}
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 13px; height: 13px; border-radius: 3px; display: block; }

/* ---- the part divider -------------------------------------------------- */

/* The deck breaks in half here, from the experiment to the build. */
.part {
  text-align: center; margin: 3.6rem 0 0; padding: 2.4rem 1rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.part b {
  display: block; color: var(--teal); font-weight: 300;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: 0.5px;
}
.part span { display: block; margin-top: 8px; color: var(--ink-2); }
.part + h2 { border-top: 0; padding-top: 0; }

/* ---- the closing quote -------------------------------------------------- */

blockquote {
  margin: 1.8rem 0; padding: 0 0 0 20px;
  border-left: 3px solid var(--teal);
  color: var(--ink); font-size: 24px; font-weight: 300; line-height: 1.4;
}
