/* ALB-OS · palette: bianco, grigio chiaro, grigio, nero. Nessuna ombra, nessun raggio. */
:root {
  --white: #FFFFFF;
  --paper: #F0F1F2;
  --grey: #6B6D70;
  --ink: #28282C;
  --black: #111114;

  --font-display: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-cover: clamp(40px, 8.5vw, 132px);
  --fs-title: clamp(26px, 3vw, 46px);
  --fs-phrase: clamp(16px, 1.4vw, 20px);
  --fs-text: clamp(14px, 1.05vw, 16px);
  --fs-note: 12px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--white);
  color: var(--ink);
  font: 400 var(--fs-text)/1.6 var(--font-mono);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: var(--white); border-bottom: 2px solid var(--paper);
  font-size: var(--fs-note); letter-spacing: .12em; text-transform: uppercase;
}
.topbar .brand { font-weight: 700; display: flex; gap: 10px; align-items: center; }
.topbar .brand i { width: 10px; height: 10px; background: var(--ink); display: inline-block; }
.topbar .right { display: flex; gap: 8px; align-items: center; }
.chip {
  border: 2px solid var(--paper); padding: 6px 10px; letter-spacing: .12em;
  font-size: var(--fs-note); text-transform: uppercase; transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.chip:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.hide-sm { display: inline; }

/* ── Layout ── */
main { min-height: calc(100vh - 54px); }
.view { animation: in .35s var(--ease) both; }
@keyframes in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ── Home ── */
.home {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  min-height: calc(100vh - 54px);
}
.hero { padding: clamp(24px, 5vw, 72px) clamp(16px, 3vw, 40px); display: flex; flex-direction: column; justify-content: center; gap: 28px; border-right: 2px solid var(--paper); }
.eyebrow { font-size: var(--fs-note); letter-spacing: .12em; text-transform: uppercase; color: var(--grey); }
.wordmark { font: 800 var(--fs-cover)/.9 var(--font-display); letter-spacing: -.04em; text-transform: uppercase; overflow-wrap: anywhere; }
.wordmark span { display: block; }
.wordmark .out { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.role { font-size: var(--fs-phrase); font-weight: 700; }
.term { background: var(--ink); color: var(--paper); padding: 18px 20px; font-size: var(--fs-text); max-width: 560px; min-height: 130px; }
.term .p { color: var(--grey); }
.term .l { display: block; white-space: pre-wrap; }
.caret { display: inline-block; width: .6em; height: 1.05em; background: var(--paper); vertical-align: -.18em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-note); letter-spacing: .12em; font-weight: 700; }
.status i { width: 8px; height: 8px; background: var(--ink); animation: blink 1.4s steps(1) infinite; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 10px 28px; justify-content: start; }
.stat b { display: block; font: 800 var(--fs-title)/1 var(--font-display); letter-spacing: -.03em; }
.stat span { font-size: var(--fs-note); letter-spacing: .12em; color: var(--grey); text-transform: uppercase; }

.modules { display: flex; flex-direction: column; }
.mod {
  flex: 1; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; text-align: left;
  padding: 18px clamp(16px, 3vw, 40px); border-bottom: 2px solid var(--paper);
  transition: background .18s var(--ease), color .18s var(--ease), padding-left .18s var(--ease);
}
.mod:last-child { border-bottom: 0; }
.mod .n { font: 800 clamp(34px, 5vh, 64px)/1 var(--font-display); color: var(--paper); transition: color .18s var(--ease); -webkit-text-stroke: 1px var(--grey); }
.mod .t b { display: block; font-size: var(--fs-phrase); letter-spacing: .08em; }
.mod .t span { font-size: var(--fs-note); color: var(--grey); letter-spacing: .06em; }
.mod .go { font-size: 22px; transition: transform .18s var(--ease); }
.mod:hover, .mod:focus-visible { background: var(--ink); color: var(--white); padding-left: calc(clamp(16px, 3vw, 40px) + 8px); outline-offset: -4px; }
.mod:hover .n, .mod:focus-visible .n { color: var(--ink); -webkit-text-stroke: 1px var(--paper); }
.mod:hover .t span, .mod:focus-visible .t span { color: var(--paper); }
.mod:hover .go { transform: translateX(6px); }
.hint { padding: 12px clamp(16px, 3vw, 40px); font-size: var(--fs-note); letter-spacing: .12em; color: var(--grey); border-top: 2px solid var(--paper); text-transform: uppercase; }

/* ── Module pages ── */
.page { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 4vw, 56px) clamp(16px, 3vw, 40px) 96px; }
.pagehead { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: end; padding-bottom: 22px; margin-bottom: 32px; border-bottom: 2px solid var(--ink); }
.pagehead .num { font: 800 clamp(56px, 9vh, 112px)/.8 var(--font-display); -webkit-text-stroke: 2px var(--ink); color: transparent; }
.pagehead h1 { font: 800 var(--fs-title)/1 var(--font-display); letter-spacing: -.02em; text-transform: uppercase; }
.pagehead p { color: var(--grey); font-size: var(--fs-text); margin-top: 6px; }
.back { border: 2px solid var(--ink); padding: 8px 14px; font-size: var(--fs-note); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; transition: background .15s, color .15s; }
.back:hover { background: var(--ink); color: var(--white); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.card { background: var(--paper); padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: background .18s var(--ease), color .18s var(--ease); position: relative; }
a.card { text-decoration: none; }
a.card:hover, .card.hl:hover { background: var(--ink); color: var(--white); }
a.card:hover .tag, .card.hl:hover .tag { background: var(--white); color: var(--ink); }
a.card:hover .muted, .card.hl:hover .muted { color: var(--paper); }
.card h3 { font: 700 var(--fs-phrase)/1.25 var(--font-mono); }
.card .top { display: flex; justify-content: space-between; font-size: var(--fs-note); letter-spacing: .12em; text-transform: uppercase; }
.card p { font-size: var(--fs-text); }
.muted { color: var(--grey); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { background: var(--ink); color: var(--white); padding: 3px 8px; font-size: var(--fs-note); letter-spacing: .06em; }
.tag.light { background: var(--paper); color: var(--ink); }

.list { border-top: 2px solid var(--paper); }
.sec .list { border-top: 0; }
.row { display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: baseline; padding: 20px 0; border-bottom: 2px solid var(--paper); }
.row .d { font-size: var(--fs-note); letter-spacing: .12em; color: var(--grey); text-transform: uppercase; }
.row h3 { font: 700 var(--fs-phrase)/1.3 var(--font-mono); }
.row .s { color: var(--grey); }
.row a { text-decoration: none; border: 2px solid var(--ink); padding: 4px 10px; font-size: var(--fs-note); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.row a:hover { background: var(--ink); color: var(--white); }

.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.sec { margin-bottom: 40px; }
.sec > h2 { font-size: var(--fs-note); letter-spacing: .14em; text-transform: uppercase; color: var(--grey); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--paper); }
.lead { font-size: var(--fs-phrase); max-width: 70ch; }
.btn { display: inline-block; background: var(--ink); color: var(--white); padding: 12px 20px; text-decoration: none; letter-spacing: .12em; font-weight: 700; font-size: var(--fs-note); text-transform: uppercase; transition: background .15s; }
.btn:hover { background: var(--grey); }
.skillgrp { margin-bottom: 18px; }
.skillgrp b { display: block; font-size: var(--fs-note); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }

.contact { display: grid; grid-template-columns: 140px 1fr auto; gap: 20px; align-items: center; padding: 26px 0; border-bottom: 2px solid var(--paper); text-decoration: none; transition: padding .18s var(--ease), background .18s var(--ease), color .18s var(--ease); }
.contact:first-child { border-top: 2px solid var(--paper); }
.contact:hover { background: var(--ink); color: var(--white); padding-left: 18px; padding-right: 18px; }
.contact .k { font-size: var(--fs-note); letter-spacing: .12em; color: var(--grey); }
.contact:hover .k { color: var(--paper); }
.contact .v { font: 700 var(--fs-phrase)/1.3 var(--font-mono); overflow-wrap: anywhere; }

.empty { color: var(--grey); padding: 24px; background: var(--paper); }

/* ── Boot / palette ── */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--white); display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 8vw, 120px); gap: 18px; cursor: pointer; transition: opacity .35s var(--ease); }
.boot.out { opacity: 0; pointer-events: none; }
.boot h2 { font: 800 clamp(22px, 3vw, 40px)/1 var(--font-display); letter-spacing: .04em; }
.boot .log { font-size: var(--fs-text); color: var(--grey); min-height: 9em; }
.boot .log div b { color: var(--ink); }
.bar { height: 12px; background: var(--paper); max-width: 520px; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s steps(8); }
.boot small { font-size: var(--fs-note); letter-spacing: .12em; color: var(--grey); text-transform: uppercase; }

