/* Proposal: the horizon, second version. The hero is the headline and the line typed under it, the map and one sentence, on the night's ground
   (#0b1224) with all of its text in white, and it is laid out for the window it is in. There are two layouts, and the map's numbers (hero-halftone.js
   reads them as --hh-* custom properties) belong to each:
   - SIDE, in a window at least 1024px wide and at least 1.2 times as wide as it is high (a laptop, a desktop, full screen at 1080p): the headline
     and the typed line at the top left, on the page column's left edge, the map across the foot of the hero as a floor that recedes (the south,
     Italy and Greece and Iberia, near and filling the width, the north, Scandinavia, far and fading into haze), moved to the right, and the
     sentence at the foot, on the left. The map's numbers are the data-* attributes on its element in index.html.
   - STACKED, in anything narrower or taller (a tablet, a narrow window, a phone): the headline, the typed line, the map, centred and as wide as
     the window lets it be, and the sentence, in one column that is as tall as the window. The numbers are below.
   In both, the map's tilt and proportions are the same (hero-halftone.js lays it out flat of the height its width gives it, 0.8, with its far
   edge 0.8 of its near): a window of any shape shows the same map, and one without the room for it is given the same map smaller. */

/* The navigation bar over the hero, in every window. The hero starts at the top of the page, under the bar (the bar is sticky and takes no
   room), and while the hero is on (html.hdr-clear, which hero-reel.js takes off when the page is scrolled) there is no bar at all: the logo
   stands in the hero instead, larger, at its foot (.hero-logo). Scrolled, the bar comes in white and the navigation is reeled in. */
