/* FACTLINK marketing site. World: a French station hall. The dark split-flap board carries
   the product at work; the yellow and white printed timetables carry the reading. */

@font-face {
  font-family: 'Barlow';
  src: url('fonts/barlow-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('fonts/barlow-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('fonts/barlow-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --hall: #0f1011;
  --hall-2: #17181a;
  --tile: #1f2023;
  --tile-top: #26272b;
  --flap: #f3f0e6;
  --flap-dim: #a9a59a;
  --amber: #f6c445;
  --green: #4fd889;
  --red: #ff7a6b;
  --yellow: #ffd31a;
  --paper: #f6f4ee;
  --ink: #121212;
  --ink-2: #3b3a36;
  --rule: #121212;

  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 66ch;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--flap);
  background: var(--hall);
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--amber);
  color: var(--ink);
}
.poster ::selection {
  background: var(--ink);
  color: var(--yellow);
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}
.poster :focus-visible {
  outline-color: var(--ink);
}

html {
  scrollbar-color: #3a3b3f var(--hall);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
}
.skip:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 3px;
  border: 1.5px solid transparent;
  transition:
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    transform 160ms var(--ease-out);
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn-lg {
  min-height: 3.1rem;
  padding: 0.6rem 1.5rem;
  font-size: 1.25rem;
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
}
.btn-primary:hover {
  background: #ffd76a;
}
.btn-line {
  border-color: rgba(243, 240, 230, 0.55);
  color: var(--flap);
}
.btn-line:hover {
  border-color: var(--flap);
  background: rgba(243, 240, 230, 0.08);
}
.btn-ghost {
  color: var(--flap-dim);
}
.btn-ghost:hover {
  color: var(--flap);
}
.btn-line-dark {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-line-dark:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem var(--gutter);
  background: var(--hall);
  border-bottom: 1px solid #25262a;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.wordmark-plate {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.9rem;
  background: var(--tile);
  border-radius: 3px;
  color: var(--amber);
  font-size: 1.3rem;
  box-shadow: inset 0 -0.95rem 0 rgba(0, 0, 0, 0.22);
}
.topnav {
  display: flex;
  gap: 1.4rem;
  margin-right: auto;
}
.topnav a {
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--flap-dim);
  text-decoration: none;
}
.topnav a:hover {
  color: var(--flap);
}
.topactions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* ---------------------------------------------------------------- hall (first viewport) */

.hall {
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
  background: radial-gradient(120% 60% at 50% 0%, #1a1b1e 0%, transparent 70%), var(--hall);
}
.hall-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  align-items: end;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}
.hall h1 {
  font-weight: 700;
  font-size: clamp(2.6rem, 5.6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--flap);
}
.hall h1 span {
  display: block;
  color: var(--amber);
}
.lede {
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.25vw, 1.2rem);
  color: #d4d0c5;
}
.hall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}
.hall-copy .lede {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}
.hall-copy .hall-actions {
  grid-column: 2;
  margin-top: 0;
}
.hall-copy h1 {
  grid-row: 1 / span 2;
}

/* ---------------------------------------------------------------- split-flap board */

