/* Main menu = Jumper + Pinout.
   Desktop: page headers stacked under the logo chip; a jumper wire from the chip's first pin drops down the
   gutter and plugs into the header you point at. MENU (all sizes) opens the chip's pinout: every page plus outside links. */
.mh { --cu: #c98a52; --cu-hi: #f0b27a; --cream: #f3e9d8;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 14px clamp(16px, 4vw, 56px); }
.mh > * { pointer-events: auto; }
.mh-left { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.mh-left > * { pointer-events: auto; }
.mh .site-logo { position: relative; }
.jp-out { position: absolute; left: 9%; top: 66%; width: 1px; height: 1px; }
@media (max-width: 860px) { .hx-scene { padding-top: 100px; } }

/* a 2-pin male header seen from above (em-based so it scales with the row) */
.jp-pad { display: flex; gap: .18em; padding: .18em; background: #121212; border-radius: 2px; box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .08); }
.jp-pad i { width: .55em; height: .55em; background: radial-gradient(circle at 40% 35%, #f8d79a, #c9963e 55%, #7a5a1e); border-radius: 1px; }

/* the column, drawn like the pinout: header -> copper trace -> page name + one mono line */
.jp { display: flex; align-items: center; gap: clamp(20px, 3vw, 64px); font-size: clamp(12px, 1.05vw, 21px); transition: opacity .2s; }
.jp ul { display: flex; flex-direction: column; gap: clamp(2px, .6vh, 10px); margin: 0; padding: 0; list-style: none; }
.jp a { display: flex; align-items: center; padding: clamp(4px, .7vh, 10px) 0; color: var(--cream); text-decoration: none; }
.jp-tr { position: relative; flex: none; width: clamp(22px, 2.2vw, 44px); height: 2px; margin: 0 .1em 0 .2em; background: rgba(201, 138, 82, .35); }
.jp-tr::before { content: ""; position: absolute; inset: 0; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.jp-tr::after { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 2px var(--c); opacity: 0; }
.jp-lb { display: flex; flex-direction: column; padding-left: .6em; }
.jp-lb b { font: 700 clamp(17px, 1.4vw, 27px)/1.05 var(--sans); letter-spacing: -.01em; transition: color .2s, transform .35s cubic-bezier(.2, .8, .2, 1); }
.jp-lb small { font: 500 clamp(10px, .62vw, 12px)/1.5 var(--mono); letter-spacing: .04em; color: rgba(243, 233, 216, .5); }
.jp li.hot .jp-tr::before { transform: none; }
.jp li.hot .jp-tr::after { animation: jp-pulse .8s ease-in infinite; }
@keyframes jp-pulse { 0% { left: 0; opacity: 1; } 85% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
.jp li.hot .jp-lb b { color: var(--c); transform: translateX(.15em); }
.jp-cta .jp-lb b { color: var(--cu); }
.jp a:focus-visible { outline: none; }
.jp a:focus-visible .jp-lb b { outline: 2px solid var(--cream); outline-offset: 4px; border-radius: 2px; }
.pn-open .jp { opacity: 0; pointer-events: none; }

/* focus: the column rests at half strength; pointing at a page lifts it, keeps the logo, and dims everything else */
.jp, .jp-wire, .pn-btn { opacity: .3; transition: opacity .3s; }   /* resting: faint, so the hero leads; hover/focus brings it back to full */
.pn-btn:hover, .pn-btn:focus-visible, .pn-open .pn-btn, .mh.hot .jp, .mh.hot .jp-wire { opacity: 1; }
.mh.hot .pn-btn { opacity: .3; }
.jp li { transition: opacity .3s; }
.mh.hot .jp li:not(.hot) { opacity: .3; }
/* the rest of the page while a page is pointed at: darkened, with real TV snow over it
   (a small canvas of fresh random grey each frame, drawn by menu.js, scaled up smooth), faint scanlines, one flicker */
.jp-dim { position: fixed; inset: 0; z-index: 0; opacity: 0; pointer-events: none; overflow: hidden; transition: opacity .25s;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px), rgba(5, 7, 12, .3); }
.jp-snow { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .38; }
.mh.hot .jp-dim { opacity: 1; animation: jp-flicker .55s steps(1) 1; }   /* light: the page stays visible under the snow */
.pn-open .jp-dim { opacity: 0; animation: none; }
@keyframes jp-flicker { 0% { opacity: .7; } 18% { opacity: 1; } 36% { opacity: .82; } 55% { opacity: 1; } 100% { opacity: 1; } }
.hx.zap { animation: hx-zap .34s steps(1) 1; }
@keyframes hx-zap { 0% { transform: translateX(-7px); } 22% { transform: translateX(5px); } 44% { transform: translateX(-3px); } 66% { transform: translateX(1px); } 100% { transform: none; } }
@media (max-width: 860px) { .pn-btn { opacity: 1; } }

/* the stage: an empty DIP socket; the hovered page's chip (same render as the logo) drops in and seats */
.jp-stage { position: relative; flex: none; width: clamp(150px, 13vw, 250px); aspect-ratio: 228 / 176; }
.jp-stage img { position: absolute; inset: 0; width: 100%; height: auto; }
.jp-sock { filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .55)); }
.jp-chip { opacity: 0; transform: translateY(-22%); filter: drop-shadow(0 34px 16px rgba(0, 0, 0, .35));
  transition: opacity .22s, transform .45s cubic-bezier(.5, 0, .7, .4), filter .45s; }
.jp-chip.seated { opacity: 1; transform: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .7));
  transition: opacity .15s, transform .5s cubic-bezier(.2, .9, .25, 1.12), filter .5s; }
.jp-ref { position: absolute; left: 4%; bottom: -1.4em; font: 600 clamp(10px, .62vw, 12px)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(243, 233, 216, .38); transition: color .2s; }
.jp-stage.on .jp-ref { color: var(--c); }
@media (max-width: 1200px) { .jp-stage { display: none; } }
@media (max-height: 820px) { .jp-lb small { display: none; } }

/* the wire: a fixed overlay, drawn by menu.js */
.jp-wire { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.jp-ws { fill: none; stroke: rgba(0, 0, 0, .55); stroke-width: 7; stroke-linecap: round; }
.jp-w { fill: none; stroke: var(--wc, #c98a52); stroke-width: 4; stroke-linecap: round; transition: stroke .2s; }
.jp-plug { fill: #161616; stroke: #000; }
.jp-tip { fill: #d9b46a; }
.pn-open .jp-wire { display: none; }
@media (max-width: 860px) { .jp, .jp-wire { display: none; } }
/* short laptop screens: tighter rows so the column stays clear of the headline */
@media (min-width: 861px) and (max-height: 700px) { .jp { font-size: 12px; } .jp a { padding: 3px 0; } .jp ul { gap: 2px; } .mh-left { gap: 4px; } .jp-lb b { font-size: 15px; } .jp-tr { width: 20px; }
  .mh .site-logo img { width: 130px; } .pn-btn { margin-top: 26px; } }

/* top-right: an icon-only socket button that opens the pinout (label is aria-label + title) */
.pn-btn { position: relative; z-index: 2; margin-top: 39px; display: grid; place-items: center; width: 56px; height: 38px; padding: 0;
  background: rgba(11, 11, 11, .72); border: 1px solid rgba(201, 138, 82, .45); border-radius: 4px; cursor: pointer; color: var(--cu);
  backdrop-filter: blur(6px); transition: border-color .2s, background-color .2s; }
.pn-btn:hover, .pn-btn:focus-visible { border-color: var(--cu); color: var(--cu-hi); }
.pn-ico { width: 38px; height: 20px; }
.pn-ico > rect { fill: #121212; stroke: currentColor; stroke-opacity: .55; }
.pn-ico-k { fill: #0b0b0b; stroke: currentColor; stroke-opacity: .55; }
.pn-ico-p rect { fill: currentColor; transition: transform .3s, opacity .3s; transform-box: fill-box; transform-origin: center; }
.pn-btn:hover .pn-ico-p rect:nth-child(odd) { transform: scale(1.3); }
.pn-open .pn-ico-p rect { transform: scale(1.25); }
.pn-open .pn-ico-p rect:nth-child(2), .pn-open .pn-ico-p rect:nth-child(3), .pn-open .pn-ico-p rect:nth-child(6), .pn-open .pn-ico-p rect:nth-child(7) { transform: scale(.4); opacity: .6; }

/* overlay */
.pn { position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; padding: 96px 16px 32px; overflow-y: auto;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(201, 138, 82, .10), transparent 70%), rgba(8, 8, 8, .93);
  backdrop-filter: blur(8px); visibility: hidden; opacity: 0; transition: opacity .35s, visibility 0s .35s; }
.pn-open .pn { visibility: visible; opacity: 1; transition: opacity .3s; }
.pn-open body { overflow: hidden; }
.pn-sheet { width: min(980px, 100%); }
.pn-cap { margin: 0 0 28px; text-align: center; font: 500 12px/1.4 var(--mono); letter-spacing: .08em; color: rgba(243, 233, 216, .55); }
.pn-cap b { color: var(--cu); }

.pn-chip { display: grid; grid-template-columns: 1fr 150px 1fr; align-items: stretch; }
.pn-body { position: relative; grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(90deg, #151515, #222 45%, #161616); border-radius: 6px; box-shadow: 0 30px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: scale(.4) translateY(-30%); opacity: 0; transition: transform .55s cubic-bezier(.2, .8, .1, 1), opacity .3s; }
.pn-open .pn-body { transform: none; opacity: 1; }
.pn-body b { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 22px/1 var(--sans); letter-spacing: .14em; color: var(--cream); }
.pn-body small { writing-mode: vertical-rl; transform: rotate(180deg); font: 500 11px/1 var(--mono); letter-spacing: .2em; color: var(--cu); }
.pn-notch { position: absolute; top: -1px; left: 50%; width: 34px; height: 17px; margin-left: -17px; background: rgba(8, 8, 8, .95); border-radius: 0 0 17px 17px; }
.pn-dot { position: absolute; top: 14px; left: 14px; width: 9px; height: 9px; border-radius: 50%; background: #0a0a0a; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .12); }

.pn-pins { display: flex; flex-direction: column; justify-content: space-around; gap: 6px; margin: 0; padding: 22px 0; list-style: none; }
.pn-l { grid-column: 1; grid-row: 1; }
.pn-r { grid-column: 3; grid-row: 1; flex-direction: column; }
.pn-pins a, .pn-pwr > span { display: flex; align-items: center; min-height: 54px; color: var(--cream); text-decoration: none; }
.pn-l a { flex-direction: row-reverse; text-align: right; }
.pn-r a, .pn-pwr > span { flex-direction: row; }
.pn-no { flex: none; width: 34px; height: 18px; display: grid; place-items: center; font: 700 10px/1 var(--mono); color: #3a2a1a;
  background: linear-gradient(180deg, #e0a56c, var(--cu) 55%, #8e5a2c); border-radius: 2px; }
.pn-l .pn-no { border-radius: 2px 0 0 2px; }
.pn-r .pn-no { border-radius: 0 2px 2px 0; }
.pn-tr { position: relative; flex: 1 1 auto; min-width: 28px; height: 2px; background: rgba(201, 138, 82, .45);
  transform: scaleX(0); transition: transform .45s cubic-bezier(.2, .8, .1, 1) calc(.18s + var(--i) * .04s), background-color .2s; }
.pn-l .pn-tr { transform-origin: right; }
.pn-r .pn-tr { transform-origin: left; }
.pn-open .pn-tr { transform: none; }
.pn-tr::after { content: ""; position: absolute; top: -3px; left: 0; width: 100%; height: 8px; opacity: 0; pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(240, 178, 122, .9)); }   /* dot on a full-width strip, moved with transform only */
.pn-l .pn-tr::after { background: radial-gradient(circle at 4px 50%, var(--cu-hi) 3.6px, transparent 4.4px); transform: translateX(calc(100% - 8px)); }
.pn-r .pn-tr::after { background: radial-gradient(circle at calc(100% - 4px) 50%, var(--cu-hi) 3.6px, transparent 4.4px); transform: translateX(calc(-100% + 8px)); }
.pn-lb { display: flex; flex-direction: column; padding: 0 14px; opacity: 0; transform: translateY(6px);
  transition: opacity .35s calc(.3s + var(--i) * .04s), transform .35s calc(.3s + var(--i) * .04s); }
.pn-open .pn-lb { opacity: 1; transform: none; }
.pn-lb b { font: 700 clamp(22px, 2.6vw, 34px)/1.1 var(--sans); letter-spacing: -.01em; transition: color .2s; }
.pn-lb small { font: 500 12px/1.5 var(--mono); color: rgba(243, 233, 216, .5); }
.pn-r .pn-lb b { font-size: 17px; }
.pn-pwr { opacity: .45; }

.pn-pins a:hover .pn-tr, .pn-pins a:focus-visible .pn-tr { background: var(--cu); }
.pn-pins a:hover .pn-lb b, .pn-pins a:focus-visible .pn-lb b { color: var(--cu-hi); }
.pn-pins a:hover .pn-no, .pn-pins a:focus-visible .pn-no { box-shadow: 0 0 14px rgba(240, 178, 122, .7); }
.pn-l a:hover .pn-tr::after, .pn-l a:focus-visible .pn-tr::after { animation: pn-pulse-l .7s ease-in infinite; }
.pn-r a:hover .pn-tr::after, .pn-r a:focus-visible .pn-tr::after { animation: pn-pulse-r .7s ease-in infinite; }
@keyframes pn-pulse-l { 0% { transform: translateX(calc(100% - 8px)); opacity: 1; } 90% { opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }
@keyframes pn-pulse-r { 0% { transform: translateX(calc(-100% + 8px)); opacity: 1; } 90% { opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }
.pn :focus-visible { outline: 2px solid var(--cu-hi); outline-offset: 4px; }

/* phone: chip turns into a slim vertical package on the left, every pin reads left to right */
@media (max-width: 720px) {
  .pn { place-items: start center; padding-top: 128px; }
  .pn-chip { grid-template-columns: 64px 1fr; }
  .pn-body { grid-column: 1; grid-row: 1 / span 2; }
  .pn-body b { font-size: 15px; }
  .pn-body small { display: none; }
  .pn-l { grid-column: 2; grid-row: 1; padding: 12px 0 0; }
  .pn-r { grid-column: 2; grid-row: 2; padding: 4px 0 12px; }
  .pn-l a { flex-direction: row; text-align: left; }
  .pn-l .pn-tr { transform-origin: left; }
  .pn-l .pn-no { border-radius: 0 2px 2px 0; }
  .pn-tr { flex: 0 0 22px; min-width: 0; }
  .pn-l .pn-tr::after { background: radial-gradient(circle at calc(100% - 4px) 50%, var(--cu-hi) 3.6px, transparent 4.4px); transform: translateX(calc(-100% + 8px)); }
  .pn-l a:hover .pn-tr::after, .pn-l a:focus-visible .pn-tr::after { animation-name: pn-pulse-r; }
  .pn-pins a, .pn-pwr > span { min-height: 46px; }
  .pn-pwr { display: none; }
  .pn-cap { margin-bottom: 16px; }
}

@media (max-width: 600px) { .pn-btn { margin-top: 26px; } }

/* no JS: header row stays as plain links (wraps on phones); the pinout and the wire are JS-only extras */
html:not(.js) .jp-wire, html:not(.js) .pn-btn, html:not(.js) .pn { display: none; }
html:not(.js) .mh { position: relative; flex-wrap: wrap; background: var(--hx-night); }
html:not(.js) .jp { display: block; }
html:not(.js) .jp-lb b { font-size: 16px; }
html:not(.js) .jp ul { flex-direction: row; flex-wrap: wrap; width: auto; gap: 4px 20px; }
html:not(.js) .jp-stage, html:not(.js) .jp-tr, html:not(.js) .jp-lb small { display: none; }
html:not(.js) .jp ul { gap: 4px 24px; }

@media (prefers-reduced-motion: reduce) {
  .jp li.hot .jp-tr::after, .mh.hot .jp-dim, .hx.zap { animation: none !important; }
  .jp-chip, .jp-tr::before, .jp-lb b, .jp, .jp li, .jp-dim, .pn-btn, .pn, .pn-body, .pn-tr, .pn-lb, .pn-btn-pins i { transition: none !important; }
  .pn-tr::after { animation: none !important; }
}
