/* Se il JS non parte, niente resta nascosto: le regole che azzerano opacità o
   larghezza valgono solo sotto `.js`, aggiunta da uno script in testa. */
/* ============================================================================
   Platform — "Volt" direction, PP (partner portal)
   ----------------------------------------------------------------------------
   The ultratech one. Carbon room, one electric accent, everything measured.

   HOW IT DIFFERS FROM PETROL, which is also dark: Petrol is a quiet instrument
   — soft tiles, one aqua signal, prose in a serif. Volt is a console. Chamfered
   corners instead of rounded, hairlines that glow instead of shadows, mono for
   every label and every number, and NO SERIF ANYWHERE — the only direction in
   the set that drops Fraunces. Petrol whispers that there is machinery; Volt
   shows you the machinery.

   WHAT THE STYLE DATABASE GOT RIGHT, AND WHAT IT GOT WRONG. The HUD/cyberpunk
   entries call for 1px lines, neon on black and heavy glow, and they flag
   themselves as poor for accessibility. That warning is the design brief:
     · the room is carbon (18.5% L), not #000 — pure black makes every glow
       bloom and every edge vibrate;
     · lines are 1px but at 30% opacity minimum, and every interactive edge
       goes to full on focus;
     · glow is a halo behind a shape, never a text-shadow under body copy;
     · lime on carbon is ~13:1, so the accent is genuinely readable rather
       than atmospheric.

   The result should read as a professional console a client is trusted with,
   not as a film prop.
   ============================================================================ */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-700.woff2") format("woff2"); }

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --void:   oklch(0.145 0.014 262);
  --carbon: oklch(0.185 0.016 260);
  --panel:  oklch(0.225 0.018 258);
  --panel-2:oklch(0.268 0.020 256);
  --edge:   oklch(1 0 0 / .10);
  --edge-2: oklch(1 0 0 / .18);

  --ink:   oklch(0.965 0.004 250);
  --muted: oklch(0.735 0.014 250);
  --faint: oklch(0.585 0.016 250);

  /* The accent. ~13:1 on carbon, so it can carry text and not just mood. */
  --volt:      oklch(0.875 0.190 128);
  --volt-deep: oklch(0.640 0.150 130);
  --volt-dim:  oklch(0.875 0.190 128 / .14);
  --volt-line: oklch(0.875 0.190 128 / .42);
  --on-volt:   oklch(0.16 0.02 130);

  /* Your move. Magenta rather than amber — amber belongs to the daylight
     directions, and on carbon it goes muddy against the lime. */
  --mag:      oklch(0.720 0.210 340);
  --mag-dim:  oklch(0.720 0.210 340 / .16);
  --mag-line: oklch(0.720 0.210 340 / .45);

  --cyan:     oklch(0.820 0.120 208);
  --cyan-dim: oklch(0.820 0.120 208 / .15);
  --warn:     oklch(0.800 0.150 78);
  --no:       oklch(0.680 0.190 22);

  --s1: 6px; --s2: 10px; --s3: 16px; --s4: 22px; --s5: 32px; --s6: 48px; --s7: 68px;

  --r:      4px;
  --r-lg:   6px;
  --r-pill: 999px;
  --chamfer: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-back: cubic-bezier(.34, 1.4, .64, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--void); color: var(--ink);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(oklch(1 0 0 / .022) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / .022) 1px, transparent 1px),
    radial-gradient(70% 50% at 50% -10%, oklch(0.875 0.190 128 / .07), transparent 70%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
  background-attachment: fixed;
}
/* One scanline sheet over the whole page, at an opacity you can only see if
   you look for it. Any stronger and long-form reading gets tiring. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: repeating-linear-gradient(0deg, oklch(0 0 0 / .16) 0 1px, transparent 1px 3px);
  opacity: .35;
}
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
::selection { background: var(--volt-line); color: var(--ink); }

/* ---- Mono furniture ------------------------------------------------------
   Labels, codes, counts and timestamps are all mono; prose is not. That split
   is what keeps the page technical without making it unreadable. */
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
       font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--volt); flex: none;
            box-shadow: 0 0 8px var(--volt); }
.tag.live .dot { animation: pulseDot 2s var(--ease) infinite; }
.tag.mag { color: var(--mag); } .tag.mag .dot { background: var(--mag); box-shadow: 0 0 8px var(--mag); }

