/*
 * Trove's page.
 *
 * Same vocabulary as the extension: graphite ground, aqua for the tether,
 * amber for divergence, mono for anything the filesystem produced. The page
 * should look like it was made by the same hand as the thing it describes.
 */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/archivo-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/archivo-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/archivo-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  --void: #0e1014;
  --panel: #171a20;
  --raise: #1f232b;
  --raise2: #262b34;
  --rule: #2a303a;
  --bone: #e9e7e2;
  --dim: #7c8492;
  --dimmer: #585f6b;
  --tether: #5fd3bc;
  --moved: #e5a93c;
  --sever: #e0664e;
  --paper: #f7f5f0;
  --ink: #14161b;
  --ui: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  --motion: 420ms cubic-bezier(0.2, 0, 0.15, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font: 400 16px/1.65 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--tether);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--mono);
}

.eyebrow {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dimmer);
}

/* ── Nav ───────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--gutter);
  background: rgba(14, 16, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 700 17px/1 var(--ui);
  color: var(--bone);
}

.nav .brand:hover {
  text-decoration: none;
}

.nav .spacer {
  flex: 1;
}

.nav a.link {
  color: var(--dim);
  font-size: 13.5px;
}

.nav a.link:hover {
  color: var(--bone);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--raise);
  color: var(--bone);
  font-size: 13.5px;
  transition: background var(--motion), border-color var(--motion), transform var(--motion);
}

.btn:hover {
  background: var(--raise2);
  border-color: var(--dimmer);
  text-decoration: none;
}

.btn-tether {
  background: var(--tether);
  border-color: transparent;
  color: var(--ink);
  font-weight: 600;
}

.btn-tether:hover {
  background: #74dcc7;
  border-color: transparent;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(56px, 11vh, 120px) 0 clamp(40px, 8vh, 88px);
  position: relative;
}

/* A wash of aqua behind the fold, the only ornament on the page. */
.hero::before {
  content: '';
  position: absolute;
  inset: -30% 30% 40% -10%;
  background: radial-gradient(closest-side, rgba(95, 211, 188, 0.09), transparent 72%);
  pointer-events: none;
}

.hero h1 {
  margin: 0;
  font: 700 clamp(38px, 6.4vw, 76px) / 1.02 var(--ui);
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.hero h1 .kept {
  color: var(--tether);
}

.hero .lede {
  margin: 22px 0 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--dim);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero .note {
  margin-top: 18px;
  font: 400 12px/1.6 var(--mono);
  color: var(--dimmer);
}

/* ── The signature: a tether that draws itself ─────────────────────────── */

.demo {
  margin: clamp(40px, 7vh, 72px) 0 0;
  padding: 26px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
}

.demo-rows {
  display: grid;
  gap: 2px;
}

.demo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px minmax(190px, 240px);
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  background: transparent;
  transition: background var(--motion);
}

.demo-row:hover {
  background: var(--raise);
}

.demo-row[data-state='moved'] {
  border-left-color: var(--moved);
}

.demo-name {
  font: 400 13px/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.demo-size {
  font: 400 11.5px/1 var(--mono);
  color: var(--dim);
  text-align: right;
}

.tether {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 400 10.5px/1.3 var(--mono);
}

.tether .node {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tether);
  transform: scale(0);
  transition: transform 320ms cubic-bezier(0.2, 0, 0.2, 1);
}

.tether .wire {
  flex: 1 1 0;
  height: 1px;
  min-width: 14px;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--tether), rgba(95, 211, 188, 0.16));
  transition: transform 620ms cubic-bezier(0.2, 0, 0.2, 1);
}

.tether .lbl {
  flex: 0 0 auto;
  color: var(--tether);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 360ms ease-out;
}

.tether[data-state='moved'] .node {
  background: var(--moved);
}

.tether[data-state='moved'] .wire {
  background: none;
  border-top: 1px dashed var(--moved);
  opacity: 0.75;
}

.tether[data-state='moved'] .lbl {
  color: var(--moved);
}

/* The draw sequence: node, then wire, then label. */
.demo.in .tether .node {
  transform: scale(1);
}

.demo.in .tether .wire {
  transform: scaleX(1);
}

.demo.in .tether .lbl {
  opacity: 1;
}

