/* raegune.ca, "line". Strict CSP: styles here, script in site.js, fonts self-hosted. */

@font-face {
  font-family: "Syne";
  src: url("fonts/syne-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --y: #ffff00;
  --on-y: #0b0b0b;
  --bg: #0b0b0b;
  --ink: #ececec;
  --dim: #8d8d8d;
  --rule: #262626;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --page: 90rem;              /* widest the page gets; it centres beyond this */
  --belt: #1d1d1d;
  --belt-tex: #2c2c2c;
  --item: #151515;
  --panel: #161616;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f4f3ee; --ink: #121212; --dim: #6a6a66; --rule: #d6d5cf; --belt: #dcdbd4; --belt-tex: #c9c8c0; --item: #ffffff; --panel: #ffffff; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 "Plex", system-ui, sans-serif; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: var(--y); color: var(--on-y); }

/* One centred column on wide screens: hero, graphic, sections and footer share its edges. */

.hero, main, footer { max-width: var(--page); margin-left: auto; margin-right: auto; }

/* Hero */

.hero {
  position: relative;
  padding: 1.5rem var(--gutter) 2.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.meta, .hero-main { position: relative; }
.meta {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.clock { margin-left: auto; font-variant-numeric: tabular-nums; }
.hero-main { margin-top: clamp(3rem, 9vw, 6rem); }
h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 11vw, 10.5rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
}
h1 span { display: block; }
.l2 { padding-left: 0.9em; }
.hero-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.role { font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 500; }
.pron { display: inline-block; margin-left: 0.6em; vertical-align: 0.35em; color: var(--dim); font: 400 clamp(0.95rem, 1.6vw, 1.35rem)/1 "Plex", sans-serif; letter-spacing: 0; white-space: nowrap; }
.mail {
  position: relative;
  font-weight: 600;
  text-decoration: none;
  padding: 0.1em 0;
}
.mail::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -0.1em;
  height: 2px; background: var(--y);
  transform-origin: left; transition: transform 0.35s ease;
}
.mail:hover::after { transform: scaleX(0.15); }
@media (prefers-color-scheme: light) { .mail::after { background: var(--ink); } }

/* Sorting line */

.line { display: block; width: calc(100% + 2 * var(--gutter)); margin: clamp(2rem, 5vw, 3.5rem) calc(-1 * var(--gutter)) 0; height: auto; overflow: hidden; }
/* Fade the belts out at the edges so they don't stop dead on wide screens. */
.line { -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); }
.belts path, .belt-tex use { fill: none; stroke-linecap: round; }
.belts path { stroke: var(--belt); stroke-width: 30; }
.belt-tex use { stroke: var(--belt-tex); stroke-width: 22; stroke-dasharray: 3 13; animation: run 0.6s linear infinite; }
@keyframes run { to { stroke-dashoffset: -16; } }
.ic { fill: var(--item); stroke: var(--ink); stroke-width: 2.5; }
.ic-band { fill: var(--y); }
.ic-ink { fill: var(--ink); }
.ic-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.machine .body { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; }
.machine .screen { fill: var(--bg); }
.machine .name { fill: var(--y); font: 700 26px "Syne", sans-serif; letter-spacing: -0.5px; }
.machine .sub { fill: var(--dim); font: 500 14px "Plex", sans-serif; letter-spacing: 1.5px; }
.led { fill: var(--rule); transition: fill 0.15s; }
.led.on { fill: var(--y); }
.dest text { fill: var(--dim); font: 500 17px "Plex", sans-serif; }
.dest .m { fill: var(--ink); font: 700 20px "Syne", sans-serif; }
@media (prefers-color-scheme: light) {
  .machine .name { fill: var(--ink); }
  .machine .screen { fill: var(--y); }
  .led.on { fill: var(--ink); }
}

/* Sections */

main { padding: 0 var(--gutter); }
section { padding: clamp(5rem, 12vw, 9rem) 0 0; }
h2 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.idx {
  display: inline-block;
  vertical-align: top;
  font: 500 0.8rem/1 "Plex", sans-serif;
  letter-spacing: 0.1em;
  color: var(--y);
  margin-right: 1.25rem;
  margin-top: 0.6rem;
}
@media (prefers-color-scheme: light) { .idx { color: var(--dim); } }
.intro-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.desk { margin: 0; }
.desk img { display: block; width: 100%; height: auto; }
@media (max-width: 50rem) { .intro-grid { grid-template-columns: 1fr; } }
.lede { max-width: 38rem; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.45; color: var(--ink); }

.facts { margin-top: 3rem; }

.facts { counter-reset: f; border-top: 1px solid var(--rule); }
.facts li {
  counter-increment: f;
  display: grid;
  grid-template-columns: 3rem 10rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.facts li::before { content: "0" counter(f); color: var(--dim); font-size: 0.8rem; letter-spacing: 0.08em; }
.k { font-family: "Syne", sans-serif; font-weight: 700; font-size: 1.2rem; }
.v { color: var(--ink); }
@media (max-width: 40rem) {
  .facts li { grid-template-columns: 2.25rem 1fr; }
  .v { grid-column: 2; }
}

/* Other stuff: big hover rows */

.rows { border-top: 1px solid var(--rule); }
.rows a {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 0.5rem 2rem;
  align-items: baseline;
  padding: 1.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  isolation: isolate;
}
.rows a::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--y);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
  z-index: -1;
}
.rows a:hover::before, .rows a:focus-visible::before { transform: scaleY(1); }
.rows a:hover, .rows a:focus-visible { color: var(--on-y); outline: none; }
.rows a:hover .d, .rows a:focus-visible .d { color: var(--on-y); }
.t {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 4.2vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
}
.rows a:hover .t { transform: translateX(0.75rem); }
.d { color: var(--dim); max-width: 30rem; transition: color 0.3s; }
@media (max-width: 40rem) { .rows a { grid-template-columns: 1fr; } }

.tag {
  display: inline-block;
  margin: 0 0.6rem 0.4rem 0;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--y);
  color: var(--y);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rows a:hover .tag, .rows a:focus-visible .tag { border-color: var(--on-y); color: var(--on-y); }
@media (prefers-color-scheme: light) { .tag { border-color: var(--ink); color: var(--ink); } }

footer {
  margin-top: clamp(6rem, 12vw, 9rem);
  padding: 0 var(--gutter) 3rem;
  color: var(--dim);
  font-size: 0.8rem;
  line-height: 1.55;
}

footer p { max-width: 44rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* Photos: add or remove <figure> blocks in index.html; they flow into two columns (one on phones), any number of them. */

.photos { columns: 2 18rem; column-gap: clamp(1rem, 3vw, 2.5rem); margin-top: clamp(3rem, 7vw, 5rem); }
.photos figure { margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); break-inside: avoid; }
.photos img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.1); transition: filter 0.8s ease; }
.photos figure:hover img { filter: none; }
figcaption { margin-top: 0.75rem; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
figcaption::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.6rem; background: var(--y); vertical-align: 0; }

/* Reveal on scroll (only once the script has run) */

.js [data-reveal] { opacity: 0; transform: translateY(1.75rem); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .hero h1 span, .js .hero-sub, .js .meta { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.js .hero .l2 { animation-delay: 0.12s; }
.js .hero-sub { animation-delay: 0.3s; }
.js .meta { animation-delay: 0.45s; }
@keyframes rise { from { opacity: 0; transform: translateY(0.6em); } }


@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .hero h1 span, .js .hero-sub, .js .meta { animation: none; }
  .rows a::before, .t { transition: none; }
  .belt-tex use { animation: none; }
}
