/* The public page on the product's own domain. See README.md beside this file.

   The colours are the product's (packages/ui/src/tokens.css and packages/ui/brand):
   the ink of the logo's tile as the ground of the hero, the mark's petrol limb for the
   line work, the accent for what is said on white. The face is Instrument Sans, the
   application's own and the one the name in the logo is set in; the two files in fonts/
   are the Latin and the Latin Extended subset (Turkish needs the second), fetched
   only by a browser that shows a character from them. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ground: #0e1a22;        /* the logo's tile, --v-ink */
  --on-ground: #c6d5d8;     /* running text on the ground */
  --line: #5fb4be;          /* the mark's far limb */
  --accent-ink: #005a66;    /* --v-accent-ink: the accent as text on white */
  --paper: #ffffff;
  --ink: #0d191e;
  --ink-2: #2a383e;
  --ink-muted: #46545a;
  --rule: #e2e9e9;
  --radius: 9px;
  --gutter: clamp(20px, 5vw, 56px);
  --measure: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- The hero: the top bar and the opening share one ground ------------------ */

.hero {
  background: var(--ground);
  color: var(--paper);
}

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.bar .brand {
  display: block;
  margin-right: auto;
  line-height: 0;
}

.bar .brand svg {
  width: 160px;
  height: 36px;
}

.languages {
  display: none;
  gap: 2px;
}

.has-script .languages {
  display: flex;
}

.languages button {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--line);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 7px 9px;
  cursor: pointer;
}

.languages button:hover {
  color: var(--paper);
}

.languages button[aria-pressed="true"] {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.12);
}

.button {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--paper);
  padding: 13px 26px;
  color: var(--ground);
  background: var(--paper);
}

.button:hover {
  background: #e5f2f4;
  border-color: #e5f2f4;
}

.button.quiet {
  font-size: 0.9375rem;
  padding: 8px 16px;
  color: var(--paper);
  background: transparent;
  border-color: rgba(95, 180, 190, 0.6);
}

.button.quiet:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line);
}

.opening {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(28px, 5vw, 64px);
  padding-bottom: clamp(48px, 7vw, 96px);
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 1.2rem + 3.1vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.lead {
  margin: 24px 0 0;
  max-width: 34em;
  font-size: 1.125rem;
  color: var(--on-ground);
}

.way-in {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.way-in p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--line);
  max-width: 17em;
  line-height: 1.4;
}

/* ---- The track: one order, followed along the board -------------------------- */

/* Six steps on a rail, and one white card that is on exactly one of them. Which one is
   the data-at attribute of the figure (index.html, site.js); everything below reads
   that number, so there is no state anywhere else. Rows have a fixed height because
   the card finds its row by multiplying. */
.track {
  --row: 52px;
  margin: 0;
  border: 1px solid rgba(95, 180, 190, 0.45);
  border-radius: 3px;
}

.track[data-at="0"] { --at: 0; }
.track[data-at="1"] { --at: 1; }
.track[data-at="2"] { --at: 2; }
.track[data-at="3"] { --at: 3; }
.track[data-at="4"] { --at: 4; }
.track[data-at="5"] { --at: 5; }

.track ol {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 14px 16px;
}

/* The rail, from the first step's mark to the last one's. */
.track ol::before {
  content: "";
  position: absolute;
  left: 27px;
  top: calc(14px + var(--row) / 2);
  bottom: calc(14px + var(--row) / 2);
  width: 1px;
  background: rgba(95, 180, 190, 0.55);
}

/* The card. */
.track ol::after {
  content: "";
  position: absolute;
  left: 50px;
  right: 16px;
  top: 20px;
  height: calc(var(--row) - 12px);
  border-radius: 6px;
  background: var(--paper);
  transform: translateY(calc(var(--at) * var(--row)));
  transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.track li {
  height: var(--row);
  display: flex;
  align-items: center;
}

.track button {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(var(--row) - 12px);
  padding: 0 14px 0 48px;
  font: inherit;
  font-weight: 500;
  text-align: left;
  color: var(--line);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.25s ease-out;
}

.track button:hover {
  color: var(--paper);
}

.track button[aria-current="step"] {
  color: var(--ground);
  font-weight: 600;
}

/* The mark on the rail: open for what is still to come, filled for what is behind the
   card, white where the card is. */
.track button::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  background: var(--ground);
  transition: background-color 0.25s ease-out, border-color 0.25s ease-out;
}

.track[data-at="1"] li:nth-child(-n + 1) button::before,
.track[data-at="2"] li:nth-child(-n + 2) button::before,
.track[data-at="3"] li:nth-child(-n + 3) button::before,
.track[data-at="4"] li:nth-child(-n + 4) button::before,
.track[data-at="5"] li:nth-child(-n + 5) button::before {
  background: var(--line);
}

.track button[aria-current="step"]::before {
  border-color: var(--paper);
  background: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  .track ol::after,
  .track button,
  .track button::before {
    transition: none;
  }
}

/* What happens at the step the card is on. As tall as its longest text in any of the
   four languages, so that nothing below it moves when the card does. */
.now {
  min-height: 7.6em;
  padding: 16px 16px 18px;
  border-top: 1px solid rgba(95, 180, 190, 0.45);
}

.now p {
  margin: 0;
  max-width: 32em;
  color: var(--on-ground);
}

.now .now-title {
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--paper);
}

.track figcaption {
  padding: 11px 16px 13px;
  border-top: 1px solid rgba(95, 180, 190, 0.25);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--line);
}

/* ---- What it does ------------------------------------------------------------ */

.parts {
  padding-top: clamp(48px, 7vw, 96px);
  padding-bottom: clamp(40px, 6vw, 80px);
}

.parts h2 {
  margin: 0 0 clamp(20px, 3vw, 36px);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.parts dl {
  margin: 0;
}

.parts dl > div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 8px clamp(28px, 5vw, 72px);
  padding: clamp(20px, 2.6vw, 30px) 0;
  border-top: 1px solid var(--rule);
}

.parts dt {
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.625rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--accent-ink);
  text-wrap: balance;
}

.parts dd {
  margin: 0;
  max-width: 36em;
  color: var(--ink-2);
}

.foot {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  padding-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.foot p {
  margin: 0;
}

/* ---- Narrow screens: one column, the words first ---------------------------- */

@media (max-width: 860px) {
  .opening {
    grid-template-columns: minmax(0, 1fr);
  }

  .parts dl > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .bar {
    gap: 8px;
  }

  .bar .brand svg {
    width: 133px;
    height: 30px;
  }

  .languages button {
    padding: 7px 6px;
  }

  .button.quiet {
    display: none;
  }

  .way-in .button {
    width: 100%;
    text-align: center;
  }

  .way-in p {
    max-width: none;
  }

  .now {
    min-height: 9.6em;
  }
}
