
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

/* ==========================================================
   01 — DESIGN SYSTEM
   ========================================================== */

:root {
    --ink: #24241f;
    --muted: #77776e;
    --paper: #f5f4ef;
    --paper-dark: #e9e7de;
    --line: #d9d8cf;
    --accent: #bd5738;
    --accent-light: rgba(189,87,56,.10);

    --gutter: 8vw;

    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'DM Sans', Arial, sans-serif;
    --mono: 'DM Mono', monospace;

    --transition: .3s cubic-bezier(.2,.7,.2,1);
}

/* ==========================================================
   02 — BASE
   ========================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 30px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent);
    color: white;
}

a {
    color: inherit;
    text-decoration: none;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px;
}

h1, h2, h3, p {
    margin-top: 0;
}

img {
    max-width: 100%;
    display: block;
}

h2 {
    font: 500 clamp(32px, 4vw, 48px)/1.12 var(--serif);
    letter-spacing: -1.5px;
    margin-bottom: 0;
}

.eyebrow,
.category,
.card-meta {
    font: 10px var(--mono);
    letter-spacing: 1.2px;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 25px;
}

/* ==========================================================
   03 — LINKS E STATI
   ========================================================== */

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--ink);
    font-size: 12px;
    font-weight: 600;
    margin-top: 28px;
    transition: color var(--transition), border-color var(--transition);
}

.text-link span {
    color: var(--accent);
    font-size: 17px;
    transition: transform var(--transition);
}

.text-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.text-link:hover span {
    transform: translate(3px,-2px);
}

.status {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid var(--line);
    font: 9px var(--mono);
    letter-spacing: 1.2px;
    color: var(--muted);
}

.status.ok {
    color: #5c7a4f;
    border-color: #b9c8b0;
}

.status.ko {
    color: var(--accent);
    border-color: rgba(189,87,56,.4);
}

.status.stop {
    color: var(--muted);
    border-style: dashed;
    border-color: #b8b6aa;
}

/* ==========================================================
   04 — HEADER
   ========================================================== */

.site-header {
    min-height: 82px;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 10;
    background: var(--paper);
}

.wordmark {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.6px;
    white-space: nowrap;
}

.wordmark span {
    color: var(--accent);
    font: 10px var(--mono);
    vertical-align: top;
    margin-left: 3px;
}

.site-header nav {
    display: flex;
    gap: 34px;
    font-size: 12px;
    color: var(--muted);
}

.site-header nav a {
    position: relative;
    transition: color var(--transition);
}

.site-header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -7px;
    height: 1px;
    background: var(--accent);
    transition: right var(--transition);
}

.site-header nav a:hover {
    color: var(--accent);
}

.site-header nav a:hover::after {
    right: 0;
}

.header-index {
    color: var(--muted);
    font: 8px var(--mono);
    letter-spacing: 1px;
}

/* ==========================================================
   05 — HERO
   ========================================================== */

.hero {
    min-height: 740px;
    padding: 100px var(--gutter) 90px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);

    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 55px;

    background:
        radial-gradient(
        circle at 80% 48%,
        rgba(189,87,56,.055),
        transparent 30%
        ),
        var(--paper);
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 790px;
}

.hero-kicker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 780px;
    margin-bottom: 35px;
}

.hero-kicker .eyebrow {
    margin: 0;
}

.hero-kicker > span {
    color: var(--muted);
    font: 9px var(--mono);
    letter-spacing: 1px;
}

.hero h1 {
    font-size: clamp(46px,5.2vw,88px);
    line-height: 1.04;
    letter-spacing: -.065em;
    font-weight: 500;
    margin: 0 0 35px;
}

.hero h1 em {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -.045em;
}

.hero h1 .hero-last {
    display: block;
    padding-left: clamp(0px,3vw,55px);
    white-space: nowrap;
}

.hero .intro {
    max-width: 465px;
    color: #66665e;
    font-size: 15px;
    line-height: 1.9;
}

.hero-note {
    margin-top: 65px;
    color: var(--muted);
    font: 9px/1.9 var(--mono);
    letter-spacing: .3px;
}

.hero-note span {
    display: inline-block;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 1.5px;
}

.hero-note p {
    margin: 0;
}

.hero-index {
    position: absolute;
    bottom: 28px;
    left: var(--gutter);
    right: var(--gutter);
    display: flex;
    justify-content: space-between;
    color: #aaa89d;
    font: 8px var(--mono);
    letter-spacing: 1.5px;
    pointer-events: none;
}

/* ==========================================================
   06 — SISTEMA ORBITALE
   ========================================================== */

.solar {
    --sz: min(500px,31vw);

    width: var(--sz);
    height: var(--sz);
    position: relative;
    flex-shrink: 0;
    isolation: isolate;
}

.solar-coordinates {
    position: absolute;
    top: 3%;
    left: 3%;
    right: 3%;
    display: flex;
    justify-content: space-between;
    color: #aaa89d;
    font: 8px var(--mono);
    letter-spacing: 1.3px;
}

.solar:before,
.solar:after {
    content: "";
    position: absolute;
    background: var(--line);
    opacity: .75;
    pointer-events: none;
}

.solar:before {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    mask: linear-gradient(to right,transparent,#000 20%,#000 80%,transparent);
}

.solar:after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    mask: linear-gradient(to bottom,transparent,#000 20%,#000 80%,transparent);
}

.solar-cross {
    position: absolute;
    inset: 10%;
    border: 1px dashed rgba(36,36,31,.07);
    border-radius: 50%;
    transform: rotate(45deg) scaleY(.55);
    pointer-events: none;
}

/* Centro */

.sun {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(189,87,56,.09);
    z-index: 2;
}

.sun span {
    position: absolute;
    top: 27px;
    left: 50%;
    transform: translateX(-50%);
    font: 9px var(--mono);
    letter-spacing: 2px;
    color: var(--accent);
}

/* Onde */

.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%,-50%);
    opacity: 0;
    animation: ripple 9s ease-out infinite;
    pointer-events: none;
}

.ripple + .ripple {
    animation-delay: -4.5s;
}

/* Orbite */

