/* ==========================================================================
   ANTIHORIZN About page: story layer.
   Loaded after site.css and launch.css on about.html only. The page is one
   story in eight chapters, and nearly all of it is set with what the system
   already has (.display, .subhead, .headline, .lede, .label, .statement,
   .blocks, .night, .film). This file adds only what that system has no word
   for, and it names no typeface: every size here is a row of the scale at
   the top of section 3 in site.css.
   Sections:
     S1  Chapters (the numbered label, the reading column)
     S2  Opening (the title page)
     S3  Statement and chart
     S4  Four answers
     S5  Film
     S6  Beta, deal and contact
     S7  Responsive and reduced motion
   ========================================================================== */

/* --- S1. Chapters --------------------------------------------------------- */

/* A chapter that follows another on the same ground drops its top padding,
   so the gap between the two is one measure and not two. Its anchor keeps
   that measure, so every chapter lands the same distance under the bar. */
.chapter--flush { padding-top: 0; scroll-margin-top: var(--stack); }

/* The chapter number: ink on a hot colour tab, the same on white and on night. */
.label.chapter__n {
  padding: 4px 6px;
  background: var(--hot);
  color: var(--on-hot);
  font-variant-numeric: tabular-nums;
}
/* A second, quieter note at the far end of a chapter's rule. */
.sec-head__end { margin-left: auto; text-align: right; }

/* The reading column. Every chapter is the same three things on the same
   axis: a label in the margin, a section headline, then text set a step
   above body size at one measure with open leading. */
.chapter__title { max-width: 21ch; }
.chapter__text {
  max-width: 60ch;
  font-size: clamp(19px, 1.36vw, 20px);
  line-height: 1.6;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: pretty;
}
.chapter__title + .chapter__text,
.chapter__title + .chapter__quote { margin-top: clamp(28px, 4.4vh, 52px); }
.chapter__text p + p { margin-top: 1em; }
.chapter__text b { font-weight: 600; }
.night .chapter__text { color: var(--on-dark); }

/* The company statement: a paragraph at sub-headline size. It takes the
   size from .subhead and gives back the weight and leading that seventy
   words need. */
.chapter__quote {
  max-width: 40ch;
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.018em;
  text-wrap: pretty;
}

/* One sentence set apart under its own hairline. The box takes the reading
   size so that its 60ch is the column's 60ch; the sentence inside is body. */
.chapter__note {
  max-width: 60ch;
  margin-top: clamp(36px, 5.6vh, 64px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: clamp(19px, 1.36vw, 20px);
}
.chapter__note p {
  max-width: 52ch;
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--ink-soft);
}
.chapter__note .arrow-link { margin-top: 22px; }

/* --- S2. Opening ---------------------------------------------------------- */
/* A title page. The running head sits under the bar, the title and the
   contents sit on the floor of the first screen, and nothing is between. */

.opening {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.opening__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-top: clamp(96px, 13vh, 128px);
  padding-bottom: clamp(28px, 4.4vh, 52px);
}
.opening .sec-head { margin-bottom: 0; }

/* The hero row of the scale, the same expression as the landing page's
   headline: 100px at 1440 by 900, two lines. */
.opening__title {
  margin-top: auto;
  padding-top: 56px;
  font-weight: 700;
  font-size: clamp(44px, min(7vw, 11.2vh), 112px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--grey);
}
.opening__title em { color: var(--hot); white-space: nowrap; }

.opening__foot {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 2.4vw, 40px);
  margin-top: clamp(30px, 5vh, 60px);
  padding-top: 24px;
  border-top: 1px solid var(--line-night-2);
}
.opening__lede { grid-column: span 5; }

