/* ═══════════════════════════════════════════════════════════════════════
   thomasbleeps.com — shared stylesheet
   2026-09-01

   Every section page links this instead of carrying its own <style> block.
   Change something here and it changes everywhere; bump the ?v= number in
   each page's <link> only when you need to defeat the browser cache, the
   same way /banner.js?v=N works.

   Page-specific rules (the video player, the binary tools) stay in their
   own page. Only what is genuinely shared lives here.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Font ──────────────────────────────────────────────────────────────
   Self-hosted, so it renders identically everywhere and nothing is
   requested from a third party. Latin subset, ~17KB each.
   Anonymous Pro has no italic — <em> will synthesise a slant.            */
@font-face{
  font-family:'Anonymous Pro';
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:url('/fonts/anonymous-pro-400.woff2') format('woff2');
}
@font-face{
  font-family:'Anonymous Pro';
  font-style:normal;
  font-weight:700;
  font-display:swap;
  src:url('/fonts/anonymous-pro-700.woff2') format('woff2');
}

/* ── Tokens ───────────────────────────────────────────────────────────
   --hair is the quiet structural grey (was called --edge before).
   --blue and --pink are the two brand colours; nothing else is coloured. */
:root{
  --bg:#0d0d0d;
  --text:#e0e0e0;
  --dim:#888;
  --hair:#2a2a2a;

  /* Each colour has ONE job. Keeping to this is what stops three neon
     colours on black looking like a gaming keyboard.
       blue  = structure   — outlines, links you have not followed
       pink  = interaction — hover, the thing under your cursor
       green = state       — live, on, connected, already visited          */
  --blue:#29B7E8;
  --pink:#FF3F8E;

  /* The banner's phosphor green, for things that are actually ON.
     Bright on purpose: 14.45:1, louder than either other colour, because
     "this is running" should carry.                                       */
  --green:#33FF5F;

  /* A quieter green for visited links. The full phosphor is brighter than
     the unvisited blue (14.45 vs 8.36), which would make a link you have
     already followed shout louder than one you have not — backwards. This
     sits just under blue at 7.45:1 so visited recedes, as it should.      */
  --green-dim:#29B84A;

  --core:#FFD9E4;      /* pale centre of each neon stroke  */
  --halo:#FF3F8E;      /* the glow around it               */

  --fill:#6E1039;      /* program-button hover fill — deep, so blue text
                          on it clears 5:1. The hot pink stays as border. */
  --onfill:#F3C6D6;    /* body copy once the fill is behind it (7.7:1)    */

  --rad:14px;          /* corner radius            */
  --bw:1px;            /* border width             */
  --lw:1px;            /* hover grid line width    */
  --gap:14px;          /* hover grid spacing       */
  --ang:55deg;         /* hover grid angle         */
  --rock:4.5s;         /* time to rock across and back     */
  --breathe:3s;        /* time to swell and settle         */
  --bounce:1.28;       /* how far the swell overshoots     */
  --fxop:.5;           /* hover grid strength      */

  --font:'Anonymous Pro','Courier New',Courier,ui-monospace,monospace;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}

body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  min-height:100vh;
  padding:28px 20px 70px;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.wrap{width:100%;max-width:620px}
.wrap-wide{max-width:820px}     /* videos, and anything else that needs room */

[data-tb-banner]{margin:0 0 22px}