.orbit {
    --c: 36,36,31;

    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(36,36,31,.13);
    border-radius: 50%;
    transform: translate(-50%,-50%);
    pointer-events: none;
    animation: grow 1.8s cubic-bezier(.2,.7,.2,1) var(--in) both;
}

.o1 {
    width: 34%;
    height: 34%;
    --t: 14s;
    --dl: -4s;
    --in: .2s;
    --c: 189,87,56;
}

.o2 {
    width: 60%;
    height: 60%;
    --t: 26s;
    --dl: -15s;
    --in: .5s;
}

.o3 {
    width: 90%;
    height: 90%;
    --t: 70s;
    --dl: -20s;
    --in: .8s;
    border-style: dashed;
    border-color: rgba(36,36,31,.2);
}

.spin {
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    animation: turn var(--t) linear var(--dl) infinite;
}

/* Scie */

.o1 .spin:before,
.o2 .spin:before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0 65%,
        rgba(var(--c),.65) 100%
        );
    mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 1.5px),
        #000 calc(100% - 1.5px)
        );
}

/* Pianeti */

.planet {
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--d);
    height: var(--d);
    margin: calc(var(--d)/-2) 0 0 calc(var(--d)/-2);
    border-radius: 50%;
    pointer-events: auto;
}

.planet:after {
    content: "";
    position: absolute;
    inset: -14px;
}

.p1 {
    --d: 12px;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(189,87,56,.13);
}

.p2 {
    --d: 9px;
    background: var(--paper);
    border: 1.5px solid var(--ink);
}

/* Etichette */

.lab {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    animation: unturn var(--t) linear var(--dl) infinite;
}

.lab em {
    position: absolute;
    left: calc(var(--d)/2 + 13px);
    top: 0;
    transform: translateY(-50%);
    font: normal 9px var(--mono);
    letter-spacing: 1.4px;
    color: var(--muted);
    white-space: nowrap;
    transition: color var(--transition);
}

.p1:hover .lab em {
    color: var(--accent);
}

.note {
    position: absolute;
    inset: 0;
    transform: rotate(var(--a));
}

.note i {
    --d: 5px;

    position: absolute;
    top: 0;
    left: 50%;
    width: var(--d);
    height: var(--d);
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: var(--muted);
}

.lab-note {
    position: absolute;
    left: 13px;
    top: -5px;
    font: 8px var(--mono);
    letter-spacing: 1px;
    color: var(--muted);
    white-space: nowrap;
}

/* Cometa */

.comet {
    position: absolute;
    top: 6%;
    right: 6%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
    opacity: 0;
    animation: comet 12s ease-in 3s infinite;
}

.comet:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110px;
    height: 1px;
    transform-origin: 0 50%;
    transform: rotate(-35deg);
    background: linear-gradient(to right,rgba(36,36,31,.55),transparent);
}

.comet small {
    position: absolute;
    left: 12px;
    top: -15px;
    font: 8px var(--mono);
    letter-spacing: 1.3px;
    color: var(--muted);
}

/* Legenda */

.solar-legend {
    position: absolute;
    bottom: 1%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    white-space: nowrap;
    color: var(--muted);
    font: 7px var(--mono);
    letter-spacing: .7px;
}

.legend-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
    margin-right: 4px;
}

.accent-dot {
    background: var(--accent);
}

.dashed-dot {
    background: transparent;
    border: 1px solid var(--muted);
}

.solar:hover .spin,
.solar:hover .ripple,
.solar:hover .comet {
    animation-play-state: paused;
}

/* Animazioni */

@keyframes grow {
    from {
        opacity: 0;
        transform: translate(-50%,-50%) scale(.35);
    }
    to {
        opacity: 1;
        transform: translate(-50%,-50%) scale(1);
    }
}

@keyframes turn {
    to { transform: rotate(360deg); }
}

@keyframes unturn {
    to { transform: rotate(-360deg); }
}

@keyframes ripple {
    from {
        width: 14px;
        height: 14px;
        opacity: .6;
    }
    to {
        width: 88%;
        height: 88%;
        opacity: 0;
    }
}

@keyframes comet {
    0%,70% {
        opacity: 0;
        transform: translate(0,0);
    }
    72% {
        opacity: 1;
    }
    86% {
        opacity: 1;
        transform: translate(calc(var(--sz)*-.7),calc(var(--sz)*.49));
    }
    88%,100% {
        opacity: 0;
        transform: translate(calc(var(--sz)*-.7),calc(var(--sz)*.49));
    }
}

/* ==========================================================
   07 — PROGETTI
   ========================================================== */

.section {
    padding: 115px var(--gutter) 120px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 50px;
    gap: 40px;
}

.section-heading h2 em {
    color: var(--accent);
    font-weight: 500;
}

.section-description {
    max-width: 285px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 4px;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.project-card {
    min-width: 0;
    border: 1px solid var(--line);
    padding: 24px;
    background: rgba(255,255,255,.22);
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: #c4bfb3;
    box-shadow: 0 22px 48px rgba(36,36,31,.075);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
}

.card-meta .status {
    margin: 0;
}

.card-visual {
    display: block;
    position: relative;
    margin: 22px 0 25px;
    overflow: hidden;
}

.card-art {
    height: 220px;
    position: relative;
    overflow: hidden;
    transition: transform .7s cubic-bezier(.2,.7,.2,1);
}

.card-visual:hover .card-art {
    transform: scale(1.025);
}

.card-art:after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255,255,255,.22);
    pointer-events: none;
}

.visual-open {
    position: absolute;
    right: 22px;
    bottom: 20px;
    font: 8px var(--mono);
    letter-spacing: 1px;
    color: white;
    opacity: 0;
    transform: translateY(5px);
    transition: all var(--transition);
}

.card-visual:hover .visual-open {
    opacity: 1;
    transform: translateY(0);
}

.category {
    font-size: 9px;
    margin-bottom: 12px;
}

.project-card h3 {
    font: 500 27px/1.2 var(--serif);
    margin-bottom: 13px;
}

.project-card h3 a:hover {
    color: var(--accent);
}

.project-card > p:not(.category) {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
    max-width: 430px;
}

.project-card .text-link {
    margin-top: 16px;
}

/* Illustrazione rete */

