/* ============================================================
   CARLO PEZZOTTI — FOGLIO DI STILE
   Linguaggio visivo: pannello frontale di un apparecchio hi-fi.
   Superfici piatte in alluminio, incisioni da 1px, una sola spia
   ambra come colore di segnale. Gli unici oggetti con profondita'
   sono gli strumenti del banco di lavoro.

   1. Token
   2. Reset e base
   3. Impianto di pagina (unita', righe incise, colonne)
   4. Tipografia
   5. Controlli fissi (tema, lingua) e scala di sintonia
   6. Inizio: targa e quadranti
   7. Profilo: specifiche, scala CEFR, mappa
   8. Percorso: registro esperienze, scuole, chip
   9. Banco di lavoro: giradischi, terminale, cabinato
   10. Progetti: conteggi, filtri, righe repository
   11. Contatti e piede
   12. Accensione (unica sequenza animata)
   13. Responsive
   14. Movimento ridotto, stampa
   ============================================================ */

/* --- 1. TOKEN ------------------------------------------------ */
:root {
    /* Alluminio: la faccia dell'apparecchio */
    --ground: #dcd9d3;
    --panel: #eceae5;
    --panel-2: #e2dfd8;
    --panel-3: #d7d3cb;

    --ink: #191817;
    --ink-2: #4f4b44;
    --ink-3: #66615a;

    --hair: #bfbbb2;
    --hair-soft: #d3cfc7;

    /* Segnale: spia ambra + verde strumento */
    --lamp: #d1660a;
    --lamp-ink: #a44f00;
    --lamp-glow: rgba(209, 102, 10, 0.35);
    --signal: #10706a;

    --alert: #b3261e;

    --shadow-object: 0 1px 1px rgba(25, 24, 23, .12), 0 10px 24px -12px rgba(25, 24, 23, .35);
    --noise-opacity: .035;
    --noise-blend: multiply;

    /* Tipografia */
    --font-sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --font-pixel: 'Press Start 2P', monospace;

    --t-xs: .75rem;
    --t-sm: .8125rem;
    --t-base: .9375rem;
    --t-md: 1.0625rem;
    --t-lg: 1.25rem;
    --t-xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
    --t-display: clamp(2.5rem, calc(16vw - 6px), 9.5rem);

    /* Ritmo */
    --gutter: clamp(1.25rem, 4vw, 3.5rem);
    --bay: clamp(4rem, 9vh, 7rem);
    --max: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ground: #0c0c0b;
        --panel: #171716;
        --panel-2: #121211;
        --panel-3: #201f1d;

        --ink: #ece9e2;
        --ink-2: #aaa59b;
        --ink-3: #837d73;

        --hair: #302f2c;
        --hair-soft: #262523;

        --lamp: #ff9a34;
        --lamp-ink: #ffa94d;
        --lamp-glow: rgba(255, 154, 52, .4);
        --signal: #45bfb1;

        --alert: #f2725f;

        --shadow-object: 0 1px 0 rgba(255, 255, 255, .05), 0 18px 34px -16px rgba(0, 0, 0, .8);
        --noise-opacity: .05;
        --noise-blend: screen;
    }
}

:root[data-theme="dark"] {
    --ground: #0c0c0b;
    --panel: #171716;
    --panel-2: #121211;
    --panel-3: #201f1d;

    --ink: #ece9e2;
    --ink-2: #aaa59b;
    --ink-3: #837d73;

    --hair: #302f2c;
    --hair-soft: #262523;

    --lamp: #ff9a34;
    --lamp-ink: #ffa94d;
    --lamp-glow: rgba(255, 154, 52, .4);
    --signal: #45bfb1;

    --alert: #f2725f;

    --shadow-object: 0 1px 0 rgba(255, 255, 255, .05), 0 18px 34px -16px rgba(0, 0, 0, .8);
    --noise-opacity: .05;
    --noise-blend: screen;
}