.demo-rows > *:nth-child(1) .node { transition-delay: 120ms }
.demo-rows > *:nth-child(1) .wire { transition-delay: 240ms }
.demo-rows > *:nth-child(1) .lbl  { transition-delay: 780ms }
.demo-rows > *:nth-child(2) .node { transition-delay: 260ms }
.demo-rows > *:nth-child(2) .wire { transition-delay: 380ms }
.demo-rows > *:nth-child(2) .lbl  { transition-delay: 920ms }
.demo-rows > *:nth-child(3) .node { transition-delay: 400ms }
.demo-rows > *:nth-child(3) .wire { transition-delay: 520ms }
.demo-rows > *:nth-child(3) .lbl  { transition-delay: 1060ms }

.demo-caption {
  margin: 18px 4px 0;
  font-size: 13.5px;
  color: var(--dim);
}

.chip-repull {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--moved);
  color: var(--moved);
  font: 400 10px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Sections ──────────────────────────────────────────────────────────── */

section {
  padding: clamp(52px, 9vh, 104px) 0;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 12px 0 0;
  font: 700 clamp(26px, 3.4vw, 40px) / 1.12 var(--ui);
  letter-spacing: -0.022em;
  max-width: 26ch;
}

.section-lede {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: clamp(15px, 1.5vw, 17px);
}

/* ── Steps ─────────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 20px;
  margin-top: 42px;
}

.step {
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--panel);
}

/* Numbered because these genuinely are a sequence. */
.step .num {
  font: 400 11px/1 var(--mono);
  color: var(--tether);
  letter-spacing: 0.1em;
}

.step h3 {
  margin: 13px 0 8px;
  font: 600 17px/1.3 var(--ui);
}

.step p {
  margin: 0;
  color: var(--dim);
  font-size: 14.5px;
}

/* ── Shots ─────────────────────────────────────────────────────────────── */

.shot {
  margin-top: 38px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  padding: 14px 18px;
  border-top: 1px solid var(--rule);
  color: var(--dim);
  font-size: 13.5px;
}

.shot-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 38px;
  align-items: start;
}

.shot-pair .shot {
  margin-top: 0;
}

/* ── Colour vocabulary ─────────────────────────────────────────────────── */

.vocab {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 40px;
}

.word {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--panel);
}

.word .swatch {
  width: 34px;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.word h3 {
  margin: 0 0 7px;
  font: 600 16px/1.3 var(--ui);
}

.word p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}

.word code {
  font: 400 11px/1 var(--mono);
  color: var(--dimmer);
}

/* ── Rules list ────────────────────────────────────────────────────────── */

.rules {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.rules li {
  display: grid;
  grid-template-columns: minmax(150px, 210px) 1fr;
  gap: 22px;
  padding: 20px 4px;
  border-top: 1px solid var(--rule);
}

.rules li:last-child {
  border-bottom: 1px solid var(--rule);
}

.rules dt,
.rules .rule-name {
  font: 400 11.5px/1.5 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bone);
}

.rules .rule-body {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
}

/* ── Privacy ───────────────────────────────────────────────────────────── */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-top: 38px;
}

.fact {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--panel);
}

.fact .n {
  font: 500 26px/1 var(--mono);
  color: var(--tether);
}

.fact .l {
  margin-top: 9px;
  font-size: 13.5px;
  color: var(--dim);
}

/* ── Install ───────────────────────────────────────────────────────────── */

pre {
  margin: 28px 0 0;
  padding: 20px 22px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--panel);
  color: var(--bone);
  font: 400 13px/1.75 var(--mono);
}

pre .c {
  color: var(--dimmer);
}

/* ── Footer ────────────────────────────────────────────────────────────── */

footer {
  padding: 44px 0 56px;
  border-top: 1px solid var(--rule);
  color: var(--dimmer);
  font-size: 13.5px;
}

footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

footer .spacer {
  flex: 1;
}

/* ── Scroll reveal ─────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 560ms ease-out, transform 560ms cubic-bezier(0.2, 0, 0.15, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal[data-delay='1'] { transition-delay: 90ms }
.reveal[data-delay='2'] { transition-delay: 180ms }
.reveal[data-delay='3'] { transition-delay: 270ms }
.reveal[data-delay='4'] { transition-delay: 360ms }

/*
 * Anyone who has asked for less motion gets the finished state immediately,
 * rather than a shorter version of the same movement.
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .tether .node,
  .tether .wire,
  .tether .lbl {
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .demo-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .demo-size {
    text-align: left;
  }
  .rules li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/*
 * "Live" - a state, and this one genuinely is a live link back to something,
 * which is exactly what aqua is for.
 */
.live {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--tether);
  color: var(--tether);
  font: 400 10px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* Kept for the next time something is pending review. */
.pending {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--moved);
  color: var(--moved);
  font: 400 10px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}
