/* tweek.fyi. Terminal-native, same family as aprescyber.com: JetBrains Mono for the chrome,
   Geist for names. Every color is a token from themes.css, so a theme restyles the whole page. */

@font-face {
  font-family: 'JetBrains Mono';
  src: url(/assets/fonts/jetbrains-mono.woff2) format('woff2');
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url(/assets/fonts/geist.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --max: 1080px;
  --gutter: clamp(16px, 4vw, 28px);
  --r: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--text);
  font: 400 14.5px/1.65 var(--mono);
  font-feature-settings: 'calt' 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brand); color: var(--brand-ink); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border-strong); }
.skip:focus { top: 12px; }
.ps1 { color: var(--brand); }

/* Header */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.logo { display: inline-flex; align-items: center; font: 600 15px/1 var(--mono); letter-spacing: -.02em; }
.logo .ps1 { margin-right: 8px; }
.logo .dim { color: var(--muted); font-weight: 400; }
.cursor { width: 8px; height: 15px; margin-left: 4px; background: var(--brand); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.top-right { display: flex; align-items: center; gap: 8px; }
.jump { display: flex; gap: 4px; }
.icon-btn {
  display: none; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
.js .icon-btn { display: inline-grid; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-2); color: var(--brand); }
.icon-btn:active { transform: scale(.94); }
kbd {
  font: 500 .86em/1 var(--mono);
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}
.jump a { padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); transition: background-color .15s, color .15s; }
.jump a:hover { background: var(--surface-2); color: var(--text); }

/* Hero */

.hero { padding: clamp(40px, 9vw, 96px) 0 clamp(36px, 6vw, 64px); }
.cmd { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
h1 { font: 600 clamp(44px, 9vw, 84px)/1 var(--sans); letter-spacing: -.045em; text-wrap: balance; }
.handle { margin-top: 14px; font-size: 16px; color: var(--brand); }
.lede { margin-top: 22px; max-width: 46ch; font-size: 15.5px; color: var(--text-2); }

/* Sections */

main { flex: 1; }
.tier { padding-bottom: clamp(40px, 6vw, 64px); scroll-margin-top: 16px; }
.label { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font: 500 13px/1 var(--mono); color: var(--muted); letter-spacing: 0; }
.label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-repos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 920px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4, .grid-repos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .grid-4, .grid-repos { grid-template-columns: 1fr; }
  .jump { display: none; }
}
.grid > li { display: flex; }

/* Cards */

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px; width: 100%;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color .15s, transform .2s var(--ease), background-color .15s;
}
.card:hover { border-color: var(--brand); background: var(--surface-2); transform: translateY(-2px); }
.card:active { transform: translateY(0); }
.kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.card h3 { font: 600 17px/1.25 var(--sans); letter-spacing: -.01em; margin-top: 2px; }
.card .tag { font-size: 13px; color: var(--text-2); }
.card .desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.card .url { margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--text-2); overflow-wrap: break-word; }
.card:hover .url, .card:hover .arr { color: var(--brand); }
.card .arr { position: absolute; top: 16px; right: 16px; margin: 0; color: var(--muted); }

.card-more { background: transparent; border-style: dashed; }

.card-lg { padding: 24px 22px 20px; gap: 8px; }
.card-lg h3 { font-size: 22px; letter-spacing: -.02em; }
.card-lg .tag { font-size: 14px; color: var(--brand); }
.card-lg .desc { font-size: 13.5px; }

.arr { display: inline-block; margin-left: 6px; transition: transform .2s var(--ease); }
a:hover .arr { transform: translate(2px, -2px); }

/* Find me */

/* Two columns on wide screens. The 1px gap shows the container's border color as the dividers;
   an odd last item spans both columns so no empty cell shows. */
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--border); border-radius: var(--r); background: var(--border); overflow: hidden; }
.links li { background: var(--surface); min-width: 0; }
.links li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 720px) { .links { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .links a { gap: 12px; padding: 14px 16px; font-size: 13.5px; } }
.links a { display: flex; align-items: baseline; gap: 16px; padding: 14px 18px; transition: background-color .15s; }
.links a:hover { background: var(--surface-2); }
.links .net { width: 9ch; flex-shrink: 0; color: var(--muted); }
.links .who { color: var(--text); overflow-wrap: anywhere; }
.links .arr { margin-left: auto; color: var(--muted); }
.links a:hover .who, .links a:hover .arr { color: var(--brand); }

/* Footer */

.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 32px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.foot a:hover { color: var(--brand); }
.foot-right { display: flex; gap: 20px; }
.foot-keys { display: none; }
.js .foot-keys { display: inline; }
@media (max-width: 520px) { .js .foot-keys { display: none; } }

/* Theme toast: shown once, on the first visit */

.toast {
  position: fixed; top: 64px; right: 16px; z-index: 60;
  width: min(296px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / .45);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast-body {
  display: flex; gap: 12px; align-items: flex-start; width: 100%;
  padding: 16px 40px 16px 16px;
  text-align: left; font: 13px/1.6 var(--mono); color: var(--text-2);
  background: none; border: 0; cursor: pointer;
}
.toast-body > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--brand); }
.toast-body strong { display: block; margin-bottom: 4px; font: 600 15px/1.3 var(--sans); color: var(--text); }
.toast-x { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; padding: 4px; background: none; border: 0; cursor: pointer; color: var(--muted); }
.toast-x svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.toast-x:hover { color: var(--text); }