/* --- 2. RESET E BASE ---------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

/* display:flex/grid batte la regola utente-agente per [hidden]:
   senza questo, conteggi e filtri vuoti resterebbero visibili. */
[hidden] {
    display: none !important;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    background: var(--panel);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--t-base);
    font-variation-settings: 'wdth' 100, 'wght' 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Grana della vernice: rompe la superficie piatta senza decorarla */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: var(--noise-opacity);
    mix-blend-mode: var(--noise-blend);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
iframe,
canvas {
    max-width: 100%;
    display: block;
}

a {
    color: var(--ink);
    text-decoration-color: var(--hair);
    text-underline-offset: .22em;
}

a:hover {
    text-decoration-color: var(--lamp);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--lamp);
    outline-offset: 3px;
    border-radius: 1px;
}

::selection {
    background: var(--lamp);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--panel-2);
}

::-webkit-scrollbar-thumb {
    background: var(--hair);
    border: 3px solid var(--panel-2);
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: .7rem 1.1rem;
    background: var(--ink);
    color: var(--panel);
    text-decoration: none;
}

.skip-link:focus {
    left: .75rem;
    top: .75rem;
}

.mono {
    font-family: var(--font-mono);
    font-size: .92em;
    letter-spacing: -.01em;
}

.digits {
    font-variant-numeric: tabular-nums;
}

/* --- 3. IMPIANTO DI PAGINA ---------------------------------- */
.wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
    position: relative;
    z-index: 2;
}

.unit {
    padding-block: var(--bay);
}

/* Alloggiamenti incassati: danno ritmo verticale senza schede */
.unit--hero {
    padding-block: clamp(5rem, 14vh, 9rem) var(--bay);
}

#workbench,
.unit--contact {
    background: var(--panel-2);
    border-block: 1px solid var(--hair-soft);
}

/* Riga incisa: il titolo E il divisore sono lo stesso oggetto */
.rule {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 2rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hair);
}

.cols {
    display: grid;
    gap: clamp(2.5rem, 5vw, 4.5rem);
}

.cols--bio {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}

.cols--path {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.subunit>h3:first-child {
    margin-bottom: 1.25rem;
}

.mt {
    margin-top: 2.75rem;
}

/* --- 4. TIPOGRAFIA ------------------------------------------ */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.015em;
}

h2 {
    font-size: var(--t-xl);
    font-variation-settings: 'wdth' 112, 'wght' 700;
    flex: 0 0 auto;
}

h3 {
    font-size: var(--t-lg);
    font-variation-settings: 'wdth' 106, 'wght' 600;
}

.role {
    font-size: var(--t-md);
    font-variation-settings: 'wdth' 100, 'wght' 500;
    color: var(--ink);
    max-width: 34ch;
    margin-top: clamp(1.25rem, 3vw, 2rem);
}

.lead {
    font-size: var(--t-md);
    color: var(--ink-2);
    max-width: 58ch;
    margin-top: .85rem;
    line-height: 1.62;
}

.lead--tight {
    margin-top: 0;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.prose p {
    max-width: 62ch;
    color: var(--ink-2);
    line-height: 1.68;
}

.prose p+p {
    margin-top: 1.1rem;
}

.note {
    font-size: var(--t-xs);
    color: var(--ink-3);
    margin-top: .85rem;
}

/* Bottoni: interruttori, non pillole */
.btn {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 1.15rem;
    border: 1px solid var(--hair);
    border-radius: 3px;
    background: var(--panel);
    color: var(--ink);
    font-size: var(--t-sm);
    font-variation-settings: 'wdth' 100, 'wght' 600;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
    transition: border-color .16s, background-color .16s, transform .08s;
}

:root[data-theme="dark"] .btn,
:root:not([data-theme="light"]) .btn {
    box-shadow: none;
}

.btn:hover {
    border-color: var(--ink-3);
    background: var(--panel-3);
}

.btn:active {
    transform: translateY(1px);
}

.btn--solid {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--panel);
    box-shadow: none;
}