.art-network {
    background:
        radial-gradient(circle at 50% 50%,rgba(189,87,56,.16),transparent 32%),
        #252a28;
}

.network-grid {
    position: absolute;
    inset: 0;
    opacity: .2;
    background-image:
        linear-gradient(rgba(255,255,255,.12) 1px,transparent 1px),
        linear-gradient(90deg,rgba(255,255,255,.12) 1px,transparent 1px);
    background-size: 30px 30px;
}

.network-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 112px;
    height: 112px;
    border: 1px solid rgba(212,161,126,.6);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #e4c1a4;
    background: rgba(37,42,40,.75);
    z-index: 2;
}

.network-center:before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(212,161,126,.35);
    border-radius: 50%;
}

.network-center span {
    font: 12px var(--mono);
    letter-spacing: 1px;
}

.network-center small {
    font: 7px var(--mono);
    color: #999c8d;
    margin-top: 8px;
}

.art-network i {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid #d4a17e;
    border-radius: 50%;
    background: #252a28;
    z-index: 1;
}

.art-network i:nth-of-type(1) {
    left: 22%;
    top: 30%;
}

.art-network i:nth-of-type(2) {
    left: 65%;
    top: 20%;
}

.art-network i:nth-of-type(3) {
    left: 48%;
    top: 83%;
}

.art-network i:nth-of-type(4) {
    left: 82%;
    top: 72%;
}

.art-network b {
    position: absolute;
    left: 48%;
    top: 38%;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
    transform: rotate(45deg);
    opacity: .7;
}

.art-network:before {
    content: "";
    position: absolute;
    left: 22%;
    top: 30%;
    width: 60%;
    height: 40%;
    border-top: 1px solid #8d927e;
    border-right: 1px solid #8d927e;
    transform: skewY(22deg);
}

.art-coordinate {
    position: absolute;
    font: 7px var(--mono);
    letter-spacing: 1px;
    color: #9da092;
}

.coordinate-one {
    top: 12%;
    left: 8%;
}

.coordinate-two {
    top: 12%;
    right: 8%;
}

.coordinate-three {
    bottom: 10%;
    left: 8%;
}

/* Illustrazione terminale */

.art-terminal {
    padding: 22px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #dedfd7;
    color: #656b5e;
    font: 11px var(--mono);
}

.terminal-top,
.terminal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    letter-spacing: 1px;
    color: #898d80;
}

.terminal-top div {
    display: flex;
    gap: 5px;
}

.terminal-top i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a7a99e;
}

.terminal-content {
    padding-left: 8%;
}

.terminal-content p {
    margin: 0 0 13px;
    color: #596052;
}

.terminal-content p span {
    color: #a4a596;
    margin-right: 12px;
}

.terminal-content em {
    font-style: normal;
    color: var(--accent);
    animation: blink 1.1s steps(2,start) infinite;
}

@keyframes blink {
    to { opacity: 0; }
}

.coming-soon {
    display: inline-block;
    margin-top: 25px;
    color: var(--muted);
    font: 9px var(--mono);
    letter-spacing: 1px;
}

.coming-soon span {
    color: var(--accent);
}

.archive-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-top: 20px;
    margin-top: 45px;
    border-top: 1px solid var(--line);
    color: #aaa89d;
    font: 8px var(--mono);
    letter-spacing: 1px;
}

/* ==========================================================
   08 — TACCUINO
   ========================================================== */

.notebook {
    background: var(--paper-dark);
    padding: 105px var(--gutter);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.notebook-left {
    position: relative;
    z-index: 1;
}

.notebook h2 {
    font-size: clamp(40px,5vw,62px);
    line-height: 1.15;
}

.notebook h2 em {
    color: var(--accent);
    font-weight: 500;
}

.notebook-stamp {
    display: flex;
    gap: 9px;
    margin-top: 35px;
}

.notebook-stamp span {
    padding: 7px 10px;
    border: 1px solid #c9c7ba;
    color: #77776e;
    font: 8px var(--mono);
    letter-spacing: .7px;
}

.notebook-right {
    position: relative;
    padding: 30px 0;
}

.notebook-number {
    color: var(--accent);
    font: 9px var(--mono);
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

.notebook-right > p {
    max-width: 430px;
    color: #65655d;
    font-size: 14px;
    line-height: 1.9;
}

.notebook-right .notebook-small {
    font-size: 12px;
    color: #88877e;
}

.notebook-decoration {
    position: absolute;
    right: 0;
    bottom: -35px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    font: 8px var(--mono);
    letter-spacing: 2px;
    color: rgba(189,87,56,.35);
    transform: rotate(-8deg);
    pointer-events: none;
}

/* ==========================================================
   09 — MANIFESTO
   ========================================================== */

.manifesto {
    text-align: center;
    padding: 140px 20px 125px;
    position: relative;
    overflow: hidden;
}

.manifesto .eyebrow {
    position: relative;
    z-index: 1;
}

.manifesto-mark {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(189,87,56,.08);
    font: 280px/.8 var(--serif);
    pointer-events: none;
}

.manifesto blockquote {
    position: relative;
    z-index: 1;
    font: 500 clamp(32px,5vw,61px)/1.25 var(--serif);
    letter-spacing: -1.5px;
    margin: 35px auto 30px;
}

.manifesto blockquote em {
    color: var(--accent);
}

.manifesto > p:not(.eyebrow) {
    position: relative;
    max-width: 520px;
    margin: auto;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
}

.manifesto-signature {
    display: block;
    margin-top: 45px;
    color: #aaa89d;
    font: 8px var(--mono);
    letter-spacing: 1.5px;
}

/* ==========================================================
   10 — FOOTER
   ========================================================== */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 28px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font: 9px var(--mono);
}

.site-footer p {
    margin: 0;
    text-align: center;
}

.site-footer > span {
    font-size: 8px;
    letter-spacing: .5px;
}

/* ==========================================================
   11 — PAGINE INTERNE: TESTATA
   ========================================================== */

.article {
    max-width: 1280px;
    margin: 0 auto;
    padding: 88px var(--gutter) 120px;
}

.article-head {
    max-width: 980px;
}

.article h1 {
    font-size: clamp(48px,7.4vw,100px);
    line-height: 1;
    letter-spacing: -4.5px;
    font-weight: 500;
    margin: 0 0 32px;
}

.article h1 em {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--accent);
}