/* Contents: seven rows in two columns, read down then across. */
.toc { grid-column: 7 / -1; }
.toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  column-gap: clamp(20px, 2.4vw, 40px);
}
.toc a {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: baseline;
  padding: 11px 0 10px;
  border-bottom: 1px solid var(--line-night);
  line-height: 1.3;
  color: var(--on-dark);
  transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.toc li:first-child a,
.toc li:nth-child(5) a { padding-top: 0; }
/* The row number is a label: same size, weight and tracking. */
.toc a span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.toc a:focus-visible { color: var(--hot); }
@media (hover: hover) and (pointer: fine) {
  .toc a:hover { color: var(--hot); border-bottom-color: var(--hot); }
}

/* Entrance: one staggered pass on load. The keyframes are the hero's, from
   launch.css, so the two dark openings arrive the same way. */
.opening [data-in] {
  opacity: 0;
  animation: lheroIn 760ms var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 160ms);
}

/* --- S3. Statement and chart ---------------------------------------------- */
/* The statement is an ordinary chapter. The chart then takes a screen of its
   own: the stage pins under the bar and the track scrubs the drawing, so the
   plot is as large as the window allows and its type can be read. */

/* The pinned stage centres the figure in the window and so brings its own
   room above and below; the chapter's bottom padding would only double it. */
.chapter--chart { padding-bottom: 0; }
.chartscroll__track { height: 280vh; }
.chartscroll__stage {
  align-items: center;
  padding-block: calc(var(--nav-h) + 20px) 24px;
}
.chartscroll__stage > .wrap { width: 100%; }
.chartscroll .sec-head { margin-bottom: clamp(14px, 2.2vh, 26px); }

/* The plot on the left, its key and sources in a column on the right. The
   chart takes the site's palette: ink for what was counted longest, grey for
   the second series, the hot colour with an ink edge for hardware. */
.sc {
  --c-web:    var(--ink);
  --c-git:    var(--ink-faint);
  --c-hw:     var(--hot);
  --c-hw-ink: var(--ink);
  --c-grid:   var(--rule-soft);
  --c-band:   #EFEFF1;                                           /* the line below, for a browser without color-mix */
  --c-band:   color-mix(in srgb, var(--hot) 13%, var(--paper));
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(216px, 18vw, 272px);
  grid-template-rows: auto 1fr;
  column-gap: clamp(24px, 3vw, 52px);
  align-items: start;
}
/* On a short window the plot gives up height before the stage outgrows it.
   The drawing ends 45 of its 1000 units above the bottom of its box (the row
   dropped below), so the box is pulled up by that much. */
.sc .sc__plot {
  grid-row: 1 / span 2;
  max-height: calc(100svh - var(--nav-h) - 124px);
  margin-bottom: -4.5%;
}

/* The empty axes are there before the first line is drawn, so the figure
   arrives as a chart waiting for data and not as a gap beside a key. */
.sc .sc__plot > g.sc-fade:first-of-type { opacity: 1; }

/* The line of dates that site.js sets under the axis is given in the
   caption instead, where it can wrap, and dropped from the drawing. */
.sc .sc__plot > g:last-of-type { display: none; }

/* A rule beats the fill and stroke attributes the script writes. */
.sc .sc-web { stroke-width: 2; }
.sc .sc-val { fill: var(--ink); }
.sc .sc-hwray { stroke: var(--ink); stroke-width: 1.5; }
.sc .sc-hwband { fill: var(--hot); opacity: 1; }
/* The band nobody published in is an opaque tint, not a wash: it is drawn
   over the grid and the era markers, so nothing runs behind the words and
   the figure set inside it. */
.sc .sc-corridor {
  fill: var(--c-band);
  stroke: rgba(11, 11, 12, 0.42);
  stroke-width: 1;
  stroke-dasharray: 5 5;
}
/* The one measured point: a hot colour disc with an ink edge and an ink centre. */
.sc .sc-pop circle:first-child {
  fill: var(--hot);
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 1;
}
.sc .sc-pop circle:last-child { fill: var(--ink); r: 4.5px; }

/* The two-line note in the corridor is built at the band's left edge, where
   the websites line climbs through it. It is moved to the right of that
   crossing and set as one sentence over two lines. */
.sc .sc-note,
.sc .sc-note--hw {
  font-size: 14px;
  letter-spacing: 0;
  transform: translate(196px, -7px);
}
.sc .sc-note { font-weight: 600; fill: var(--ink); }
.sc .sc-note--hw { font-weight: 400; fill: var(--ink-soft); }