.btn--solid:hover {
    background: var(--lamp-ink);
    border-color: var(--lamp-ink);
    color: #fff;
}

/* --- 5. CONTROLLI FISSI E SCALA DI SINTONIA ----------------- */
.panel-controls {
    position: fixed;
    top: clamp(.75rem, 2vw, 1.5rem);
    right: clamp(.75rem, 2vw, 1.5rem);
    z-index: 40;
    display: flex;
    gap: .5rem;
}

.ctl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .55rem;
    border: 1px solid var(--hair);
    border-radius: 3px;
    background: var(--panel);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    transition: color .16s, background-color .16s, border-color .16s;
}

.ctl:hover {
    color: var(--ink);
    background: var(--panel-3);
}

.ctl-group {
    display: flex;
    border: 1px solid var(--hair);
    border-radius: 3px;
    background: var(--panel);
    overflow: hidden;
}

.ctl-group .ctl {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.ctl-group .ctl+.ctl {
    border-left: 1px solid var(--hair-soft);
}

.ctl--lang.is-on {
    color: var(--panel);
    background: var(--ink);
}

.ctl--theme .ctl__glyph {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

/* Scala di sintonia: dove sei nella pagina, e come spostarti */
.dial {
    position: fixed;
    top: 50%;
    right: clamp(.75rem, 1.6vw, 1.4rem);
    transform: translateY(-50%);
    z-index: 30;
}

.dial__list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .9rem;
}

.dial a {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    height: 1.1rem;
    text-decoration: none;
    font-size: var(--t-xs);
    font-variation-settings: 'wdth' 88, 'wght' 600;
    color: var(--ink-3);
    white-space: nowrap;
}

.dial a::after {
    content: '';
    width: 14px;
    height: 1px;
    background: var(--hair);
    transition: width .2s, background-color .2s;
}

.dial a span {
    opacity: 0;
    transform: translateX(4px);
    transition: opacity .2s, transform .2s;
}

.dial a:hover span,
.dial a:focus-visible span,
.dial a[aria-current="true"] span {
    opacity: 1;
    transform: none;
}

.dial a:hover::after {
    width: 26px;
    background: var(--ink-3);
}

.dial a[aria-current="true"] {
    color: var(--lamp-ink);
}

.dial a[aria-current="true"]::after {
    width: 30px;
    height: 2px;
    background: var(--lamp);
}

/* --- 6. INIZIO: TARGA E QUADRANTI --------------------------- */
.readout {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}

.readout__cell {
    flex: 0 1 auto;
    min-width: 11rem;
    padding: .7rem clamp(1rem, 2.5vw, 2rem) .75rem 0;
}

.readout__cell+.readout__cell {
    padding-left: clamp(1rem, 2.5vw, 2rem);
    border-left: 1px solid var(--hair-soft);
}

.readout__label {
    display: block;
    font-size: var(--t-xs);
    font-variation-settings: 'wdth' 92, 'wght' 500;
    color: var(--ink-3);
}

.readout b {
    display: block;
    font-size: var(--t-base);
    font-variation-settings: 'wdth' 100, 'wght' 600;
    color: var(--ink);
    margin-top: .1rem;
}

.readout small {
    display: block;
    font-size: var(--t-xs);
    color: var(--ink-3);
}

/* La targa: il momento tipografico della pagina */
.nameplate {
    margin-top: clamp(2rem, 6vw, 4rem);
    font-size: var(--t-display);
    line-height: .86;
    text-transform: uppercase;
    letter-spacing: -.02em;
}

.nameplate__line {
    display: block;
    font-variation-settings: 'wdth' 122, 'wght' 700;
}

.nameplate__line:last-child {
    color: var(--ink-2);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem clamp(1rem, 2.5vw, 2rem);
    margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.lamp {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: var(--t-sm);
    color: var(--ink-2);
}

.lamp__led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lamp);
    box-shadow: 0 0 0 1px var(--lamp-ink), 0 0 10px 1px var(--lamp-glow);
}