/* ---- Top bar ------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: var(--s4);
       padding: 9px clamp(14px, 3vw, 30px);
       background: oklch(0.145 0.014 262 / .90); backdrop-filter: blur(12px);
       border-bottom: 1px solid var(--edge); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
              background: linear-gradient(90deg, transparent, var(--volt-line) 30%, var(--volt-line) 70%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.brand .sub { display: block; font-family: var(--font-mono); font-size: 9.5px; color: var(--faint);
              letter-spacing: .12em; text-transform: uppercase; }
.mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center;
        font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--on-volt);
        background: var(--volt); clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
        box-shadow: 0 0 16px oklch(0.875 0.190 128 / .45); }
.nav { display: flex; gap: 1px; flex: 1; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px;
         text-decoration: none; color: var(--muted); font-family: var(--font-mono);
         font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
         border-bottom: 2px solid transparent;
         transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease); }
.nav a:hover { color: var(--ink); background: oklch(1 0 0 / .04); }
.nav a.on { color: var(--volt); border-bottom-color: var(--volt); background: var(--volt-dim); }
.nav a .n { margin-left: 7px; font-size: 10px; color: var(--mag); }
.top .right { display: flex; align-items: center; gap: var(--s3); flex: none; }
.who { text-align: right; line-height: 1.2; }
.who .n { font-size: 12.5px; font-weight: 600; }
.who .o { font-family: var(--font-mono); font-size: 9.5px; color: var(--faint); letter-spacing: .1em; }
.me { width: 34px; height: 34px; flex: none; display: grid; place-items: center; cursor: pointer;
      font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--volt);
      background: var(--panel); border: 1px solid var(--volt-line); border-radius: var(--r); }
@media (max-width: 900px) { .nav, .who { display: none; } }

/* ---- Frame --------------------------------------------------------------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: var(--s5) clamp(14px, 3vw, 30px) var(--s7); }

h1.display { font-family: var(--font-sans); font-weight: 700;
             font-size: clamp(28px, 4vw, 46px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 var(--s3); }
h1.display em { font-style: normal; color: var(--volt); }
.lede { font-size: 15.5px; line-height: 1.7; color: var(--muted); max-width: 62ch; margin: 0; }

.h-sec { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s3);
         font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
         text-transform: uppercase; color: var(--faint); }
.h-sec::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--volt);
                 clip-path: polygon(0 0, 100% 0, 100% 60%, 60% 100%, 0 100%); }
.h-sec::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.h-sec .n { color: var(--volt); }
.h-sec.mag::before { background: var(--mag); } .h-sec.mag .n { color: var(--mag); }

/* ---- Grid & panels ------------------------------------------------------- */
.g12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s3); align-items: start; }
.c3{grid-column:span 3}.c4{grid-column:span 4}.c5{grid-column:span 5}.c6{grid-column:span 6}
.c7{grid-column:span 7}.c8{grid-column:span 8}.c12{grid-column:span 12}
@media (max-width: 1100px) { .c3,.c4{grid-column:span 6} .c5,.c7,.c8{grid-column:span 12} }
@media (max-width: 700px) { .g12 > * { grid-column: span 12 !important; } }

