/* ==========================================================================
   Untiring Systems — The RSI Lab
   Type: Vollkorn  ·  Surface: white  ·  Mood: minimal, editorial, pixel
   ========================================================================== */

:root {
  --white: #ffffff;
  --ink: #0d0d0d;
  --ink-2: #3c3c3c;
  --muted: #8c8c8c;
  --faint: #b4b4b4;
  --line: rgba(13, 13, 13, 0.14);
  --line-soft: rgba(13, 13, 13, 0.08);

  /* Very large page margins */
  --gutter: clamp(2.25rem, 16vw, 27rem);
  --content: 900px;
  --topbar-h: 4.5rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --serif: "Vollkorn", Georgia, "Times New Roman", serif;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Layout ------------------------------------------------------------------ */

.wrap,
.topbar__inner {
  width: min(var(--content), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.section {
  padding-block: clamp(6rem, 12vw, 11rem);
  scroll-margin-top: 6rem;
}

.section + .section {
  padding-top: 0;
}

.section--hero {
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(4.5rem, 9vw, 8rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Sticky menu ------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
}

.topbar.is-scrolled {
  border-bottom-color: var(--line-soft);
}

.topbar__inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand__mark {
  width: 26px;
  height: 26px;
  flex: none;
  transition: transform 0.7s var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(180deg);
}

.brand__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

/* Pixelated cogs in the header -------------------------------------------- */

.cogs {
  width: clamp(112px, 13vw, 168px);
  height: auto;
  aspect-ratio: 108 / 30;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Section meta (numbered marker + rule) ----------------------------------- */

.meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.meta__num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.meta__rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
}

.js .meta__rule {
  transform: scaleX(0);
}

.js .is-visible .meta__rule {
  transform: scaleX(1);
}

.meta__kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Typography -------------------------------------------------------------- */

.display {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: -0.014em;
  font-weight: 400;
  max-width: 28ch;
}

.heading {
  margin: 0;
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
  font-weight: 500;
  max-width: 28ch;
}

.heading--tight {
  margin-bottom: clamp(1.8rem, 3.5vw, 3rem);
}

.lead {
  margin: 0;
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 54ch;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.hero__mark {
  margin: 0;
  justify-self: end;
}

.pixel-sphere {
  width: clamp(168px, 24vw, 290px);
  height: auto;
  aspect-ratio: 1 / 1;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Prose ------------------------------------------------------------------- */

.prose__body {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  max-width: 62ch;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  line-height: 1.8;
}

.prose__body p {
  margin: 0 0 1.5em;
}

.prose__body p:last-child {
  margin-bottom: 0;
}

.pull {
  margin-top: clamp(1.5rem, 3vw, 2.2rem) !important;
  max-width: 34ch;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1.36;
  letter-spacing: -0.008em;
}

/* Research areas ---------------------------------------------------------- */

.areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 5rem);
  border-bottom: 1px solid var(--line);
}

.area {
  padding-block: clamp(1.5rem, 2.5vw, 2.2rem);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.area__num {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.area__title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.02rem, 1.25vw, 1.2rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.008em;
}

.area__body {
  margin: 0.6rem 0 0;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 0.96rem;
  line-height: 1.7;
}

/* Levers ------------------------------------------------------------------ */

.levers {
  list-style: none;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.levers__item {
  padding: 0.95rem clamp(0.9rem, 1.8vw, 1.5rem);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-right: 1px solid var(--line);
}

.levers__item:first-child {
  padding-left: 0;
}

.levers__item:last-child {
  border-right: 0;
}

/* Vision statement -------------------------------------------------------- */

.statement {
  max-width: 72ch;
}

.statement__lead {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  line-height: 1.38;
  letter-spacing: -0.01em;
  font-weight: 400;
  max-width: 36ch;
}

.statement__body {
  margin: clamp(1.6rem, 3vw, 2.4rem) 0 0;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.78;
}

/* Footer ------------------------------------------------------------------ */

.footer {
  border-top: 1px solid var(--line-soft);
  padding-block: clamp(1.8rem, 3.5vw, 2.6rem);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer__mark {
  width: 20px;
  height: 20px;
}

.footer__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

/* Timeline navigation ----------------------------------------------------- */

.timeline {
  position: fixed;
  top: 50%;
  right: clamp(1rem, 2.2vw, 2.2rem);
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.timeline::before {
  content: "";
  position: absolute;
  right: 0;
  top: 1.25rem;
  bottom: 1.25rem;
  width: 1px;
  background: var(--line);
}

.timeline__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 2.5rem;
}

.timeline__tick {
  position: relative;
  display: block;
  width: 30px;
  height: 100%;
}

.timeline__tick::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: rgba(13, 13, 13, 0.32);
  transition: width 0.45s var(--ease), background 0.45s var(--ease);
}

.timeline__item:hover .timeline__tick::before,
.timeline__item:focus-visible .timeline__tick::before,
.timeline__item.is-active .timeline__tick::before {
  width: 27px;
  background: var(--ink);
}

/* Blurry popover (no shadow) */
.timeline__label {
  position: absolute;
  top: 50%;
  right: calc(100% + 16px);
  transform: translateY(-50%) translateX(8px);
  white-space: nowrap;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(13, 13, 13, 0.09);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.timeline__label .timeline__num {
  color: var(--muted);
  margin-right: 0.35em;
  font-variant-numeric: tabular-nums;
}

.timeline__item:hover .timeline__label,
.timeline__item:focus-visible .timeline__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Reveal on scroll -------------------------------------------------------- */

[data-reveal] {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Focus ------------------------------------------------------------------- */

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

/* Responsive -------------------------------------------------------------- */

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

  .hero__mark {
    justify-self: start;
  }

  .areas {
    grid-template-columns: minmax(0, 1fr);
  }

  .cogs {
    width: clamp(96px, 26vw, 132px);
  }

  /* Timeline becomes a horizontal rail pinned to the bottom */
  .timeline {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    transform: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(0.8rem, 4vw, 1.8rem);
    padding: 0.5rem var(--gutter);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-top: 1px solid var(--line-soft);
  }

  .timeline::before {
    top: 50%;
    bottom: auto;
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    height: 1px;
    transform: translateY(-50%);
  }

  .timeline__item {
    height: 1.9rem;
    width: 26px;
    justify-content: center;
    z-index: 1;
  }

  .timeline__tick {
    width: 26px;
  }

  .timeline__tick::before {
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .timeline__label {
    right: auto;
    left: 50%;
    top: auto;
    bottom: calc(100% + 12px);
    transform: translate(-50%, 8px);
  }

  .timeline__item:hover .timeline__label,
  .timeline__item:focus-visible .timeline__label,
  .timeline__item.is-active .timeline__label {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  body {
    padding-bottom: 4.25rem;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: clamp(1.5rem, 12vw, 3.75rem);
  }

  .brand__name {
    font-size: 0.92rem;
  }

  .cogs {
    width: clamp(84px, 24vw, 110px);
  }

  .levers__item {
    border-right: 0;
    width: 50%;
    border-bottom: 1px solid var(--line);
  }

  .levers__item:first-child {
    padding-left: clamp(0.9rem, 1.8vw, 1.5rem);
  }

  .levers__item:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-left: 0;
  }

  .levers__item:last-child {
    border-bottom: 0;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal],
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Uniform type
   Every text element renders at the same size.
   ========================================================================== */

:root {
  --fs: 1rem;
}

* {
  font-size: var(--fs) !important;
}

