/* whoami — pastalabs.dev
   One stylesheet, no script. Dark terminal theme, same palette as pubky.pastalabs.dev.
   Fonts are self-hosted (OFL): VT323 for display, JetBrains Mono for the interface. */

@font-face {
  font-family: "VT323";
  src: url("/fonts/vt323-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --void: #070707;
  --panel: #0e0e0f;
  --panel-raised: #151517;
  --line: #2a2a2d;
  --text: #dcd8d0;
  --dim: #948f86;
  --red: #ff3442;
  --red-deep: #9e0f1c;
  --green: #3dff8a;
  --cyan: #29e6ff;

  --display: "VT323", "JetBrains Mono", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;

  --gutter: 20px;
  --measure: 44rem;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* CRT: scanlines and vignette over everything, never in the way of clicks. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}
body::before { background: repeating-linear-gradient(#ffffff06 0 1px, transparent 1px 3px); }
body::after { background: radial-gradient(transparent 55%, #0000008c 100%); }

a { color: inherit; }
.red { color: var(--red); }
.dim { color: var(--dim); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

::selection { background: var(--red); color: var(--void); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 70;
  background: var(--green);
  color: var(--void);
  padding: 12px 16px;
  min-height: 44px;
  font-family: var(--mono);
}

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--void);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  flex-wrap: wrap;
  text-decoration: none;
}
.brand .who { color: var(--green); overflow-wrap: anywhere; min-width: 0; }
.top nav {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -10px;
}
.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  color: var(--dim);
  text-decoration: none;
}
.top nav a:hover { color: var(--red); }
.top nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.cursor::after {
  content: "█";
  color: var(--green);
  margin-left: 0.15em;
}

/* ---------- layout ---------- */

.page {
  max-width: 64rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 48px 0;
}

/* ---------- hero ---------- */

.prompt {
  font-family: var(--mono);
  font-size: 0.9375rem;
  color: var(--green);
  margin: 0 0 8px;
}
.typed { display: inline-block; max-width: 100%; }

h1 {
  font-family: var(--display);
  font-weight: 400;
  /* the floor stays low: with a doubled browser font, one long word must still fit */
  font-size: clamp(1.75rem, 15vw, 9rem);
  line-height: 0.85;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0 0 28px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  clip-path: inset(100% 0 0);
}
.glitch::before { color: var(--cyan); transform: translate(-3px); }
.glitch::after { color: var(--red); transform: translate(3px); }

.lead {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.4;
  max-width: 36ch;
  margin: 0 0 14px;
  text-wrap: pretty;
}
.sub {
  color: var(--dim);
  max-width: var(--measure);
  margin: 0;
  text-wrap: pretty;
}
.hero-sm h1 { font-size: clamp(3rem, 12vw, 6.5rem); }

/* home hero: avatar above the text on phones, beside it from tablet width */
.hero-id {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px 48px;
  align-items: center;
}
.hero-text { min-width: 0; container-type: inline-size; }
/* "PASTAGRINGO" in VT323 is about 4.4em wide, 5.4em with the badges: size it from its own column */
.hero-text h1 { font-size: clamp(1.75rem, 17cqi, 9rem); }
/* 🇫🇷🤖 after the name. The flag is an SVG: Windows has no flag emoji and would show "FR". */
.h1-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  margin-left: 0.3em;
  font-size: 0.42em;
  vertical-align: top;
  position: relative;
  top: 0.25em; /* line-height 0.85 puts the line top above the letters */
  white-space: nowrap;
  text-transform: none;
}
.h1-badges .flag {
  width: 1.2em;
  height: 0.8em;
  box-shadow: 0 0 0 1px var(--line);
}
.avatar {
  display: block;
  width: 112px;
  height: 112px;
  max-width: 100%;
  border: 1px solid var(--line);
  box-shadow: 6px 6px 0 var(--red-deep);
  background: var(--panel);
}
@media (min-width: 48rem) {
  .hero-id { grid-template-columns: minmax(0, 1fr) 240px; }
  .avatar { order: 2; width: 240px; height: 240px; }
}

/* ---------- sections ---------- */

section { margin-top: 80px; }

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.section-head .no {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--red);
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.4vw, 2.6rem);
  font-weight: 400;
  line-height: 1;
  margin: 0;
  min-width: 0;
  max-width: 100%;
}
.intro {
  margin: 16px 0 4px;
  color: var(--dim);
  max-width: var(--measure);
  text-wrap: pretty;
}

/* ---------- link rows (every target >= 44px) ---------- */

.rows { list-style: none; margin: 0; padding: 0; }

/* flex + wrap: with a large font the meta (a host name) drops under the name
   instead of overflowing. */
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  align-items: baseline;
  min-height: 44px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.row:hover .name,
.row:focus-visible .name { color: var(--red); }
.row:hover .arrow { transform: translateX(4px); }

.name {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  min-width: 0;
  max-width: 100%;
}
.meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  min-width: 0;
  max-width: 100%;
}
.desc {
  flex: 1 1 100%;
  color: var(--dim);
  min-width: 0;
  text-wrap: pretty;
}
.arrow {
  display: inline-block;
  color: var(--red);
  transition: transform 0.15s ease;
}

.find { margin-top: 16px; }