.pane { position: relative; background: var(--carbon); border: 1px solid var(--edge);
        border-radius: var(--r-lg); transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.pane.pad { padding: var(--s4); }
.pane.tight { padding: var(--s3); }
.pane.cut { clip-path: var(--chamfer); border-radius: 0; }
/* Corner ticks: the cheapest possible "instrument" signal, and unlike a glow
   they cost nothing and never blur the text behind them. */
.pane.ticks::before, .pane.ticks::after {
  content: ""; position: absolute; width: 10px; height: 10px; border: 1px solid var(--volt-line); pointer-events: none;
}
.pane.ticks::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.pane.ticks::after  { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.pane.hot { border-color: var(--mag-line); }
.pane.lit { border-color: var(--volt-line); box-shadow: 0 0 0 1px var(--volt-dim), 0 0 30px oklch(0.875 0.190 128 / .10); }
.pane.lift:hover { border-color: var(--volt-line); box-shadow: 0 0 26px oklch(0.875 0.190 128 / .10); }

/* ---- Buttons ------------------------------------------------------------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       min-height: 44px; padding: 10px 20px; cursor: pointer;
       font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
       color: var(--ink); background: var(--panel); border: 1px solid var(--edge-2); border-radius: var(--r);
       transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { border-color: var(--volt-line); color: var(--volt); box-shadow: 0 0 18px oklch(0.875 0.190 128 / .16); }
.btn:active { transform: translateY(1px); }
.btn-volt { color: var(--on-volt); background: var(--volt); border-color: var(--volt); font-weight: 700;
            box-shadow: 0 0 20px oklch(0.875 0.190 128 / .35); }
.btn-volt:hover { color: var(--on-volt); background: var(--volt); box-shadow: 0 0 30px oklch(0.875 0.190 128 / .55); }
.btn-mag { color: var(--on-volt); background: var(--mag); border-color: var(--mag); font-weight: 700;
           box-shadow: 0 0 20px oklch(0.720 0.210 340 / .35); }
.btn-mag:hover { color: var(--on-volt); box-shadow: 0 0 30px oklch(0.720 0.210 340 / .55); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--faint); }
.btn-quiet:hover { color: var(--no); border-color: oklch(0.680 0.190 22 / .4); box-shadow: none; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 11px; }
.btn-xs { min-height: 32px; padding: 6px 11px; font-size: 10.5px; }
@media (pointer: coarse) { .btn-sm, .btn-xs { min-height: 44px; } }
.link { color: var(--volt); text-decoration: none; border-bottom: 1px solid var(--volt-line); }
.link:hover { border-bottom-color: var(--volt); }

.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 14px; cursor: pointer;
        font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
        color: var(--muted); background: transparent; border: 1px solid var(--edge-2); border-radius: var(--r);
        transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease); }
.chip:hover { color: var(--ink); border-color: var(--edge-2); background: oklch(1 0 0 / .04); }
.chip.on { color: var(--volt); border-color: var(--volt-line); background: var(--volt-dim); }
@media (pointer: coarse) { .chip { min-height: 44px; } }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
         font-family: var(--font-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase;
         color: var(--muted); background: oklch(1 0 0 / .05); border: 1px solid var(--edge-2); border-radius: var(--r); }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge.you  { color: var(--mag);  background: var(--mag-dim);  border-color: var(--mag-line); }
.badge.live { color: var(--volt); background: var(--volt-dim); border-color: var(--volt-line); }
.badge.info { color: var(--cyan); background: var(--cyan-dim); border-color: oklch(0.820 0.120 208 / .4); }
.code { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .04em; }

/* ---- Data ---------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px var(--s3); margin: 0; font-size: 13.5px; }
.kv dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
         color: var(--faint); align-self: center; white-space: nowrap; }
.kv dd { margin: 0; text-align: right; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
.kv dd.hot { color: var(--mag); }

.stat .n { font-family: var(--font-mono); font-size: clamp(30px, 3.6vw, 42px); font-weight: 700;
           line-height: 1; letter-spacing: -.02em; color: var(--volt); font-variant-numeric: tabular-nums;
           text-shadow: 0 0 22px oklch(0.875 0.190 128 / .35); }
.stat .n.mag { color: var(--mag); text-shadow: 0 0 22px oklch(0.720 0.210 340 / .35); }
.stat .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
           color: var(--faint); margin-top: 9px; }

/* Skill bars read as a level meter: discrete cells, not a smooth gradient. */
.skills { display: grid; gap: 7px; }
.skill { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 11px;
         font-family: var(--font-mono); font-size: 12px; }
.skill .nm { color: var(--muted); letter-spacing: .04em; }
.skill.req .nm { color: var(--volt); }
.skill .cells { display: flex; gap: 3px; }
.skill .cells i { width: 9px; height: 12px; background: oklch(1 0 0 / .09); border-radius: 1px;
                  transform: scaleY(.3); opacity: 0; transition: transform .3s var(--ease-back), opacity .25s var(--ease), background .3s var(--ease); }
.in .skill .cells i, .skills.in .cells i { transform: scaleY(1); opacity: 1; }
.in .skill .cells i.f, .skills.in .cells i.f { background: var(--volt-deep); }
.skill.req .cells i.f { background: var(--volt); box-shadow: 0 0 7px oklch(0.875 0.190 128 / .5); }
.skill .cells i:nth-child(1){transition-delay:.02s}.skill .cells i:nth-child(2){transition-delay:.05s}
.skill .cells i:nth-child(3){transition-delay:.08s}.skill .cells i:nth-child(4){transition-delay:.11s}
.skill .cells i:nth-child(5){transition-delay:.14s}.skill .cells i:nth-child(6){transition-delay:.17s}
.skill .cells i:nth-child(7){transition-delay:.20s}.skill .cells i:nth-child(8){transition-delay:.23s}
.skill .yr { color: var(--faint); font-size: 10.5px; white-space: nowrap; }

.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 var(--s3) var(--s4); }
.tl li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 8px; height: 8px;
                 background: var(--panel-2); border: 1px solid var(--edge-2);
                 clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tl li.hi::before { background: var(--volt); border-color: var(--volt); box-shadow: 0 0 9px var(--volt); }
.tl li::after { content: ""; position: absolute; left: 5.5px; top: 16px; bottom: 2px; width: 1px; background: var(--edge); }
.tl li:last-child { padding-bottom: 0; } .tl li:last-child::after { display: none; }
.tl .role { font-size: 14.5px; font-weight: 650; }
.tl .co { font-size: 13px; color: var(--muted); }
.tl .when { font-family: var(--font-mono); font-size: 10px; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; margin-top: 3px; }
.tl .did { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.tl .stack { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tl .stack span { font-family: var(--font-mono); font-size: 10px; color: var(--volt);
                  background: var(--volt-dim); border: 1px solid var(--volt-line); border-radius: 2px; padding: 2px 6px; }

.rows { display: flex; flex-direction: column; gap: var(--s2); }
.rowcard { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto;
           align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
           text-decoration: none; color: inherit; background: var(--carbon);
           border: 1px solid var(--edge); border-radius: var(--r-lg);
           transition: border-color .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease); }
.rowcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
                   background: var(--volt); transform: scaleY(0); transition: transform .25s var(--ease-back); }
.rowcard.yours::before { background: var(--mag); }
.rowcard:hover { border-color: var(--volt-line); background: var(--panel);
                 box-shadow: inset 0 0 30px oklch(0.875 0.190 128 / .05); }
.rowcard:hover::before, .rowcard:focus-visible::before { transform: scaleY(1); }
.rowcard h3 { font-size: 16px; font-weight: 650; letter-spacing: -.012em; margin: 0 0 4px; }
.rowcard .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
                 font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--faint); }