/* --- 6B. USCITA VERSO CERESIO OS ---------------------------- */
/* Solo il monitorino: e' un oggetto, quindi ha profondita'
   come gli strumenti del banco di lavoro. */
.osjack {
    display: inline-block;
    margin-top: clamp(3.5rem, 9vw, 6rem);
    border-radius: 6px;
    text-decoration: none;
    transition: transform .16s;
}

.osjack:hover {
    transform: translateY(-3px);
}

.osjack:active {
    transform: translateY(0);
}

.osjack:focus-visible {
    outline: 2px solid var(--lamp);
    outline-offset: 4px;
}

.osjack__monitor {
    position: relative;
    display: block;
    width: clamp(11rem, 24vw, 15rem);
    aspect-ratio: 16 / 9;
    padding: 6px 6px 13px;
    border-radius: 5px;
    background: #262521;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -2px 0 rgba(0, 0, 0, .35), var(--shadow-object);
    box-sizing: content-box;
}

.osjack__screen {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background: #141a33;
    image-rendering: pixelated;
    transition: filter .16s;
}

/* Righe del tubo catodico sopra l'immagine */
.osjack__monitor::after {
    content: '';
    position: absolute;
    inset: 6px 6px 13px;
    border-radius: 2px;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .16) 2px 3px);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, .45);
    pointer-events: none;
}

.osjack__led {
    position: absolute;
    right: 9px;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6fce5a;
    box-shadow: 0 0 6px 1px rgba(111, 206, 90, .55);
}

.osjack:hover .osjack__screen {
    filter: brightness(1.12) saturate(1.1);
}

/* --- 7. PROFILO -------------------------------------------- */
.spec {
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    border-top: 1px solid var(--hair);
}

.spec__row {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) 1fr;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--hair-soft);
}

.spec dt {
    font-size: var(--t-sm);
    color: var(--ink-3);
}

.spec dd {
    font-size: var(--t-sm);
    font-variation-settings: 'wdth' 100, 'wght' 500;
    color: var(--ink);
}

/* Scala CEFR: una tacca per livello, non una barra di percentuale */
.cefr {
    list-style: none;
    padding: 0;
    border-top: 1px solid var(--hair);
}

.cefr__row {
    display: grid;
    grid-template-columns: minmax(5rem, 7rem) 1fr auto;
    align-items: center;
    gap: .9rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--hair-soft);
}

.cefr__name {
    font-size: var(--t-sm);
    font-variation-settings: 'wdth' 100, 'wght' 500;
}

.cefr__scale {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    align-items: end;
    height: 14px;
}

.cefr__tick {
    height: 5px;
    background: var(--hair);
    border-radius: 1px;
}

.cefr__tick.is-on {
    background: var(--ink-3);
}

.cefr__tick.is-mark {
    height: 14px;
    background: var(--lamp);
}

.cefr__val {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ink-2);
    justify-self: end;
}

.cefr__legend {
    display: grid;
    grid-template-columns: minmax(5rem, 7rem) 1fr auto;
    gap: .9rem;
    padding-top: .45rem;
}

.cefr__legend-scale {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    font-family: var(--font-mono);
    font-size: .625rem;
    color: var(--ink-3);
}

.cefr__legend-scale span {
    text-align: center;
}

.place {
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    height: 190px;
    border: 1px solid var(--hair);
    background: var(--panel-3);
    overflow: hidden;
}

.place iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: saturate(.55) contrast(1.02);
}

:root[data-theme="dark"] .place iframe {
    filter: saturate(.4) brightness(.8) invert(.92) hue-rotate(180deg);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .place iframe {
        filter: saturate(.4) brightness(.8) invert(.92) hue-rotate(180deg);
    }
}

