/* tatendagatawa.dev: dark terminal look (2001 hacker news-site) with modern
   gimmicks in site.js: a command palette on "/" or Ctrl/Cmd+K, and a tmux-style
   status bar with clocks, weather and a context-window reading meter. */
:root {
  --bg: #0c100f; --panel: #131a18; --ink: #e3e7de; --ink-2: #b9c1b7; --muted: #8b958c;
  --rule: #26312d; --green: #7fe08c; --amber: #f2c46d; --link: #8fd3ff; --visited: #c6a8ff; --red: #ff7b6b;
  --mono: "IBM Plex Mono", "Lucida Console", Monaco, monospace;
  --sans: "IBM Plex Sans", Verdana, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17.5px/1.7 var(--sans); }
::selection { background: var(--green); color: #000; }
a { color: var(--link); text-decoration-color: rgba(143, 211, 255, .45); text-underline-offset: 3px; }
a:visited { color: var(--visited); }
a:hover { color: #fff; text-decoration-color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--amber); color: #000; padding: 6px 10px; z-index: 99; }
.mono, .kicker, .sub-h, .kind, .count, .legal, time, .tag, .n, .nav, .brand, .filters, h1, h2, h3, h4, dt { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 22px; }

.bar { position: sticky; top: 0; z-index: 20; background: rgba(12, 16, 15, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.bar .wrap { display: flex; align-items: center; gap: 16px; height: 50px; max-width: 60rem; }
.brand { color: var(--green) !important; text-decoration: none; font-weight: 600; }
.brand::before { content: "~/"; color: var(--muted); }
.nav { list-style: none; display: flex; gap: 14px; margin: 0 0 0 auto; padding: 0; font-size: 0.82rem; }
.nav a { color: var(--ink-2) !important; text-decoration: none; }
.nav a::before { content: "["; color: var(--muted); } .nav a::after { content: "]"; color: var(--muted); }
.nav a:hover { color: var(--green) !important; }
.kbd-hint { font: 0.72rem var(--mono); color: var(--muted); border: 1px solid var(--rule); padding: 2px 7px; background: none; cursor: pointer; }
.kbd-hint:hover { color: var(--amber); border-color: var(--amber); }
.nav-toggle { display: none; }

section, .hero { padding: 40px 0; border-bottom: 1px dashed var(--rule); }
.hero::before { content: ""; }
.intro { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.avatar { flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: repeating-linear-gradient(0deg, #142019 0 2px, #0f1713 2px 4px); border: 2px solid var(--green); box-shadow: 0 0 18px rgba(127, 224, 140, .25); font: 600 1.4rem var(--mono); color: var(--green); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.h1-statement { font-size: 2rem; line-height: 1.15; margin: 0 0 6px; color: #fff; font-weight: 600; }
.h1-statement::before { content: "$ whoami\A"; white-space: pre; display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); margin-bottom: 6px; }
.tagline { margin: 0; color: var(--amber); font-family: var(--mono); font-size: 0.95rem; }
.lead { margin: 0 0 16px; color: var(--ink); max-width: 66ch; }
.kicker { font-size: 0.75rem; color: var(--muted); margin: 22px 0 10px; }
.kicker::before { content: "# "; color: var(--green); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font: 0.8rem var(--mono); }
.tags a { display: inline-block; color: var(--ink-2); text-decoration: none; border: 1px solid var(--rule); padding: 3px 9px; }
.tags a:hover { border-color: var(--green); color: var(--green); }
.tags li { display: flex; align-items: center; gap: 0; }
.tags .n { font-size: 0.72rem; color: #000; background: var(--green); padding: 4px 6px; margin-left: -1px; }

.sec-head h2 { font-size: 1.2rem; color: var(--green); margin: 0 0 6px; font-weight: 600; }
.sec-head h2::before { content: "## "; color: var(--muted); }
.sec-head p { margin: 0 0 18px; color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; font-size: 0.75rem; }
.filters button { font: 0.75rem var(--mono); padding: 3px 9px; background: none; border: 1px solid var(--rule); color: var(--ink-2); cursor: pointer; }
.filters button:hover { border-color: var(--green); color: var(--green); }
.filters button[aria-pressed="true"] { background: var(--green); color: #000; border-color: var(--green); }
.filters .count { margin-left: auto; color: var(--muted); align-self: center; }

.feed { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.feed li { counter-increment: n; position: relative; padding: 9px 0 9px 2.8rem; border-bottom: 1px solid var(--rule); }
.feed li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 12px; font: 0.78rem var(--mono); color: var(--muted); }
.feed li[hidden] { display: none; }
.feed time { display: none; }
.feed a { display: block; color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.45; }
.feed a:visited { color: var(--visited); }
.feed a:hover { color: var(--green); text-decoration: underline; }
.feed .src, .feed .tag { font: 0.74rem var(--mono); color: var(--muted); }
.feed .src::before { content: "via "; }
.feed .tag { color: var(--amber); }
.feed .tag::before { content: "  #"; white-space: pre; color: var(--muted); }

.topic { padding: 22px 0; border-top: 1px solid var(--rule); scroll-margin-top: 64px; }
.topic-head h3 { font-size: 1.05rem; color: var(--amber); margin: 0 0 4px; font-weight: 600; }
.topic-head h3::before { content: "> "; color: var(--green); }
.topic-head p { margin: 0 0 4px; color: var(--ink-2); }
.topic-head .mono { font-size: 0.72rem; color: var(--muted); }
.sub-h { font-size: 0.72rem; color: var(--green); text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 4px; }
.srcs, .reads { list-style: none; margin: 0; padding: 0; }
.srcs li, .reads li { padding: 6px 0 6px 14px; border-left: 1px solid var(--rule); margin-bottom: 2px; }
.srcs li:hover, .reads li:hover { border-left-color: var(--green); }
.kind { font-size: 0.64rem; color: var(--muted); text-transform: uppercase; margin-left: 8px; }
.d { display: block; font-size: 0.92rem; color: var(--ink-2); }
.goldmine { margin: 16px 0 6px; padding: 14px 16px; border: 1px solid var(--amber); background: #19170f; }
.goldmine .mono { font-size: 0.7rem; color: #000; background: var(--amber); padding: 1px 6px; text-transform: uppercase; }
.goldmine h4 { margin: 8px 0 4px; font-size: 1.05rem; }
.goldmine h4 a { color: var(--amber); }
.goldmine p { margin: 0 0 8px; color: var(--ink); }
.goldmine ul { margin: 0 0 8px; padding-left: 18px; columns: 2; font-size: 0.92rem; }
.goldmine .follow { font: 0.8rem var(--mono); }

.timeline { margin: 0 0 12px; display: grid; grid-template-columns: 5.5rem 1fr; gap: 4px 16px; }
.timeline dt { grid-column: 1; font-size: 0.78rem; color: var(--green); padding-top: 4px; }
.timeline dd { grid-column: 2; margin: 0 0 8px; }
.coach-list { padding-left: 0; list-style: none; } .coach-list li { margin: 0 0 10px; padding-left: 18px; position: relative; }
.coach-list li::before { content: "*"; position: absolute; left: 0; color: var(--amber); font-family: var(--mono); }
.coach-list a, #work a { color: var(--link); }

.foot { padding: 26px 0 50px; color: var(--muted); }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 0; font-size: 0.75rem; }

/* Command palette */
.pal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 0; }
.pal.open { display: flex; }
.pal-box { width: min(40rem, 100%); background: var(--panel); border: 1px solid var(--green); box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 24px rgba(127,224,140,.15); font-family: var(--mono); }
.pal-in { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--rule); color: var(--green); font-size: 0.9rem; }
.pal-in input { flex: 1; background: none; border: 0; outline: 0; color: var(--ink); font: 0.95rem var(--mono); }
.pal ul { list-style: none; margin: 0; padding: 6px 0; max-height: 50vh; overflow: auto; }
.pal li { display: flex; gap: 10px; align-items: baseline; padding: 6px 14px; cursor: pointer; font-size: 0.86rem; }
.pal li .k { flex: none; width: 4.5rem; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; }
.pal li.on { background: #1e2a25; color: var(--green); }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--rule); font-size: 0.7rem; color: var(--muted); }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .h1-statement { font-size: 1.6rem; }
  .avatar { width: 70px; height: 70px; font-size: 1.1rem; }
  .goldmine ul { columns: 1; }
  .nav-toggle { display: block; margin-left: auto; font: 0.8rem var(--mono); background: none; color: var(--green); border: 1px solid var(--rule); padding: 3px 10px; }
  .kbd-hint { margin-left: 0; }
  .nav { display: none; }
  .bar.open .nav { display: flex; flex-direction: column; gap: 6px; position: absolute; top: 50px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--rule); padding: 10px 16px; margin: 0; }
  .timeline { grid-template-columns: 1fr; } .timeline dt, .timeline dd { grid-column: 1; }
}

/* tmux-style status bar (site.js) */
body { padding-bottom: 38px; }
.tmux { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: stretch; height: 30px; background: #0a0d0c; border-top: 1px solid var(--rule); font: 12px/30px var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tmux > * { padding: 0 12px; border-right: 1px solid var(--rule); }
.tmux .seg-ctx { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; color: var(--green); }
.tmux .seg-ctx b { font-weight: 600; }
.tmux .meter { flex: 1 1 auto; min-width: 40px; max-width: 220px; height: 8px; border: 1px solid #2e5a35; background: #0f1713; }
.tmux .meter i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--green) 0 5px, #4fae5d 5px 10px); }
.tmux .seg-feeds { color: var(--muted); }
.tmux .seg-feeds .ok { color: var(--green); }
.tmux .seg-you, .tmux .seg-me { color: var(--ink); }
.tmux .lbl { color: var(--muted); }
.tmux .clock { color: #fff; font-variant-numeric: tabular-nums; }
.tmux .wx { color: var(--amber); }
.tmux .seg-reach { border-right: 0; color: #000; background: var(--green); font-weight: 600; }
.tmux .seg-reach.off { background: var(--amber); }
.tmux .seg-reach.loading { background: var(--rule); color: var(--muted); }
@media (max-width: 1100px) { .tmux .seg-feeds { display: none; } }
@media (max-width: 860px) {
  .tmux .seg-you .wx, .tmux .seg-me .wx, .tmux .seg-reach .why { display: none; }
  .tmux .seg-ctx .tok { display: none; }
}
@media (max-width: 520px) { .tmux .seg-you { display: none; } .tmux > * { padding: 0 9px; } }

/* ===== Adaptive layer: how the page is being used, not just how wide it is ===== */
/* Notches and home bars */
.bar .wrap { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
.tmux { height: calc(30px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
body { padding-bottom: calc(38px + env(safe-area-inset-bottom)); }
.seg-ctx { cursor: pointer; }

/* Touch: bigger targets, no sticky hover, no zoom-on-focus */
html[data-input="touch"] .tags a,
html[data-input="touch"] .filters button,
html[data-input="touch"] .kbd-hint,
html[data-input="touch"] .nav-toggle { min-height: 40px; display: inline-flex; align-items: center; }
html[data-input="touch"] .tags .n { padding: 11px 8px; }
html[data-input="touch"] .feed li { padding-top: 12px; padding-bottom: 12px; }
html[data-input="touch"] .srcs li, html[data-input="touch"] .reads li { padding-top: 10px; padding-bottom: 10px; }
html[data-input="touch"] .bar.open .nav a { display: block; padding: 10px 0; }
html[data-input="touch"] .pal-in input { font-size: 16px; }
html[data-input="touch"] .pal li { padding-top: 12px; padding-bottom: 12px; }
@media (hover: none) {
  .tags a:hover, .filters button:hover { border-color: var(--rule); color: var(--ink-2); }
  .srcs li:hover, .reads li:hover { border-left-color: var(--rule); }
}

/* Phones: one swipeable row of filters, collapsible topics, a shorter reading list */
@media (max-width: 860px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: 8px; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; scroll-snap-align: start; }
  .filters .count { display: none; }
  .tags { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .tags::-webkit-scrollbar { display: none; }
  .tags li { flex: none; }
}
.feed li.clip { display: none; }
.more { display: block; width: 100%; margin: 14px 0 0; padding: 12px; font: 0.85rem var(--mono); color: var(--green); background: none; border: 1px dashed var(--rule); cursor: pointer; }
.more:hover { border-color: var(--green); }
.topic.folded .topic-body { display: none; }
.fold { margin-top: 10px; font: 0.8rem var(--mono); color: var(--green); background: none; border: 1px solid var(--rule); padding: 8px 12px; min-height: 40px; cursor: pointer; }
.fold::after { content: " \25be"; }
.topic:not(.folded) .fold::after { content: " \25b4"; }
.tmux .seg-ctx { overflow: hidden; }
@media (max-width: 520px) { .tmux .pct, .tmux .seg-me .lbl { display: none; } .tmux .meter { min-width: 48px; } }
/* Profile photo */
img.avatar { display: block; width: 112px; height: 112px; object-fit: cover; padding: 0; background: #0f1713; }
@media (max-width: 860px) { img.avatar { width: 76px; height: 76px; } }
/* Work with me */
#work h3 { font: 600 0.95rem var(--mono); color: var(--amber); margin: 30px 0 10px; }
#work h3::before { content: "### "; color: var(--muted); }
#work dd b { color: #fff; }
.checks { list-style: none; margin: 0 0 8px; padding: 0; }
.checks li { position: relative; padding: 3px 0 3px 26px; }
.checks li::before { content: "[x]"; position: absolute; left: 0; font: 0.78rem/1.9 var(--mono); color: var(--green); }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; font: 600 0.85rem var(--mono); text-decoration: none; border: 1px solid var(--green); color: var(--green) !important; }
.btn.signal { background: var(--green); color: #000 !important; }
.btn.signal:hover { background: #a2f0ac; }