/* ── Back button ──────────────────────────────────────────────────── */
.back{
  display:inline-flex;align-items:center;gap:9px;
  text-decoration:none;
  font-size:.66rem;letter-spacing:.18em;text-transform:uppercase;
  border:1px solid var(--hair);
  padding:9px 14px;
  border-radius:var(--rad);
  color:var(--dim);
  transition:border-color .12s,color .12s;
}
.back:hover,.back:active,.back:focus-visible{border-color:var(--blue);color:#fff}

/* ── Heading and rule ─────────────────────────────────────────────────
   The rule is a run of slashes fading blue to pink, drawn with ::before
   on the <div class="rule"> the pages already carry — so switching it
   later needs no edit to any page.

   width:fit-content is load-bearing: without it the gradient stretches
   across the whole column and the fade all but disappears.

   `color` is set to a solid value FIRST and only then overridden to
   transparent, so if background-clip:text is ever unsupported the
   slashes show solid blue rather than vanishing entirely.               */
header{margin:34px 0 10px}

h1{
  font-size:clamp(1.7rem,7vw,2.8rem);
  font-weight:400;
  letter-spacing:.2em;
  text-transform:uppercase;
  line-height:1.1;
  color:#fff;
}

.rule{
  margin:20px 0 16px;
  width:fit-content;
  color:var(--blue);
  background-image:linear-gradient(90deg,var(--blue) 0%,var(--pink) 100%);
  -webkit-background-clip:text;
          background-clip:text;
  color:transparent;
}
.rule::before{
  content:"//////////";
  display:inline-block;
  white-space:pre;
  font-size:1rem;
  letter-spacing:.55em;
  line-height:1;
}

.blurb{font-size:.78rem;line-height:1.8;letter-spacing:.06em;color:var(--dim)}

/* ── Inline links ─────────────────────────────────────────────────────
   These previously inherited the body colour, which meant a link inside a
   sentence had no affordance at all — nothing marked it as clickable.

   The colour system in full: blue unvisited, green once followed, pink
   under the cursor. Useful here specifically, because the site has a lot
   of small tools and "which have I already tried" is a real question.

   The underline is not decoration — it carries the link on its own, so
   anyone who cannot separate the two hues still knows it is a link. The
   blue/green difference is a bonus signal, never the only one.

   Note :visited is deliberately crippled by browsers to prevent history
   sniffing: only color, background-color, border-color and outline-color
   can change. Do not plan anything cleverer here; it will silently not
   happen.                                                                */
.blurb a,
p a,
footer a{
  color:var(--blue);
  text-decoration:underline;
  text-underline-offset:.22em;
  text-decoration-thickness:1px;
  text-decoration-color:color-mix(in srgb,var(--blue) 45%,transparent);
  transition:color .12s,text-decoration-color .12s;
}
.blurb a:visited,
p a:visited,
footer a:visited{
  color:var(--green-dim);
  text-decoration-color:color-mix(in srgb,var(--green-dim) 45%,transparent);
}
.blurb a:hover,.blurb a:active,.blurb a:focus-visible,
p a:hover,p a:active,p a:focus-visible,
footer a:hover,footer a:active,footer a:focus-visible{
  color:var(--pink);
  text-decoration-color:var(--pink);
}

/* section subheading */
h2.sec{
  font-size:.62rem;letter-spacing:.26em;text-transform:uppercase;font-weight:400;
  color:var(--dim);margin:48px 0 16px;
  padding-bottom:10px;border-bottom:1px solid var(--hair);
}

/* ── Cards ────────────────────────────────────────────────────────────
   The hover: a neon grid that rocks back and forth while breathing.

   EDGE RULE — do not break this. The layer is a SQUARE sized to twice the
   button's larger dimension, via aspect-ratio:1 with both minimums at
   200%. Any rectangle's diagonal is at most 1.415x its larger side, so a
   2x square always contains the button — at every angle of rotation, on
   every shape, with no per-shape checking. Sizing the layer as a
   percentage of each axis instead (inset:-50%) makes coverage depend on
   aspect ratio, and wide short buttons then leak visible grid edges.
   Verified across 11 button shapes x 12 angles.

   Centring uses the standalone `translate` property so that `rotate` and
   `scale` stay free for the animation. Keeping them as three separate
   properties, rather than one `transform` list, is what lets the rock and
   the breathe run at different speeds on the same element without
   overwriting each other.

   The rock is 4.5s and the breathe is 3s — deliberately not multiples, so
   the two loops drift against each other and the motion never reads as
   repeating.

   NEON: each line is a pale core with a coloured bloom around it, which is
   what makes it read as a lit tube rather than a ruled line. The bloom is
   a real drop-shadow. Measured at 60fps for one hovered card, including at
   phone pixel density; it only degrades with many cards animating at once,
   which hover cannot produce. Do not reuse this filter for anything
   always-on across many elements.

   Nothing animates until hover — the animations sit on the :hover rule,
   so an idle page runs none at all.                                      */
ul.items{list-style:none;margin-top:34px;display:flex;flex-direction:column;gap:14px}

.item{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  border:var(--bw) solid var(--blue);
  border-radius:var(--rad);
  padding:20px;
  background:rgba(255,255,255,.02);
  display:block;
  text-decoration:none;
  color:var(--text);
  transition:box-shadow .18s;
}
.item:hover,.item:active,.item:focus-visible{
  box-shadow:0 0 0 1px var(--blue),0 0 18px -6px var(--blue);
}

.item::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  aspect-ratio:1;
  min-width:200%;
  min-height:200%;
  translate:-50% -50%;
  rotate:-22deg;
  scale:.9;
  z-index:1;
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
  will-change:rotate,scale;
  background-image:
    repeating-linear-gradient(var(--ang),
      var(--core) 0 var(--lw), transparent var(--lw) var(--gap)),
    repeating-linear-gradient(calc(var(--ang) + 90deg),
      var(--core) 0 var(--lw), transparent var(--lw) var(--gap));
  filter:drop-shadow(0 0 2px var(--halo)) drop-shadow(0 0 6px var(--halo));
}
.item:hover::before,.item:active::before,.item:focus-visible::before{
  opacity:var(--fxop);
  animation:
    rock    var(--rock)    cubic-bezier(.34,1.4,.64,1) infinite,
    breathe var(--breathe) ease-in-out                 infinite;
}
/* the springiness is in the easing above: control points past 1 make the
   value overshoot and settle, which is what separates a rock from a slide */
@keyframes rock{
  0%,100%{rotate:-22deg}
  50%    {rotate: 22deg}
}
@keyframes breathe{
  0%,100%{scale:.9}
  50%    {scale:var(--bounce)}
}