/* --- 8. PERCORSO ------------------------------------------- */
.log {
    list-style: none;
    padding: 0;
    counter-reset: none;
}

.log__item {
    display: grid;
    grid-template-columns: 4.75rem 1fr;
    gap: 0 1.1rem;
    padding: 0 0 1.5rem;
    position: relative;
}

.log__item::before {
    /* binario verticale */
    content: '';
    position: absolute;
    left: calc(4.75rem + .55rem - 1px);
    top: .55rem;
    bottom: -.35rem;
    width: 1px;
    background: var(--hair);
}

.log__item:last-child::before {
    display: none;
}

.log__year {
    grid-column: 1;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ink-3);
    padding-top: .12rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.log__body {
    grid-column: 2;
    padding-left: 1.2rem;
    position: relative;
}

.log__body::before {
    /* tacca quadrata, colorata per tipo di esperienza */
    content: '';
    position: absolute;
    left: -.55rem;
    top: .42rem;
    width: 7px;
    height: 7px;
    background: var(--ink-3);
    outline: 3px solid var(--panel);
}

.log__item[data-kind="dev"] .log__body::before {
    background: var(--lamp);
}

.log__item[data-kind="research"] .log__body::before {
    background: var(--signal);
}

.log__item[data-kind="service"] .log__body::before {
    background: var(--ink-2);
}

.log__title {
    font-size: var(--t-base);
    font-variation-settings: 'wdth' 100, 'wght' 600;
}

.log__desc {
    font-size: var(--t-sm);
    color: var(--ink-2);
    margin-top: .15rem;
    max-width: 44ch;
}

.log__kind {
    font-size: var(--t-xs);
    color: var(--ink-3);
    margin-top: .3rem;
}

.log__item[data-live="true"] .log__year {
    color: var(--lamp-ink);
}

.schools {
    list-style: none;
    padding: 0;
    border-top: 1px solid var(--hair);
}

.schools li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .2rem 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--hair-soft);
}

.schools b {
    font-size: var(--t-base);
    font-variation-settings: 'wdth' 100, 'wght' 600;
}

.schools span {
    font-size: var(--t-sm);
    color: var(--ink-2);
    grid-column: 1;
}

.schools .schools__place {
    grid-row: 1;
    grid-column: 2;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ink-3);
    text-align: right;
}

.chips {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.chips li {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .6rem;
    border: 1px solid var(--hair);
    border-radius: 2px;
    font-size: var(--t-xs);
    color: var(--ink-2);
}

.chips li::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot, var(--ink-3));
}

/* --- 9. BANCO DI LAVORO ------------------------------------ */
.bench {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(1.75rem, 3.5vw, 3rem);
    align-items: start;
}

.rig {
    margin: 0;
    min-width: 0;
}

.rig--deck {
    grid-row: span 2;
}

.rig figcaption {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--hair);
}

.rig figcaption b {
    display: block;
    font-size: var(--t-base);
    font-variation-settings: 'wdth' 104, 'wght' 600;
}

.rig figcaption span {
    display: block;
    font-size: var(--t-sm);
    color: var(--ink-3);
    margin-top: .1rem;
    max-width: 38ch;
}

/* --- 9A. GIRADISCHI --- */
.vinyl-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    background:
        linear-gradient(160deg, var(--panel-3) 0%, var(--panel-2) 55%, var(--panel-3) 100%);
    border: 1px solid var(--hair);
    border-radius: 4px;
    box-shadow: var(--shadow-object);
    overflow: hidden;
}

.deck__plinth {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 5px);
    opacity: .7;
}

.record {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: radial-gradient(circle, #14130f 18%, #1c1b18 19%, #141310 21%, #17161300 22%, #161512 96%, #2c2a26 100%);
    background-color: #161512;
    display: grid;
    place-items: center;
    cursor: grab;
    touch-action: none;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55);
}