.article .intro {
    max-width: 620px;
    color: #66665e;
    font-size: 17px;
    line-height: 1.8;
}

.article-meta {
    margin-top: 34px;
    font: 10px/1.9 var(--mono);
    letter-spacing: 1.1px;
    color: var(--muted);
}

.article-meta span {
    margin: 0 8px;
    color: var(--accent);
}

.article-art {
    height: 240px;
    margin: 0 0 0;
}

/* ==========================================================
   12 — PAGINE INTERNE: CONTENUTO
   ========================================================== */

.article-body {
    display: grid;
    grid-template-columns: 190px minmax(0,1fr);
    gap: 90px;
    margin-top: 72px;
}

.article-content {
    max-width: 840px;
}

.toc {
    position: sticky;
    top: 36px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font: 10px var(--mono);
    letter-spacing: 1.1px;
    color: var(--muted);
}

.toc a {
    transition: color var(--transition);
}

.toc a:hover {
    color: var(--accent);
}

.article h2 {
    font-size: clamp(28px,3.4vw,40px);
    margin: 80px 0 20px;
    scroll-margin-top: 30px;
}

.article-content > h2:first-child {
    margin-top: 0;
}

.article h3 {
    font: 500 24px/1.25 var(--serif);
    margin: 0 0 12px;
}

.article p,
.article li {
    font-size: 15px;
    line-height: 1.9;
    color: #4a4a43;
}

.article ul,
.article ol {
    padding-left: 20px;
    margin: 0 0 24px;
}

.article li::marker {
    color: var(--accent);
}

.article .todo {
    font: 11px/1.8 var(--mono);
    color: var(--muted);
}

.article-content a:not(.text-link) {
    border-bottom: 1px solid var(--line);
    transition: color var(--transition), border-color var(--transition);
}

.article-content a:not(.text-link):hover {
    color: var(--accent);
    border-color: var(--accent);
}

.back-link {
    margin-top: 80px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

/* ==========================================================
   13 — CRONOLOGIA E COMPONENTI
   ========================================================== */

.log-entry {
    position: relative;
    margin: 0 0 44px;
    padding: 2px 0 2px 30px;
    border-left: 1px solid var(--line);
}

.log-entry::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--accent);
}

.log-entry .eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
}

.stages {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 22px;
    margin: 28px 0 8px;
}

.stage {
    position: relative;
    padding: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.22);
}

.stage .eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
}

.stage h3 {
    font-size: 20px;
}

.stage p:not(.eyebrow) {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

.vincoli .stage {
    border-top: 2px solid var(--accent);
}

.path .stage:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -19px;
    top: 50%;
    transform: translateY(-50%);
    font: 12px var(--mono);
    color: var(--accent);
}

/* Tabelle */

.spec {
    width: 100%;
    margin: 24px 0 8px;
    border-collapse: collapse;
}

.spec th,
.spec td {
    padding: 16px 0;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.7;
}

.spec tr:last-child th,
.spec tr:last-child td {
    border-bottom: 1px solid var(--line);
}

.spec th {
    width: 32%;
    padding-right: 24px;
    font: 500 11px/1.7 var(--mono);
    letter-spacing: .8px;
    color: var(--accent);
}

.spec td {
    color: #4a4a43;
}

.spec td em {
    font: 11px var(--mono);
    font-style: normal;
    color: var(--muted);
}

.spec .todo {
    color: var(--muted);
    font-style: italic;
}

/* Flusso numerato */

.flow {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 20px 0 24px;
}

.flow li {
    counter-increment: step;
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.flow li::before {
    content: "0" counter(step);
    padding-top: 7px;
    font: 10px var(--mono);
    letter-spacing: 1px;
    color: var(--accent);
}

/* Lezione */

.lesson {
    margin: 28px 0 18px;
    padding: 24px;
    background: var(--paper-dark);
    border-left: 2px solid var(--accent);
}

.lesson .eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
}

.lesson p:last-child {
    margin: 0;
    font: 500 19px/1.5 var(--serif);
    color: var(--ink);
}

/* ==========================================================
   14 — RESPONSIVE TABLET
   ========================================================== */

@media (max-width: 1100px) {

    :root {
        --gutter: 6vw;
    }

    .header-index {
        display: none;
    }

    .hero {
        grid-template-columns: minmax(0,1fr) auto;
        gap: 25px;
    }

    .hero h1 {
        font-size: clamp(42px,5.5vw,68px);
    }

    .solar {
        --sz: min(410px,37vw);
    }

    .article-body {
        gap: 55px;
    }
}

@media (max-width: 900px) {

    .hero {
        grid-template-columns: 1fr;
        gap: 70px;
        padding-bottom: 110px;
    }

    .hero-copy {
        max-width: 750px;
    }

    .hero h1 {
        font-size: clamp(48px,8vw,80px);
    }

    .solar {
        --sz: min(480px,75vw);
        margin: 0 auto;
    }

    .hero-index {
        bottom: 25px;
    }

    .notebook {
        gap: 45px;
    }

    .article-body {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-top: 48px;
    }

    .toc {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 22px;
    }
}

/* ==========================================================
   15 — RESPONSIVE MOBILE
   ========================================================== */