.site-header { margin-bottom: calc(-1 * var(--bar-h)); transition: opacity .35s ease, background-color .4s ease, border-color .4s ease; }
/* on the way back up to the hero the bar fades out before it is taken away (hero-reel.js) */
html.hdr-out .site-header { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
html.hdr-clear .site-header { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.nav-main { transition: opacity .25s ease .1s; }

/* The hero's logo: the navigation bar's (Tinos italic, the first three letters underlined in the colours of the pillars), larger and in white, at the foot
   of the hero, above the row of the three lines and the two links (.hero-base holds them, the logo first). The whole base is disclosed at once, once the
   line "On European soil" has been typed (hero.js puts .is-typed on the hero). None of the hero's text has a shadow of its own (a shadow on the
   letters smudges small text, and the reels' letters would carry it too): what keeps the text clear of the map is the veil over the map, below. */
.hero .hero-logo { display: block; width: max-content; margin: 0;
  font-family: 'Tinos', serif; font-weight: 700; font-style: italic; font-size: 45.4px; line-height: 1; color: var(--th-fg); text-decoration: none; }
.js-reel .hero:not(.is-typed) .hero-base { opacity: 0; transform: translateY(10px); }
.hero .hero-logo .lg { text-decoration: underline; text-underline-offset: .09em; text-decoration-thickness: .07em; }
.hero .hero-logo .lg-1 { text-decoration-color: var(--brand-1); }
.hero .hero-logo .lg-2 { text-decoration-color: var(--brand-2); }
.hero .hero-logo .lg-3 { text-decoration-color: var(--brand-3); }
.hero .hero-logo .lg-4, .hero .hero-logo .lg-5 { text-decoration-color: var(--th-fg); }
.site-header.is-reeling .nw:not(.is-done) { visibility: hidden; }
.site-header.is-reeling .nw .hw-reel, .site-header.is-reeling .nw .hw-reel * { visibility: visible; }

/* The theme's ground, and all of the hero's text in its ink, in both layouts (the night's ground and white text in the dark theme, paper and the ink in the light). */
.hero {
  --pad-top: 0px;
  --pad-foot: 0px;
  --strip-gap: 0px;
  min-height: max(560px, 100vh);
  min-height: max(560px, 100svh);
  background: var(--th-bg);
  color: var(--th-fg);
}
.hero:before { display: none; }
.hero .hero-top-row::before { display: none; }
/* the land's ink is the theme's (the engine reads --hh-ink before it reads data-ink, and again when the theme changes) */
.hero .hh { --hh-ink: var(--th-hh-ink); --hh-shade: var(--th-hh-shade); --hh-land-alpha: var(--th-hh-land); --hh-colors: var(--th-hh-colors); }
/* The camera is zoomed in 7.5% more than the zoom the limits of its view leave it (--hh-cam-extra, hero-halftone.js: a multiple of the zoom fitZoom gives, in every layout), so the map is a little closer; the limits are
   the same ones, and a closer view only has more room to move inside them. */
.hero .hh { --hh-cam-extra: 1.075; }
/* The veil over the map (its gradients are in each layout, below) is part of the map's element and comes in with it (hero-halftone.js puts
   .is-rising on the element when the land starts to rise): over the empty night it would only show the dither of its gradients, as fine lines. */
.hero .hh::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
.hero .hh.is-rising::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero .hh::after { transition: none; } }
.hero .hero-copy { position: relative; z-index: 3; max-width: none; margin: 0; text-align: left; }
.hero .hero-copy h1 { margin-bottom: 0; }
.hero .lede { margin: 0; max-width: none; text-align: left; }
.hero .hero-copy h1, .hero .hero-copy h1 strong, .hero .hero-copy h1 em { color: var(--th-fg); }
/* Three lines at the foot of the hero, to the right of the logo, in its row: plain text, the lead of each in the ink. */
.hero .hero-stats { list-style: none; margin: 0; padding: 0; color: var(--th-fg-2); font-size: 17px; line-height: 1.4; }
.hero .hero-stats b { color: var(--th-fg); font-weight: 600; }
/* and the two links at the other end of the row: "Learn more" (to the first section) and "Read the docs", plain text with a hairline under it, and the theme's switch before them (theme.js) */
.hero .hero-links { display: flex; align-items: center; gap: 28px; }
.hero .hero-link { color: var(--th-fg); font-size: 17px; font-weight: 500; line-height: 1.2; text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid rgb(var(--th-fg-rgb) / .35); transition: border-color .2s ease; }
.hero .hero-link:hover, .hero .hero-link:focus-visible { border-bottom-color: var(--th-fg); outline: none; }
.hero .hero-link span { display: inline-block; margin-left: 4px; }
.hero .hero-caret { color: var(--th-fg); }
/* The row fades out as the page is scrolled (hero-reel.js sets --hf on it, 0 to 1); once it has gone it cannot be pointed at or tabbed to. */
.hero .hero-foot { opacity: calc(1 - var(--hf, 0)); }
.hero.hf-off .hero-foot { visibility: hidden; }
/* SIDE. The hero is a block as tall as the window: the headline stands with its bottom edge on the line a third of the way down (--copy-bottom) and the
   typed line hangs under it, the map fills it behind the copy, and the logo and the three lines stand at the foot of it, the logo on the page column's
   left edge, clear of the bottom edge by 6.2% of the window's height (56 px at 900, at least 24 and at most 64). */
@media (min-width: 1024px) and (min-aspect-ratio: 6/5) {
  .hero {
    display: block;
    padding: 0;
    --copy-bottom: .3333;                    /* the share of the hero's height that the bottom edge of the headline stands at */
  }
  .hero .hero-top-row { display: block; width: 100%; flex: none; position: static; }
  .hero .hero-art { position: absolute; inset: 0; min-height: 0; margin: 0; z-index: 1; display: block; }
  .hero .hh {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 100%;
    aspect-ratio: auto;
    transform: none;
    z-index: 1;
    /* The map is zoomed in by the camera (1.4 times) and sways slowly over all that it may show, across it and up and down it (--hh-pan: the share
       of that way it goes, 1 all of it; one round across in 70 s), starting at the east end so that Crimea is in view when the map shows. The view
       never shows what is past the limits (--hh-pan-limit, in the picture's units: west, east, north, south; "land" is the mainland's own last
       dot on that side, Portugal's in the west, with one dot of room past it): at any end of the way across or of the way up and down, at most
       one dot past the mainland is seen, in any window. The headline may stand over the map: no land is kept clear of any word. */
    --hh-cam: 1.4; --hh-cam-at: .42; --hh-cam-at-x: .56; --hh-pan: 1; --hh-pan-ms: 70000; --hh-pan-limit: land,land,land,land; --hh-avoid: none;
  }
  /* The copy is a grid of two rows: the first is a third of the hero's height (--copy-bottom; the hero is at least 560 px, or the window, tall) and holds
     the headline at its foot, so that the headline's bottom edge stands on that line; the typed line is the second row, under it. A headline taller than
     the row (a window very low for its width) makes the row as tall as itself. */
  .hero .hero-copy { display: grid; grid-template-rows: minmax(calc(max(560px, 100svh) * var(--copy-bottom)), auto) auto; padding: 0 var(--padding); }
  .hero .hero-copy > h1 { align-self: end; }
  .hero .hero-copy h1 { font-size: clamp(36px, 4.8vw, 76px); }
  /* the typed line: its letters looser than the headline's (-0.04em, not -0.07em) and set off from it by more room (0.9em above it) */
  .hero .hero-copy h1 em { font-size: clamp(23px, 2.5vw, 40px); padding-top: .9em; letter-spacing: -0.04em; word-spacing: .06em; }
  /* The base: at the foot of the hero between the page column's edges, the logo and under it one row, the three lines at its left (a hairline between
     them) and the two links pinned to its right. */
  .hero .hero-base { position: absolute; z-index: 3; left: var(--padding); right: var(--padding); bottom: clamp(24px, 6.2vh, 64px);
    display: flex; flex-direction: column; align-items: flex-start; gap: clamp(12px, 2vh, 20px); }
  .hero .hero-foot { width: 100%; min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 40px; }
  .hero .hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
  .hero .hero-links { margin-left: auto; }       /* (pinned right even when a narrow window wraps it under the lines) */
  .hero .hero-stats li + li { margin-left: 32px; padding-left: 32px; border-left: 1px solid rgb(var(--th-fg-rgb) / .18); }
  /* A veil in the ground's colour over the map, under the text (the map's ::after), so that the words read where the map passes beneath them: it
     runs the whole width of the hero, so that no edge of it shows anywhere, thickest at the very top and at the very foot and falling off smoothly
     (in many steps, so that no band shows) to nothing. */
  .hero .hh::after {
    background:
      linear-gradient(to bottom, rgb(var(--th-bg-rgb) / .52) 0, rgb(var(--th-bg-rgb) / .49) 8%, rgb(var(--th-bg-rgb) / .42) 16%, rgb(var(--th-bg-rgb) / .33) 25%, rgb(var(--th-bg-rgb) / .23) 34%,
        rgb(var(--th-bg-rgb) / .14) 43%, rgb(var(--th-bg-rgb) / .06) 50%, rgb(var(--th-bg-rgb) / .02) 56%, rgb(var(--th-bg-rgb) / 0) 62%),
      linear-gradient(to top, rgb(var(--th-bg-rgb) / .64) 0, rgb(var(--th-bg-rgb) / .6) 7%, rgb(var(--th-bg-rgb) / .5) 14%, rgb(var(--th-bg-rgb) / .38) 21%, rgb(var(--th-bg-rgb) / .26) 28%,
        rgb(var(--th-bg-rgb) / .15) 35%, rgb(var(--th-bg-rgb) / .07) 42%, rgb(var(--th-bg-rgb) / .02) 48%, rgb(var(--th-bg-rgb) / 0) 54%); }
  /* On the night the map is dimmed a little, to 0.87 of its brightness, so that it sits just under the words (the stacked layout dims it more, below); on paper it is not dimmed
     (--th-hh-dim-side, base.css). */
  .hero .hh-canvas { filter: var(--th-hh-dim-side); }
}

/* STACKED. The hero is a column as tall as the window (or as its content, if that is taller): the headline and the typed line at the top, the
   sentence at the foot, and the map behind them, over the whole of the hero. The map is zoomed in by a camera (--hh-cam: 1.8 on a tablet; on a
   phone the zoom is the one that puts the middle of Italy, between Florence and Rome, at the foot of the screen: --hh-cam-edge) that begins on the Netherlands,
   Germany and Belgium, with the first square, which comes down in Groningen, in the exact middle of the screen (--hh-cam-at .5), and then follows one shot of the
   show at a time, slowly, at the same zoom to the end (hero-halftone.js: it stays on the last shot, it does not zoom out). The map is dimmed
   (its canvas at 0.7 of its brightness). Over the map, under the text, a veil in the night's colour (the map's ::after) is thickest behind
   the headline and behind the sentence and clear in the middle, so that the words read and the map shows. */
@media (max-width: 1023px), (max-aspect-ratio: 119/100) {
  .hero {
    --hpad: var(--padding);
    display: flex;
    flex-direction: column;
    padding: calc(var(--bar-h) + clamp(20px, 5vh, 56px)) 0 0;
  }
  .hero .hh::after {
    background:
      linear-gradient(to bottom, rgb(var(--th-bg-rgb) / .6) 0, rgb(var(--th-bg-rgb) / .4) 26%, rgb(var(--th-bg-rgb) / 0) 48%),
      linear-gradient(to top, rgb(var(--th-bg-rgb) / .65) 0, rgb(var(--th-bg-rgb) / .4) 14%, rgb(var(--th-bg-rgb) / 0) 30%); }
  .hero .hero-top-row { display: flex; flex-direction: column; align-items: stretch; flex: 1 1 auto; width: 100%; position: static; }
  .hero .hero-copy { display: block; padding: 0 var(--hpad); }
  .hero .hero-copy h1 { font-size: clamp(34px, 7.5vw, 64px); }
  .hero .hero-copy h1 em { font-size: clamp(20px, 3.9vw, 32px); padding-top: .8em; letter-spacing: -0.04em; word-spacing: .06em; }
  .hero .hero-art { position: absolute; inset: 0; order: 0; min-height: 0; margin: 0; z-index: 1; display: block; }
  .hero .hh {
    --hh-near: 1.1; --hh-far: .8; --hh-top: 0; --hh-bottom: .68; --hh-haze: .4; --hh-shift: 0; --hh-pin: none; --hh-avoid: none; --hh-flat: .8;
    --hh-cam: 1.8; --hh-cam-at: .54;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    aspect-ratio: auto;
    transform: none;
    z-index: 1;
  }
  .hero .hero-base { position: relative; z-index: 3; order: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 8px var(--hpad) clamp(24px, 4.5vh, 48px); }
  .hero .hero-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero .hero-stats { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
  .hero .hero-link { font-size: 15px; }
  .hero .hero-logo { font-size: clamp(44px, 9vw, 72px); }
  /* On the night the map is dimmed, to 0.7 of its brightness (as a black overlay of 0.3 over it would, but over the squares alone and not over the night's
     ground), so that the words are what the hero is and the map is behind them; on paper it is not (--th-hh-dim-stacked, base.css). */
  .hero .hh-canvas { filter: var(--th-hh-dim-stacked); }
}
@media (max-width: 580px) {
  .hero { --hpad: 5vw; }
  .hero .hero-logo { font-size: 46px; }
  .hero .hh { --hh-cam: 8; --hh-cam-at: .5; --hh-cam-edge: 473.3,495; }
}

/* The headline reeled in (hero-reel.js). The hero starts blank: while the reel plays, the words are hidden and each is drawn as a word of
   reels, a column to a letter, every column a strip of the alphabet rolling up from a blank; a word that has landed is shown as text, and
   when the last has, the typed line and the sentence fade in. Without script (js-reel is not set) and in the reduced-motion case none of
   this applies. */
.hw { position: relative; display: inline-block; }
/* The line under "sovereign." is drawn four times from left to right, as if it were being underlined, once the word has landed, each time on top of
   the one before: Atomic's orange, Backbone's purple, Canvas's green, and last the white that stays, which covers them (and is simply all there is
   without the reel). Each takes .55 s and starts when the one before it is half drawn, .275 s on, so the four overlap and are done 1.4 s after a wait
   of .15 s. A layer's width is a share of the line, a registered number (--u1, orange, to --u4, the white) that an animation of its own runs from 0 to 1:
   one animation to a layer, because a single animation of the background's sizes cannot give each layer a start of its own. The first of the layers
   listed is the one on top, so the widths run white, green, purple, orange. The white that stays is the hero's secondary white (white at 74% over the
   night, #c0c1c6) as a solid colour and not #fff: the descender of the "g" crosses the line, and a line as white as the letter fused with it. It is solid,
   not translucent, so that it covers the three under it. The hero's reel marks the last word done in the same frame as the whole headline (hr-done), so
   the sequence hangs on the word's own is-done and not on hr-done. */
@property --u1 { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --u2 { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --u3 { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --u4 { syntax: '<number>'; inherits: false; initial-value: 1; }
/* how much of the border of a box of the first section is drawn, 0 to 4, an edge to a unit (sections/what.css); and the layers above, --u1 to --u4, are the underline of its name */
@property --edge-drawn { syntax: '<number>'; inherits: false; initial-value: 0; }
.hero h1 strong.hw { text-decoration: none; isolation: isolate; }
.hero h1 strong.hw::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: .02em; height: .06em;
  background: linear-gradient(var(--th-fg-2-solid), var(--th-fg-2-solid)), linear-gradient(var(--brand-3), var(--brand-3)), linear-gradient(var(--brand-2), var(--brand-2)), linear-gradient(var(--brand-1), var(--brand-1));
  background-repeat: no-repeat; background-position: 0 0;
  background-size: calc(var(--u4) * 100%) 100%, calc(var(--u3) * 100%) 100%, calc(var(--u2) * 100%) 100%, calc(var(--u1) * 100%) 100%; }
.js-reel .hero:not(.hr-done) h1 strong.hw:not(.is-done)::after { --u1: 0; --u2: 0; --u3: 0; --u4: 0; }
.hero h1 strong.hw.is-done::after { animation: underline-1 .55s cubic-bezier(.3, .7, .2, 1) .15s both, underline-2 .55s cubic-bezier(.3, .7, .2, 1) .425s both,
  underline-3 .55s cubic-bezier(.3, .7, .2, 1) .7s both, underline-4 .55s cubic-bezier(.3, .7, .2, 1) .975s both; }
@keyframes underline-1 { from { --u1: 0; } to { --u1: 1; } }
@keyframes underline-2 { from { --u2: 0; } to { --u2: 1; } }
@keyframes underline-3 { from { --u3: 0; } to { --u3: 1; } }
@keyframes underline-4 { from { --u4: 0; } to { --u4: 1; } }
@media (prefers-reduced-motion: reduce) { .hero h1 strong.hw.is-done::after { animation: none; } }
.js-reel .hero:not(.hr-done) .hw:not(.is-done) { visibility: hidden; }
.js-reel .hero:not(.hr-done) .hw-reel, .js-reel .hero:not(.hr-done) .hw-reel * { visibility: visible; }
.hw.is-done .hw-reel { display: none; }
.hw-reel { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
/* A column is one letter wide (the width the letter has in the headline, which its negative letter spacing makes narrower than the letter's ink),
   and clips only above and below: the letters of the strip start at its left edge, as the letter does in the text, and are not cut at the sides. */
.hw-col { position: absolute; box-sizing: content-box; top: calc((var(--lh, 0.92em) - 1.3em) / 2); height: 1.3em; padding: 0 .25em; margin-left: -.25em; overflow: hidden;
  -webkit-mask: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%) no-repeat 0 0 / 100% 100%;
  mask: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%) no-repeat 0 0 / 100% 100%; }
.hw-strip { display: block; transform: translateY(calc(var(--pos, 0) * -1.3em)); will-change: transform; }
.hw-strip i { display: block; height: 1.3em; line-height: 1.3em; font-style: normal; text-align: left; white-space: pre; letter-spacing: inherit; }
.hero .lede, .hero .hero-base { transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .3, 1); }
.js-reel .hero:not(.hr-done) .lede { opacity: 0; transform: translateY(10px); }
@media (prefers-reduced-motion: reduce) {
  .hero .lede, .hero .hero-base { transition: none; }
}

/* THE HERO HANGS OVER THE FIRST SECTION. Where the page scrolls (no stage: html.stg is the slideshow's), the map's canvas goes on below the hero's foot, over the top of the first section, and a veil in
   the ground's colour over it thickens to the ground itself at its lower edge, so the dots thin out into the page and do not stop at a line. The section (the first, #what) has no ground of its own
   (its script's css takes the section's off) and stands over the map. --hang is how far the canvas goes on. */
html:not(.stg) .hero { --hang: clamp(160px, 26vh, 280px); overflow-x: clip; overflow-y: visible; }
html:not(.stg) .hero .hero-art { bottom: calc(-1 * var(--hang)); }
/* The veil, from the lower edge of the canvas up: the ground itself at the edge, easing to the thickness the hero's own foot has always had (.64, where the strip of reasons stands), and from there up
   as it was (it falls off to nothing over 54% of the hero's height). The heading of the first section stands in the hang, under .8 and over. */
html:not(.stg) .hero .hh::after {
  background:
    linear-gradient(to top, rgb(var(--th-bg-rgb) / 1) 0, rgb(var(--th-bg-rgb) / .96) calc(var(--hang) * .15), rgb(var(--th-bg-rgb) / .9) calc(var(--hang) * .3), rgb(var(--th-bg-rgb) / .83) calc(var(--hang) * .45),
      rgb(var(--th-bg-rgb) / .76) calc(var(--hang) * .6), rgb(var(--th-bg-rgb) / .7) calc(var(--hang) * .75), rgb(var(--th-bg-rgb) / .64) var(--hang),
      rgb(var(--th-bg-rgb) / .6) calc(var(--hang) + 7vh), rgb(var(--th-bg-rgb) / .5) calc(var(--hang) + 14vh), rgb(var(--th-bg-rgb) / .38) calc(var(--hang) + 21vh), rgb(var(--th-bg-rgb) / .26) calc(var(--hang) + 28vh),
      rgb(var(--th-bg-rgb) / .15) calc(var(--hang) + 35vh), rgb(var(--th-bg-rgb) / .07) calc(var(--hang) + 42vh), rgb(var(--th-bg-rgb) / .02) calc(var(--hang) + 48vh), rgb(var(--th-bg-rgb) / 0) calc(var(--hang) + 54vh)),
    linear-gradient(to bottom, rgb(var(--th-bg-rgb) / .52) 0, rgb(var(--th-bg-rgb) / .42) 16%, rgb(var(--th-bg-rgb) / .23) 34%, rgb(var(--th-bg-rgb) / .06) 50%, rgb(var(--th-bg-rgb) / 0) 62%); }
html:not(.stg) #what { z-index: 2; background: transparent; margin-top: var(--drop, 0px); }   /* (--drop: centre.js moves the section down so that it is in the middle of the window when the bar picks up the wordmark) */
