:root {
  --night: #172131;    /* page */
  --deep: #1f2c40;     /* raised surfaces */
  --rule: #33445e;     /* lines and borders */
  --chalk: #e7ecf3;    /* main text */
  --dust: #93a3bb;     /* secondary text */
  --amber: #f2b33d;    /* the one accent */
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --measure: 66ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font: 1.0625rem/1.6 var(--body);
}
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--amber); color: var(--night); padding: 6px 10px; z-index: 10; }

/* ---- header / footer ---- */
.site-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px;
  max-width: 1120px; margin: 0 auto; padding: 22px 24px;
  border-bottom: 1px solid var(--rule);
}
.brand { font: 700 1.25rem/1 var(--display); text-decoration: none; letter-spacing: -0.01em; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-head nav a { color: var(--dust); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.site-head nav a:hover { color: var(--chalk); }
.site-head nav a[aria-current="page"] { color: var(--chalk); border-bottom-color: var(--amber); }

main { max-width: 1120px; margin: 0 auto; padding: 0 24px 64px; }

.site-foot {
  max-width: 1120px; margin: 0 auto; padding: 24px;
  border-top: 1px solid var(--rule); color: var(--dust); font-size: 0.9rem;
}

/* ---- type ---- */
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw + 1rem, 5.2rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 700; }
.lede { font-size: 1.2rem; color: var(--dust); max-width: 48ch; margin: 16px 0 0; }

/* ---- hero with the tangent diagram ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center; gap: 24px; padding: 48px 0 24px;
}
.hero-hint { color: var(--dust); margin-top: 28px; font-size: 0.95rem; }

.diagram { width: 100%; height: auto; overflow: visible; }
.diagram .core { fill: none; stroke: var(--rule); stroke-width: 2; }
.tan line { stroke: var(--dust); stroke-width: 2; }
.tan .touch { fill: var(--night); stroke: var(--dust); stroke-width: 2; }
.tan .end { fill: var(--dust); }
.tan text { fill: var(--chalk); font: 700 19px var(--display); }
.tan { outline: none; }
.tan:hover line, .tan:focus-visible line { stroke: var(--amber); stroke-width: 3; }
.tan:hover .touch, .tan:focus-visible .touch { stroke: var(--amber); fill: var(--amber); }
.tan:hover .end, .tan:focus-visible .end { fill: var(--amber); }
.tan:hover text, .tan:focus-visible text { fill: var(--amber); }
.tan:focus-visible text { text-decoration: underline; }

/* the one page-load moment: lines draw out from the circle */
@media (prefers-reduced-motion: no-preference) {
  .tan line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.7s ease-out forwards; animation-delay: calc(0.25s + var(--i) * 0.09s); }
  .tan text, .tan .end { opacity: 0; animation: show 0.3s ease-out forwards; animation-delay: calc(0.75s + var(--i) * 0.09s); }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes show { to { opacity: 1; } }
}

/* ---- lists of assets ---- */
.recent { margin-top: 40px; }
.recent h2 { margin-bottom: 8px; }
.section-head { padding: 48px 0 28px; }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { border-bottom: 1px solid var(--rule); }
.row > a {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 14px 4px; text-decoration: none;
}
.row > a:hover .row-title { color: var(--amber); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--deep); }
.thumb-empty {
  display: grid; place-items: center; font: 800 1.6rem var(--display); color: var(--dust);
  border: 1px solid var(--rule);
}
.row-text { display: grid; gap: 2px; }
.row-title { font: 700 1.2rem/1.25 var(--display); }
.row-sum { color: var(--dust); }
.row-meta { display: grid; justify-items: end; color: var(--dust); font-size: 0.9rem; white-space: nowrap; }

.empty { padding: 28px 0; color: var(--dust); max-width: var(--measure); }
.empty p:first-child { color: var(--chalk); font-size: 1.15rem; }

/* ---- folders inside a section ---- */
.group { margin-top: 8px; }
.group + .group { margin-top: 40px; }
.group h2 { margin-bottom: 8px; }
.section-intro { margin-top: 20px; color: var(--chalk); }
.section-head .crumb { margin-bottom: 12px; }
.thumb-folder { position: relative; border: 1px solid var(--rule); background: var(--deep); }
/* a folder drawn as a circle with a tangent: the site's mark at row size */
.thumb-folder::before {
  content: ""; position: absolute; left: 50%; top: 54%; width: 46%; height: 46%;
  transform: translate(-50%, -50%); border: 2px solid var(--dust); border-radius: 50%;
}
.thumb-folder::after {
  content: ""; position: absolute; left: 18%; right: 14%; top: 31%; height: 2px;
  background: var(--amber); border-radius: 2px;
}
.row-folder > a:hover .thumb-folder::before { border-color: var(--chalk); }

/* ---- single asset page ---- */
.asset { max-width: 760px; padding-top: 40px; }
.crumb { margin: 0 0 12px; }
.crumb a { color: var(--dust); }
.asset h1 { font-size: clamp(2.2rem, 4vw + 1rem, 3.8rem); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.btn {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: var(--amber); color: var(--night); font: 700 1.05rem var(--display);
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
}
.btn:hover { background: #ffc85e; }
.btn-note { font: 400 0.85rem var(--body); opacity: 0.8; }
.btn-quiet { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn-quiet:hover { background: var(--deep); }
.hero-img { display: block; width: 100%; border-radius: 10px; margin: 8px 0 24px; }

.prose { max-width: var(--measure); }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 0.4em; }
.prose a { color: var(--amber); }
.prose code { background: var(--deep); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }
.prose pre { background: var(--deep); padding: 16px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 1em 0; padding-left: 16px; border-left: 3px solid var(--amber); color: var(--dust); }

.facts { display: flex; flex-wrap: wrap; gap: 8px 40px; margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.facts dt { color: var(--dust); font-size: 0.9rem; }
.facts dd { margin: 0; }

/* ---- small screens ---- */
@media (max-width: 760px) {
  main, .site-head, .site-foot { padding-left: 16px; padding-right: 16px; }
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .diagram { max-width: 480px; margin: 0 auto; }
  .tan text { font-size: 25px; }
  .row > a { grid-template-columns: 48px minmax(0, 1fr); }
  .thumb { width: 48px; height: 48px; }
  .row-meta { grid-column: 2; justify-items: start; display: flex; gap: 12px; }
}
