/* jjscoolwebsite.com — socials page only.
   One painted scene (a corkboard under a single lamp) on a 384x216 canvas.
   The board and its two notes sit inside a 256x144 safe zone at the centre
   of that canvas; the rest is garage that gets cropped at the edges.

   --s is the size of one art pixel. It fits the whole canvas to the width,
   so as much of the garage as possible is shown, unless that would be so
   short a window that the safe zone no longer fits the height — then the
   safe zone wins and the board is still whole. The canvas is centred, the
   section clips whatever is left over vertically, and the section's own
   colour is the canvas's edge colour for any space past the art.

   Sizes are container units against .socials, which fills the band between
   the top bar and the ticker (main is a flex column). No inline styles
   anywhere on this page — the CSP forbids them — so every position is here. */

.socials {
  --safe-w: 256;
  --safe-h: 144;
  --art-w: 384;
  --art-h: 216;
  --s: min(calc(100cqw / var(--art-w)), calc(100cqh / var(--safe-h)));
  /* What the news ticker used to take (2.6 line-height at its font size,
     plus its top rule). The page no longer has one; the scene is dropped
     by this much so the lamp at the top of the painting gets more room. */
  --ticker-h: calc(2.6 * clamp(0.7rem, 1.8vw, 0.85rem) + var(--rule));

  position: relative;
  flex: 1;
  min-height: 18rem;
  overflow: hidden;
  container-type: size;
  background: #3a262f;
}

.socials__scene {
  position: absolute;
  /* Centred, then dropped by the old ticker's height (the section grew by
     that much, so half of it is already in the centring and this adds the
     other half back). Never below 0 (no gap above the art), never so far
     down that the safe zone's bottom (art y 180) leaves the section, and
     never so far up that its top (art y 36) does. */
  top: max(
    calc(-36 * var(--s)),
    min(
      0px,
      calc(100cqh - 180 * var(--s)),
      calc((100cqh - var(--art-h) * var(--s)) / 2 + var(--ticker-h) / 2)
    )
  );
  left: 50%;
  translate: -50% 0;
  width: calc(var(--art-w) * var(--s));
  height: calc(var(--art-h) * var(--s));
}

.socials__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

/* Hard cuts, no fade: a bulb flickering is on or off. enterSocials() adds
   .is-out to .socials to drop the lit layer. */
.socials.is-out .socials__lit {
  visibility: hidden;
}

/* --- the notes ------------------------------------------------------------
   Boxes read off socials-notes.png (x, y, w, h in art pixels on the
   384x216 canvas), turned into percentages so they stay on the art. */
.socials__note {
  position: absolute;
  display: block;
  cursor: pointer;
}

.socials__note--github {
  left: calc(97 / 384 * 100%);
  top: calc(57 / 216 * 100%);
  width: calc(55 / 384 * 100%);
  height: calc(62 / 216 * 100%);
}

.socials__note--linkedin {
  left: calc(164 / 384 * 100%);
  top: calc(57 / 216 * 100%);
  width: calc(57 / 384 * 100%);
  height: calc(65 / 216 * 100%);
}

.socials__note:hover {
  background: rgba(255, 255, 255, 0.14);
}

.socials__note:focus-visible {
  outline: calc(var(--s) * 1px) solid var(--yellow);
  outline-offset: calc(var(--s) * 1px);
}