.record::after {
    /* solchi */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, rgba(255, 255, 255, .055) 0 1px, transparent 1px 4px);
    pointer-events: none;
}

.record-reflection {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .11) 48%, transparent 58%);
    pointer-events: none;
}

.record-label {
    width: 34%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: #0f0e0c;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
    z-index: 3;
}

.record-label::after {
    /* perno centrale */
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--panel-3);
}

.tone-arm {
    position: absolute;
    top: 4%;
    right: 3%;
    width: 84px;
    height: 132px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 150'%3E%3Cpath d='M45 8 L41 104 L26 128' stroke='%23a8a49b' stroke-width='7' fill='none' stroke-linecap='round'/%3E%3Crect x='19' y='122' width='24' height='30' rx='3' fill='%233b3a36'/%3E%3Ccircle cx='45' cy='10' r='13' fill='%238e8a81'/%3E%3Ccircle cx='45' cy='10' r='5' fill='%235d5a54'/%3E%3C/svg%3E");
    transform-origin: 45px 10px;
    transition: transform .9s cubic-bezier(.4, 0, .2, 1);
    cursor: pointer;
    z-index: 6;
}

.vinyl-wrapper.playing .tone-arm {
    transform: rotate(24deg);
}

.deck__strobe {
    position: absolute;
    left: clamp(1rem, 2.5vw, 1.75rem);
    bottom: clamp(1rem, 2.5vw, 1.75rem);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hair);
    z-index: 6;
}

.vinyl-wrapper.playing .deck__strobe {
    background: var(--lamp);
    box-shadow: 0 0 9px 1px var(--lamp-glow);
}

/* --- 9B. TERMINALE --- */
.terminal-wrapper {
    display: flex;
    flex-direction: column;
    height: 300px;
    background: #121412;
    border: 1px solid var(--hair);
    border-radius: 4px;
    box-shadow: var(--shadow-object);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 9px 12px;
    background: #1c1f1c;
    border-bottom: 1px solid #000;
}

.t-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.t-red {
    background: #d2564a;
}

.t-yellow {
    background: #d8a33c;
}

.t-green {
    background: #62a84f;
}

.terminal-title {
    margin-left: auto;
    font-size: .6875rem;
    color: #6f7a6d;
}

.terminal-body {
    flex: 1;
    min-height: 0;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: .75rem;
    line-height: 1.55;
    color: #7ec97a;
    overflow: hidden;
}

.term-line {
    margin-bottom: 3px;
    word-break: break-word;
}

.cursor {
    display: inline-block;
    width: 7px;
    height: .95em;
    vertical-align: text-bottom;
    background: #7ec97a;
    animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* --- 9C. CABINATO --- */
.arcade-frame {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 300px;
    padding: 16px;
    background: linear-gradient(180deg, #2a2723 0%, #211f1c 100%);
    border: 1px solid #14130f;
    border-radius: 4px;
    box-shadow: var(--shadow-object);
}

.arcade-screen-container {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 6px;
    background: #050604;
    border: 1px solid #0d0e0c;
    border-radius: 3px;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, .9);
}

#arcade-canvas {
    width: auto;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    image-rendering: pixelated;
}

.arcade-controls {
    display: flex;
    justify-content: center;
    gap: 34px;
    flex-shrink: 0;
}

.btn-red {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e0604f 0%, #b93b2c 60%, #8f2b1e 100%);
    border: 1px solid #6d2015;
    box-shadow: 0 4px 0 #5e1c12;
    transition: transform .06s, box-shadow .06s;
}

.btn-red.is-down {
    transform: translateY(4px);
    box-shadow: 0 0 0 #5e1c12;
}

/* --- 10. PROGETTI ------------------------------------------ */
.projects__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    margin-bottom: 1.75rem;
}

.projects__top .lead {
    margin: 0;
}