@media (max-width: 700px) {

    :root {
        --gutter: 7vw;
    }

    .site-header {
        min-height: 90px;
        padding: 17px var(--gutter);
        align-items: flex-start;
        justify-content: center;
        gap: 15px;
        flex-direction: column;
    }

    .site-header nav {
        flex-wrap: wrap;
        gap: 10px 24px;
        font-size: 11px;
    }

    .hero {
        padding: 70px var(--gutter) 95px;
        min-height: 0;
        gap: 55px;
    }

    .hero-kicker {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 28px;
    }

    .hero h1 {
        font-size: clamp(43px,11vw,70px);
        line-height: 1.06;
        letter-spacing: -.05em;
    }

    .hero h1 .hero-last {
        padding-left: 0;
        white-space: normal;
    }

    .hero h1 .hero-last span {
        white-space: normal;
    }

    .hero .intro {
        font-size: 14px;
    }

    .hero-note {
        margin-top: 42px;
    }

    .solar {
        --sz: min(340px,84vw);
    }

    .solar-legend {
        gap: 9px;
        font-size: 6px;
    }

    .lab em {
        font-size: 7px;
    }

    .section {
        padding: 78px var(--gutter) 85px;
    }

    .section-heading {
        display: block;
        margin-bottom: 35px;
    }

    .section-description {
        margin-top: 20px;
        max-width: 360px;
    }

    .project-grid,
    .notebook {
        grid-template-columns: 1fr;
    }

    .project-grid {
        gap: 20px;
    }

    .project-card {
        padding: 19px;
    }

    .card-art {
        height: 185px;
    }

    .archive-footer {
        flex-direction: column;
        gap: 10px;
        font-size: 7px;
    }

    .notebook {
        padding: 75px var(--gutter);
        gap: 30px;
    }

    .notebook h2 {
        font-size: clamp(40px,10vw,55px);
    }

    .notebook-decoration {
        opacity: .6;
    }

    .manifesto {
        padding: 105px 7vw 90px;
    }

    .manifesto blockquote {
        font-size: clamp(32px,8vw,48px);
        letter-spacing: -.8px;
    }

    .manifesto > p:not(.eyebrow) {
        font-size: 12px;
    }

    .site-footer {
        padding: 27px var(--gutter);
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .site-footer p {
        text-align: left;
    }

    .site-footer > span {
        line-height: 1.7;
    }

    /* Pagine interne */

    .article {
        padding: 65px var(--gutter) 85px;
    }

    .article h1 {
        font-size: clamp(43px,10vw,70px);
        letter-spacing: -2.5px;
    }

    .article .intro {
        font-size: 15px;
    }

    .article-art {
        height: 170px;
        margin-top: 40px;
    }

    .article h2 {
        margin-top: 56px;
    }

    .log-entry {
        padding-left: 22px;
    }

    .stages {
        grid-template-columns: 1fr;
    }

    .path .stage:not(:last-child)::after {
        content: "↓";
        right: auto;
        left: 50%;
        top: auto;
        bottom: -19px;
        transform: translateX(-50%);
    }

    .spec th,
    .spec td {
        display: block;
        width: 100%;
    }

    .spec th {
        padding: 16px 0 0;
        border-bottom: 0;
    }

    .spec td {
        padding: 4px 0 16px;
        border-top: 0;
    }
}

/* ==========================================================
   16 — MOBILE PICCOLO
   ========================================================== */

@media (max-width: 380px) {

    .hero h1 {
        font-size: 40px;
    }

    .solar {
        --sz: 290px;
    }

    .solar-legend {
        gap: 6px;
        font-size: 5px;
    }

    .card-art {
        height: 165px;
    }

    .notebook-stamp {
        flex-wrap: wrap;
    }
}

/* ==========================================================
   17 — ACCESSIBILITÀ E MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .ripple,
    .comet {
        display: none;
    }
}

/* ==========================================================
   MENU MOBILE
   Foglio aggiuntivo: non modifica il design system esistente.
   Da caricare DOPO style.css.
   ========================================================== */

.site-header {
    z-index: 30;
}

.desktop-nav {
    display: flex;
}

/* Pulsante hamburger: visibile solo su mobile */
.menu-toggle {
    display: none;
    border: 0;
    padding: 12px 0 12px 12px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: 9px var(--mono);
    letter-spacing: 1.4px;
}

.menu-toggle > span:not(.menu-toggle-label) {
    display: block;
    width: 19px;
    height: 1px;
    background: var(--ink);
    transition: transform .35s cubic-bezier(.2,.7,.2,1), width .35s ease;
}

.menu-toggle > span:nth-child(2) {
    width: 13px;
    margin-top: 5px;
}

.menu-toggle-label {
    margin: 8px 0 0;
    font-size: 7px;
}

.menu-toggle[aria-expanded="true"] > span:first-child {
    transform: translateY(3px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] > span:nth-child(2) {
    width: 19px;
    transform: translateY(-3px) rotate(-45deg);
}

/* Menu a tutto schermo */
body.menu-is-open {
    overflow: hidden;
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: stretch;
    background: var(--paper);
    visibility: hidden;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transition:
        clip-path .65s cubic-bezier(.77,0,.18,1),
        opacity .35s ease,
        visibility .65s;
}

.mobile-menu.is-open {
    visibility: visible;
    opacity: 1;
    clip-path: inset(0 0 0 0);
}

.mobile-menu-inner {
    width: 100%;
    min-height: 100%;
    padding: 125px var(--gutter) 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-menu-top,
.mobile-menu-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: var(--muted);
    font: 8px var(--mono);
    letter-spacing: 1.2px;
}

.mobile-menu-top .eyebrow {
    margin: 0;
}

.mobile-menu-edition {
    text-align: right;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
}

.mobile-menu nav a {
    display: grid;
    grid-template-columns: 42px 1fr 24px;
    align-items: center;
    gap: 10px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
    font: 500 clamp(32px, 9vw, 48px)/1.1 var(--serif);
    letter-spacing: -1.2px;
    transition: color .25s ease, padding .35s cubic-bezier(.2,.7,.2,1);
}

.mobile-menu nav a > span {
    align-self: start;
    padding-top: 7px;
    color: var(--accent);
    font: 9px var(--mono);
    letter-spacing: 1px;
}

.mobile-menu nav a i {
    justify-self: end;
    color: var(--accent);
    font: normal 18px var(--sans);
    transition: transform .3s ease;
}

.mobile-menu nav a:hover {
    color: var(--accent);
    padding-left: 9px;
}

.mobile-menu nav a:hover i {
    transform: translate(3px,-3px);
}

.mobile-menu-bottom b {
    color: var(--accent);
    font-size: 13px;
}

/* Mobile */
@media (max-width: 700px) {
    .site-header {
        min-height: 76px;
        padding: 0 var(--gutter);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .site-header .wordmark {
        font-size: 14px;
    }

    .site-header .desktop-nav,
    .site-header .header-index {
        display: none;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .mobile-menu-inner {
        padding-top: 112px;
        padding-bottom: 28px;
    }
}

@media (max-width: 380px) {
    .mobile-menu nav a {
        font-size: 31px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-menu,
    .mobile-menu nav a,
    .menu-toggle > span {
        transition: none !important;
    }
}


/* ==========================================================
   TOC — INDICE DINAMICO
   ========================================================== */

.toc {
    padding-left: 20px;
    position: sticky;
}

/* Binario dell'avanzamento */
.toc::before,
.toc::after {
    content: "";
    position: absolute;
    left: 0;
    top: 22px;
    bottom: 0;
    width: 1px;
}

.toc::before {
    background: var(--line);
}

.toc::after {
    background: var(--accent);
    transform: scaleY(var(--toc-progress, 0));
    transform-origin: top;
    transition: transform .12s linear;
}

/* Voci dell'indice */
.toc a {
    position: relative;
    display: block;
    width: fit-content;
    transition:
        color var(--transition),
        transform var(--transition);
}

/* Piccolo indicatore accanto alla voce */
.toc a::before {
    content: "";
    position: absolute;
    left: -23px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-50%) scale(0);
    transition: transform var(--transition);
}

/* Sezione attiva */
.toc a.is-active {
    color: var(--accent);
    font-weight: 500;
}

.toc a.is-active::before {
    transform: translateY(-50%) scale(1);
}

/* Hover */
.toc a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.toc a:hover::before {
    transform: translateY(-50%) scale(1);
}

/* Indice orizzontale su tablet e mobile */
@media (max-width: 900px) {
    .toc {
        padding-left: 0;
    }

    .toc::before,
    .toc::after {
        display: none;
    }

    .toc a {
        display: inline-block;
        padding: 7px 0;
        border-bottom: 1px solid transparent;
    }

    .toc a::before {
        display: none;
    }

    .toc a.is-active {
        border-bottom-color: var(--accent);
    }

    .toc a:hover {
        transform: translateY(-2px);
    }
}


/* ==========================================================
   CODE BLOCK — FRAMMENTI TECNICI
   ========================================================== */

.code-block {
    margin: 28px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #242521;
    color: #e8e5dc;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    color: #b5b3a9;
    font: 9px var(--mono);
    letter-spacing: 1.2px;
}

.code-header span:last-child {
    color: #bd8b70;
}

.code-block pre {
    margin: 0;
    padding: 20px 18px;
    overflow-x: auto;
    font: 12px/1.8 var(--mono);
    white-space: pre;
}

.code-block code {
    color: #e8e5dc;
}

.code-note {
    margin: 0 !important;
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(255,255,255,.1);
    color: #aaa99f;
    font: 10px/1.7 var(--mono);
}

@media (max-width: 600px) {
    .code-block pre {
        padding: 16px 12px;
        font-size: 10px;
    }

    .code-header {
        padding: 10px 12px;
    }
}

/* FEEDME AI BOT — COVER */

.feedme-art {
    position: relative;
    overflow: hidden;
    min-height: 340px;
    padding: 28px 34px;
    background: #252b29;
    color: #f5f4ef;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feedme-topline,
.feedme-bottomline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font: 9px var(--mono);
    letter-spacing: 1.2px;
    color: #aeb7aa;
}

.feedme-scene {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    align-items: center;
    gap: 18px;
    max-width: 850px;
    width: 100%;
    margin: 30px auto;
}

.feedme-preferences,
.feedme-telegram {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font: 10px var(--mono);
}

.feedme-label {
    color: #c7a18e;
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ingredient {
    display: flex;
    justify-content: space-between;
    padding: 9px 10px;
    background: #343c37;
    border: 1px solid #49534b;
    color: #e7e5dc;
}

.ingredient b {
    color: #d58a6e;
    font-weight: 400;
}

.feedme-preferences small {
    color: #89958b;
    font-size: 8px;
    letter-spacing: 1px;
    margin-top: 5px;
}

.feedme-recipe {
    position: relative;
    min-height: 190px;
    padding: 22px;
    background: #f1eee5;
    color: #292e29;
    transform: rotate(-2deg);
    box-shadow: 8px 12px 30px #151a1770;
}

.recipe-heading,
.recipe-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font: 8px var(--mono);
    letter-spacing: .8px;
}

.recipe-heading {
    color: #77786e;
}

.recipe-spark {
    color: var(--accent);
    font-size: 19px;
}

.recipe-number {
    margin-top: 24px;
    color: var(--accent);
    font: 10px var(--mono);
}

.feedme-recipe h2 {
    margin: 8px 0 22px;
    font: 32px/1.05 var(--serif);
    font-weight: 400;
    letter-spacing: -1px;
}

.recipe-details {
    padding-top: 12px;
    border-top: 1px solid #d8d3c7;
    color: #77786e;
    font-size: 7px;
}

.telegram-bubble {
    padding: 12px;
    background: #3e5148;
    border-radius: 10px 10px 10px 2px;
    color: #f1eee5;
    line-height: 1.5;
    font: 10px var(--sans);
}

.telegram-answer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: #343c37;
    border: 1px solid #49534b;
    color: #d9dfd6;
    font: 9px var(--mono);
}

.telegram-answer span {
    color: #aeb7aa;
}

.telegram-answer b {
    color: #d58a6e;
    font-weight: 400;
}

.feedme-bottomline {
    justify-content: center;
    flex-wrap: wrap;
    color: #89958b;
}

@media (max-width: 700px) {
    .feedme-art {
        min-height: 300px;
        padding: 20px 16px;
    }

    .feedme-scene {
        grid-template-columns: 1fr 1.4fr;
        gap: 10px;
    }

    .feedme-telegram {
        display: none;
    }

    .feedme-recipe {
        min-height: 170px;
        padding: 16px;
    }

    .feedme-recipe h2 {
        font-size: 25px;
    }

    .feedme-topline,
    .feedme-bottomline {
        font-size: 7px;
    }
}


.frigate-art {
    position: relative;
    overflow: hidden;
    min-height: 340px;
    padding: 28px 34px;
    background: #252b29;
    color: #f5f4ef;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.frigate-topline,
.frigate-bottomline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font: 9px var(--mono);
    letter-spacing: 1.2px;
    color: #aeb7aa;
}

.frigate-scene {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    align-items: center;
    gap: 18px;
    max-width: 850px;
    width: 100%;
    margin: 30px auto;
}

.frigate-camera,
.frigate-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font: 9px var(--mono);
}

.frigate-label {
    color: #c7a18e;
    font-size: 9px;
    letter-spacing: 1px;
}

.camera-preview {
    position: relative;
    height: 105px;
    overflow: hidden;
    background:
        linear-gradient(135deg, #39463e, #202a25);
    border: 1px solid #536157;
}

.camera-crosshair {
    position: absolute;
    width: 38px;
    height: 48px;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    border: 1px solid #d58a6e;
    opacity: .75;
}

.camera-scanline {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #d58a6e;
    opacity: .4;
}

.camera-time {
    position: absolute;
    bottom: 7px;
    left: 8px;
    font-size: 7px;
    color: #c1c9bf;
}

.camera-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d58a6e;
}

.frigate-camera small {
    color: #89958b;
    font-size: 8px;
    letter-spacing: 1px;
}

.frigate-monitor {
    padding: 12px;
    background: #f1eee5;
    color: #292e29;
    transform: rotate(-2deg);
    box-shadow: 8px 12px 30px #151a1770;
}

.monitor-header,
.monitor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font: 8px var(--mono);
    letter-spacing: .7px;
}

.monitor-header {
    padding-bottom: 10px;
}

.monitor-live {
    color: #a85b42;
    font-size: 7px;
}

.monitor-screen {
    position: relative;
    height: 125px;
    overflow: hidden;
    background:
        linear-gradient(135deg, #59685b, #303c34);
}

.screen-grid {
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image:
        linear-gradient(#d9dfd6 1px, transparent 1px),
        linear-gradient(90deg, #d9dfd6 1px, transparent 1px);
    background-size: 20px 20px;
}

.detection-frame {
    position: absolute;
    width: 42px;
    height: 68px;
    left: 52%;
    top: 46%;
    transform: translate(-50%, -50%);
    border: 1px solid #e2a184;
}

.detection-frame span {
    position: absolute;
    top: -13px;
    left: -1px;
    padding: 2px 4px;
    background: #bd5738;
    color: white;
    font: 6px var(--mono);
    letter-spacing: .4px;
}

.screen-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: #e2a184;
    border-style: solid;
}

.corner-tl {
    top: 7px;
    left: 7px;
    border-width: 1px 0 0 1px;
}

.corner-tr {
    top: 7px;
    right: 7px;
    border-width: 1px 1px 0 0;
}

.corner-bl {
    bottom: 7px;
    left: 7px;
    border-width: 0 0 1px 1px;
}

.corner-br {
    bottom: 7px;
    right: 7px;
    border-width: 0 1px 1px 0;
}

.monitor-footer {
    padding-top: 10px;
    color: #77786e;
    font-size: 7px;
}

.frigate-events {
    gap: 12px;
}

.event-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 7px;
    background: #343c37;
    border: 1px solid #49534b;
}

.event-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-top: 3px;
    border-radius: 50%;
    background: #aeb7aa;
}

.event-dot-accent {
    background: #d58a6e;
}

.event-item div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-item b {
    color: #e7e5dc;
    font-size: 8px;
    font-weight: 400;
}

.event-item small {
    color: #89958b;
    font-size: 7px;
}

.event-storage {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #49534b;
    color: #89958b;
    font-size: 8px;
}

.event-storage b {
    color: #d58a6e;
    font-weight: 400;
}

.frigate-bottomline {
    justify-content: center;
    flex-wrap: wrap;
    color: #89958b;
}

@media (max-width: 700px) {
    .frigate-art {
        min-height: 340px;
        padding: 20px 16px;
    }

    .frigate-scene {
        grid-template-columns: 1fr 1.4fr;
        gap: 10px;
    }

    .frigate-events {
        display: none;
    }

    .monitor-screen {
        height: 115px;
    }

    .frigate-topline,
    .frigate-bottomline {
        font-size: 7px;
    }
}


/* Uniforma le illustrazioni della home */
.home-art {
    min-height: 340px;
    height: 340px;
    box-sizing: border-box;
}

@media (max-width: 700px) {
    .home-art {
        min-height: 300px;
        height: 300px;
    }
}


/* ==========================================================
   FIX — TOC MOBILE
   ========================================================== */

@media (max-width: 700px) {

    .article-body {
        overflow: visible;
    }

    .toc {
        position: relative;
        top: auto;
        z-index: 5;

        display: flex;
        flex-direction: row;
        flex-wrap: wrap;

        width: 100%;
        padding: 16px 14px;

        background: var(--paper);
        border: 1px solid var(--line);
    }

    .toc a {
        position: relative;
        display: inline-block;
        padding: 7px 0;
    }
}


/* ==========================================================
   GRAFICHE — COMPOSIZIONE RESPONSIVE MOBILE
   ========================================================== */

@media (max-width: 700px) {

    /* FRIGATE */

    .frigate-art {
        height: auto;
        min-height: 0;
        padding: 18px 14px;
        gap: 20px;
    }

    .frigate-topline,
    .frigate-bottomline {
        font-size: 6px;
        letter-spacing: .6px;
    }

    .frigate-scene {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
        gap: 10px;
        margin: 12px auto;
    }

    .frigate-camera,
    .frigate-monitor {
        min-width: 0;
    }

    .frigate-label {
        font-size: 7px;
        line-height: 1.5;
    }

    .camera-preview {
        height: 90px;
    }

    .frigate-monitor {
        padding: 9px;
        transform: rotate(-1deg);
    }

    .monitor-screen {
        height: 100px;
    }

    .monitor-header,
    .monitor-footer {
        font-size: 6px;
    }

    /* Eventi sotto le due schermate */
    .frigate-events {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .frigate-events > .frigate-label,
    .frigate-events .event-storage {
        grid-column: 1 / -1;
    }

    .event-item {
        padding: 8px 6px;
    }

    .event-item b {
        font-size: 7px;
    }

    .event-item small {
        font-size: 6px;
    }

    /* FEEDME */

    .feedme-art {
        height: auto;
        min-height: 0;
        padding: 18px 14px;
        gap: 20px;
    }

    .feedme-topline,
    .feedme-bottomline {
        font-size: 6px;
        letter-spacing: .6px;
    }

    .feedme-scene {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
        gap: 10px;
        margin: 12px auto;
    }

    .feedme-preferences,
    .feedme-recipe {
        min-width: 0;
    }

    .ingredient {
        padding: 7px 6px;
        font-size: 8px;
    }

    .feedme-recipe {
        min-height: 155px;
        padding: 12px;
        transform: rotate(-1deg);
    }

    .feedme-recipe h2 {
        font-size: 21px;
        letter-spacing: -.7px;
    }

    .recipe-heading,
    .recipe-details {
        font-size: 6px;
    }

    /* Telegram torna visibile nella seconda riga */
    .feedme-telegram {
        display: flex;
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .feedme-telegram .feedme-label {
        flex-shrink: 0;
    }

    .telegram-bubble,
    .telegram-answer {
        flex: 1;
        min-width: 0;
        padding: 9px;
        font-size: 8px;
    }

    .feedme-bottomline,
    .frigate-bottomline {
        gap: 5px;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Le illustrazioni non devono imporre altezze fisse */
    .card-art.frigate-art,
    .card-art.feedme-art,
    .article-art.frigate-art,
    .article-art.feedme-art {
        height: auto;
        min-height: 0;
    }
}


/* ==========================================================
   HOME — TRE CARD PROGETTO
   ========================================================== */

/* Dimensioni uniformi */
.project-grid .card-art {
    height: 340px;
    min-height: 340px;
}

/* FRIGATE */

.project-grid .frigate-art {
    padding: 22px 20px;
    gap: 15px;
}

.project-grid .frigate-scene {
    grid-template-columns: minmax(0,.85fr) minmax(0,1.4fr) minmax(0,.85fr);
    gap: 10px;
    margin: 18px auto;
}

.project-grid .frigate-scene > * {
    min-width: 0;
}

.project-grid .camera-preview {
    height: 90px;
}

.project-grid .monitor-screen {
    height: 105px;
}

/* FEEDME */

.project-grid .feedme-art {
    padding: 22px 20px;
    gap: 15px;
}

.project-grid .feedme-scene {
    grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr);
    gap: 12px;
    margin: 18px auto;
}

.project-grid .feedme-scene > * {
    min-width: 0;
}

.project-grid .feedme-recipe {
    min-width: 0;
}

.project-grid .feedme-recipe h2 {
    font-size: clamp(20px,2vw,32px);
}

/* PLACEHOLDER — TERMINALE */

.project-grid .art-terminal {
    padding: 22px 28px;
}

.project-grid .terminal-content {
    padding-left: 8%;
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width:700px) {

    /* Illustrazioni */
    .project-grid .card-art {
        height: 300px;
        min-height: 300px;
    }

    /* FRIGATE */

    .project-grid .frigate-art {
        padding: 17px 13px;
        gap: 12px;
    }

    .project-grid .frigate-topline,
    .project-grid .frigate-bottomline {
        font-size: 6px;
        letter-spacing: .5px;
    }

    .project-grid .frigate-scene {
        grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
        gap: 9px;
        margin: 8px auto;
    }

    .project-grid .frigate-label {
        font-size: 7px;
    }

    .project-grid .camera-preview {
        height: 75px;
    }

    .project-grid .frigate-monitor {
        padding: 8px;
    }

    .project-grid .monitor-screen {
        height: 85px;
    }

    .project-grid .monitor-header,
    .project-grid .monitor-footer {
        font-size: 6px;
    }

    .project-grid .frigate-events {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 6px;
    }

    .project-grid .frigate-events > .frigate-label,
    .project-grid .frigate-events .event-storage {
        grid-column: 1 / -1;
    }

    .project-grid .event-item {
        padding: 6px;
        gap: 5px;
    }

    .project-grid .event-item b {
        font-size: 7px;
    }

    .project-grid .event-item small {
        font-size: 6px;
    }

    /* FEEDME */

    .project-grid .feedme-art {
        padding: 17px 13px;
        gap: 12px;
    }

    .project-grid .feedme-topline,
    .project-grid .feedme-bottomline {
        font-size: 6px;
        letter-spacing: .5px;
    }

    .project-grid .feedme-scene {
        grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
        gap: 9px;
        margin: 8px auto;
    }

    .project-grid .feedme-preferences {
        gap: 6px;
    }

    .project-grid .ingredient {
        padding: 7px 6px;
        font-size: 8px;
    }

    .project-grid .feedme-recipe {
        min-height: 145px;
        padding: 12px;
    }

    .project-grid .feedme-recipe h2 {
        font-size: 21px;
    }

    .project-grid .recipe-heading,
    .project-grid .recipe-details {
        font-size: 6px;
    }

    .project-grid .feedme-telegram {
        display: flex;
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .project-grid .feedme-telegram .feedme-label {
        flex-shrink: 0;
    }

    .project-grid .telegram-bubble,
    .project-grid .telegram-answer {
        flex: 1;
        min-width: 0;
        padding: 8px;
        font-size: 8px;
    }

    /* TERMINALE */

    .project-grid .art-terminal {
        padding: 18px 15px;
    }

    .project-grid .terminal-top,
    .project-grid .terminal-footer {
        font-size: 7px;
    }

    .project-grid .terminal-content {
        padding-left: 4%;
        font-size: 9px;
    }

    .project-grid .terminal-content p {
        margin-bottom: 10px;
    }
}

/* Smartphone piccoli */

@media (max-width:380px) {

    .project-grid .card-art {
        height: 280px;
        min-height: 280px;
    }

    .project-grid .frigate-art,
    .project-grid .feedme-art {
        padding: 14px 9px;
    }

    .project-grid .frigate-scene,
    .project-grid .feedme-scene {
        gap: 7px;
    }

    .project-grid .camera-preview {
        height: 65px;
    }

    .project-grid .monitor-screen {
        height: 75px;
    }

    .project-grid .art-terminal {
        padding: 15px 12px;
    }
}