/* text sits above the grid, with a soft knockout so the lines do not
   slice through the letters */
.item h2,.item h3{
  position:relative;z-index:2;
  font-size:.88rem;font-weight:400;letter-spacing:.12em;text-transform:uppercase;
  color:#fff;margin-bottom:10px;
}
.item p{
  position:relative;z-index:2;
  font-size:.72rem;line-height:1.75;letter-spacing:.04em;color:var(--dim);
}
.item:hover h2,.item:hover h3,.item:hover p,
.item:active h2,.item:active h3,.item:active p,
.item:focus-visible h2,.item:focus-visible h3,.item:focus-visible p{
  text-shadow:0 0 4px var(--bg),0 0 8px var(--bg),0 0 12px var(--bg);
}
.item:hover p,.item:active p,.item:focus-visible p{color:#ccc}

/* ── Programs ─────────────────────────────────────────────────────────
   The second tier of button, for things that RUN rather than things that
   take you somewhere: the binary tools, the HTMIDI instruments.

   Deliberately quieter than .item — no moving grid, no animation at all.
   The difference is the point: menus are atmospheric, programs are solid.
   A visitor can tell which is which before clicking.

   The state change is inverse video, which is what a terminal does to show
   selection: blue outline and blue text at rest, pink fill on hover with
   the text still blue.

   COLOUR, and why the fill is dark. Blue on the full #FF3F8E is 1.42:1 —
   the two are nearly identical in luminance, so the text vibrates and
   disappears. The fill is therefore a deep pink at 5.03:1, with the hot
   pink kept as the BORDER so the state still reads as pink. The body copy
   lightens on hover too, because #888 on that fill is only 3.30:1.

   The bloom is inset, so the box reads as lit from within rather than as a
   sticker with a halo. A box-shadow costs nothing next to a filter, and
   these buttons never animate, so there is no per-frame work at all.     */
.prog{
  position:relative;
  display:block;
  border:var(--bw) solid var(--blue);
  border-radius:var(--rad);
  padding:16px 18px;
  background:transparent;
  color:var(--blue);
  text-decoration:none;
  box-shadow:inset 0 0 14px -6px var(--blue);
  transition:background .16s,border-color .16s,box-shadow .16s,color .16s;
}
.prog:hover,.prog:active,.prog:focus-visible{
  background:var(--fill);
  border-color:var(--pink);
  box-shadow:inset 0 0 22px -4px var(--pink);
}

/* A program that is actually running or live — the binary clock, the
   scanner, an HTMIDI instrument with a port open. Green means ON, the same
   thing it means in the banner and in every terminal. Add `live` to the
   class list; nothing else changes. */
.prog.live{
  border-color:var(--green);
  color:var(--green);
  box-shadow:inset 0 0 14px -6px var(--green);
}
.prog.live b{color:var(--green)}
.prog.live:hover,.prog.live:active,.prog.live:focus-visible{
  background:var(--fill);
  border-color:var(--pink);
  box-shadow:inset 0 0 22px -4px var(--pink);
}

.prog h2,.prog h3,.prog b{
  display:block;
  font-size:.8rem;font-weight:400;letter-spacing:.12em;text-transform:uppercase;
  color:var(--blue);
  margin-bottom:8px;
}
.prog p{
  font-size:.7rem;line-height:1.75;letter-spacing:.03em;
  color:var(--dim);
  transition:color .16s;
}
.prog:hover p,.prog:active p,.prog:focus-visible p{color:var(--onfill)}

/* a row of them, for hubs like /binary/ */
ul.progs{list-style:none;display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:28px}


/* ── Focus ────────────────────────────────────────────────────────────
   Keyboard focus is green, so it is not just a weaker copy of the pink
   hover state — the two are telling you different things. :focus-visible
   means this appears for keyboard users without flashing on every mouse
   click. Sits outside the element so it never fights the border colour. */
:focus-visible{
  outline:2px solid var(--green);
  outline-offset:3px;
}

/* ── Empty-section placeholder ────────────────────────────────────── */
.empty{margin-top:34px;border:1px dashed #333;border-radius:var(--rad);
  padding:30px 20px;text-align:center}
.empty p{font-size:.72rem;line-height:1.8;letter-spacing:.05em;color:#666}
.empty strong{display:block;font-size:.68rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--dim);margin-bottom:12px}

/* ── Footer ───────────────────────────────────────────────────────── */
footer{margin-top:56px;font-size:.62rem;letter-spacing:.1em;color:#666}

/* ── Motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  .item::before{animation:none!important;rotate:-8deg;scale:1.05}
}

/* Touch devices: every hover rule above is deliberately paired with :active,
   and deliberately NOT wrapped in @media (hover: hover). On a phone the
   browser fakes a hover on tap, which is what makes the grid flash during the
   moment between tapping a link and the next page arriving. Tom likes that,
   so it is a feature here, not the bug it usually is. Do not add a hover
   media query to "fix" it. :active makes the same effect fire on touchdown
   on its own terms rather than depending on that quirk. */