.board {
  margin: 0;
  padding: clamp(0.9rem, 1.6vw, 1.5rem);
  background: #0a0a0b;
  border-radius: 6px;
  box-shadow:
    0 1px 0 #2a2b2f inset,
    0 24px 60px -20px rgba(0, 0, 0, 0.8);
  --t: clamp(10px, 1.08vw, 17px);
}
.board-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0 0.2rem 0.8rem;
  border-bottom: 1px solid #222326;
  margin-bottom: 0.7rem;
}
.board-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 2.1rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
}
.board-sub {
  font-family: var(--display);
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  color: var(--flap-dim);
}
.board-clock {
  margin-left: auto;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  letter-spacing: 0.06em;
  color: var(--flap);
}
.board-grid {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t);
}
.board-grid,
.mini-board {
  /* One split-flap tile plus its gap, in the board's font size. */
  --p: 1.155em;
}
.board-row {
  display: grid;
  grid-template-columns:
    calc(var(--p) * 5) minmax(0, 1fr) calc(var(--p) * 9) calc(var(--p) * 7)
    calc(var(--p) * 10) calc(var(--p) * 16);
  gap: 0 1.1em;
  align-items: center;
  padding: 0.28em 0;
}
.board-row + .board-row {
  border-top: 1px solid #18191b;
}
.board-row-head {
  padding-bottom: 0.45em;
}
.board-row-head > span {
  font-weight: 500;
  font-size: 0.82em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flap-dim);
}
.cells {
  display: flex;
  gap: 0.14em;
  overflow: hidden;
  white-space: nowrap;
}
.ch {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 0.86em;
  height: 1.42em;
  font-size: 1.18em;
  line-height: 1;
  color: var(--flap);
  background: linear-gradient(
    to bottom,
    var(--tile-top) 0 49.5%,
    #0b0b0c 49.5% 50.5%,
    var(--tile) 50.5% 100%
  );
  border-radius: 0.12em;
  text-transform: uppercase;
}
.ch::after {
  content: '';
  position: absolute;
  inset: 0 0 50% 0;
  border-radius: 0.12em 0.12em 0 0;
  background: var(--tile-top);
  transform-origin: 50% 100%;
  opacity: 0;
}
.ch.is-flipping::after {
  animation: flap 90ms linear;
}
@keyframes flap {
  0% {
    opacity: 1;
    transform: scaleY(1);
  }
  100% {
    opacity: 1;
    transform: scaleY(0);
  }
}
.tone-go .ch {
  color: var(--green);
}
.tone-wait .ch {
  color: var(--amber);
}
.tone-stop .ch {
  color: var(--red);
}
.board-note {
  margin-top: 0.9rem;
  padding: 0 0.2rem;
  font-size: 0.8rem;
  color: #8b887f;
}

/* ---------------------------------------------------------------- printed posters */

.poster {
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
  color: var(--ink);
}
.poster-yellow {
  background: var(--yellow);
}
.poster-white {
  background: var(--paper);
}
.poster-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  align-items: end;
  padding-bottom: 1.4rem;
  border-bottom: 6px solid var(--rule);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.poster h2 {
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.005em;
}
.poster-intro {
  max-width: 48ch;
  font-size: 1.15rem;
  color: var(--ink-2);
}
.poster-yellow .poster-intro {
  color: #2b2817;
}
.ticket {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1em;
  padding: 0.05em 0.35em;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 2px;
  white-space: nowrap;
}

/* The line: stops along a single rail. */
.line {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 62rem;
}
.stop {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem 2.5rem minmax(0, 1fr);
  padding-bottom: 2.1rem;
}
.stop::before {
  content: '';
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.35rem;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  z-index: 1;
}
.stop::after {
  content: '';
  position: absolute;
  left: calc(6.5rem + 1.25rem - 3px);
  top: 1rem;
  bottom: -0.4rem;
  width: 6px;
  background: var(--ink);
}
.stop-terminus::after {
  display: none;
}
.stop-terminus::before {
  background: var(--ink);
  border-radius: 3px;
}
.stop-time {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
}
.stop-body {
  grid-column: 3;
  grid-row: 1;
  padding-left: 0.6rem;
}
.stop h3 {
  font-weight: 700;
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}
.stop p {
  max-width: var(--measure);
  color: #2b2817;
}

/* Timetables. */
.timetable {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
}
.timetable thead th {
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}
.poster-yellow .timetable thead th {
  color: var(--yellow);
}
.timetable tbody th,
.timetable tbody td {
  padding: 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(18, 18, 18, 0.35);
}
.timetable tbody th {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.15;
  white-space: nowrap;
}
.timetable tbody td:last-child {
  font-weight: 500;
}
.timetable tbody tr:hover {
  background: rgba(18, 18, 18, 0.04);
}
.voie {
  width: 4.5rem;
}
.plate {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
}
.timetable-reform tbody th.date {
  font-size: 1.9rem;
}
.timetable-reform td {
  font-size: 1.15rem;
}

/* ---------------------------------------------------------------- arrivals */