/* The key: one row per mark, ruled, in small text. */
.sc .sc-legend {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  margin-top: clamp(20px, 2.4vw, 36px);   /* level with the era names over the plot */
  border-bottom: 1px solid var(--rule);
}
.sc .sc-legend span {
  text-wrap: balance;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}
.sc .sc-legend span:first-child { padding-top: 0; border-top: 0; }
.sc .sc-legend i { flex: none; width: 20px; margin-top: 9px; }
.sc .sc-legend .k-web i { border-top-color: var(--c-web); }
.sc .sc-legend .k-git i { border-top-color: var(--c-git); }
.sc .sc-legend .k-hw i {
  width: 12px;
  height: 12px;
  margin: 4px 4px 0;
  border: 1.5px solid var(--ink);
  background: var(--hot);
}
.sc .sc-legend .k-cor i {
  height: 12px;
  margin-top: 4px;
  border: 1px dashed rgba(11, 11, 12, 0.5);
  background: var(--c-band);
}
.sc .sc-legend .k-prj i {
  width: 20px;
  height: 12px;
  margin-top: 4px;
  border: 1.5px solid var(--ink);
  background: var(--hot);
}
.sc .sc__cap { margin-top: 16px; }
.sc .sc__cap p + p { margin-top: 8px; }

/* Where the chart is not pinned (S7) it plays once when it comes into view.
   --p is a registered number, so it can be animated like any other. */
@keyframes scPlay { from { --p: 0; } to { --p: 1; } }

/* --- S4. Four answers ------------------------------------------------------ */
/* The grid sits on the gutter like everything else and is closed on all four
   sides, two answers to a row. */

.blocks--framed { border: 1px solid var(--rule); }
.blocks--framed .block { padding: clamp(28px, 3vw, 44px); }
.blocks--framed .block p { max-width: 50ch; }

/* --- S5. Film -------------------------------------------------------------- */
/* On the landing page the film is a backdrop with a line over it. Here it is
   the subject, so it runs uncropped at its own 16:9 with the credit directly
   beneath and the words after. */

.film--story { padding-block: var(--stack); }
.film--story .film__media {
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 88svh;
}
.film__by {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 28px;
  padding-top: 16px;
}
.film__by .label { line-height: 1.5; }
.film__by .film__name { color: var(--on-dark); }
.film__by .film__not { margin-left: auto; }

.film--story .statement { margin-top: clamp(56px, 9vh, 112px); }

/* Where we stand: four questions answered as the rows of a spec sheet, the
   question in ink on the left and the answer beside it. Hairlines, no boxes. */
.answers {
  max-width: 940px;
  margin: clamp(36px, 6vh, 64px) 0 0;
  border-top: 1px solid var(--rule);
}
.answers > div {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: 8px clamp(24px, 3vw, 52px);
  align-items: baseline;
  padding-block: clamp(22px, 3.2vh, 30px);
  border-bottom: 1px solid var(--rule);
}
.answers dd { margin: 0; max-width: 54ch; color: var(--ink-soft); }
@media (max-width: 760px) {
  .answers > div { grid-template-columns: 1fr; }
}

/* --- S6. Beta, deal and contact -------------------------------------------- */

/* What the beta settled, as a quiet list: two columns, a hairline over each
   entry, no boxes and no numbers. */