.rowcard .aside { display: flex; align-items: center; gap: var(--s3); justify-self: end; }
.rowcard .note { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-align: right; letter-spacing: .04em; }
.rowcard .note b { color: var(--volt); font-weight: 400; }
@media (max-width: 860px) { .rowcard { grid-template-columns: 1fr; } .rowcard .aside { justify-self: start; flex-wrap: wrap; } .rowcard .note { text-align: left; } }

/* Progress as discrete segments — a console counts, it does not fill. */
.segs { display: flex; gap: 3px; }
.segs i { width: 16px; height: 4px; background: oklch(1 0 0 / .10); border-radius: 1px;
          transform: scaleX(.2); opacity: 0; transition: transform .4s var(--ease-back), opacity .3s var(--ease), background .3s var(--ease); }
.in .segs i, .segs.in i { transform: scaleX(1); opacity: 1; }
.in .segs i.done, .segs.in i.done { background: var(--volt-deep); }
.in .segs i.here, .segs.in i.here { background: var(--volt); box-shadow: 0 0 9px var(--volt); animation: segPulse 2.2s var(--ease) infinite; }
.segs i:nth-child(1){transition-delay:.03s}.segs i:nth-child(2){transition-delay:.07s}
.segs i:nth-child(3){transition-delay:.11s}.segs i:nth-child(4){transition-delay:.15s}
.segs i:nth-child(5){transition-delay:.19s}.segs i:nth-child(6){transition-delay:.23s}

.quote { margin: 0 0 var(--s3); padding-left: var(--s3); border-left: 1px solid var(--volt-line);
         font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.quote:last-child { margin-bottom: 0; }
.quote .by { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 9.5px;
             letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

.slot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%;
        padding: 10px 13px; cursor: pointer; text-align: left; color: var(--ink);
        background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r);
        font-family: var(--font-mono); font-size: 12px;
        transition: border-color .18s var(--ease), background .18s var(--ease); }
.slot:hover { border-color: var(--volt-line); background: var(--panel-2); }
.slot .h { color: var(--faint); font-size: 10.5px; letter-spacing: .08em; }