.arrivals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: center;
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
  background: var(--hall-2);
}
.arrivals h2 {
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 4.2rem);
  line-height: 0.98;
  color: var(--flap);
  margin-bottom: 1.2rem;
}
.arrivals-copy p {
  max-width: 52ch;
  color: #d4d0c5;
}
.arrivals-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.arrivals-list li {
  padding: 0.7rem 0;
  border-top: 1px solid #2c2d31;
  color: var(--flap);
}
.arrivals-list li::before {
  content: '';
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.8rem;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 0.1em;
}
.mini-board {
  padding: 1.1rem;
  background: #0a0a0b;
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(10px, 1.05vw, 17px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
}
.mini-head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.7rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid #222326;
  font-size: 1.4em;
}
.mini-head span:first-child {
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mini-head span:last-child {
  font-size: 0.75em;
  color: var(--flap-dim);
}
.mini-board .board-row {
  grid-template-columns: calc(var(--p) * 5) minmax(0, 1fr) calc(var(--p) * 15);
}

/* ---------------------------------------------------------------- developers */

.dev-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.5rem;
}
.code {
  margin: 0;
  background: var(--hall);
  color: var(--flap);
  border-radius: 6px;
  overflow: hidden;
}
.code figcaption {
  padding: 0.65rem 1.1rem;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid #25262a;
}
.code pre {
  margin: 0;
  padding: 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.65;
}
.c-k {
  color: var(--amber);
}
.c-s {
  color: #a6e3b8;
}
.dev-links {
  margin-top: 2rem;
}

/* ---------------------------------------------------------------- close + footer */

.close {
  padding: clamp(4rem, 10vw, 8rem) var(--gutter);
  background: var(--hall);
  text-align: left;
}
.close h2 {
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  line-height: 0.95;
  color: var(--flap);
  max-width: 16ch;
}
.close p {
  margin-top: 1.2rem;
  max-width: 52ch;
  font-size: 1.2rem;
  color: #d4d0c5;
}
.close .hall-actions {
  margin-top: 2rem;
}

.foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.6rem var(--gutter);
  border-top: 1px solid #25262a;
  font-size: 0.92rem;
  color: #a9a59a;
}
.foot-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--flap);
}
.foot nav {
  display: flex;
  gap: 1.2rem;
}
.foot nav a {
  text-decoration: none;
}
.foot nav a:hover {
  color: var(--flap);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .topnav {
    display: none;
  }
}

@media (max-width: 900px) {
  .hall-copy,
  .poster-head,
  .arrivals,
  .dev-grid {
    grid-template-columns: 1fr;
  }
  .hall-copy h1,
  .hall-copy .lede,
  .hall-copy .hall-actions {
    grid-column: 1;
    grid-row: auto;
  }
  .board {
    --t: clamp(11px, 2.4vw, 17px);
  }
  .board .board-row {
    grid-template-columns: calc(var(--p) * 5) minmax(0, 1fr) calc(var(--p) * 16);
  }
  .board .board-row > :nth-child(3),
  .board .board-row > :nth-child(4),
  .board .board-row > :nth-child(5) {
    display: none;
  }
  .mini-board {
    font-size: clamp(11px, 2.6vw, 16px);
  }
  .foot {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }
  .topbar {
    gap: 0.75rem;
    padding-block: 0.6rem;
  }
  .topactions .btn-ghost {
    display: none;
  }
  .board {
    padding: 0.7rem;
    --t: 3.4vw;
  }
  .board-head {
    flex-wrap: wrap;
    gap: 0.2rem 0.8rem;
  }
  /* Two lines per departure: time and destination, then the state under the destination. */
  .board .board-row,
  .mini-board .board-row {
    grid-template-columns: calc(var(--p) * 5) minmax(0, 1fr);
    gap: 0.2em 0.6em;
  }
  .board .board-row > :nth-child(6),
  .mini-board .board-row > :nth-child(3) {
    grid-column: 2;
  }
  .board-row-head > :nth-child(6) {
    display: none;
  }
  .mini-board {
    font-size: 3.4vw;
  }
  .timetable td[data-label]::before {
    content: attr(data-label) ' : ';
    font-weight: 400;
    color: var(--ink-2);
  }
  .stop {
    grid-template-columns: 4.6rem 2.2rem minmax(0, 1fr);
  }
  .stop::after {
    left: calc(4.6rem + 1.1rem - 3px);
  }
  .stop-time {
    font-size: 1.25rem;
  }
  .stop-body {
    padding-left: 0.3rem;
  }
  .timetable thead {
    display: none;
  }
  .timetable,
  .timetable tbody,
  .timetable tr {
    display: block;
  }
  .timetable tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.2rem 0.9rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(18, 18, 18, 0.35);
  }
  .timetable tbody th,
  .timetable tbody td {
    padding: 0;
    border: 0;
  }
  .timetable td.voie {
    grid-row: 1 / span 3;
    width: auto;
  }
  .timetable-reform tbody tr {
    grid-template-columns: 1fr;
  }
  .timetable-reform tbody th.date {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .ch.is-flipping::after {
    animation: none;
  }
}
