/* tushdev.co: 13px type, dark by default, sticky header, numbered ruled lists. */
:root {
  --bg: #0a0a0a;
  --fg: #f1f5f2;
  --muted: #8b8d8b;
  --line: #232323;
  --line-strong: #3a3b3a;
  --code-bg: #121212;
  --accent: #91cae8;
  --font-name: "Space Grotesk", "Archivo", system-ui, sans-serif;
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-button: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --header-h: 52px;
  --tk-k: #91cae8; --tk-s: #9ed3a6; --tk-n: #e3b779; --tk-t: #7fd1c8; --tk-f: #cbb7f5; --tk-a: #e39b8b;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f5f3;
    --fg: #0a0a0a;
    --muted: #5f615f;
    --line: #dcdcd9;
    --line-strong: #bdbdb8;
    --code-bg: #ecece9;
    --accent: #1b6c96;
    --tk-k: #1b6c96; --tk-s: #2e7a43; --tk-n: #9a5a00; --tk-t: #0d6f6b; --tk-f: #6a4bb0; --tk-a: #b0432d;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f5f3;
  --fg: #0a0a0a;
  --muted: #5f615f;
  --line: #dcdcd9;
  --line-strong: #bdbdb8;
  --code-bg: #ecece9;
  --accent: #1b6c96;
  --tk-k: #1b6c96; --tk-s: #2e7a43; --tk-n: #9a5a00; --tk-t: #0d6f6b; --tk-f: #6a4bb0; --tk-a: #b0432d;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img, svg { max-width: 100%; }
.ico { width: 15px; height: 15px; flex: none; }
.ico.arr { width: 13px; height: 13px; opacity: .6; transition: transform .15s, opacity .15s, color .15s; }
a:hover > .arr { opacity: 1; color: var(--accent); transform: translate(2px, -2px); }
a:hover > .arr-e { transform: translateX(3px); }
a:hover > .arr-w { transform: translateX(-3px); }
a:hover > .arr-n { transform: translateY(-3px); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 6px 12px; z-index: 60; }
.skip:focus { left: 8px; }

/* one narrow column, side gutters clear of device insets */
.c { max-width: 672px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.main { display: flex; flex-direction: column; gap: 44px; padding-block: 36px 24px; min-height: 70vh; }

#progress { position: fixed; top: var(--header-h); left: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 45; pointer-events: none; }

/* ---------- sticky header + hamburger menu ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); view-transition-name: site-header; }
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); }
.home { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.mark { flex: none; width: 28px; height: 28px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; transition: border-color .15s; }
.home:hover .mark { border-color: var(--accent); }
.home-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.home-name { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.home-sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.theme, .menu-btn { font-family: var(--font-button); font-size: 12px; color: var(--muted); background: none; border: 1px solid var(--line); padding: 5px 11px; cursor: pointer; transition: color .15s, border-color .15s; }
.theme:hover, .menu-btn:hover { color: var(--accent); border-color: var(--accent); }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 30px; padding: 0; color: var(--fg); }
.burger { position: relative; display: block; width: 14px; height: 10px; }
.burger i { position: absolute; left: 0; height: 1.5px; background: currentColor; transition: transform .25s ease, opacity .2s ease, top .25s ease, width .25s ease; }
.burger i:nth-child(1) { top: 0; width: 100%; }
.burger i:nth-child(2) { top: 4px; width: 70%; }
.burger i:nth-child(3) { top: 8px; width: 40%; }
.menu-btn.open .burger i:nth-child(1) { width: 100%; top: 4px; transform: rotate(45deg); }
.menu-btn.open .burger i:nth-child(2) { opacity: 0; }
.menu-btn:not(.open):hover .burger i:nth-child(2), .menu-btn:not(.open):hover .burger i:nth-child(3) { width: 100%; }
.menu-btn.open .burger i:nth-child(3) { width: 100%; top: 4px; transform: rotate(-45deg); }

.menu { border-top: 1px solid var(--line); background: var(--bg); }
.js .menu { position: absolute; top: 100%; left: 0; right: 0; border-top: 0; border-bottom: 1px solid var(--line); visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
.js .menu.open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.menu-in { padding-block: 6px 16px; }
.menu-list a > span { flex: 1; }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 500; }
.menu-list a::before { content: ""; width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; transition: background .2s, border-color .2s; }
.menu-list a:hover::before, .menu-list a[aria-current="page"]::before { background: var(--accent); border-color: var(--accent); }
.menu-list a[aria-current="page"] { color: var(--accent); }
.menu-links { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 14px; font-family: var(--font-mono); font-size: 12px; }
.menu-links a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); }
.menu-links a:hover { color: var(--accent); }

/* ---------- type ---------- */
.tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.tag b { color: var(--accent); font-weight: 500; }
h1 { font-family: var(--font-display); font-weight: 800; font-stretch: 80%; font-size: clamp(2.3rem, 9vw, 3.4rem); line-height: .9; letter-spacing: -0.03em; text-transform: uppercase; margin: 0; }
.hero h1 { font-family: var(--font-name); font-weight: 700; font-stretch: 100%; font-size: clamp(1.9rem, 6.6vw, 2.5rem); line-height: .98; letter-spacing: -0.035em; }
.page-head h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); }
h1.title { font-weight: 700; font-stretch: 92%; font-size: clamp(1.45rem, 5vw, 1.85rem); line-height: 1.15; letter-spacing: -0.02em; text-transform: none; text-wrap: balance; }
h2.section { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
h2.section::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---------- hero and page heads ---------- */
.hero { display: flex; flex-direction: column; gap: 14px; }
.role { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin: 0; }
.hero .pts { max-width: 60ch; margin-top: 2px; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.hero-id { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* pixel portrait: tile backdrop with accent corner ticks, same motif as the rest of the site */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.chip { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; display: inline-flex; align-items: center; gap: 8px; }
.dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.page-head { display: flex; flex-direction: column; gap: 12px; }
.lede { margin: 0; color: var(--muted); max-width: 52ch; }
.back { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-family: var(--font-mono); font-size: 11px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--accent); }

/* ---------- numbered ruled lists ---------- */
section { display: flex; flex-direction: column; gap: 2px; }
.list > li { border-top: 1px solid var(--line); }
.list > li:last-child { border-bottom: 1px solid var(--line); }
.row { --c: 2; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 3px 14px; padding: 14px 0; align-items: baseline; }
.row > * { min-width: 0; }
/* circle marker in the left gutter: fills on hover, always filled for the current role */
.row::before, .post-link::before, .defs > div::before { content: ""; align-self: start; margin-top: 8px; width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; transition: background .2s, border-color .2s, transform .2s; }
.post-link::before { margin-top: 6px; }
.defs > div::before { margin-top: 5px; }
.list > li:hover .row::before, .list > li:hover .post-link::before, .defs > div:hover::before { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.list > li.now .row::before { background: var(--accent); border-color: var(--accent); }
.name { font-weight: 500; font-size: 13.5px; }
.name a { text-decoration: none; }
.name a .arr { margin-left: 6px; vertical-align: -1px; }
.when { font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.pts, .stack, .inline-links { grid-column: var(--c) / -1; }
.pts { margin: 2px 0 0; display: flex; flex-direction: column; gap: 3px; color: var(--muted); max-width: 62ch; font-size: 12px; }
.pts li { position: relative; padding-left: 14px; }
.pts li::before { content: ""; position: absolute; left: 3px; top: .82em; width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.stack span::before { content: "#"; color: var(--accent); margin-right: 2px; opacity: .8; }
.inline-links { display: flex; gap: 16px; margin: 6px 0 0; font-family: var(--font-mono); font-size: 11px; }
.inline-links a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--muted); transition: color .15s; }
.inline-links a:hover { color: var(--accent); }
.more { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; text-decoration: none; }

/* ---------- writing index ---------- */
.post-link { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 3px 14px; padding: 14px 0; text-decoration: none; }
.post-link > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.post-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-title { font-size: 14px; font-weight: 500; line-height: 1.35; margin: 0; transition: color .15s; }
.post-dek { margin: 0; color: var(--muted); max-width: 58ch; }
.post-more { margin-top: 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: color .15s; }
.post-more { display: inline-flex; align-items: center; gap: 6px; }
.post-link:hover .arr-e { opacity: 1; color: var(--accent); transform: translateX(3px); }
.post-link:hover .post-title, .post-link:hover .post-more { color: var(--accent); }

/* ---------- articles and case studies ---------- */
.article { display: flex; flex-direction: column; gap: 26px; }
.head { display: flex; flex-direction: column; gap: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.meta .pill { color: var(--accent); }
.dek { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 56ch; }
.byline { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.byline .mark { width: 28px; height: 28px; }
.byline small { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 12px; }
.facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.facts a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }

.prose { font-size: 13px; line-height: 1.8; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.prose p { margin: 0; max-width: 66ch; }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-stretch: 92%; font-size: 1.05rem; line-height: 1.2; letter-spacing: -0.01em; margin: 14px 0 -4px; text-wrap: balance; }
.prose ul { display: flex; flex-direction: column; gap: 6px; max-width: 66ch; }
.prose ul li { position: relative; padding-left: 16px; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .95em; width: 7px; height: 1px; background: var(--accent); }
.prose blockquote { margin: 6px 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); font-family: var(--font-display); font-weight: 600; font-stretch: 92%; font-size: 1.05rem; line-height: 1.35; max-width: 34ch; }
.prose code { font-family: var(--font-mono); font-size: .92em; background: var(--code-bg); border: 1px solid var(--line); padding: 0 5px; }
.prose a { text-decoration-color: var(--accent); }
.code { border: 1px solid var(--line); background: var(--code-bg); min-width: 0; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hl .tk-k { color: var(--tk-k); }
.hl .tk-s { color: var(--tk-s); }
.hl .tk-n { color: var(--tk-n); }
.hl .tk-t { color: var(--tk-t); }
.hl .tk-f { color: var(--tk-f); }
.hl .tk-a { color: var(--tk-a); }
.hl .tk-c { color: var(--muted); font-style: italic; }
.copy { font-family: var(--font-button); font-size: 11px; color: var(--muted); background: none; border: 1px solid var(--line); padding: 2px 9px; cursor: pointer; letter-spacing: 0; text-transform: none; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.prose .code code { background: none; border: 0; padding: 0; font-size: 12px; }
.code pre { margin: 0; padding: 12px; overflow-x: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.65; tab-size: 2; }

.next { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.next a { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; text-decoration: none; min-width: 0; }
.next a + a { padding-left: 16px; border-left: 1px solid var(--line); text-align: right; align-items: flex-end; }
.next a:only-child { grid-column: 1 / -1; }
.next span { font-size: 13px; font-weight: 500; line-height: 1.35; }
.next a:hover span { color: var(--accent); }
.next .tag { display: inline-flex; align-items: center; gap: 6px; }
.next .tag span { font-size: inherit; font-weight: inherit; }
.next a:hover .tag span { color: inherit; }

/* ---------- stack and now ---------- */
.defs { display: flex; flex-direction: column; }
.defs > div { display: grid; grid-template-columns: 18px 130px minmax(0, 1fr); gap: 4px 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.defs > div:last-child { border-bottom: 1px solid var(--line); }
.defs dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.defs dd { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.foot-wrap { margin-top: 40px; }
.foot { display: flex; flex-direction: column; gap: 16px; padding-block: 18px 36px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-size: 12px; transition: color .15s; }
.foot-links a:hover { color: var(--fg); }
.foot-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; color: var(--muted); }
.foot-clock { display: inline-flex; align-items: center; gap: 8px; }
.foot-clock .dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.foot-right { display: inline-flex; align-items: center; gap: 18px; }
.foot-meta a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.foot-meta a:hover { color: var(--accent); }

.nf { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

@media (max-width: 560px) {
  .home-sub { display: none; }
    .hero-head { gap: 14px; }
  .row { grid-template-columns: 18px minmax(0, 1fr); }
  .when { grid-column: var(--c); text-align: left; white-space: normal; }
  .foot-meta { justify-content: flex-start; }
  .foot-right { margin-left: auto; }
  .next { grid-template-columns: minmax(0, 1fr); }
  .next a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); text-align: left; align-items: flex-start; }
  .defs > div { grid-template-columns: 18px minmax(0, 1fr); }
  .defs dt, .defs dd { grid-column: 2; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 93%, 100% { fill: #2b2b2b; } 95%, 97% { fill: #5c4334; } }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  :is(.hero, .page-head, .article > .head, .nf) > *,
  .article > .back { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  :is(.hero, .page-head, .article > .head, .nf) > :nth-child(2) { animation-delay: .06s; }
  :is(.hero, .page-head, .article > .head, .nf) > :nth-child(3) { animation-delay: .12s; }
  :is(.hero, .page-head, .article > .head, .nf) > :nth-child(4) { animation-delay: .18s; }
  :is(.hero, .page-head, .article > .head, .nf) > :nth-child(5) { animation-delay: .24s; }
    .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 2.2s ease-out infinite; }
  .menu.open .menu-list li { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
  .menu.open .menu-list li:nth-child(2) { animation-delay: .04s; }
  .menu.open .menu-list li:nth-child(3) { animation-delay: .08s; }
  .menu.open .menu-list li:nth-child(4) { animation-delay: .12s; }
  .js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
  .js .reveal.in { opacity: 1; transform: none; }
  .row, .post-link { transition: padding-left .2s ease; }
  .list > li:hover .row, .list > li:hover .post-link { padding-left: 4px; }
  @view-transition { navigation: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header, #progress, .copy { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; color: #000; }
}