.doc { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--edge); }
.doc:last-child { border-bottom: 0; padding-bottom: 0; }
.doc .ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: var(--volt);
           background: var(--volt-dim); border: 1px solid var(--volt-line); border-radius: var(--r); }
.doc .t { flex: 1; min-width: 0; }
.doc .t b { display: block; font-size: 13px; font-weight: 600; }
.doc .t span { font-family: var(--font-mono); font-size: 9.5px; color: var(--faint); letter-spacing: .1em; }

/* ---- Fields -------------------------------------------------------------- */
.field { margin-bottom: var(--s3); }
.field label { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
               text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.field input { width: 100%; min-height: 46px; padding: 12px 14px; font-size: 14.5px; color: var(--ink);
               background: var(--void); border: 1px solid var(--edge-2); border-radius: var(--r); outline: none;
               transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.field input::placeholder { color: var(--faint); }
.field input:focus { border-color: var(--volt); box-shadow: 0 0 0 3px var(--volt-dim), 0 0 22px oklch(0.875 0.190 128 / .18); }
.hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); margin: -4px 0 var(--s3); letter-spacing: .04em; }

/* ---- Motion -------------------------------------------------------------- */
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes segPulse { 0%,100% { box-shadow: 0 0 9px var(--volt); } 50% { box-shadow: 0 0 16px var(--volt); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
/* The boot line: a hairline that runs across a panel once, when it arrives. */
@keyframes sweepLine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.rise { animation: rise .6s var(--ease) both; }
.d1{animation-delay:.04s}.d2{animation-delay:.10s}.d3{animation-delay:.16s}
.d4{animation-delay:.22s}.d5{animation-delay:.28s}.d6{animation-delay:.34s}

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .stagger > * { opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .42s var(--ease-back); }
.js .stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1){transition-delay:.00s}.stagger.in > *:nth-child(2){transition-delay:.06s}
.stagger.in > *:nth-child(3){transition-delay:.12s}.stagger.in > *:nth-child(4){transition-delay:.18s}
.stagger.in > *:nth-child(5){transition-delay:.24s}.stagger.in > *:nth-child(6){transition-delay:.30s}

/* A panel announces itself with one pass of light along its top edge. */
.sweep { position: relative; overflow: hidden; }
.sweep > .beam { position: absolute; top: 0; left: 0; right: 0; height: 1px;
                 background: linear-gradient(90deg, transparent, var(--volt), transparent); opacity: 0; }
.sweep.in > .beam { opacity: 1; animation: sweepLine 1.1s var(--ease) both; }

.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor;
          opacity: .2; transform: scale(0); animation: ripple .55s var(--ease) forwards; }

.thread-bar { position: fixed; inset: 0 0 auto; height: 2px; z-index: 90; transform-origin: 0 50%;
              transform: scaleX(var(--p, 0)); background: var(--volt); box-shadow: 0 0 12px var(--volt); }

/* ---- Switcher ------------------------------------------------------------ */
.style-switch { position: fixed; bottom: 14px; right: 14px; z-index: 80; display: flex; align-items: center; gap: 3px;
                padding: 4px 4px 4px 11px; background: var(--carbon); border: 1px solid var(--edge-2); border-radius: var(--r);
                font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.style-switch a { padding: 6px 10px; border-radius: 2px; text-decoration: none; color: var(--muted);
                  font-size: 10.5px; letter-spacing: .06em; transition: color .18s var(--ease), background .18s var(--ease); }
.style-switch a:hover { color: var(--ink); background: oklch(1 0 0 / .05); }
.style-switch a.on { color: var(--on-volt); background: var(--volt); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
                           transition-duration: .001ms !important; }
  .reveal, .stagger > * { opacity: 1; transform: none; }
  .segs i, .skill .cells i { transform: none; opacity: 1; }
  .sweep > .beam { display: none; }
  body::after { display: none; }
}

/* ============================================================================
   THE ASSISTANT, IN THE CONSOLE
   ----------------------------------------------------------------------------
   Same creature as the daylight direction, deliberately unchanged. A console
   this cold needs exactly one warm-blooded thing in it, and redrawing her in
   wireframe would have thrown away the only part of the set that is already
   a product asset rather than a style exercise. Cream on carbon carries a
   contrast of its own, so she reads as a character in the room, not as a
   sticker on a dashboard.
   ============================================================================ */

