/* Blog di Salvatore Luongo — stile ispirato a salvatoreluongo.it */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --body: #262626;
  --muted: #7a7a7a;
  --line: #ececec;
  --pill: #f4f4f4;
  --accent: #e8693f;        /* "Leggi di più", link */
  --progress: #ff5a1f;      /* barra di lettura */
  --badge: #f7d35c;         /* fulmine sulle copertine */
  --pill-hover: #eaeaea;
  --header-bg: rgba(255,255,255,.82);
  --menu-bg: #ffffff;
  --source-bg: #fff6f2;
  --card-bg: #ffffff;
  --accent-soft: #fdeee7;
  --shadow-card: 0 10px 32px rgba(30,34,42,.05);
  --radius: 28px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ── Tema scuro: automatico (sistema) o scelto con l'interruttore ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0f1115; --ink:#f4f5f7; --body:#c9ccd3; --muted:#8b909b;
    --line:#262a31; --pill:#1b1f26; --pill-hover:#242933;
    --accent:#ff7d54; --header-bg:rgba(15,17,21,.82); --menu-bg:#0f1115; --source-bg:#241711;
    --card-bg:#171d26; --accent-soft:#2b1d17; --shadow-card:0 10px 34px rgba(0,0,0,.22);
  }
}
:root[data-theme="dark"] {
  --bg:#0f1115; --ink:#f4f5f7; --body:#c9ccd3; --muted:#8b909b;
  --line:#262a31; --pill:#1b1f26; --pill-hover:#242933;
  --accent:#ff7d54; --header-bg:rgba(15,17,21,.82); --menu-bg:#0f1115; --source-bg:#241711;
  --card-bg:#171d26; --accent-soft:#2b1d17; --shadow-card:0 10px 34px rgba(0,0,0,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--body); font-family: var(--font); -webkit-font-smoothing: antialiased; transition: background .3s ease, color .3s ease; }
a { color: inherit; }
img { max-width: 100%; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* ── Barra di lettura ─────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 300; background: transparent; }
.progress { height: 4px; }
.progress span { display: block; height: 100%; width: 0; background: var(--progress); transition: width .08s linear; }
body:not(.is-post) .progress { display: none; }   /* la barra di lettura solo negli articoli */

/* ── Header ───────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 200; background: var(--header-bg); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.header-inner { display: flex; align-items: center; gap: 14px; height: 84px; }

/* ── Interruttore tema chiaro/scuro (sole ⇆ luna) ── */
.theme-toggle { margin-left: auto; width: 44px; height: 44px; border: 0; background: var(--pill); border-radius: 50%; color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s, transform .15s; }
.theme-toggle:hover { transform: translateY(-1px); background: var(--pill-hover); }
.theme-toggle + .menu-btn { margin-left: 14px; }
.sun-moon { display: block; }
.sun-moon .mask-dot { transition: transform .5s cubic-bezier(.4,0,.2,1); }
.sun-moon .sm-rays line { transform-origin: 12px 12px; transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .3s ease; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-moon .mask-dot { transform: translate(-8px, 4px); }
  :root:not([data-theme="light"]) .sun-moon .sm-rays line { transform: scale(0); opacity: 0; }
}
:root[data-theme="dark"] .sun-moon .mask-dot { transform: translate(-8px, 4px); }
:root[data-theme="dark"] .sun-moon .sm-rays line { transform: scale(0); opacity: 0; }

/* ── Navigazione desktop nell'header ──────────────── */
.header-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-nav a { position: relative; text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 700; padding: 10px 15px; border-radius: 9px; transition: background .18s, color .18s; }
.header-nav a:hover, .header-nav a[aria-current="page"] { background: var(--pill); color: var(--ink); }
.header-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.header-nav + .theme-toggle { margin-left: 8px; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .header-nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .menu-btn { display: flex; }
}

/* ── Pagine elenco piu ampie (home, categorie, archivio) ── */
body:not(.is-post) .container { max-width: 1240px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: #111; object-fit: cover; display: block; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); flex: 1; opacity: 0; transition: opacity .2s; }
@media (min-width: 700px) { .brand { opacity: 1; } }
.menu-btn { align-items: center; gap: 10px; border: 0; border-left: 1px solid var(--line); background: none; padding: 6px 0 6px 18px; font: 600 21px var(--font); color: var(--ink); cursor: pointer; margin-left: auto; }

/* ── Menu a tutto schermo ─────────────────────────── */
.menu { position: fixed; inset: 0; background: var(--menu-bg); z-index: 400; overflow-y: auto; }
.menu[hidden] { display: none; }
.menu-inner { padding-top: 28px; padding-bottom: 60px; position: relative; }
.menu-close { position: absolute; right: 20px; top: 26px; background: var(--pill); border: 0; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.menu-main { display: block; font-size: 34px; font-weight: 800; color: var(--ink); text-decoration: none; padding: 10px 0; letter-spacing: -.02em; }
.menu-main:first-of-type { margin-top: 64px; }
.menu-label { margin: 34px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.menu-cats, .menu-links { list-style: none; margin: 0; padding: 0; }
.menu-cats a, .menu-links a { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 21px; font-weight: 600; color: var(--ink); }
.menu-cats a span { background: var(--pill); border-radius: 999px; padding: 3px 12px; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; }
.menu-cats a { transition: color .15s; }
.menu-cats a:hover { color: var(--accent); }
.menu-cats a:hover span { background: var(--accent); color: #fff; }
body.menu-open { overflow: hidden; }

/* ── Home e liste ─────────────────────────────────── */
.intro { padding: 36px 0 8px; }
.intro h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; color: var(--ink); margin: 0; font-weight: 800; }
.intro p { font-size: 18px; color: var(--muted); line-height: 1.6; margin: 12px 0 0; }
.cards { display: grid; gap: 64px; padding: 36px 0 24px; }
.card-cover { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--pill); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.card-cover:hover img { transform: scale(1.03); }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #1f2937, #e8693f); }
.badge { position: absolute; top: 22px; left: 22px; width: 42px; height: 42px; border-radius: 50%; background: var(--badge); color: #111; display: grid; place-items: center; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.pill { background: var(--pill); border-radius: 999px; padding: 8px 18px; font-size: 16px; font-weight: 500; text-decoration: none; color: var(--ink); }
.pill:hover { background: var(--pill-hover); }
.card-title { font-size: 30px; line-height: 1.18; letter-spacing: -.025em; font-weight: 800; color: var(--ink); margin: 20px 0 0; }
.card-title a { text-decoration: none; }
.card-foot { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.mini-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); object-fit: cover; }
.byline { display: flex; flex-direction: column; font-size: 16px; line-height: 1.35; }
.byline strong { color: var(--ink); font-weight: 700; }
.byline time { color: var(--muted); }
.more { margin-left: auto; align-self: flex-end; color: var(--accent); text-decoration: none; font-weight: 500; font-size: 17px; }
.empty { color: var(--muted); font-size: 18px; padding: 40px 0; }
.all-link { text-align: center; margin: 10px 0 40px; font-weight: 700; }
.all-link a { color: var(--accent); text-decoration: none; }
.page-title { font-size: 38px; letter-spacing: -.03em; font-weight: 800; color: var(--ink); margin: 36px 0 8px; }
.year { font-size: 24px; font-weight: 800; color: var(--ink); margin: 40px 0 6px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.list a { text-decoration: none; font-weight: 600; color: var(--ink); }
.list span { color: var(--muted); white-space: nowrap; font-size: 15px; }
.cat-index { margin-bottom: 8px; }
.cat-index .pill.active { background: var(--accent); color: #fff; }
.cat-index .pill:hover { background: var(--accent); color: #fff; }
.cat-section { scroll-margin-top: 100px; }
.cat-section .cards { padding-top: 10px; gap: 48px; }

/* ── Articolo ─────────────────────────────────────── */
.post { padding: 28px 0 20px; max-width: 800px; margin: 0 auto; }
.post-cover { width: 100%; display: block; border-radius: var(--radius); }
.post-title { font-size: 40px; line-height: 1.12; letter-spacing: -.03em; font-weight: 800; color: var(--ink); margin: 26px 0 0; }
.post-meta { color: var(--muted); font-size: 17px; margin: 18px 0 0; }
.post-meta .dot { margin: 0 8px; color: #c4c4c4; }
.share { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 8px; }
.sh { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 0; cursor: pointer; text-decoration: none; transition: transform .15s; }
.sh:hover { transform: translateY(-2px); }
@media (max-width: 600px) { .share { gap: 9px; } .sh { width: 38px; height: 38px; } .sh svg { width: 19px; height: 19px; } }
.sh-li { background: #0a66c2; } .sh-fb { background: #1877f2; } .sh-x { background: #111; }
.sh-wa { background: #25d366; } .sh-tg { background: #229ed9; } .sh-copy { background: var(--pill); color: var(--ink); }
.sh-copy.ok { background: #2e7d32; color: #fff; animation: pop .3s ease; }
.ic-check { display: none; }
.sh-copy.ok .ic-link { display: none; }
.sh-copy.ok .ic-check { display: block; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 18px); background: #1f2633; color: #ffffff; padding: 11px 20px; border-radius: 999px; font: 600 14px var(--font); opacity: 0; transition: opacity .25s, transform .25s; z-index: 400; box-shadow: 0 8px 24px rgba(0,0,0,.35); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.post-content { font-size: 19px; line-height: 1.8; color: var(--body); margin-top: 30px; }
.post-content p { margin: 0 0 1.3em; }
.post-content h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.02em; font-weight: 800; color: var(--ink); margin: 1.8em 0 .6em; }
.post-content h3 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 1.6em 0 .5em; }
.post-content strong { color: var(--ink); font-weight: 700; }
.post-content a { color: var(--accent); text-underline-offset: 3px; }
.post-content img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); margin: 1.6em 0 .4em; }
.post-content img + em, .post-content p > em:only-child { display: block; text-align: center; font-size: 15px; color: var(--muted); margin-bottom: 1.4em; }
.post-content ul, .post-content ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.post-content li { margin: .35em 0; }
.post-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: var(--ink); font-weight: 500; }
.post-content code { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85em; background: var(--pill); padding: 2px 6px; border-radius: 6px; }
.post-content pre { background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 18px 20px; overflow-x: auto; font-size: 15px; line-height: 1.6; margin: 1.6em 0; }
.post-content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.post-content pre { scrollbar-width: thin; scrollbar-color: #475569 transparent; -webkit-overflow-scrolling: touch; }
.post-content pre::-webkit-scrollbar { height: 8px; }
.post-content pre::-webkit-scrollbar-thumb { background: #475569; border-radius: 999px; }
.post-content pre::-webkit-scrollbar-track { background: transparent; }

/* Blocco di codice con pulsante "Copia" e indicatore di scroll */
.code-wrap { position: relative; margin: 1.6em 0; }
.code-wrap pre { margin: 0; }
.copy-code { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255,255,255,.1); color: #e2e8f0; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 6px 12px; font: 600 13px var(--font); cursor: pointer; backdrop-filter: blur(4px); transition: background .15s, color .15s, opacity .15s; opacity: .55; }
.code-wrap:hover .copy-code { opacity: 1; }
.copy-code:hover { background: rgba(255,255,255,.2); }
.copy-code.ok { background: #2e7d32; color: #fff; border-color: #2e7d32; opacity: 1; }
.code-wrap.scrollable:not(.at-end)::after { content: ""; position: absolute; top: 0; right: 0; bottom: 8px; width: 44px; border-radius: 0 16px 16px 0; background: linear-gradient(to right, rgba(15,23,42,0), rgba(15,23,42,.92)); pointer-events: none; }
@media (max-width: 600px) { .copy-code { display: none; } }   /* copia codice solo su desktop */

/* Indice cliccabile */
.toc { background: var(--pill); border-radius: 18px; padding: 18px 22px; margin: 30px 0 0; }
.toc-title { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc li { margin: 0; }
.toc a { display: block; padding: 7px 10px; margin: 0 -10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16.5px; line-height: 1.4; transition: background .15s, color .15s; }
.toc a:hover { background: var(--accent); color: #fff; }
.post-content h2[id] { scroll-margin-top: 100px; }

/* Box "Potrebbe interessarti" inline */
.readalso { display: flex; flex-direction: column; gap: 4px; background: var(--source-bg); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 18px; margin: 1.8em 0; }
.readalso-k { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
.readalso a { color: var(--ink); font-weight: 700; text-decoration: none; font-size: 16.5px; line-height: 1.4; }
.readalso a:hover { color: var(--accent); text-decoration: underline; }

/* Lightbox (zoom immagini) */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; overflow: auto; background: rgba(10,12,16,.72); backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); cursor: zoom-out; animation: lbfade .18s ease; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 24px 80px rgba(0,0,0,.55); cursor: zoom-in; object-fit: contain; transition: transform .2s ease; }
.lightbox img.zoom { transform: scale(1.9); cursor: zoom-out; }
.lb-close { position: fixed; top: 16px; right: 20px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lb-close:hover { background: rgba(255,255,255,.26); }
body.lb-open { overflow: hidden; }
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }
.post-content table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 1.6em 0; display: block; overflow-x: auto; }
.post-content th, .post-content td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.source { background: var(--source-bg); border-radius: 20px; padding: 18px 22px; margin: 36px 0 0; font-size: 16px; line-height: 1.6; }
.source p { margin: 0; }
.source-label { font-size: 12px !important; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px !important; }
.source a { color: var(--accent); }
.post-end { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 22px; }
.share-title { font-weight: 700; color: var(--ink); margin: 0; font-size: 18px; }
.post-nav { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin: 36px 0 10px; }
.post-nav a { background: var(--pill); border-radius: 20px; padding: 16px 18px; text-decoration: none; font-weight: 700; color: var(--ink); font-size: 16px; line-height: 1.35; }
.post-nav a span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.post-nav .next { grid-column: 2; text-align: right; }

/* ── Contatto diretto ─────────────────────────────── */
.contact { background: var(--source-bg); border-radius: 20px; padding: 22px 24px; margin: 30px 0 0; }
.contact p { margin: 0; color: var(--body); font-size: 16px; line-height: 1.6; }
.contact-title { font-weight: 800 !important; color: var(--ink) !important; font-size: 19px !important; margin-bottom: 4px !important; }
.contact-btn { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; line-height: 1; padding: 14px 28px; border: 0; border-radius: 999px; cursor: pointer; transition: transform .15s ease, filter .2s ease; }
.contact-btn svg { width: 18px; height: 18px; }
.contact-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.contact-btn:active { transform: translateY(0); }
.contact-btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
/* Modulo di contatto */
.cform { margin-top: 16px; display: grid; gap: 12px; }
.cform-in { width: 100%; font: 400 16px var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cform-in::placeholder { color: var(--muted); }
.cform-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,105,63,.18); }
textarea.cform-in { resize: vertical; min-height: 96px; }
.cform .contact-btn { justify-self: start; margin-top: 2px; }
.cform-msg { margin: 4px 0 0 !important; font-size: 15px !important; font-weight: 600; min-height: 1.2em; }
.cform-msg.ok { color: #2e7d32; }
.cform-msg.err { color: #c0392b; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ── Leggi anche ──────────────────────────────────── */
.read-also { margin: 40px 0 0; }
.read-also-title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 16px; letter-spacing: -.02em; }
.related { display: grid; gap: 12px; }
.rel-item { display: flex; align-items: center; gap: 16px; background: var(--pill); border-radius: 18px; padding: 12px 14px; text-decoration: none; transition: background .2s, transform .15s; }
.rel-item:hover { background: var(--pill-hover); transform: translateY(-1px); }
.rel-thumb { width: 72px; height: 54px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: #0f172a; }
.rel-ph { display: grid; place-items: center; color: #ff5a1f; font: 800 20px "SFMono-Regular", Menlo, Consolas, monospace; }
.rel-text { display: flex; flex-direction: column; gap: 3px; }
.rel-text strong { color: var(--ink); font-weight: 700; font-size: 17px; line-height: 1.25; }
.rel-text small { color: var(--muted); font-size: 14px; }

/* ── Footer e pulsante "torna su" ─────────────────── */
.site-footer { color: var(--muted); font-size: 14px; padding-top: 40px; padding-bottom: 50px; border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer a { color: var(--muted); }
.footer-tools { margin-top: 6px; }
.footer-tools a { color: var(--accent); font-weight: 600; text-decoration: none; }
.footer-tools a:hover { text-decoration: underline; }
.to-top { position: fixed; right: 16px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(90,90,90,.72); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 150; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

@media (max-width: 600px) {
  .intro h1 { font-size: 28px; }
  .card-title { font-size: 26px; }
  .post-title { font-size: 33px; }
  .post-content { font-size: 18px; }
  .cards { gap: 52px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
}

/* ══════════════ HOME EDITORIALE ══════════════ */
/* Hero */
.hero { margin: 36px 0 44px; padding: 50px 50px 48px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center; border-radius: 26px; position: relative; overflow: hidden; color: #f9fafb;
  background: radial-gradient(ellipse at 88% 6%, rgba(255,122,79,.22), transparent 38%), linear-gradient(145deg,#1e2733 0%,#101722 82%); }
.hero::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; right: -240px; top: -220px; pointer-events: none; }
.hero-copy, .hero-terminal { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #f9ac85; }
.live-dot { width: 7px; height: 7px; background: #ff7a4f; border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,122,79,.14); }
.hero h1 { color: #fff; font-size: clamp(30px,3.4vw,50px); margin: 20px 0 16px; line-height: 1.12; letter-spacing: -.045em; font-weight: 800; }
.hero p { margin: 0; font-size: 16.5px; line-height: 1.7; color: #bdc8d5; max-width: 500px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 28px; }
.action-primary { background: #ff7a4f; color: #17202b; border-radius: 12px; padding: 14px 20px; text-decoration: none; font-weight: 800; font-size: 13.5px; display: inline-flex; align-items: center; gap: 12px; transition: transform .18s, background .18s; }
.action-primary:hover { transform: translateY(-2px); background: #ff946f; }
.action-text { color: #f4f6f9; text-decoration: none; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.action-text span { color: #ff9a6f; }
.hero-terminal { border: 1px solid rgba(222,230,240,.18); border-radius: 16px; background: rgba(9,14,21,.55); box-shadow: 0 24px 50px rgba(0,0,0,.26); transform: rotate(2deg); overflow: hidden; }
.terminal-bar { height: 44px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.1); color: #8193a5; font: 700 11px ui-monospace,Menlo,Consolas,monospace; letter-spacing: .1em; }
.terminal-dots { display: inline-flex; gap: 5px; }
.terminal-dots i { width: 7px; height: 7px; background: #ff936b; border-radius: 50%; }
.terminal-dots i:nth-child(2) { background: #f4c56e; } .terminal-dots i:nth-child(3) { background: #69c8aa; }
.terminal-square { margin-left: auto; color: #657587; }
.terminal-content { padding: 22px 20px 23px; }
.terminal-content p { font: 500 15px/2.0 ui-monospace,Menlo,Consolas,monospace; color: #c8d4df; margin: 0; }
.terminal-content .terminal-command { margin-bottom: 4px; white-space: nowrap; }
.terminal-command .t-user { color: #7ae2b3; }
.terminal-command .t-punct { color: #657587; }
.terminal-command .t-path { color: #6fb1d8; }
.terminal-command .t-cmd { color: #e6c074; }
.terminal-cursor { color: #ff9b72; animation: tblink 1.05s steps(1) infinite; }
@keyframes tblink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* Loop colorato stile editor */
.terminal-code { margin: 12px 0 2px; white-space: pre; font: 600 16px/1.3 ui-monospace,Menlo,Consolas,monospace; }
.terminal-code .l { display: block; }
.terminal-code .c-kw  { color: #ff5fa2; }   /* while */
.terminal-code .c-var { color: #35d6e8; }   /* learning */
.terminal-code .c-fn  { color: #5bd86a; }   /* funzioni */
.terminal-code .c-pn  { color: #c3cfdb; }   /* parentesi e ; */

@media (prefers-reduced-motion: reduce) { .terminal-cursor { animation: none; } }

/* Intestazioni di sezione */
.home-featured, .home-latest { margin-top: 44px; }
.section-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-kicker { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.section-topline h2 { font-size: clamp(25px,2.2vw,32px); color: var(--ink); font-weight: 800; line-height: 1.2; letter-spacing: -.04em; margin: 7px 0 0; }
.section-aside { color: var(--muted); font-size: 12.5px; padding-bottom: 5px; }
.section-all { text-decoration: none; font-weight: 800; font-size: 13px; color: var(--accent); padding-bottom: 4px; white-space: nowrap; }

/* Schede home */
.hcards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.hcard.is-more { display: none; }
.hcards-more { display: flex; justify-content: center; margin-top: 30px; }
.load-more-btn { cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px; letter-spacing: -.01em; padding: 14px 28px; border-radius: 999px; background: transparent; color: var(--accent); border: 1.5px solid var(--accent); transition: background .2s, color .2s, transform .15s; }
.load-more-btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.load-more-btn:active { transform: translateY(0); }
.hcard { min-width: 0; background: var(--card-bg); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-card); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.hcard:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(20,27,38,.1); }
.hcard-cover { position: relative; display: block; aspect-ratio: 1.85; background: #202a37; overflow: hidden; }
.hcard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.hcard:hover .hcard-cover img { transform: scale(1.04); }
.hcard-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #ff7a4f; font: 800 30px ui-monospace,Menlo,Consolas,monospace; }
.cover-corner { position: absolute; right: 14px; bottom: 14px; background: rgba(255,255,255,.92); color: #151b24; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; font-weight: 800; font-size: 16px; transition: transform .2s; }
.hcard:hover .cover-corner { transform: rotate(45deg); }
.hcard-body { padding: 20px 23px 21px; display: flex; flex-direction: column; flex: 1; }
.hcard-overline { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.hcard-overline .pills { margin: 0; gap: 7px; }
.hcard .pill { color: var(--accent); background: var(--accent-soft); padding: 6px 11px; border-radius: 7px; font-weight: 800; font-size: 11px; letter-spacing: .02em; }
.hcard .pill:hover { background: var(--accent); color: #fff; }
.hcard-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hcard-title { font-size: clamp(19px,1.9vw,23px); line-height: 1.26; margin: 13px 0 0; letter-spacing: -.03em; font-weight: 800; color: var(--ink); }
.hcard-title a { text-decoration: none; }
.hcard-title a:hover { color: var(--accent); }
.hcard-excerpt { margin: 10px 0 0; font-size: 14.5px; line-height: 1.65; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 15px; }
.hcard .byline { display: inline-flex; align-items: center; flex-direction: row; gap: 9px; font-size: 12px; color: var(--ink); }
.hcard .byline strong { font-weight: 800; }
.hcard .mini-avatar { width: 29px; height: 29px; border-radius: 50%; }
.hcard .more { color: var(--accent); font-size: 12.5px; font-weight: 800; white-space: nowrap; text-decoration: none; }

/* In evidenza (orizzontale) */
.hcard-featured { display: grid; grid-template-columns: 1.12fr 1fr; min-height: 330px; }
.hcard-featured .hcard-cover { height: 100%; aspect-ratio: auto; }
.hcard-featured .hcard-body { padding: 28px 32px 26px; justify-content: center; }
.hcard-featured .hcard-title { font-size: clamp(23px,2.7vw,33px); line-height: 1.18; }
.hcard-featured .hcard-excerpt { font-size: 15px; -webkit-line-clamp: 4; }
.hcard-featured .hcard-foot { margin-top: auto; }

/* Banner "segnala una curiosità" (con form che si apre) */
.home-outro { margin: 48px 0 40px; background: var(--accent-soft); padding: 30px 36px; border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 22px; }
.outro-head { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.home-outro .section-kicker { margin-bottom: 4px; }
.home-outro h2 { margin: 6px 0; color: var(--ink); letter-spacing: -.035em; font-size: clamp(20px,2.2vw,28px); line-height: 1.2; }
.home-outro p { color: var(--muted); margin: 0; font-size: 13.5px; line-height: 1.6; max-width: 640px; }
.outro-link { display: grid; place-items: center; flex: 0 0 auto; width: 54px; height: 54px; border: 0; border-radius: 50%; color: #fff; background: var(--accent); cursor: pointer; font-size: 23px; line-height: 1; transition: transform .25s; }
.outro-link:hover { transform: rotate(45deg); }
.outro-link.open { transform: rotate(90deg); }
.outro-form { margin-top: 22px; border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); padding-top: 20px; }
.outro-form[hidden] { display: none; }
.outro-form .cform { margin-top: 0; max-width: 560px; }
/* Categorie in stile home */
.cat-section .cat-grid { margin-top: 22px; }
.cat-section { margin-top: 10px; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding: 40px; gap: 30px; }
  .hero-terminal { width: min(430px,100%); transform: none; }
  .hcards { grid-template-columns: 1fr; }
  .hcard-featured { grid-template-columns: 1fr; min-height: 0; }
  .hcard-featured .hcard-cover { aspect-ratio: 1.85; }
}
@media (max-width: 600px) {
  .hero { margin: 16px 0 34px; padding: 28px 22px; border-radius: 20px; }
  .hero-terminal { display: none; }
  .section-aside { display: none; }
  .home-featured, .home-latest { margin-top: 32px; }
  .hcard-featured .hcard-body, .hcard-body { padding: 20px; }
  .home-outro { padding: 24px; }
  .outro-head { gap: 16px; }
  .outro-link { width: 46px; height: 46px; }
}
