/* Sito francescorattin.com — landing in stile terminale. Regole in docs/REGOLE-INTERFACCIA.md */
@font-face { font-family: 'Mono'; src: url('/fonts/mono-latin.woff2') format('woff2'); font-weight: 100 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Mono'; src: url('/fonts/mono-latin-ext.woff2') format('woff2'); font-weight: 100 800; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0d1117;        /* fondo pagina */
  --term: #161b22;      /* finestra */
  --bar: #21262d;       /* barra della finestra */
  --line: #30363d;      /* bordi */
  --text: #e6edf3;      /* testo principale (contrasto 16:1 su --term) */
  --muted: #9aa4b0;     /* testo secondario (≥ 6:1) */
  --accent: #3da2ff;    /* blu elettrico: prompt, cursore, fuoco, lingua attiva (7:1 su --term) */
  --ok: #7ee787;        /* verde solo per lo stato «ok» */
  --link: #8cc8ff;      /* link (blu chiaro, distinto dal blu del prompt) */
  --wine: #e5737f;      /* accento vino, puntiforme */
  --c-err: #ff7b72;     /* errori: sempre rossi */
  --mono: 'Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: radial-gradient(1200px 600px at 50% -10%, #0f2340 0%, var(--bg) 62%) fixed, var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative;
  color: var(--text); font: 16px/1.6 var(--mono);
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #c2e1ff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* sfondo «Matrix»: dietro a tutto, attenuato perché il testo resti leggibile */
#matrix { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .28; }
.top, main, .foot { position: relative; z-index: 1; }
.foot p, .host { text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: #06101c; padding: 10px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 8px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); }
.host { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langs { display: flex; gap: 4px; }
.langs a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px;
  color: var(--muted); text-decoration: none; border: 1px solid transparent; border-radius: 6px; font-size: 14px; }
.langs a:hover { color: var(--text); border-color: var(--line); }
.langs a[aria-current="page"] { color: var(--accent); border-color: var(--line); }

main { flex: 1; display: grid; place-items: center; padding: 8px clamp(12px, 4vw, 40px) 24px; }
.term { width: min(100%, 860px); background: var(--term); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.02) inset; overflow: hidden; }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bar); border-bottom: 1px solid var(--line); }
.bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; flex: none; }
.bar i:nth-child(2) { background: #febc2e; } .bar i:nth-child(3) { background: #28c840; }
.bar span { margin-left: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.body { padding: clamp(18px, 4vw, 36px); }

.ln { margin: 0 0 22px; }
.cmd { margin: 0; color: var(--muted); }
.ps { color: var(--accent); font-weight: 700; }
.out { margin: 4px 0 0; color: var(--text); overflow-wrap: anywhere; }
.out .i { white-space: nowrap; }
.out.ok { color: var(--ok); }
.out.err { color: var(--c-err); }
h1 { margin: 6px 0 2px; font: 700 clamp(30px, 7vw, 56px)/1.08 var(--sans); letter-spacing: -.02em; color: #fff; }
h1.out { font: 600 18px/1.4 var(--mono); }
h1 + .out { color: var(--muted); }

.cursor { display: inline-block; width: .6em; height: 1.15em; vertical-align: text-bottom; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* comparsa delle righe una dopo l'altra, come se fossero digitate */
.ln, .last { animation: appear .01s both; animation-delay: calc(var(--i) * 450ms + 200ms); }
@keyframes appear { from { visibility: hidden; } to { visibility: visible; } }

.foot { padding: 16px clamp(16px, 4vw, 40px) 24px; text-align: center; color: var(--muted); font-size: 13px; }
.foot p { margin: 0; }
.ver { opacity: .8; }

@media (max-width: 420px) { body { font-size: 15px; } .host { display: none; } .top { justify-content: flex-end; } }
@media (prefers-reduced-motion: reduce) {
  #matrix { display: none; }
  .ln, .last { animation: none; }
  .cursor { animation: none; }
}