.buddy-wrap { position: relative; flex: none; }
.buddy-btn {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  --skin: oklch(0.975 0.012 92); --line-b: oklch(0.185 0.030 250);
  --mouth: oklch(0.720 0.150 42); --blush: oklch(0.790 0.090 22); --heart: oklch(0.680 0.190 25);
}
.buddy-btn:hover { background: oklch(1 0 0 / .05); border-color: var(--volt-line); }
.buddy { display: block; width: 34px; height: 34px; overflow: visible; transition: transform .22s var(--ease-back); }
.buddy-btn:active .buddy { transform: scale(.93); }
.buddy .skin   { fill: var(--skin); stroke: var(--line-b); stroke-width: 3.4; stroke-linejoin: round; }
.buddy .seam   { fill: none; stroke: var(--line-b); stroke-width: 1.5; opacity: .5; }
.buddy .ink    { fill: var(--line-b); }
.buddy .stroke { fill: none; stroke: var(--line-b); stroke-width: 4.2; stroke-linecap: round; }
.buddy .mouth  { fill: var(--mouth); stroke: var(--line-b); stroke-width: 2.6; stroke-linejoin: round; }
.buddy .blush  { fill: var(--blush); opacity: .75; }
.buddy .heart  { fill: var(--heart); }
.buddy .shine  { fill: oklch(1 0 0); opacity: .9; }
.buddy .eyes, .buddy .pupil, .buddy .body { transform-box: fill-box; transform-origin: center; }

.buddy .mood { display: none; }
.buddy-btn[data-mood="idle"] .m-idle, .buddy-btn[data-mood="happy"] .m-happy,
.buddy-btn[data-mood="wink"] .m-wink, .buddy-btn[data-mood="surprised"] .m-surprised,
.buddy-btn[data-mood="thinking"] .m-thinking, .buddy-btn[data-mood="sleepy"] .m-sleepy,
.buddy-btn[data-mood="cool"] .m-cool, .buddy-btn[data-mood="love"] .m-love { display: block; }
.buddy-btn:not([data-mood]) .m-idle { display: block; }
.buddy-btn:hover:not([data-mood="thinking"]):not([data-mood="surprised"]):not([data-mood="love"]) .mood { display: none; }
.buddy-btn:hover:not([data-mood="thinking"]):not([data-mood="surprised"]):not([data-mood="love"]) .m-wink { display: block; }

.buddy-float { display: block; animation: float 3.6s var(--ease) infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2.5px) rotate(-2.5deg); } }
.buddy .lids { animation: blink 6.8s infinite; transform-box: fill-box; transform-origin: 50% 0%; }
.buddy .lids rect { fill: var(--skin); }
@keyframes blink { 0%,93.5%,100% { transform: scaleY(0); } 95.5% { transform: scaleY(1); } }

/* Pending, in a console, also lights the housing — the creature is inside an
   instrument here, so the instrument reacts with her. */
.buddy-btn.pending { border-color: var(--mag-line); box-shadow: 0 0 18px oklch(0.720 0.210 340 / .28); }
.buddy-btn.pending .buddy-float { animation: nudge 4.6s var(--ease) infinite; }
@keyframes nudge {
  0%,60%,100% { transform: translateY(0) rotate(0deg); }
  64% { transform: translateY(-8px) rotate(-8deg) scale(1.04); }
  70% { transform: translateY(0) rotate(0deg) scale(.98); }
  75% { transform: translateY(-5px) rotate(6deg); }
  81% { transform: translateY(0) rotate(0deg); }
  85% { transform: translateY(-2px) rotate(-2deg); }
}
.buddy .mark { animation: markPop 2.4s var(--ease) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes markPop { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.14); opacity: .75; } }
.buddy-btn[aria-expanded="true"] { background: var(--volt-dim); border-color: var(--volt-line); }
.buddy-btn[aria-expanded="true"] .buddy-float { animation: none; transform: none; }