.tally {
    display: flex;
    gap: clamp(1.25rem, 3vw, 2.5rem);
}

.tally div {
    text-align: right;
}

.tally dd {
    margin: 0;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-variation-settings: 'wdth' 92, 'wght' 600;
    line-height: 1;
    color: var(--ink);
}

.tally dt {
    font-size: var(--t-xs);
    color: var(--ink-3);
    margin-top: .2rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.25rem;
}

.filters button {
    padding: .3rem .65rem;
    border: 1px solid var(--hair);
    border-radius: 2px;
    font-size: var(--t-xs);
    color: var(--ink-2);
    transition: color .16s, background-color .16s, border-color .16s;
}

.filters button:hover {
    border-color: var(--ink-3);
    color: var(--ink);
}

.filters button[aria-pressed="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--panel);
}

/* Righe, non schede: piu' progetti visibili e piu' facili da scorrere */
.repos {
    list-style: none;
    padding: 0;
    border-top: 1px solid var(--hair);
}

.repo {
    border-bottom: 1px solid var(--hair-soft);
}

.repo--pending,
.repo--error {
    padding: 1.25rem 0;
    font-size: var(--t-sm);
    color: var(--ink-3);
}

.repo--error b {
    display: block;
    font-size: var(--t-base);
    color: var(--ink);
    margin-bottom: .3rem;
}

.repo--error p {
    max-width: 56ch;
}

.repo__link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9rem 4.5rem;
    align-items: baseline;
    gap: .35rem 1.5rem;
    padding: 1.05rem .9rem 1.05rem .9rem;
    margin-inline: -.9rem;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: background-color .16s, border-color .16s;
}

.repo__link:hover,
.repo__link:focus-visible {
    background: var(--panel-3);
    border-left-color: var(--lamp);
}

.repo__name {
    font-size: var(--t-md);
    font-variation-settings: 'wdth' 104, 'wght' 600;
    color: var(--ink);
}

.repo__desc {
    grid-column: 1;
    font-size: var(--t-sm);
    color: var(--ink-2);
    max-width: 64ch;
}

.repo__lang {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: var(--t-xs);
    color: var(--ink-2);
    grid-row: 1;
    grid-column: 2;
}

.repo__lang::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot, var(--ink-3));
    flex: 0 0 auto;
}

.repo__nums {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.repo__when {
    grid-row: 2;
    grid-column: 2 / -1;
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--ink-3);
}

.more {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: var(--t-sm);
    font-variation-settings: 'wdth' 100, 'wght' 500;
    color: var(--ink);
    text-decoration-color: var(--lamp);
}

/* --- 11. CONTATTI E PIEDE ---------------------------------- */
.ports {
    list-style: none;
    padding: 0;
    margin-top: clamp(2rem, 4vw, 3rem);
    border-top: 1px solid var(--hair);
    max-width: 760px;
}

.ports li {
    display: grid;
    grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .95rem 0;
    border-bottom: 1px solid var(--hair-soft);
}

.ports .ports__label {
    font-style: normal;
    font-size: var(--t-sm);
    color: var(--ink-3);
}

.ports a,
.ports .ports__val {
    font-size: var(--t-md);
    font-variation-settings: 'wdth' 100, 'wght' 500;
    color: var(--ink);
    word-break: break-word;
}

.ports__copy {
    padding: .35rem .7rem;
    border: 1px solid var(--hair);
    border-radius: 2px;
    font-size: var(--t-xs);
    color: var(--ink-2);
    transition: border-color .16s, color .16s;
}

.ports__copy:hover {
    border-color: var(--ink-3);
    color: var(--ink);
}

.ports__copy[data-done="true"] {
    border-color: var(--lamp);
    color: var(--lamp-ink);
}

.foot {
    padding-block: 2.25rem 2.75rem;
    border-top: 1px solid var(--hair);
}

.foot .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 2rem;
}

