/* Styles for the intro (js/intro.js): the opening screen and the lyric-video
   texts that play over the page before the tree. Ported from the approved
   prototype (notes/intro-demo-reference.js), with its sizes kept exactly.

   The intro is drawn like a printed page, so its colours are written out
   here (the light palette: paper #fbfbfa, ink #111, spot blue #1747b5,
   marker red #e0241b) rather than taken from the tokens in style.css.
   The house colours on the example cards (text 6) do use the tokens. Everything is inside #intro, so none of these
   class names can clash with the site's. */

/* While the intro is on (a class set by the small script in index.html's
   <head>, before anything is drawn), the page underneath is hidden, so the
   tree doesn't flash up first. It is still laid out: the logo's landing
   spot is measured from the masthead. */
.intro-on .masthead,
.intro-on .stage { visibility: hidden; }
/* While the intro's logo glides into the masthead, the masthead's own logo
   waits, hidden, under where it will land */
.intro-landing .masthead .logo { visibility: hidden; }

/* The overlay: covers the whole window */
#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  font-family: "Source Serif 4", Georgia, serif;
  color: #111;
}

/* The paper behind everything: newsprint with faint column rules exactly
   where the page's own gutter rules will be on the James screen: the same
   spacing (a column, 300 tree pixels, times the page's zoom: about 195px on
   a phone) and the same place. js/intro.js (placeColumns) reads them from
   the page as soon as it has been laid out (and again on any resize) and
   draws them as an SVG path, like the page's: 1px, ink at 14%. Until then
   no rules show. A separate layer, so it can fade on its own at the end
   while the logo flies to the masthead. */
#intro .intro-paper {
  position: absolute;
  inset: 0;
  background-color: #fbfbfa;
}
#intro .intro-paper svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#intro .intro-paper path { fill: none; stroke: #111; stroke-opacity: .14; stroke-width: 1; }

/* The big logo. The bottom padding keeps the tail of the "g" in
   "Eighty-Eight" inside the black box. */
#intro .intro-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  background: #111;
  color: #fff;
  line-height: .86;
  font-family: "Roboto Serif Poster", "Roboto Serif", Georgia, serif;   /* (its own file: see FONTS in style.css) */
  font-weight: 900;
  font-variation-settings: "wdth" 70, "opsz" 144;
  padding: 22px 40px 30px;
  transform-origin: 50% 0;
}
#intro .intro-logo .a { display: block; font-size: clamp(80px, 14vw, 180px); }
#intro .intro-logo .b { display: block; font-size: clamp(36px, 6.4vw, 82px); margin-top: .2em; white-space: nowrap; }
/* Phones: a smaller logo with clear space either side (about 333px wide,
   28px each side, at 390px; never under about 20px a side on narrower
   phones), and more room between the lines, so the "g" clears the second */
@media (max-width: 600px) {
  #intro .intro-logo { padding: 18px 26px 24px; }
  #intro .intro-logo .a { font-size: min(68px, 17.4vw); }
  #intro .intro-logo .b { font-size: min(30px, 7.7vw); margin-top: .5em; }
}

/* Under the logo on the opening screen: the Oxford rule, the subheader and
   the "Get the Scoop" button */
#intro .under {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
  padding: 0 16px;
}
#intro .rule { width: min(640px, 80vw); border-top: 4px solid #111; box-shadow: 0 3px 0 #fbfbfa, 0 4px 0 #111; }
#intro h1 {
  margin: 0;
  font-family: "Roboto Serif", Georgia, serif;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 70, "opsz" 72;
  font-size: clamp(22px, 3vw, 38px);
  text-wrap: balance;
}
#intro .cta {
  font-family: "Roboto Serif", Georgia, serif;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 70, "opsz" 72;
  font-size: 26px;
  background: #1747b5;
  color: #fff;
  border: 2px solid #111;
  box-shadow: 6px 6px 0 #111;
  padding: 12px 34px 14px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
#intro .cta:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #111; }
#intro .cta:focus-visible, #intro .skip:focus-visible { outline: 2px solid #1747b5; outline-offset: 3px; }

/* Where the texts play: below the shrunk logo, above the Skip link */
#intro .intro-stage {
  position: absolute;
  left: 50%;
  top: 150px;
  bottom: 56px;
  transform: translateX(-50%);
  width: min(920px, 92vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}
#intro .txt { font-size: clamp(22px, 4.6vw, 36px); line-height: 1.25; margin: 0; text-wrap: balance; position: relative; z-index: 1; }

/* One word (or an emphasized phrase), hidden until its turn */
#intro .w { display: inline-block; position: relative; margin: 0 .13em; opacity: 0; }
/* "kings and queens.": kept on one line, so the crowns can meet */
#intro .grp { display: inline-block; white-space: nowrap; }
/* Emphasized words: the headline font (Header 1), a size up */
#intro .em {
  font-family: "Roboto Serif", Georgia, serif;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 70, "opsz" 72;
  font-size: 1.3em;
}