.pal { position: fixed; inset: 0; z-index: 90; background: rgba(40, 40, 44, .55); display: none; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.pal.open { display: flex; }
.pal .box { background: var(--white); width: min(560px, 92vw); border: 2px solid var(--ink); }
.pal input { width: 100%; border: 0; border-bottom: 2px solid var(--paper); padding: 16px; font: inherit; font-size: var(--fs-phrase); outline: 0; background: var(--white); color: var(--ink); }
.pal ul { list-style: none; max-height: 50vh; overflow: auto; }
.pal li { padding: 12px 16px; display: flex; justify-content: space-between; cursor: pointer; }
.pal li.sel { background: var(--ink); color: var(--white); }
.pal li span { color: var(--grey); font-size: var(--fs-note); letter-spacing: .1em; }
.pal li.sel span { color: var(--paper); }

/* ── FX: transizioni apri/esci ── */
[data-nav="open"] .view { animation-name: inOpen; animation-duration: .45s; }
[data-nav="close"] .view { animation-name: inClose; animation-duration: .45s; }
@keyframes inOpen { from { opacity: 0; transform: translateX(40px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes inClose { from { opacity: 0; transform: translateX(-40px) scale(1.015); } to { opacity: 1; transform: none; } }
.wipe { position: fixed; inset: 0; z-index: 80; background: var(--ink); transform: scaleX(0); pointer-events: none; }
.wipe.go-open { transform-origin: right; animation: wipeOut .5s var(--ease) both; }
.wipe.go-close { transform-origin: left; animation: wipeOut .5s var(--ease) both; }
@keyframes wipeOut { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── FX: hover sulle sezioni ── */
.mod { position: relative; overflow: hidden; }
.mod::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent); transform: skewX(-20deg); pointer-events: none; }
.mod:hover::after, .mod:focus-visible::after { animation: sweep .6s var(--ease); }
@keyframes sweep { from { left: -40%; } to { left: 120%; } }
.mod:hover .n { transform: translateX(4px); }
.mod .n { transition: color .18s var(--ease), transform .18s var(--ease); }
a.card, .card.hl { transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); }
a.card:hover, .card.hl:hover { transform: translateY(-4px); }
.contact:hover .v { letter-spacing: .02em; }
.contact .v { transition: letter-spacing .2s var(--ease); }
.row { transition: padding-left .18s var(--ease); }
.row:hover { padding-left: 8px; }
.chip:active, .back:active, .btn:active { transform: scale(.96); }

/* ── FX: cursore cerchio + punto ── */
.fx-cursor, .fx-cursor * { cursor: none !important; }
.cur-ring, .cur-dot, .cur-ripple { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1000; mix-blend-mode: difference; }
.cur-ring, .cur-dot { opacity: 0; transition: opacity .2s; }
.cur-on .cur-ring, .cur-on .cur-dot { opacity: 1; }
.cur-ring { width: 20px; height: 20px; border: 1px solid #fff; border-radius: 50%; transition: opacity .2s, width .2s var(--ease), height .2s var(--ease); }
.cur-ring.hot { width: 30px; height: 30px; }
.cur-ring.down { width: 14px; height: 14px; }
.cur-dot { width: 4px; height: 4px; background: #fff; border-radius: 50%; }
.cur-ripple { width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 1px solid #fff; border-radius: 50%; animation: ripple .6s var(--ease) forwards; }
@keyframes ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(4.5); opacity: 0; } }

/* ── Responsive ── */
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; }
  .hero { border-right: 0; border-bottom: 2px solid var(--paper); }
  .mod { padding-top: 22px; padding-bottom: 22px; }
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, auto); }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .contact { grid-template-columns: 1fr auto; }
  .contact .k { grid-column: 1 / -1; }
  .pagehead { grid-template-columns: auto 1fr; }
  .pagehead .back { grid-column: 1 / -1; justify-self: start; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