/* ---- Panel --------------------------------------------------------------- */
.assist-drop {
  position: absolute; top: calc(100% + 10px); right: -2px; z-index: 70;
  width: min(400px, calc(100vw - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--carbon); border: 1px solid var(--volt-line); border-radius: var(--r-lg);
  box-shadow: 0 20px 60px oklch(0 0 0 / .6), 0 0 40px oklch(0.875 0.190 128 / .10);
  transform-origin: calc(100% - 20px) -10px;
}
.assist-drop[hidden] { display: none; }
.assist-drop.opening { animation: dropIn .34s var(--ease-back) both; }
.assist-drop.closing { animation: dropOut .16s var(--ease) both; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes dropOut { to { opacity: 0; transform: translateY(-6px) scale(.92); } }
@media (max-width: 560px) { .assist-drop { position: fixed; top: 58px; right: 10px; left: 10px; width: auto; } }

.assist-head { display: flex; align-items: center; gap: 10px; padding: var(--s3) var(--s3) var(--s2);
               border-bottom: 1px solid var(--edge); }
.assist-head .face { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--r);
                     font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--volt);
                     background: var(--volt-dim); border: 1px solid var(--volt-line); }
.assist-head .who-t { flex: 1; min-width: 0; }
.assist-head .who-t b { display: block; font-size: 13.5px; font-weight: 650; }
.assist-head .who-t span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
                           text-transform: uppercase; color: var(--faint); }
.assist-scope { padding: 8px var(--s3); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em;
                color: var(--cyan); background: var(--cyan-dim); border-bottom: 1px solid var(--edge); }
.assist-thread { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3);
                 max-height: 340px; overflow-y: auto; }
.assist-thread .said { display: flex; gap: 9px; align-items: flex-start; }
.assist-thread .said .f { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 3px;
                          font-family: var(--font-mono); font-size: 9px; color: var(--volt);
                          background: var(--volt-dim); border: 1px solid var(--volt-line); }
.assist-thread .bubble { padding: 10px 12px; border-radius: var(--r); background: var(--panel);
                         border: 1px solid var(--edge); font-size: 13px; line-height: 1.6; color: var(--muted); }
.assist-thread .bubble b { color: var(--volt); font-weight: 600; }
.assist-thread .mine { display: flex; justify-content: flex-end; }
.assist-thread .mine .bubble { background: var(--volt-dim); border-color: var(--volt-line); color: var(--ink);
                               font-family: var(--font-mono); font-size: 11.5px; }
.typing { display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px;
          background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--volt); opacity: .4;
            animation: typing 1.2s var(--ease) infinite; }
.typing i:nth-child(2){animation-delay:.15s} .typing i:nth-child(3){animation-delay:.3s}
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .3; } 30% { transform: translateY(-4px); opacity: 1; } }
.said[data-typing] > .bubble { display: none; }
.said[data-typing].spoken > .bubble { display: block; }
.said[data-typing].spoken > .typing { display: none; }

.assist-asks { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 var(--s3) var(--s3); }
.ask-chip { min-height: 34px; padding: 7px 11px; cursor: pointer;
            font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em;
            color: var(--volt); background: transparent; border: 1px solid var(--volt-line); border-radius: var(--r);
            transition: background .18s var(--ease); }
.ask-chip:hover { background: var(--volt-dim); }
@media (pointer: coarse) { .ask-chip { min-height: 44px; } }
.assist-composer { display: flex; gap: 7px; padding: var(--s3); border-top: 1px solid var(--edge); background: var(--void); }
.assist-composer input { flex: 1; min-width: 0; min-height: 40px; padding: 9px 12px; font-size: 13px; color: var(--ink);
                         background: var(--carbon); border: 1px solid var(--edge-2); border-radius: var(--r); outline: none; }
.assist-composer input:focus { border-color: var(--volt); box-shadow: 0 0 0 2px var(--volt-dim); }
.assist-composer button { width: 40px; height: 40px; flex: none; display: grid; place-items: center; cursor: pointer;
                          color: var(--on-volt); background: var(--volt); border: 0; border-radius: var(--r); }
.sticky { position: sticky; top: 66px; }

@media (prefers-reduced-motion: reduce) {
  .buddy-float, .buddy .lids, .buddy .mark, .buddy-btn.pending .buddy-float,
  .assist-drop.opening, .assist-drop.closing { animation: none !important; }
  .buddy .lids { transform: scaleY(0); }
  .typing { display: none !important; }
  .said[data-typing] > .bubble { display: block !important; }
}

/* Il testo che si risolve dal rumore cambia larghezza a ogni frame: senza un
   blocco inline il titolo ballerebbe e trascinerebbe con sé la riga sotto.
   `tnum` tiene le cifre a larghezza fissa mentre scorrono. */
.scramble { display: inline-block; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
