/* Rimi Lab home page. One typeface, Recursive, served from this site. No outside requests. */
@font-face {
  font-family: "Recursive";
  src: url("/assets/fonts/recursive.woff2") format("woff2");
  font-weight: 300 1000;
  font-display: swap;
}

:root {
  --paper: #eef3f1;
  --ink: #13232b;
  --soft: #4a5d66;
  --rule: #c5d3cf;
  --cobalt: #2348d8;
  --amber: #f2a900;
  --amber-ink: #8a5d00;
  --green: #0b7d62;
  --moon-dark: #c9d3d6;
  --moon-lit: #fdf6df;
  --focus: #2348d8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1b21;
    --ink: #e4edef;
    --soft: #a3b6bd;
    --rule: #2a3d44;
    --cobalt: #8ea6ff;
    --amber: #ffc13d;
    --amber-ink: #ffc13d;
    --green: #45d3ab;
    --moon-dark: #24343b;
    --moon-lit: #fdf3cf;
    --focus: #ffc13d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Recursive", ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: "CASL" 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
}
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--cobalt); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 16px; }

/* ------------------------------------------------------------------ header */
.top {
  display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; justify-content: space-between;
  max-width: 72rem; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px) 0;
}
.mark {
  font-size: 1.6rem; font-weight: 820; letter-spacing: -0.02em; text-decoration: none;
  font-variation-settings: "CASL" 1;
}
.mark .i { position: relative; }
/* The two dotless i's get their dots back as two coloured beads. */
.mark .i::after {
  content: ""; position: absolute; left: 50%; top: 0.08em; width: 0.26em; height: 0.26em; border-radius: 50%;
  transform: translateX(-50%);
}
.mark .i1::after { background: var(--cobalt); }
.mark .i2::after { background: var(--amber); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--soft); padding: 6px 0; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

main { max-width: 72rem; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
section { padding: clamp(48px, 8vw, 96px) 0 0; }
h1, h2, h3 { font-variation-settings: "CASL" 1; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 780; line-height: 1.1; margin-bottom: 18px; }
h3 { font-size: 1.3rem; font-weight: 720; line-height: 1.25; }
p { margin: 0 0 1em; max-width: 64ch; }
.small { font-size: 0.92rem; color: var(--soft); }

/* ------------------------------------------------------------------ hero */
.hero { padding-top: clamp(40px, 9vw, 110px); }
.hero h1 {
  font-size: clamp(2.7rem, 8.4vw, 6.2rem); font-weight: 860; line-height: 0.98; letter-spacing: -0.035em;
  max-width: 12ch; margin-bottom: clamp(28px, 4vw, 44px);
}
.play {
  font-size: clamp(1.3rem, 2.7vw, 2.05rem); line-height: 1.5; max-width: 38ch; font-weight: 420;
  font-variation-settings: "CASL" 0.4;
}
.num {
  color: var(--cobalt); font-weight: 760; font-variant-numeric: tabular-nums;
  border-bottom: 3px dotted currentColor; cursor: ew-resize; touch-action: none; user-select: none;
  padding: 0 0.08em; border-radius: 3px;
}
.num:hover, .num.dragging { background: color-mix(in srgb, var(--cobalt) 12%, transparent); }
.num.weak { color: var(--amber-ink); }
.result { font-weight: 800; white-space: nowrap; }

.bars { display: grid; gap: 6px; max-width: 46rem; margin: 26px 0 14px; }
.bar { display: grid; grid-template-columns: minmax(7.5rem, 11rem) 1fr; align-items: center; gap: 12px; font-size: 0.9rem; }
.bar-name { color: var(--soft); }
.bar-track { position: relative; height: 26px; }
.bar-fill {
  position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 2px 6px 6px 2px; min-width: 3px;
  transition: width 0.35s cubic-bezier(.2,.8,.2,1);
}
.bar-count { position: absolute; top: 50%; transform: translateY(-50%); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }
.bar.after-weak .bar-fill { background: var(--amber); }
@media (prefers-reduced-motion: reduce) { .bar-fill { transition: none; } }
.hint { font-size: 0.92rem; color: var(--soft); }
.lede { font-size: 1.15rem; margin-top: 28px; }

/* ------------------------------------------------------------------ labs */
.lab-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.lab {
  display: grid; grid-template-columns: 72px 1fr; gap: 22px; align-items: start;
  padding: 26px 0; border-bottom: 1px solid var(--rule);
}
.glyph { width: 64px; height: 64px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lab-mba .glyph { stroke: var(--cobalt); }
.lab-mba .glyph rect { fill: color-mix(in srgb, var(--cobalt) 18%, transparent); }
.lab-models .glyph { stroke: var(--green); }
.lab-models .glyph circle { fill: var(--green); stroke: none; }
.lab-cosmos .glyph { stroke: var(--amber-ink); }
.lab-cosmos .glyph circle:last-child { fill: var(--amber); stroke: none; }
.lab-compass .glyph { stroke: var(--ink); }
.lab-compass .glyph path { fill: var(--ink); stroke: none; }
.lab h3 a { text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.25s; }
.lab h3 a:hover, .lab h3 a:focus-visible { background-size: 100% 2px; color: inherit; }
.lab h3 a::after { content: ""; position: absolute; inset: 0; }
.lab { position: relative; }
.lab p { margin: 6px 0 0; color: var(--soft); }
@media (prefers-reduced-motion: reduce) { .lab h3 a { transition: none; } }

/* ------------------------------------------------------------------ moon */
.moon { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.moon-art svg { width: 100%; height: auto; display: block; }
.moon-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 18px 0 20px; }
.moon-facts dt { color: var(--soft); }
.moon-facts dd { margin: 0; font-weight: 680; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ privacy and support */
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; max-width: 64ch; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 0.5em; width: 12px; height: 7px;
  border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg);
}
.support p { font-size: 1.15rem; }

.foot { max-width: 72rem; margin: clamp(56px, 8vw, 96px) auto 0; padding: 22px clamp(16px, 4vw, 40px) 40px; border-top: 1px solid var(--rule); color: var(--soft); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
.foot p { margin: 0; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 640px) {
  .lab { grid-template-columns: 48px 1fr; gap: 16px; }
  .glyph { width: 46px; height: 46px; }
  .moon { grid-template-columns: 1fr; }
  .moon-art { max-width: 220px; }
  .bar { grid-template-columns: 6.6rem 1fr; }
}

/* ------------------------------------------------------------------ licences page */
.doc { max-width: 46rem; padding-top: 40px; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 820; margin-bottom: 20px; }
.doc h2 { font-size: 1.35rem; margin: 28px 0 8px; }
