@charset "UTF-8";

/* ─────────────────────────────────────────────
   CODE — Raúl Salas
   Warm dark, quiet type, liquid glass.
   ───────────────────────────────────────────── */

:root {
  --bg: #0d0c0b;
  --ink: #f2ebdd;
  --ink-2: rgba(242, 235, 221, 0.66);
  --ink-3: rgba(242, 235, 221, 0.40);
  --ink-4: rgba(242, 235, 221, 0.18);
  --line: rgba(242, 235, 221, 0.08);
  --accent: #e3a66f;

  --glass: rgba(38, 33, 29, 0.42);
  --glass-hover: rgba(255, 246, 232, 0.05);
  --glass-edge: rgba(255, 246, 232, 0.10);
  --glass-shine: inset 0 1px 0 rgba(255, 250, 240, 0.12),
                 inset 0 -1px 0 rgba(0, 0, 0, 0.25),
                 inset 0 0 0 1px rgba(255, 246, 232, 0.06);
  --glass-drop: 0 1px 2px rgba(0, 0, 0, 0.2), 0 18px 50px -12px rgba(0, 0, 0, 0.55);
  --blur: blur(28px) saturate(170%) brightness(1.06);

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }

::selection { background: rgba(227, 166, 111, 0.35); color: var(--ink); }

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

/* ─── Ambient light (what the glass refracts) ─── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.ambient span:nth-child(1) {
  width: 46vmax; height: 46vmax;
  top: -18vmax; left: -10vmax;
  background: radial-gradient(circle, #a4532a 0%, transparent 65%);
  animation: drift-a 38s ease-in-out infinite alternate;
}

.ambient span:nth-child(2) {
  width: 40vmax; height: 40vmax;
  top: 30vh; right: -16vmax;
  background: radial-gradient(circle, #6e3340 0%, transparent 65%);
  opacity: 0.45;
  animation: drift-b 46s ease-in-out infinite alternate;
}

.ambient span:nth-child(3) {
  width: 36vmax; height: 36vmax;
  bottom: -20vmax; left: 20vw;
  background: radial-gradient(circle, #33544c 0%, transparent 65%);
  opacity: 0.4;
  animation: drift-c 52s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(14vw, 10vh) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-12vw, -14vh) scale(0.92); } }
@keyframes drift-c { to { transform: translate(-10vw, -8vh) scale(1.12); } }

/* Film grain: a bit of texture so it doesn't feel rendered */
.grain {
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Glass primitive ─── */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shine), var(--glass-drop);
}

/* Specular rim: light catching the top edge */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(170deg, rgba(255, 250, 240, 0.28), rgba(255, 250, 240, 0) 32%, rgba(255, 250, 240, 0) 70%, rgba(255, 250, 240, 0.08));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* ─── Dock (floating nav) ─── */
.dock {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  max-width: calc(100vw - 24px);
  view-transition-name: dock;
}

.dock-link,
.dock-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.dock-link:hover,
button.dock-crumb:hover {
  background: var(--glass-hover);
  color: var(--ink);
}

.dock-link svg { width: 14px; height: 14px; flex-shrink: 0; }

.dock-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
  flex-shrink: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  min-width: 0;
}

.crumb-slash { color: var(--ink-4); padding: 0 2px; }

.dock-crumb.is-current {
  color: var(--ink);
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 36px;
  max-width: 34vw;
}

.dock-lang {
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 0 12px;
}

.dock-human {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.25s var(--ease), transform 0.4s var(--ease);
}

.dock-human:hover { background: var(--glass-hover); transform: rotate(-8deg); }
.dock-human img { width: 24px; height: 24px; object-fit: contain; }

/* ─── Page shell ─── */
.page {
  width: min(1080px, 100% - 40px);
  margin: 0 auto;
  padding: 132px 0 64px;
}

/* ─── Catalog ─── */
.intro { max-width: 720px; margin-bottom: 72px; }

.display {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-optical-sizing: auto;
}

.display em {
  font-style: italic;
  color: var(--ink-2);
}

.lede {
  margin-top: 28px;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
}

.shelf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.search {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search svg {
  position: absolute;
  left: 0;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  padding: 6px 0 6px 26px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.search input::placeholder { color: var(--ink-3); }

.search input { -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search:focus-within svg { color: var(--ink); }

.shelf-count {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.shelf { display: flex; flex-direction: column; }

.shelf-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr auto 28px;
  align-items: baseline;
  gap: 20px;
  width: 100%;
  text-align: left;
  padding: 28px 22px;
  margin: 0 -22px;
  width: calc(100% + 44px);
  border-radius: var(--r-md);
  isolation: isolate;
  transition: transform 0.5s var(--ease);
}

/* The row becomes a pane of glass on hover */
.shelf-row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 246, 232, 0.035);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-shine), 0 14px 40px -18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}

