/* RYIUK — one font, one scale, four colors, one moving line. */

@font-face {
  font-family: Ry;
  src: url("../fonts/ryiuk.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --s: max(0.9px, calc(100vw / 1440));

  --paper: #000000;
  --ink: #EDEBE6;
  --grey: #9A9A94;
  --line: rgba(237, 235, 230, 0.18);

  --t-label: calc(11 * var(--s));
  --t-body: calc(16 * var(--s));
  --t-lede: calc(22 * var(--s));
  --t-title: calc(38 * var(--s));
  --t-hero: calc(88 * var(--s));
  --t-num: calc(72 * var(--s));

  --p1: calc(4 * var(--s));
  --p2: calc(8 * var(--s));
  --p3: calc(16 * var(--s));
  --p4: calc(24 * var(--s));
  --p5: calc(40 * var(--s));
  --p6: calc(64 * var(--s));
  --p7: calc(104 * var(--s));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--paper); color-scheme: dark; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Ry, sans-serif;
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 var(--p5);
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; }

/* the twelve column measuring grid, fixed behind everything */
.cols {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding: 0 var(--p5);
  pointer-events: none;
}
.cols i { border-left: 1px solid rgba(237, 235, 230, 0.035); }

main, header, footer { position: relative; }

/* the only moving thing on the page */
@keyframes rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.rule {
  display: block;
  height: 1px;
  background: var(--line);
  transform-origin: left center;
  width: 100%;
}
.js .rule.in { animation: rule 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards; }

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--p4);
  padding: var(--p4) 0 var(--p3);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-label);
  color: var(--grey);
}
header .name { color: var(--ink); letter-spacing: 0.22em; }
nav { display: flex; gap: var(--p4); flex-wrap: wrap; }
nav a { text-decoration: none; }
nav a:hover { color: var(--ink); }

section {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--p7) 0 var(--p6);
}
section > .rule { margin-bottom: var(--p5); }

.label {
  font-size: var(--t-label);
  color: var(--grey);
  letter-spacing: 0.22em;
  margin-bottom: var(--p4);
}

h1, h2 {
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
h1 { font-size: var(--t-hero); }
h2 { font-size: var(--t-title); }

.hero p, .about p {
  max-width: 40ch;
  font-size: var(--t-lede);
  color: var(--grey);
  margin-top: var(--p4);
}

/* four stations on one line */
.path {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--p3);
  margin-top: var(--p6);
  border-top: 1px solid var(--line);
  padding-top: var(--p3);
}
.path > div { position: relative; padding-top: var(--p3); }
.path > div::before {
  content: "";
  position: absolute;
  top: calc(-4 * var(--s));
  left: 0;
  width: calc(7 * var(--s));
  height: calc(7 * var(--s));
  background: var(--ink);
}
.path .k { display: block; color: var(--grey); font-size: var(--t-label); }
.path .v { display: block; margin-top: var(--p1); }

.spec {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 4fr;
  gap: var(--p3);
  padding: var(--p3) 0;
  border-bottom: 1px solid var(--line);
}
.spec:first-of-type { border-top: 1px solid var(--line); }
.spec .k { color: var(--grey); }

.bigs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--p4);
  margin-top: var(--p6);
}
.bigs .n {
  display: block;
  font-size: var(--t-num);
  line-height: 1;
  letter-spacing: -0.06em;
}
.bigs .k {
  display: block;
  margin-top: var(--p2);
  color: var(--grey);
  font-size: var(--t-label);
}

.bars { margin-top: var(--p6); }
.bar {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 4fr auto;
  gap: var(--p3);
  align-items: center;
  padding: var(--p2) 0;
}
.bar .track { height: 1px; background: var(--line); position: relative; }
.bar .track i {
  display: block;
  height: 1px;
  background: var(--ink);
  position: absolute;
  left: 0;
  top: 0;
}
.bar .n { text-align: right; }

.slots {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: var(--p2);
  margin-top: var(--p5);
  max-width: calc(600 * var(--s));
}
.slots i { height: calc(24 * var(--s)); border: 1px solid var(--line); }
.slots i.on { background: var(--ink); }

.rows { display: grid; gap: var(--p4); }
.row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 4fr;
  gap: var(--p3);
  padding-bottom: var(--p4);
  border-bottom: 1px solid var(--line);
}
.row .k { color: var(--grey); }
.row .d {
  display: block;
  margin-top: var(--p1);
  color: var(--grey);
  font-size: var(--t-label);
}
.row:hover { border-bottom-color: var(--ink); }
.row:hover .k { color: var(--ink); }

.note {
  color: var(--grey);
  max-width: 55ch;
  margin-top: var(--p5);
}

footer {
  border-top: 1px solid var(--line);
  padding: var(--p5) 0 var(--p6);
  color: var(--grey);
  font-size: var(--t-label);
  display: flex;
  flex-wrap: wrap;
  gap: var(--p4);
  justify-content: space-between;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

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

@media (max-width: 720px) {
  .path, .bigs { grid-template-columns: repeat(2, 1fr); gap: var(--p4); }
  .cols { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rule, .js .rule.in { animation: none; transform: none; }
}