/* An illustration, hung below its word (or above it, for the lectern) */
#intro .ill { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 10px); line-height: 0; opacity: 0; z-index: -1; }
#intro .ill.above { top: auto; bottom: 100%; transform: translate(-50%, -8px); }
#intro .crown { transform-origin: 50% 90%; }
#intro .ill.eu { transform: translate(-50%, 2px); }
#intro .ill.crw { transform: translate(-50%, 24px); }
#intro .sh { opacity: 0; }                                     /* the shout marks */
#intro .draw path { stroke-dasharray: 1; stroke-dashoffset: 1; }  /* drawings that draw themselves */
#intro .spk { position: absolute; opacity: 0; line-height: 0; z-index: 0; }   /* the crowns' spark */

/* The red marker underline */
#intro .mk { position: absolute; left: -4%; width: 108%; height: 14px; bottom: -8px; }
#intro .mk path { stroke-dasharray: 1; stroke-dashoffset: 1; }

/* "Skip intro", bottom right, throughout */
#intro .skip {
  position: absolute;
  right: 24px;
  bottom: 20px;
  font: 700 12px/1 "Source Serif 4", serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5b6068;
  background: none;
  border: 0;
  border-bottom: 1px solid #c9ccd1;
  cursor: pointer;
  padding: 6px 0;          /* (24px tall in all: the smallest target WCAG 2.2 allows) */
  min-height: 24px;
  z-index: 3;
}

/* Text 6. Desktop: one page, the lines on the left and an example card
   beside each of lines 2-4. Each sentence stays on one line: the text
   column is as wide as the screen allows (the page may be wider than the
   other texts' stage), and js/intro.js (fitPage) makes the text a little
   smaller if one still doesn't fit. Phones: one line at a time, the card
   below. */
/* Text 6 on desktop: the first line on top, centred, then a grid of the
   other lines and their examples: the cards in one column,
   24px after the longest of those lines, each beside its own line and
   centred in the column. The
   block is only as wide as its contents, and centred as a whole. */
#intro .pg {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 94vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  row-gap: 22px;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.25;
}
#intro .pg .pl { margin: 0; white-space: nowrap; min-width: 0; max-width: 100%; }
#intro .pg .pl.first { text-align: center; margin-bottom: 10px; }
#intro .pg-rows {
  display: grid;
  grid-template-columns: minmax(0, max-content) max-content;
  column-gap: 24px;
  row-gap: 22px;
  align-items: center;
  max-width: 100%;
  text-align: left;
}
#intro .pg-rows .pex { justify-content: center; }   /* (each card centred in the shared column: they're different widths) */
#intro .pgm { display: flex; flex-direction: column; align-items: center; gap: 22px; font-size: clamp(22px, 5vw, 30px); line-height: 1.25; }
#intro .pgm .pl { margin: 0; text-wrap: balance; }
#intro .pex { display: flex; justify-content: center; }

/* The example cards: small copies of the tree's three card tiers */
#intro .ex { visibility: hidden; background: #fff; font-family: "Roboto Serif", Georgia, serif; text-align: center; }
#intro .ex1 { width: 150px; border: 4px solid #111; padding: 3px; }      /* Tier 1: Lead Story */
#intro .ex1 img { display: block; width: 100%; aspect-ratio: 1; }
#intro .ex1 .hl { font-size: 16px; }
#intro .ex2 { width: 150px; border: 2px solid #111; padding: 3px 3px 0; } /* Tier 2: Column */
#intro .ex2 .hl { font-size: 13px; }
#intro .ex3 {                                                              /* Tier 3: Sidebar */
  width: 120px;
  border: 1px solid #8a9099;
  color: #fff;
  font-weight: 700;
  font-variation-settings: "wdth" 75, "opsz" 36;
  font-size: 11px;
  padding: 7px 6px;
}
#intro .ex .nb { color: #fff; font-weight: 700; font-variation-settings: "wdth" 75, "opsz" 36; font-size: 11px; padding: 4px 5px; }
#intro .ex .hl { font-weight: 900; font-style: italic; font-variation-settings: "wdth" 70, "opsz" 72; line-height: 1.02; padding: 6px 6px 8px; }
/* The Scandal Sheet example: a small copy of the masthead's burst (off:
   hot pink, the heart, "Scandal / Sheet"), tilted the same -9deg. The
   tilt is on the inner box, since popCard animates the outer one. */
#intro .exs { background: none; width: 108px; height: 108px; }
#intro .exs-tilt {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  transform: rotate(-9deg);
}
#intro .exs-burst {
  position: absolute;
  inset: 0;
  background: #ff2d87;
  clip-path: polygon(50.0% 0.0%, 58.2% 13.9%, 71.7% 5.0%, 73.1% 21.1%, 89.1% 18.8%, 83.3% 33.9%, 98.7% 38.9%, 87.0% 50.0%, 98.7% 61.1%, 83.3% 66.1%, 89.1% 81.2%, 73.1% 78.9%, 71.7% 95.0%, 58.2% 86.1%, 50.0% 100.0%, 41.8% 86.1%, 28.3% 95.0%, 26.9% 78.9%, 10.9% 81.2%, 16.7% 66.1%, 1.3% 61.1%, 13.0% 50.0%, 1.3% 38.9%, 16.7% 33.9%, 10.9% 18.8%, 26.9% 21.1%, 28.3% 5.0%, 41.8% 13.9%);
}
#intro .exs svg { position: relative; display: block; height: 14px; width: auto; fill: #fff; margin-bottom: 1px; }
#intro .exs-text {
  position: relative;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 70, "opsz" 72;
  font-size: 19px;
  line-height: 0.95;
}