.foot p {
    font-size: var(--t-xs);
    color: var(--ink-3);
}

/* --- 12. ACCENSIONE ---------------------------------------- */
/* Una sola sequenza, all'apertura della pagina: i quadranti si
   accendono, la targa si allarga come un fader che sale. */
.boot .readout__cell,
.boot .role,
.boot .lead,
.boot .hero__actions {
    animation: settle .7s both cubic-bezier(.16, 1, .3, 1);
}

.boot .readout__cell:nth-child(1) {
    animation-delay: .05s;
}

.boot .readout__cell:nth-child(2) {
    animation-delay: .13s;
}

.boot .readout__cell:nth-child(3) {
    animation-delay: .21s;
}

.boot .nameplate__line {
    animation: widen .95s both cubic-bezier(.16, 1, .3, 1);
}

.boot .nameplate__line:nth-child(1) {
    animation-delay: .26s;
}

.boot .nameplate__line:nth-child(2) {
    animation-delay: .36s;
}

.boot .role {
    animation-delay: .62s;
}

.boot .lead {
    animation-delay: .7s;
}

.boot .hero__actions {
    animation-delay: .78s;
}

.boot .osjack {
    animation: settle .7s both cubic-bezier(.16, 1, .3, 1) .9s;
}

.boot .lamp__led {
    animation: strike .5s both linear .95s;
}

@keyframes settle {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes widen {
    from {
        opacity: 0;
        font-variation-settings: 'wdth' 64, 'wght' 700;
        letter-spacing: .02em;
    }
}

@keyframes strike {

    0%,
    45% {
        background: var(--hair);
        box-shadow: none;
    }

    55% {
        background: var(--lamp);
        box-shadow: 0 0 14px 2px var(--lamp-glow);
    }
}

/* --- 13. RESPONSIVE ---------------------------------------- */
@media (max-width: 1080px) {
    .dial {
        display: none;
    }

    .cols--bio,
    .cols--path {
        grid-template-columns: minmax(0, 1fr);
    }

    .bench {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .rig--deck {
        grid-row: auto;
        grid-column: span 2;
    }

    .vinyl-wrapper {
        aspect-ratio: auto;
        min-height: 340px;
    }
}

@media (max-width: 720px) {
    .readout__cell {
        min-width: 0;
        flex: 1 1 100%;
        padding-right: 0;
    }

    .readout__cell+.readout__cell {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--hair-soft);
    }

    .bench {
        grid-template-columns: minmax(0, 1fr);
    }

    .rig--deck {
        grid-column: auto;
    }

    .repo__link {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .3rem 1rem;
    }

    .repo__desc {
        grid-column: 1 / -1;
    }

    .repo__lang {
        grid-row: 3;
        grid-column: 1;
    }

    .repo__nums {
        grid-row: 1;
        grid-column: 2;
    }

    .repo__when {
        grid-row: 3;
        grid-column: 2;
        justify-self: end;
    }

    .ports li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ports .ports__label {
        grid-column: 1 / -1;
    }

    .spec__row,
    .cefr__row,
    .cefr__legend {
        grid-template-columns: 5.5rem 1fr auto;
    }

    .log__item {
        grid-template-columns: 3.9rem 1fr;
    }

    .log__item::before {
        left: calc(3.9rem + .55rem - 1px);
    }

    .terminal-wrapper,
    .arcade-frame {
        height: 270px;
    }
}

@media (max-width: 420px) {
    .spec__row {
        grid-template-columns: minmax(0, 1fr);
        gap: .15rem;
    }
}

/* --- 14. MOVIMENTO RIDOTTO, STAMPA ------------------------- */
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .cursor {
        animation: none;
        opacity: 1;
    }
}

@media print {

    .panel-controls,
    .dial,
    .bench,
    .place,
    .skip-link,
    body::after {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .unit {
        padding-block: 1.5rem;
        break-inside: avoid;
    }
}