.shelf li + li .shelf-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: var(--line);
  transition: opacity 0.3s;
}

button.shelf-row:hover::after,
button.shelf-row:focus-visible::after { opacity: 1; transform: scale(1); }

button.shelf-row:focus-visible { outline-offset: 0; }

.row-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.row-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 380;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  width: fit-content;
}

.row-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.row-desc {
  margin-top: 4px;
  max-width: 560px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
}

.row-meta {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}

.row-arrow {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  align-self: center;
  transition: transform 0.45s var(--ease), color 0.3s;
}

button.shelf-row:hover .row-arrow { transform: translateX(4px); color: var(--ink); }

.shelf-row.is-soon { cursor: default; }
.shelf-row.is-soon .row-title { color: var(--ink-2); }

.soon-tag {
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
  align-self: center;
}

.shelf-empty {
  padding: 40px 0;
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
}

.foot {
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
}

.foot a:hover { color: var(--ink); }

/* ─── Repo view ─── */
.repo-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px 32px;
  margin-bottom: 36px;
}

.back {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 14px;
  color: var(--ink-3);
  transition: color 0.25s, gap 0.35s var(--ease);
}

.back svg { width: 14px; height: 14px; }
.back:hover { color: var(--ink); gap: 12px; }

.repo-title { width: fit-content; outline: none; }

.repo-sub {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 17px;
  max-width: 560px;
}

.repo-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-3);
}

.repo-meta span + span::before { content: "·"; margin: 0 8px; color: var(--ink-4); }

/* Segmented control */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  min-width: 220px;
}

.seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: rgba(255, 246, 232, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.18), 0 4px 14px -4px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s var(--ease);
}

.segmented[data-active="code"] .seg-thumb { transform: translateX(100%); }

.seg-btn {
  position: relative;
  z-index: 1;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-3);
  transition: color 0.3s;
}

.seg-btn[aria-selected="true"] { color: var(--ink); }
.seg-btn:hover { color: var(--ink); }

/* ─── Read me ─── */
.readme {
  border-radius: var(--r-lg);
  padding: clamp(28px, 6vw, 72px) clamp(22px, 6vw, 72px);
}

.prose {
  max-width: 660px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

.prose > * + * { margin-top: 1.1em; }

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 2.2em;
}

.prose h2:first-child { margin-top: 0; }

.prose strong { color: var(--ink); font-weight: 500; }

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(255, 246, 232, 0.06);
  color: var(--ink);
}

.prose pre {
  margin-top: 1.4em;
  padding: 18px 22px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.prose pre .c { color: var(--ink-3); }

.prose dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 24px;
  margin-top: 1.4em;
}

.prose dt { font-family: var(--mono); font-size: 14px; color: var(--ink); padding-top: 2px; }
.prose dd { margin: 0; }

.prose .aside {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2);
  padding-left: 20px;
  border-left: 1px solid var(--ink-4);
}

/* Figures (generated SVG previews) */
.figures {
  display: grid;
  gap: 40px;
  margin: 2.4em 0 0;
}

.figure img { width: 100%; height: auto; }

.figure-frame {
  border-radius: var(--r-md);
  padding: clamp(14px, 3vw, 24px);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}

.figure-frame.stack { display: grid; gap: 14px; }

.figure-frame.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.figure-frame.tags img { height: 22px; width: auto; }

.figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
}

.figure figcaption code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  background: none;
  padding: 0;
}

/* ─── Code explorer ─── */
.explorer {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: min(76vh, 860px);
  min-height: 460px;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.files {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
}

.files-label {
  font-size: 12px;
  color: var(--ink-3);
  padding: 0 12px 10px;
}

.file,
.folder-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
}

.file:hover,
.folder-toggle:hover { background: var(--glass-hover); color: var(--ink); }

.file[aria-current="true"] {
  background: rgba(255, 246, 232, 0.08);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.08);
}

.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-ext {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
}

.folder-toggle { color: var(--ink-3); margin-top: 6px; }

.folder-toggle svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.folder[data-open="false"] .folder-toggle svg { transform: rotate(-90deg); }
.folder[data-open="false"] .folder-list { display: none; }

.folder-count { margin-left: auto; font-size: 11px; color: var(--ink-4); }

.folder-list { padding-left: 14px; margin-left: 12px; border-left: 1px solid var(--line); }

.viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px 12px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.viewer-file {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-stats {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: rgba(255, 246, 232, 0.05);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 250, 240, 0.08);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { background: rgba(255, 246, 232, 0.1); color: var(--ink); }
.copy-btn.is-done { color: #b9d3a3; }

.code-scroll {
  flex: 1;
  display: flex;
  overflow: auto;
  min-height: 0;
  background: rgba(0, 0, 0, 0.16);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
}

.gutter {
  position: sticky;
  left: 0;
  display: block;
  text-align: right;
  white-space: pre;
  padding: 18px 14px 18px 18px;
  min-width: 56px;
  height: fit-content;
  min-height: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-4);
  user-select: none;
  background: rgba(16, 14, 13, 0.9);
  flex-shrink: 0;
}

.code-pre {
  flex: 1;
  padding: 18px 28px 18px 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: #ddd3c2;
  tab-size: 4;
  white-space: pre;
}

/* Warm, quiet syntax colours */
.tok-kw { color: #e3a66f; }
.tok-str { color: #b9cf9c; }
.tok-fn { color: #f1e4c8; }
.tok-builtin { color: #d9a0a0; }
.tok-num { color: #d6b56e; }
.tok-comment { color: var(--ink-3); font-style: italic; }
.tok-tag { color: #e3a66f; }
.tok-attr { color: #c9b08a; }

/* ─── Made in Human modal ─── */
.human-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 7, 6, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.human-modal-backdrop.active { opacity: 1; visibility: visible; }

.human-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 95;
  width: min(560px, 100% - 32px);
  height: fit-content;
  max-height: 88vh;
  padding: 0;
  color: var(--ink);
  border-radius: var(--r-lg);
  background: rgba(30, 26, 23, 0.6);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shine), 0 40px 90px -20px rgba(0, 0, 0, 0.7);
  display: none;
  overflow: hidden;
}

.human-modal[open],
.human-modal.active {
  display: block;
  animation: modal-in 0.5s var(--ease);
}

.human-modal::backdrop { display: none; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.human-modal-inner { padding: 32px 36px 36px; max-height: 88vh; overflow-y: auto; }

.human-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.human-modal-brand { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.human-modal-avatar { width: 32px; height: 32px; object-fit: contain; }

.human-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: background 0.2s, color 0.2s;
}

.human-modal-close:hover { background: var(--glass-hover); color: var(--ink); }
.human-modal-close svg { width: 14px; height: 14px; }

.human-modal-title {
  font-family: var(--serif);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.human-modal-body p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.human-modal-body p + p { margin-top: 14px; }
.human-modal-body strong { color: var(--ink); font-weight: 500; }

.human-modal-sign {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ─── View transitions ─── */
::view-transition-group(root) { animation-duration: 0.45s; animation-timing-function: var(--ease); }

::view-transition-group(repo-title) { animation-duration: 0.55s; animation-timing-function: var(--ease); }

::view-transition-old(repo-title),
::view-transition-new(repo-title) { height: 100%; }

html:active-view-transition-type(forward)::view-transition-old(root) { animation-name: vt-out-left; }
html:active-view-transition-type(forward)::view-transition-new(root) { animation-name: vt-in-right; }
html:active-view-transition-type(backward)::view-transition-old(root) { animation-name: vt-out-right; }
html:active-view-transition-type(backward)::view-transition-new(root) { animation-name: vt-in-left; }

@keyframes vt-out-left  { to   { opacity: 0; transform: translateX(-24px); } }
@keyframes vt-in-right  { from { opacity: 0; transform: translateX(24px); } }
@keyframes vt-out-right { to   { opacity: 0; transform: translateX(24px); } }
@keyframes vt-in-left   { from { opacity: 0; transform: translateX(-24px); } }

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .page { padding-top: 112px; }
  .intro { margin-bottom: 52px; }

  .shelf-row { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 24px 18px; margin: 0 -18px; width: calc(100% + 36px); }
  .row-num { display: none; }
  .row-meta { grid-column: 1; grid-row: 2; }
  .row-arrow, .soon-tag { grid-column: 2; grid-row: 1; }

  .repo-head { grid-template-columns: 1fr; }
  .segmented { justify-self: start; }

  .explorer { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .files { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .code-scroll { height: 64vh; }
}

@media (max-width: 560px) {
  .page { width: calc(100% - 28px); }
  .dock { top: 12px; }
  .dock-link.home span { display: none; }
  .dock-link, .dock-crumb { padding: 0 11px; }
  .dock-crumb.is-current { max-width: 40vw; }
  .lede { font-size: 16.5px; }
  .prose { font-size: 16px; }
  .prose dl { grid-template-columns: 1fr; gap: 2px; }
  .prose dd { margin-bottom: 10px; }
  .viewer-stats { display: none; }
  .foot { flex-direction: column; }
  .human-modal-inner { padding: 24px 22px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient span { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