/* ---------- blog: category filters and post cards ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 24px;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.filters a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--dim);
  text-decoration: none;
}
.filters a:hover { color: var(--red); border-color: var(--red); }
.filters a[aria-current="page"] { color: var(--void); background: var(--green); border-color: var(--green); }
.filters .count { opacity: 0.75; }

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.post-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 0 0 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.post-card:hover { border-color: var(--red); background: var(--panel-raised); }
.post-card > :not(.thumb) { margin-inline: 18px; min-width: 0; }
.thumb {
  display: block;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: filter 0.2s ease;
}
.post-card:hover .thumb img { filter: none; }
/* no picture: a terminal-style plate with the category */
.thumb-none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(-45deg, var(--panel-raised) 0 10px, var(--panel) 10px 20px);
  font-family: var(--display);
  font-size: 2.6rem;
  color: var(--green);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
}
.cat { color: var(--green); text-decoration: none; }
a.cat:hover { text-decoration: underline; }
.card-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  text-wrap: balance;
}
.post-card:hover .card-title { color: var(--red); }
.excerpt {
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ---------- running now: cards ---------- */

.now {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
@media (min-width: 48rem) {
  .now { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 44px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.card:hover { border-top-color: var(--red); background: var(--panel-raised); }
.card .title {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
  min-width: 0;
}
.card .host {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  min-width: 0;
}
.card p { margin: 0; color: var(--dim); text-wrap: pretty; }
.badge {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
}
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex: none;
}

/* ---------- build log: year gutter ---------- */

.era {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 32px;
  padding-top: 32px;
}
@media (min-width: 48rem) {
  .era { grid-template-columns: 160px minmax(0, 1fr); }
}
.years {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--red);
  padding-top: 6px;
}
.era h3 {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
  margin: 0 0 6px;
}
.era > div > p {
  margin: 0 0 8px;
  color: var(--dim);
  max-width: var(--measure);
  text-wrap: pretty;
}

/* ---------- article pages ---------- */

.crumb {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  margin: 0 0 32px;
}
.crumb a {
  color: var(--green);
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  margin-block: -12px;
}
.crumb a:hover { text-decoration: underline; }

.post { max-width: 46rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  margin: 0 0 16px;
}
.post-meta time { color: var(--green); }
/* 44px tap target without pushing the line apart */
.post-meta a.cat {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -12px;
}
.post-meta .topic { color: var(--red); }
.post-title {
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  line-height: 0.95;
  text-transform: none;
  text-wrap: balance;
}
.post .lead { max-width: none; color: var(--dim); }

.cover {
  margin: 32px 0;
  border: 1px solid var(--line);
  background: var(--panel);
}
.cover img { display: block; width: 100%; height: auto; }

.prose { margin-top: 32px; }
.prose > * { max-width: 100%; }
.prose p,
.prose ul,
.prose ol,
.prose blockquote { margin: 0 0 1.1em; }
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1.3;
  margin: 2.2em 0 0.7em;
  text-wrap: balance;
}
.prose h2 { font-size: 1.45rem; }
.prose h3 { font-size: 1.2rem; }
.prose h4,
.prose h5,
.prose h6 { font-size: 1rem; }
.prose h2::before { content: "## "; color: var(--red); }
.prose h3::before { content: "### "; color: var(--red); }
.prose a {
  color: var(--text);
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--red); }
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2em 0;
  border: 1px solid var(--line);
}
.img-gone {
  display: block;
  margin: 1.2em 0;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--green);
  background: var(--panel-raised);
  padding: 0.1em 0.35em;
}
.prose pre {
  margin: 0 0 1.2em;
  padding: 16px;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--green);
  line-height: 1.5;
}
.prose pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.8125rem;
}
.prose blockquote {
  padding-left: 16px;
  border-left: 2px solid var(--red);
  color: var(--dim);
}
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2em 0; }
.prose li { margin-bottom: 0.3em; }
.prose li > p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.prose table { border-collapse: collapse; font-size: 0.9375rem; }
.prose th,
.prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { font-family: var(--mono); background: var(--panel); }

.post-foot {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.post-foot p { color: var(--dim); font-size: 0.9375rem; margin: 0 0 8px; }
.key { font-family: var(--mono); color: var(--green); font-size: 0.875em; }

/* ---------- footer ---------- */

.foot {
  max-width: 64rem;
  margin: 96px auto 0;
  padding: 16px var(--gutter) 32px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}
.foot p { margin: 0; }

/* ---------- motion (only when the visitor allows it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .cursor::after { animation: blink 1.05s step-end infinite; }
  .glitch::before { animation: glitch-a 3.2s step-end infinite; }
  .glitch::after { animation: glitch-b 2.7s step-end infinite; }
  .typed {
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    width: 0;
    animation: type 1.4s steps(14) 0.3s forwards;
  }
  @keyframes blink { 50% { opacity: 0; } }
  @keyframes type { to { width: 14ch; } }
  @keyframes glitch-a {
    0%, 86%, 100% { clip-path: inset(100% 0 0); }
    88% { clip-path: inset(12% 0 64%); }
    91% { clip-path: inset(58% 0 18%); }
    94% { clip-path: inset(30% 0 46%); }
  }
  @keyframes glitch-b {
    0%, 80%, 100% { clip-path: inset(100% 0 0); }
    82% { clip-path: inset(70% 0 6%); }
    85% { clip-path: inset(8% 0 74%); }
    88% { clip-path: inset(44% 0 32%); }
  }
}