.points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vh, 48px) clamp(24px, 3vw, 52px);
  max-width: 940px;
  margin-top: clamp(48px, 8vh, 88px);
}
.points li {
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.points p {
  max-width: 44ch;
  margin-top: 10px;
  color: var(--ink-soft);
}

.deal__cta { margin-top: clamp(28px, 4vh, 40px); }

.contact {
  margin-top: var(--stack);
  padding-top: clamp(28px, 4vh, 44px);
  border-top: 1px solid var(--rule);
}
.contact__title { max-width: 18ch; text-wrap: balance; }
.contact__lede {
  max-width: 52ch;
  margin-top: 16px;
  color: var(--ink-soft);
}
.contact__rows {
  max-width: 720px;
  margin-top: clamp(32px, 5vh, 52px);
  border-top: 1px solid var(--rule);
}
.contact__rows > p {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.contact__rows a {
  justify-self: start;
  overflow-wrap: anywhere;
  transition: background-color 180ms var(--ease-out);
}
.contact__rows a:focus-visible { background-color: var(--hot); color: var(--on-hot); }
@media (hover: hover) and (pointer: fine) {
  .contact__rows a:hover { background-color: var(--hot); color: var(--on-hot); }
}
.contact__else { display: flex; flex-wrap: wrap; gap: 6px 24px; }

/* --- S7. Responsive and reduced motion ------------------------------------- */

/* Tablet: the key moves under the plot and runs across. */
@media (max-width: 1080px) {
  .sc { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .sc .sc__plot {
    grid-row: auto;
    max-height: calc(100svh - var(--nav-h) - 300px);
    margin-bottom: 0;
  }
  .sc .sc-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 28px;
    margin-top: 0;
    border-bottom: 0;
  }
  .sc .sc-legend span,
  .sc .sc-legend span:first-child {
    flex: 1 1 260px;
    padding: 11px 0;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 900px) {
  .opening__title em { white-space: normal; }
  .opening__foot { grid-template-columns: 1fr; gap: 28px; }
  .opening__lede, .toc { grid-column: 1 / -1; }
  .sec-head__end { display: none; }
  .film__by .film__not { margin-left: 0; }
}

/* Phone. The chart is not pinned: it sits in the page like any figure and
   draws itself once when it scrolls into view (site.js marks a revealed
   element with .is-in). One chart unit is a third of a pixel here, so type
   drawn at 12 units cannot be read. The numbers that carry the argument are
   set larger; the annotations that cannot be made legible at this width are
   dropped, and the key and the caption say the same thing. These selectors
   follow the order site.js builds the chart in. */
@media (max-width: 760px) {
  .chapter__text, .chapter__note { font-size: 18px; }
  .chapter__note p { font-size: 16px; }

  .chartscroll__track { height: auto; }
  .chartscroll__stage {
    position: static;
    display: block;
    min-height: 0;
    padding-block: clamp(32px, 6vh, 56px) var(--stack);
  }
  .chartscroll .sec-head { margin-bottom: 20px; }
  .sc .sc__plot { max-height: none; }
  .sc {
    animation: scPlay 2600ms cubic-bezier(0.3, 0.5, 0.4, 1) 350ms both paused;
  }
  .sc.is-in { animation-play-state: running; }

  .sc .sc-tick { font-size: 24px; }
  .sc .sc__plot > g:first-of-type > text[text-anchor="middle"] { transform: translateY(13px); }
  .sc .sc__plot > g:first-of-type > text:nth-last-of-type(-n + 2),   /* COUNT, LOG10 */
  .sc .sc-erasub,
  .sc .sc-note,
  .sc .sc-note--hw,
  .sc .sc-valsub,
  .sc .sc-foot { display: none; }

  .sc .sc-era { font-size: 21px; letter-spacing: 0.04em; }
  .sc .sc-era:nth-of-type(5) { text-anchor: end; transform: translateX(-8px); }   /* Copilot, clear of Agents */

  .sc .sc-val { font-size: 28px; }

  .sc .sc-web { stroke-width: 4; }
  .sc .sc-git { stroke-width: 3.6; }
  .sc .sc-hwray { stroke-width: 3; }
  .sc .sc-corridor { stroke-width: 2; }
  .sc .sc-grid, .sc .sc-axis, .sc .sc-eraline { stroke-width: 2; }

  .sc .sc-legend span { flex-basis: 100%; }

  .points { grid-template-columns: 1fr; }
  .contact__rows > p { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 560px) {
  .toc ol { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .toc li:nth-child(5) a { padding-top: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .opening [data-in] { opacity: 1; animation: none; }
  /* The chart is handed over finished, so there is nothing to scroll for. */
  .chartscroll__track { height: auto; }
  .chartscroll__stage { display: block; padding-block: clamp(32px, 6vh, 56px) var(--stack); }
  .sc { animation: none; }
}
