/* thrulinehq.com — chrome: tokens, header, footer, the index (⌘K), buttons.
   Self-contained and namespaced (tl-/tlh-/tlf-/tlk-) so the research posts, which keep their own
   article styles, can carry the same header and footer without inheriting the rest of the site. */
:root {
  --bg: #050506; --bg1: #0a0a0b; --bg2: #111113; --bg3: #18181b;
  --line: #1f1f23; --line2: #2e2e35;
  --fg: #ededef; --mut: #9a9aa4; --dim: #6b6b76;
  --or: #ff7a29; --or2: #ffa063; --or-dim: rgba(255, 122, 41, .14);
  --gr: #3ddc84; --rd: #ff5d52; --am: #ffc53d;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --gut: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --hh: 60px;
}

/* ---------- buttons ---------- */
.tl-btn {
  --b: var(--line2);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; box-sizing: border-box;
  font: 600 14px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: var(--fg); background: transparent; border: 1px solid var(--b); border-radius: 2px; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tl-btn:hover { border-color: var(--fg); background: rgba(255, 255, 255, .05); }
.tl-btn:active { transform: translateY(1px); }
.tl-btn-or { color: #000; background: var(--or); border-color: var(--or); }
.tl-btn-or:hover { background: var(--or2); border-color: var(--or2); }
.tl-btn-sm { min-height: 38px; padding: 0 14px; font-size: 12.5px; }
.tl-btn-lg { min-height: 56px; padding: 0 28px; font-size: 15px; }
.tl-btn svg { width: 16px; height: 16px; flex: none; }
.tl-btn .arr { transition: transform .25s var(--ease); }
.tl-btn:hover .arr { transform: translateX(4px); }
:where(.tlh, .tlf, .tlk, .tl-news) a:focus-visible, .tl-btn:focus-visible, :where(.tlh, .tlk) button:focus-visible {
  outline: 2px solid var(--or); outline-offset: 3px; border-radius: 2px;
}

.tl-skip { position: fixed; left: 12px; top: -80px; z-index: 300; padding: 12px 16px; background: var(--or); color: #000; font: 600 14px/1 var(--mono); text-decoration: none; }
.tl-skip:focus { top: 12px; }

/* ---------- the line above the header: the newest post ---------- */
.tl-news { position: relative; display: block; background: var(--or); color: #000; font: 500 12.5px/1.3 var(--mono); letter-spacing: .01em; }
.tl-news a { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px var(--gut); color: inherit; text-decoration: none; text-align: center; }
.tl-news b { font-weight: 700; }
.tl-news a:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- header ---------- */
.tlh {
  position: sticky; top: 0; z-index: 100; height: var(--hh); box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 var(--gut);
  font-family: var(--sans); color: var(--fg);
  background: rgba(5, 5, 6, .72); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.tlh::after { /* scroll progress: the thru-line */
  content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--or);
  transform-origin: 0 50%; transform: scaleX(var(--tl-progress, 0));
}
.tlh-nav { display: flex; align-items: center; gap: 2px; }
.tlh-nav a { position: relative; padding: 9px 12px; color: var(--mut); text-decoration: none; font: 500 13px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase; transition: color .15s; }
.tlh-nav a:hover, .tlh-nav a[aria-current] { color: var(--fg); }
.tlh-nav a[aria-current]::before { content: ''; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; background: var(--or); }
.tlh-act { display: flex; align-items: center; gap: 10px; }
.tlh-k {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; box-sizing: border-box;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 2px; color: var(--mut); font: 500 12.5px/1 var(--mono); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tlh-k:hover { border-color: var(--line2); color: var(--fg); }
.tlh-k kbd { font: 500 11px/1 var(--mono); padding: 4px 5px; border: 1px solid var(--line2); border-radius: 2px; color: var(--mut); }
.tlh-burger { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; background: none; border: 1px solid var(--line); border-radius: 2px; color: var(--fg); cursor: pointer; }
.tlh-burger svg { width: 18px; height: 18px; }
@media (max-width: 1080px) {
  .tlh-nav { display: none; }
  .tlh-burger { display: inline-flex; }
  .tlh-k { display: none; }
}
@media (max-width: 520px) { .tlh-act .tl-btn { display: none; } }

/* ---------- the index: every page, one keystroke (⌘K, /, or the menu button) ---------- */
.tlk { position: fixed; inset: 0; z-index: 200; display: none; font-family: var(--sans); color: var(--fg); }
.tlk[open], .tlk.is-open { display: block; }
.tlk [hidden] { display: none !important; }
.tlk-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: tlk-fade .18s var(--ease); }
.tlk-panel {
  position: absolute; left: 50%; top: min(12vh, 110px); width: min(720px, calc(100vw - 24px)); max-height: min(76vh, 720px); transform: translateX(-50%);
  display: flex; flex-direction: column; background: var(--bg1); border: 1px solid var(--line2); border-radius: 4px;
  box-shadow: 0 40px 120px -20px #000;
  animation: tlk-in .22s var(--ease);
}
@keyframes tlk-fade { from { opacity: 0 } }
@keyframes tlk-in { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.985) } }
.tlk-top { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tlk-top span { color: var(--or); font: 600 15px/1 var(--mono); }
.tlk-top input { flex: 1; min-width: 0; height: 56px; background: none; border: 0; outline: 0; color: var(--fg); font: 400 16px/1 var(--mono); }
.tlk-top input::placeholder { color: var(--dim); }
.tlk-top button { background: none; border: 1px solid var(--line2); border-radius: 2px; color: var(--mut); font: 500 11px/1 var(--mono); padding: 6px 7px; cursor: pointer; }
.tlk-list { overflow: auto; padding: 8px; overscroll-behavior: contain; }
.tlk-group { padding: 14px 10px 6px; color: var(--dim); font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.tlk-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; padding: 10px; border-radius: 2px; color: var(--fg); text-decoration: none; }
.tlk-item b { font: 500 15px/1.3 var(--sans); }
.tlk-item i { grid-column: 1; font: 400 13px/1.4 var(--sans); color: var(--mut); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlk-item code { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 400 12px/1 var(--mono); color: var(--dim); }
.tlk-item:hover, .tlk-item.is-on { background: var(--bg3); }
.tlk-item.is-on code { color: var(--or); }
.tlk-empty { padding: 28px 12px; color: var(--mut); font: 400 14px/1.5 var(--mono); }
.tlk-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font: 400 11.5px/1 var(--mono); }
.tlk-foot kbd { font: inherit; color: var(--mut); border: 1px solid var(--line2); padding: 2px 4px; border-radius: 2px; margin-right: 4px; }
@media (max-width: 640px) {
  .tlk-panel { top: 0; left: 0; width: 100vw; max-height: 100dvh; height: 100dvh; transform: none; border: 0; border-radius: 0; animation: tlk-fade .18s; }
  .tlk-foot { display: none; }
  .tlk-item code { display: none; }
}

/* ---------- footer: the whole site, indexed ---------- */
.tlf { position: relative; overflow: hidden; margin-top: auto; background: var(--bg); border-top: 1px solid var(--line); color: var(--fg); font-family: var(--sans); }
.tlf-in { max-width: var(--max); margin: 0 auto; padding: 72px var(--gut) 0; box-sizing: border-box; }
.tlf-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2.4fr); gap: 56px; padding-bottom: 64px; }
.tlf-id p { margin: 18px 0 0; max-width: 34ch; color: var(--mut); font: 400 15px/1.55 var(--sans); }
.tlf-id .tlf-mail { display: inline-block; margin-top: 18px; color: var(--fg); font: 500 14px/1 var(--mono); text-underline-offset: 4px; text-decoration-color: var(--or); }
.tlf-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 24px; }
.tlf-cols h2 { margin: 0 0 14px; color: var(--dim); font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.tlf-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tlf-cols a { display: inline-flex; min-height: 28px; align-items: center; color: var(--mut); text-decoration: none; font: 400 14px/1.3 var(--sans); transition: color .15s, transform .2s var(--ease); }
.tlf-cols a:hover { color: var(--fg); transform: translateX(3px); }
.tlf-base { position: relative; border-top: 1px solid var(--line); background: var(--bg); }
.tlf-base div { max-width: var(--max); margin: 0 auto; padding: 20px var(--gut) 28px; box-sizing: border-box; display: flex; flex-wrap: wrap; gap: 6px 28px; color: var(--dim); font: 400 12.5px/1.6 var(--mono); }
.tlf-base p { margin: 0; flex-basis: 100%; }
@media (max-width: 1000px) { .tlf-top { grid-template-columns: minmax(0, 1fr); gap: 40px; } .tlf-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tlf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  .tlk-scrim, .tlk-panel { animation: none; }
  .tl-btn, .tl-btn .arr, .tlf-cols a { transition: none; }
}

.tl-news[hidden] { display: none; }
.tl-news a { padding-right: calc(var(--gut) + 28px); }
.tl-news button { position: absolute; right: calc(var(--gut) - 10px); top: 50%; transform: translateY(-50%); width: 32px; height: 32px; background: none; border: 0; color: #000; font: 500 13px/1 var(--mono); cursor: pointer; }
.tl-news button:hover { background: rgba(0, 0, 0, .12); }
.tlh-k, .tlh-burger { text-decoration: none; }

/* ---------- the logo ----------
   Proportions are the official artwork's, in units of the tile (--m): the word's cap height is 36/64 of the tile, the
   line leaves the tile at the t's foot (46.5/64 down, 9.5/64 thick) and ends in a round cap, the i's dot is orange. */
.tlh-logo { display: inline-flex; color: var(--fg); text-decoration: none; font-size: 21px; }
.tl-logo { --m: 1.27em; --run: .34em; position: relative; display: inline-flex; align-items: flex-start; gap: .26em; height: var(--m); padding-right: var(--run); color: inherit; font: 700 1em/1 var(--sans); letter-spacing: -.035em; white-space: nowrap; }
.tl-logo-mark { flex: none; width: var(--m); height: var(--m); }
.tl-logo-mark svg { display: block; width: 100%; height: 100%; }
.tl-logo-word { position: relative; z-index: 1; margin-top: .055em; }
.tl-logo-i { position: relative; display: inline-block; }
.tl-logo-i::after { content: ''; position: absolute; left: 50%; top: .075em; width: .15em; height: .15em; margin-left: -.075em; border-radius: 50%; background: var(--or); }
.tl-logo-line { position: absolute; left: calc(var(--m) - .5px); right: 0; top: calc(var(--m) * .7266); height: calc(var(--m) * .1484); border-radius: 0 99px 99px 0; background: var(--or); transform-origin: 0 50%; }

/* in the header: the line is drawn when the page opens, and reaches further when you point at it */

/* signing off: the logo at full size, its line running out of the page */
.tlf-sign { position: relative; padding: clamp(8px, 2vw, 28px) 0 clamp(36px, 6vw, 84px); font-size: clamp(38px, 14.4vw, 218px); pointer-events: none; user-select: none; }
.tlf-sign .tl-logo { --run: 0px; display: flex; }
.tlf-sign .tl-logo-line { right: -100vw; border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .tlh .tl-logo-line, .tlh .tl-logo-i::after, .tlh-logo:hover .tl-logo-i::after { animation: none; }
  .js .tlf-sign .tl-logo-line, .js .tlf-sign .tl-logo-mark, .js .tlf-sign .tl-logo-i::after { transform: none; opacity: 1; transition: none; }
  .js .tlf-sign .tl-logo-word { clip-path: none; transition: none; }
}