/* Theme picker: a carousel of mini previews, each in its own palette */

html.picker-open { overflow: hidden; }
.picker { position: fixed; inset: 0; z-index: 100; display: none; outline: none; }
.picker.open { display: grid; grid-template-rows: 1fr auto; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }
.picker-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.picker-stage { --card-w: min(560px, 72vw, 90vh); position: relative; min-height: 0; touch-action: pan-y; }
.picker-track { position: absolute; left: 50%; top: 52%; width: 0; height: 0; }
.picker-card {
  position: absolute; left: 0; top: 0;
  width: var(--card-w); aspect-ratio: 16 / 10;
  padding: 0; border: 0; overflow: hidden; background: none;
  border-radius: 10px; cursor: pointer;
  box-shadow: 0 30px 80px -25px rgb(0 0 0 / .65);
  transition: transform .55s cubic-bezier(.2, .85, .2, 1), opacity .45s, box-shadow .3s;
}
.picker-card.active { box-shadow: 0 0 0 3px var(--brand), 0 40px 110px -25px rgb(0 0 0 / .75); }
.picker-arrow {
  position: absolute; top: 52%; z-index: 30;
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  transform: translateY(-50%); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.picker-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.picker-arrow:hover { color: var(--brand); border-color: var(--brand); }
.picker-arrow.prev { left: 20px; }
.picker-arrow.next { right: 20px; }
.picker-caption { position: relative; padding: 0 20px 7vh; text-align: center; }
.picker-name { margin-bottom: 4px; font: 600 clamp(28px, 4.4vw, 44px)/1.1 var(--sans); letter-spacing: -.03em; color: var(--text); }
.picker-kind { margin-bottom: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.picker-hint { font-size: 13px; color: var(--text-2); }
@media (max-width: 520px) {
  .picker-arrow { top: auto; bottom: calc(7vh + 4px); transform: none; }
  .picker-hint { display: none; }
}

/* Mini preview of this page. Sized in cqw so it scales with its card. cqw resolves against an
   ancestor container, so .mini is the container and .mini-in carries the sized box. */

.mini { container-type: inline-size; display: block; width: 100%; height: 100%; }
.mini-in {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: 3.2cqw;
  padding: 4cqw 6cqw;
  overflow: hidden; text-align: left;
  font-family: var(--mono); color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) .25cqw, transparent .3cqw);
  background-size: 3.6cqw 3.6cqw;
}
.mini-top { display: flex; align-items: center; justify-content: space-between; font-size: 2.6cqw; font-weight: 600; }
.mini-top em { font-style: normal; color: var(--brand); margin-right: 1cqw; }
.mini-top i { display: inline-block; width: 1.3cqw; height: 2.6cqw; margin-left: .6cqw; vertical-align: middle; background: var(--brand); }
.mini-top .dim { color: var(--muted); font-weight: 400; }
.mini-nav { display: flex; gap: 2cqw; }
.mini-nav b { width: 6cqw; height: .9cqw; border-radius: .3cqw; background: var(--text-2); opacity: .5; }
.mini-hero { display: flex; flex-direction: column; gap: 1.2cqw; padding-top: 2cqw; }
.mini-name { font: 600 8.5cqw/1 var(--sans); letter-spacing: -.045em; }
.mini-handle { font-size: 2.6cqw; color: var(--brand); }
.mini-row { display: grid; gap: 1.6cqw; }
.mini-row.r3 { grid-template-columns: repeat(3, 1fr); }
.mini-row.r4 { grid-template-columns: repeat(4, 1fr); }
.mini-row i {
  display: flex; flex-direction: column; gap: .9cqw;
  padding: 1.8cqw;
  background: var(--surface); border: .2cqw solid var(--border); border-radius: .8cqw;
}
.mini-row i::before { content: ''; width: 55%; height: 1.4cqw; border-radius: .3cqw; background: var(--text); opacity: .85; }
.mini-row i::after { content: ''; width: 75%; height: .9cqw; border-radius: .3cqw; background: var(--brand); }
.mini-row.r3 i { min-height: 13cqw; }
.mini-row.r3 i:first-child { border-color: var(--brand); }
.mini-row.r4 i::after { background: var(--muted); }

/* Theme switch: the new theme scans down over the old one (themes.js animates the clip). */

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* 404 */

.lost { flex: 1; display: grid; align-content: center; gap: 14px; padding-bottom: 12vh; }
.lost h1 { font-size: clamp(36px, 7vw, 56px); }
.lost p { color: var(--text-2); }
.lost a { color: var(--brand); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .card, .arr, .picker-card, .toast { transition: none; }
  .card:hover { transform: none; }
  .picker.open { animation: none; }
}
