/* ==========================================================================
   The Guardians of Civilization — "Almanacco dei Custodi"
   Carta calda, inchiostro di bosco, accento terracotta.
   Fraunces (titoli) · Instrument Sans (testo) · IBM Plex Mono (cartellini)
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces/fraunces-latin-full-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces/fraunces-latin-full-italic.woff2') format('woff2');
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument/instrument-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument/instrument-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument/instrument-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument/instrument-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/plex/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/plex/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --paper: #f3ede1;
  --paper-2: #eae1cf;
  --paper-3: #e0d4bd;
  --card: #f8f4ec;
  --ink: #1e2a1f;
  --ink-2: #3b463b;
  --ink-3: #6b726a;
  --moss: #3d5a3a;
  --sage: #8fa27b;
  --terra: #b5532b;
  --terra-2: #d27a4f;
  --ochre: #c9962f;
  --line: rgba(30, 42, 31, 0.16);
  --line-strong: rgba(30, 42, 31, 0.32);
  --night: #17211a;
  --night-ink: #efe7d6;
  --focus: #b5532b;
  --shadow: 0 1px 0 rgba(30, 42, 31, 0.06), 0 18px 40px -24px rgba(30, 42, 31, 0.35);

  --f-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --f-body: 'Instrument Sans', 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* colori delle famiglie del catalogo */
  --c-verdura: #5f7d4e;
  --c-frutta: #b5532b;
  --c-aromatica: #3d5a3a;
  --c-cereale: #c9962f;
  --c-legume: #8a6a3b;
  --c-altro: #6b726a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141c16;
    --paper-2: #1b251d;
    --paper-3: #243026;
    --card: #19231b;
    --ink: #efe7d6;
    --ink-2: #cfc6b3;
    --ink-3: #9a9b8e;
    --moss: #9cb98a;
    --sage: #7d9470;
    --terra: #e0805a;
    --terra-2: #eaa07b;
    --ochre: #e0b456;
    --line: rgba(239, 231, 214, 0.14);
    --line-strong: rgba(239, 231, 214, 0.3);
    --night: #0c120e;
    --night-ink: #efe7d6;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    --c-verdura: #8fb07a;
    --c-frutta: #e0805a;
    --c-aromatica: #9cb98a;
    --c-cereale: #e0b456;
    --c-legume: #c49a62;
    --c-altro: #9a9b8e;
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* grana della carta: una tessera di rumore ripetuta, senza blend (costa poco anche sui telefoni) */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .16 0 0 0 0 .12 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  body::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .94 0 0 0 0 .9 0 0 0 0 .84 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--terra); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--terra); color: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 860px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------- tipografia */
.display, h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.04; letter-spacing: -0.015em; margin: 0; font-variation-settings: 'SOFT' 50, 'WONK' 0; }
h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); font-variation-settings: 'opsz' 144, 'SOFT' 60; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-variation-settings: 'opsz' 96, 'SOFT' 50; }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); font-variation-settings: 'opsz' 36; line-height: 1.15; }
em, .it { font-style: italic; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
h1 em, h2 em, .display em { color: var(--terra); }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.mono, .tag, .kicker {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker { color: var(--terra); display: inline-flex; align-items: center; gap: 0.6rem; }
.kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.muted { color: var(--ink-3); }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand__seal { width: 38px; height: 38px; color: var(--moss); transition: transform 0.8s var(--ease); }
.brand:hover .brand__seal { transform: rotate(-24deg); }
.brand__name { font-family: var(--f-display); font-size: 1.45rem; font-style: italic; font-variation-settings: 'opsz' 72, 'SOFT' 100, 'WONK' 1; letter-spacing: -0.01em; line-height: 1; }
.brand__of { font-size: 0.8em; color: var(--ink-2); }
.brand__name small { display: block; font-family: var(--f-mono); font-style: normal; font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.nav__link {
  position: relative;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.nav__link::after {
  content: ''; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.25rem; height: 1px;
  background: var(--terra); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.nav__link:hover, .nav__link[aria-current='page'] { color: var(--ink); }
.nav__link:hover::after, .nav__link[aria-current='page']::after { transform: scaleX(1); }
.nav__sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 0.5rem; }
.nav__btn {
  margin-left: 0.5rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  background: transparent;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.nav__btn:hover { background: var(--ink); color: var(--paper); }
.nav__btn--solid { background: var(--ink); color: var(--paper); }
.nav__btn--solid:hover { background: var(--terra); border-color: var(--terra); color: var(--paper); }
.nav__admin { color: var(--terra); }

.menu-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 0.5rem; cursor: pointer; align-items: center; gap: 0.6rem; }
.menu-toggle__bars { width: 26px; height: 12px; position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink); transition: transform 0.4s var(--ease), top 0.4s var(--ease); }
.menu-toggle__bars::before { top: 0; }
.menu-toggle__bars::after { top: 10px; }
.menu-open .menu-toggle__bars::before { top: 5px; transform: rotate(45deg); }
.menu-open .menu-toggle__bars::after { top: 5px; transform: rotate(-45deg); }

/* menu a tutto schermo (mobile) */
.drawer {
  position: fixed; inset: 72px 0 0 0; z-index: 49;
  background: var(--paper);
  padding: 2rem var(--gutter) 3rem;
  overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.45s;
}
.menu-open .drawer { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.drawer__group + .drawer__group { margin-top: 2rem; }
.drawer__label { color: var(--ink-3); margin-bottom: 0.75rem; }
.drawer__link {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  line-height: 1.15;
}
.drawer__link .mono { color: var(--terra); font-size: 0.7rem; }
.drawer button.drawer__link { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; padding-left: 0; }
body.menu-open { overflow: hidden; }

@media (max-width: 1240px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (min-width: 1241px) { .drawer { display: none; } }
@media (max-width: 520px) {
  .brand__name { font-size: 1.2rem; }
  .brand__of { display: block; font-size: 0.72em; margin-top: 1px; }
  .brand__name small { display: none; }
  .brand__seal { width: 34px; height: 34px; }
}

/* ------------------------------------------------------------- bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.btn:hover { background: var(--terra); border-color: var(--terra); color: var(--paper); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--small { padding: 0.55rem 1rem; font-size: 0.88rem; }
.btn--danger { background: transparent; color: var(--terra); border-color: var(--terra); }
.btn--danger:hover { background: var(--terra); color: var(--paper); }
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn[disabled], .btn[aria-busy='true'] { opacity: 0.55; pointer-events: none; }

.link-arrow { display: inline-flex; gap: 0.5rem; align-items: center; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.link-arrow:hover { border-color: var(--terra); }

/* -------------------------------------------------------------- hero */
.hero { position: relative; padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero h1 { font-size: clamp(3.1rem, 9vw, 7.6rem); line-height: 0.92; margin: 1.25rem 0 1.75rem; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero h1 .line > span { display: inline-block; animation: rise 1.1s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 0.24s; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.hero__art { position: relative; aspect-ratio: 4 / 5; }
.hero__plate {
  position: absolute; inset: 0;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--ochre) 22%, transparent), transparent 55%),
    radial-gradient(circle at 80% 85%, color-mix(in srgb, var(--sage) 30%, transparent), transparent 60%),
    var(--card);
  box-shadow: var(--shadow);
  animation: fade 1.2s var(--ease) 0.2s both;
}
.hero__plate::before { content: ''; position: absolute; inset: 14px; border: 1px solid var(--line); pointer-events: none; }
.hero__plate-label { position: absolute; left: 28px; right: 28px; bottom: 24px; display: flex; justify-content: space-between; color: var(--ink-3); }
.hero__plate-title { position: absolute; left: 28px; top: 24px; color: var(--ink-3); }
.hero__drawing { position: absolute; inset: 9% 10% 14%; color: var(--moss); }
.hero__drawing path, .hero__drawing circle, .hero__drawing line {
  fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200);
  animation: draw 3.2s var(--ease) forwards;
}
.hero__drawing .accent { color: var(--terra); stroke: var(--terra); }
.hero__drawing .fill-dot { fill: var(--terra); stroke: none; animation: fade 1s ease 2.4s both; }
.hero__stamp {
  position: absolute; left: -46px; bottom: 9%;
  width: 118px; height: 118px;
  background: var(--paper); border-radius: 50%;
  color: var(--terra);
  animation: spin 40s linear infinite;
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 420px; width: 100%; justify-self: center; }
  .hero__stamp { left: -12px; width: 92px; height: 92px; }
}

/* striscia dei numeri (dati veri dal catalogo) */
.ledger { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.ledger__item { padding: 1.5rem 1.25rem 1.6rem; border-left: 1px solid var(--line); }
.ledger__item:first-child { border-left: 0; padding-left: 0; }
.ledger__num { font-family: var(--f-display); font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; font-variation-settings: 'opsz' 144, 'SOFT' 30; }
.ledger__label { margin-top: 0.5rem; color: var(--ink-3); }
@media (max-width: 700px) {
  .ledger { grid-template-columns: repeat(2, 1fr); }
  .ledger__item:nth-child(3) { border-left: 0; padding-left: 0; }
  .ledger__item:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ----------------------------------------------------------- sezioni */
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); flex-wrap: wrap; }
.section__head h2 { max-width: 16ch; margin-top: 0.9rem; }
.section__head p { max-width: 40ch; color: var(--ink-2); margin: 0; }

/* capitoli dell'almanacco (home) */
.chapters { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.chapter {
  position: relative;
  display: flex; flex-direction: column;
  padding: 2rem 1.5rem 1.75rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  min-height: 420px;
  overflow: hidden;
  transition: background 0.5s var(--ease);
}
.chapter:last-child { border-right: 0; }
.chapter:hover { background: var(--card); color: var(--ink); }
.chapter__no { font-family: var(--f-display); font-style: italic; font-size: 1.1rem; color: var(--terra); }
.chapter__icon { width: 92px; height: 92px; margin: 2rem 0 auto; color: var(--moss); transition: transform 0.8s var(--ease); }
.chapter:hover .chapter__icon { transform: translateY(-6px) rotate(-4deg); }
.chapter h3 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); margin: 2rem 0 0.75rem; }
.chapter p { color: var(--ink-2); font-size: 0.95rem; margin: 0 0 1.5rem; }
.chapter__foot { display: flex; justify-content: space-between; align-items: center; color: var(--ink-3); padding-top: 1rem; border-top: 1px dashed var(--line-strong); }
.chapter__foot .arrow { transition: transform 0.4s var(--ease); color: var(--ink); }
.chapter:hover .chapter__foot .arrow { transform: translateX(6px); color: var(--terra); }
@media (max-width: 1020px) {
  .chapters { grid-template-columns: repeat(2, 1fr); }
  .chapter:nth-child(2) { border-right: 0; }
  .chapter { min-height: 360px; }
}
@media (max-width: 560px) {
  .chapters { grid-template-columns: 1fr; }
  .chapter { border-right: 0; min-height: 0; }
  .chapter__icon { margin: 1.5rem 0 0; width: 72px; height: 72px; }
}

/* fascia scura */
.band { background: var(--night); color: var(--night-ink); position: relative; overflow: hidden; }
.band a:hover { color: var(--terra-2); }
.band .kicker { color: var(--terra-2); }
.band__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: end; }
.band h2 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.band p { color: color-mix(in srgb, var(--night-ink) 75%, transparent); }
.band .btn { background: var(--night-ink); color: var(--night); border-color: var(--night-ink); }
.band .btn:hover { background: var(--terra-2); border-color: var(--terra-2); color: var(--night); }
.band .btn--ghost { background: transparent; color: var(--night-ink); }
.band__mark { position: absolute; right: -60px; bottom: -80px; width: 380px; height: 380px; color: color-mix(in srgb, var(--night-ink) 8%, transparent); pointer-events: none; }
@media (max-width: 760px) { .band__grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------- testata pagine */
.page-head { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); position: relative; }
.page-head__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
.page-head h1 { margin: 1rem 0 1.25rem; }
.page-head__icon { width: clamp(90px, 13vw, 170px); height: auto; color: var(--moss); opacity: 0.9; }
.page-head__count { font-family: var(--f-display); font-style: italic; color: var(--ink-3); }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--ink-3); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--terra); }
.crumbs span[aria-hidden] { opacity: 0.6; }
@media (max-width: 640px) { .page-head__icon { display: none; } .page-head__grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------- filtri/ricerca */
.toolbar {
  position: sticky; top: 72px; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}
.toolbar__inner { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  transition: border-color 0.3s;
}
.search input:focus { outline: none; border-color: var(--ink); }
.search svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px;
  padding: 0.42rem 0.8rem; cursor: pointer; white-space: nowrap;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { opacity: 0.6; margin-left: 0.25rem; }
.toolbar__count { margin-left: auto; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 700px) {
  .toolbar { position: static; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); width: calc(100% + 2 * var(--gutter)); }
  .chips::-webkit-scrollbar { display: none; }
  .search { max-width: none; }
  .toolbar__count { margin-left: 0; }
}

.empty { padding: 4rem 0; text-align: center; color: var(--ink-3); font-family: var(--f-display); font-style: italic; font-size: 1.4rem; }
.group-title { display: flex; align-items: baseline; gap: 1rem; margin: 3.5rem 0 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--ink); }
.group-title:first-child { margin-top: 2rem; }
.group-title h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.group-title .mono { color: var(--ink-3); margin-left: auto; }

/* --------------------------------------------------- griglie card */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
@media (max-width: 400px) { .grid, .grid--wide { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
  min-height: 210px;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.card__top { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--ink-3); }
.card__title { font-family: var(--f-display); font-size: 1.55rem; line-height: 1.1; margin: 1.1rem 0 0.4rem; font-variation-settings: 'opsz' 48, 'SOFT' 50; }
.card__sub { color: var(--ink-2); font-style: italic; font-family: var(--f-display); font-size: 1.02rem; }
.card__body { color: var(--ink-2); font-size: 0.92rem; margin: 0.6rem 0 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin-top: auto; padding-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; border-top: 1px dashed var(--line-strong); color: var(--ink-2); font-size: 0.85rem; }
.card__meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.card__meta svg { width: 15px; height: 15px; color: var(--ink-3); }
.card:hover .card__title { color: var(--terra); }
.card__corner { position: absolute; right: 1rem; bottom: 1rem; width: 40px; height: 40px; color: var(--ink-3); opacity: 0.25; }

/* bustina di semi (coltivabili) */
.packet { padding-top: 1.75rem; overflow: hidden; }
.packet::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: var(--fam, var(--c-altro));
  -webkit-mask: radial-gradient(circle at 6px 10px, transparent 5px, #000 5.5px) 0 0 / 12px 10px repeat-x;
  mask: radial-gradient(circle at 6px 10px, transparent 5px, #000 5.5px) 0 0 / 12px 10px repeat-x;
}
.packet .card__top .fam { color: var(--fam); }
.packet__rows { display: grid; gap: 0.35rem; margin-top: 0.9rem; font-size: 0.86rem; }
.packet__row { display: grid; grid-template-columns: 74px 1fr; gap: 0.5rem; }
.packet__row dt { color: var(--ink-3); font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.15em; }
.packet__row dd { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* difficoltà a pallini */
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; display: block; }
.dots i.on { background: currentColor; }

/* bollo prezzo (strumenti) */
.stamp {
  position: absolute; top: 1rem; right: 1rem;
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--terra); color: var(--terra);
  display: grid; place-items: center; text-align: center;
  font-family: var(--f-display); font-size: 1rem; line-height: 1;
  transform: rotate(-10deg);
  transition: transform 0.6s var(--ease);
}
.stamp small { display: block; font-family: var(--f-mono); font-size: 0.5rem; letter-spacing: 0.1em; margin-top: 3px; }
.card:hover .stamp { transform: rotate(4deg) scale(1.05); }
.tool-card .card__title { padding-right: 72px; }

/* card animale: numeri grandi */
.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin-top: 1.2rem; border-top: 1px solid var(--line); }
.figure { padding: 0.9rem 0.5rem 0 0; }
.figure + .figure { border-left: 1px solid var(--line); padding-left: 0.9rem; }
.figure__n { font-family: var(--f-display); font-size: 1.9rem; line-height: 1; font-variation-settings: 'opsz' 96; }
.figure__n small { font-size: 0.9rem; color: var(--ink-3); margin-left: 0.2rem; }
.figure__l { color: var(--ink-3); margin-top: 0.3rem; font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; }

.index-list { columns: 3 220px; column-gap: 2rem; margin: 0; padding: 0; list-style: none; }
.index-list li { break-inside: avoid; padding: 0.4rem 0; border-bottom: 1px dotted var(--line-strong); display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; }
.index-list .mono { color: var(--ink-3); }

/* comparsa allo scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ----------------------------------------------------- scheda dettaglio */
.detail-head { padding: clamp(2.5rem, 6vw, 5rem) 0 2.5rem; }
.detail-head h1 { font-size: clamp(2.8rem, 8vw, 6.2rem); margin: 1rem 0 0.75rem; max-width: 14ch; }
.detail-head__sub { font-family: var(--f-display); font-style: italic; font-size: clamp(1.2rem, 2vw, 1.6rem); color: var(--ink-2); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-top: 2.5rem; }
.spec { padding: 1rem 1rem 1.1rem 0; border-right: 1px solid var(--line); }
.spec + .spec { padding-left: 1rem; }
.spec:last-child { border-right: 0; }
.spec__l { color: var(--ink-3); }
.spec__v { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.2; margin-top: 0.35rem; font-variation-settings: 'opsz' 36; }

.detail-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); padding-top: 3rem; padding-bottom: 6rem; }
.toc { position: sticky; top: 100px; align-self: start; }
.toc ol { list-style: none; margin: 0.75rem 0 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 0.75rem; padding: 0.5rem 0; text-decoration: none; color: var(--ink-2); border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.toc a::before { content: counter(toc, upper-roman); font-family: var(--f-display); font-style: italic; color: var(--terra); width: 1.6rem; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.toc a.is-active::before { color: var(--ink); }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } .toc { display: none; } }

.chapter-block { scroll-margin-top: 100px; padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--line); }
.chapter-block:last-child { border-bottom: 0; }
.chapter-block > h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 1.75rem; display: flex; gap: 1rem; align-items: baseline; }
.chapter-block > h2 .roman { font-style: italic; color: var(--terra); font-size: 0.6em; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 2.5rem; margin: 0; }
.fact { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.fact dt { color: var(--ink-3); margin-bottom: 0.3rem; }
.fact dd { margin: 0; color: var(--ink); }
.fact--wide { grid-column: 1 / -1; }

.prose { max-width: 68ch; font-size: 1.06rem; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 2.2em 0 0.7em; }
.prose h3 { margin: 1.8em 0 0.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--terra); }
.prose blockquote { margin: 2rem 0; padding: 0 0 0 1.5rem; border-left: 2px solid var(--terra); font-family: var(--f-display); font-style: italic; font-size: 1.3rem; color: var(--ink-2); }
.prose img { border-radius: var(--radius); margin: 2rem 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 1.5rem 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.prose code { font-family: var(--f-mono); font-size: 0.88em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }
.prose > p:first-of-type::first-letter {
  float: left; font-family: var(--f-display); font-size: 4.4em; line-height: 0.82; padding: 0.06em 0.12em 0 0; color: var(--terra);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; font-style: italic;
}

/* ricetta */
.recipe-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); padding-top: 3rem; padding-bottom: 6rem; align-items: start; }
.ingredients { position: sticky; top: 96px; background: var(--card); border: 1px solid var(--line); padding: 1.6rem; border-radius: var(--radius); }
.ingredients h2 { font-size: 1.9rem; }
.servings { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0 1rem; padding: 0.75rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; font-size: 1.2rem; line-height: 1; border-radius: 50%; }
.stepper button:hover { color: var(--terra); }
.stepper output { min-width: 2.2rem; text-align: center; font-family: var(--f-display); font-size: 1.25rem; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dotted var(--line-strong); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list .q { font-family: var(--f-mono); font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; }
.ing-list a { text-decoration-color: var(--line-strong); }
.ing-list .flag { color: var(--moss); font-size: 0.7rem; margin-left: 0.35rem; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid var(--line); font-size: 1.05rem; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--f-display); font-style: italic; font-size: 2.2rem; line-height: 0.9; color: var(--ochre); font-variation-settings: 'opsz' 144, 'SOFT' 100; }
.note { margin-top: 2rem; padding: 1.25rem 1.5rem; background: var(--paper-2); border-left: 2px solid var(--ochre); font-size: 0.98rem; }
.note .mono { color: var(--ochre); display: block; margin-bottom: 0.4rem; }
@media (max-width: 900px) { .recipe-layout { grid-template-columns: 1fr; } .ingredients { position: static; } .steps li { grid-template-columns: 3rem 1fr; } }

/* nutrizione */
.nutri { display: grid; gap: 0.6rem; }
.nutri__row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 0.75rem; align-items: center; font-size: 0.92rem; }
.nutri__bar { height: 8px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.nutri__bar span { display: block; height: 100%; background: var(--moss); border-radius: inherit; width: 0; transition: width 1.2s var(--ease); }
.nutri__bar span.terra { background: var(--terra); }
.nutri__bar span.ochre { background: var(--ochre); }
.nutri__row .v { text-align: right; font-family: var(--f-mono); font-size: 0.8rem; }
.kcal { font-family: var(--f-display); font-size: 3.4rem; line-height: 1; font-variation-settings: 'opsz' 144; }
.kcal small { font-size: 1rem; color: var(--ink-3); margin-left: 0.3rem; }

.linked { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.linked a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; font-size: 0.92rem; transition: background 0.25s, color 0.25s; }
.linked a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.linked .mono { font-size: 0.62rem; opacity: 0.7; }

.tool-uses { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tool-use { border: 1px solid var(--line); padding: 1rem 1.15rem; border-radius: var(--radius); background: var(--card); }
.tool-use h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.tool-use p { font-size: 0.92rem; color: var(--ink-2); margin: 0 0 0.5rem; }
.tool-use .mono { color: var(--ink-3); }

/* --------------------------------------------------------------- blog */
.feature { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; text-decoration: none; padding-bottom: 3rem; border-bottom: 1px solid var(--ink); }
.feature:hover { color: var(--ink); }
.feature__img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.feature__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.feature:hover .feature__img img { transform: scale(1.04); }
.feature h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); margin: 1rem 0; }
.feature:hover h2 { color: var(--terra); }
@media (max-width: 800px) { .feature { grid-template-columns: 1fr; } }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2.5rem 2rem; margin-top: 3rem; }
.post { text-decoration: none; display: flex; flex-direction: column; }
.post:hover { color: var(--ink); }
.post__img { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); margin-bottom: 1.1rem; }
.post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.post:hover .post__img img { transform: scale(1.05); }
.post__img--empty { display: grid; place-items: center; color: var(--moss); }
.post__img--empty svg { width: 34%; opacity: 0.6; }
.post h3 { font-size: 1.55rem; margin: 0.6rem 0; }
.post:hover h3 { color: var(--terra); }
.post p { color: var(--ink-2); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post__meta { display: flex; gap: 1rem; color: var(--ink-3); flex-wrap: wrap; }

.article-head { padding: clamp(3rem, 7vw, 6rem) 0 2rem; text-align: center; }
.article-head h1 { font-size: clamp(2.4rem, 6.4vw, 5rem); max-width: 18ch; margin: 1.25rem auto; }
.article-head .lede { margin: 0 auto; }
.article-head__meta { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; color: var(--ink-3); margin-top: 1.75rem; }
.article-cover { max-width: 1100px; margin: 1rem auto 3.5rem; aspect-ratio: 16 / 8; overflow: hidden; border-radius: var(--radius); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { padding-bottom: 5rem; }
.article-body .prose { margin: 0 auto; }
.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; margin-top: 3rem; }
.tags span { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.3rem 0.7rem; color: var(--ink-3); }

/* -------------------------------------------------------------- moduli */
.auth { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 1fr 1fr; }
.auth__side {
  position: relative;
  background: var(--night); color: var(--night-ink);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth__side h2 { font-size: clamp(2.2rem, 4vw, 3.6rem); max-width: 12ch; }
.auth__side h2 em { color: var(--terra-2); }
.auth__side p { color: color-mix(in srgb, var(--night-ink) 70%, transparent); max-width: 38ch; }
.auth__side .kicker { color: var(--terra-2); }
.auth__art { position: absolute; right: -40px; bottom: -40px; width: 70%; max-width: 420px; color: color-mix(in srgb, var(--night-ink) 14%, transparent); }
.auth__main { display: grid; place-items: center; padding: clamp(2rem, 5vw, 4rem) var(--gutter); }
.auth__box { width: 100%; max-width: 420px; }
.auth__box h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin: 0.75rem 0 0.5rem; }
.auth__box > p { color: var(--ink-2); }
.auth__alt { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--ink-2); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth__side { min-height: 260px; } }

.form { display: grid; gap: 1.1rem; margin-top: 1.75rem; }
.field { display: grid; gap: 0.4rem; }
.field label, .field .label { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.input, .field input, .field select, .field textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 18%, transparent); }
.field .hint { font-size: 0.82rem; color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-row--date { grid-template-columns: minmax(0, 1fr) 84px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 0.7rem; align-items: start; font-size: 0.92rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0.15rem 0 0; accent-color: var(--moss); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: 0.95rem; padding: 0.85rem 1rem; border-radius: var(--radius); display: none; }
.form-msg.is-error { display: block; background: color-mix(in srgb, var(--terra) 12%, transparent); color: var(--terra); border-left: 2px solid var(--terra); }
.form-msg.is-ok { display: block; background: color-mix(in srgb, var(--moss) 14%, transparent); color: var(--moss); border-left: 2px solid var(--moss); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3.2rem; }
.pw-toggle { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; padding: 0.4rem 0.6rem; color: var(--ink-3); font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* area personale */
.dash { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); padding-top: 3rem; padding-bottom: 6rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.panel h2 { font-size: 1.8rem; margin-bottom: 0.75rem; }
.panel + .panel { margin-top: 1.5rem; }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shortcut { background: var(--card); padding: 1.25rem; text-decoration: none; display: grid; gap: 0.75rem; min-height: 150px; align-content: space-between; transition: background 0.3s; }
.shortcut:hover { background: var(--paper-2); color: var(--ink); }
.shortcut svg { width: 46px; height: 46px; color: var(--moss); }
.shortcut strong { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.switch { position: relative; width: 50px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--paper-3); transition: background 0.3s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 0.35s var(--ease); }
.switch input:checked + span { background: var(--moss); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }

/* admin */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-family: var(--f-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 400; }
.table td.actions { white-space: nowrap; text-align: right; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid currentColor; }
.badge--draft { color: var(--ochre); }
.badge--published { color: var(--moss); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; padding-top: 2rem; padding-bottom: 5rem; align-items: start; }
.editor .field textarea.body { min-height: 520px; font-family: var(--f-mono); font-size: 0.88rem; }
.editor__side { position: sticky; top: 96px; display: grid; gap: 1.25rem; }
.editor__tabs { display: flex; gap: 0.25rem; margin-bottom: 0.5rem; }
.preview { min-height: 520px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
@media (max-width: 960px) { .editor { grid-template-columns: 1fr; } .editor__side { position: static; } }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-pair div { border-top: 1px solid var(--ink); padding-top: 0.75rem; }
.stat-pair strong { display: block; font-family: var(--f-display); font-weight: 400; font-size: 2.6rem; line-height: 1; }

/* contatti */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); padding-top: 3rem; padding-bottom: 6rem; }
.contact__aside p { color: var(--ink-2); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* pagine legali */
.legal { padding-top: 3rem; padding-bottom: 6rem; }
.legal .prose > p:first-of-type::first-letter { all: unset; }
.legal .prose h2 { font-size: 1.6rem; }

/* --------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--ink); padding: clamp(3rem, 7vw, 6rem) 0 2rem; margin-top: 0; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 3rem; }
.footer__motto { font-family: var(--f-display); font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.08; max-width: 16ch; }
.footer__motto em { color: var(--terra); }
.footer__col h4 { margin: 0 0 1rem; color: var(--ink-3); font-weight: 400; }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer__col a { text-decoration: none; color: var(--ink-2); }
.footer__col a:hover { color: var(--terra); }
.footer__base { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--ink-3); }
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > :first-child { grid-column: 1 / -1; } }

/* errore */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 4rem var(--gutter); }
.error-page .big { font-family: var(--f-display); font-style: italic; font-size: clamp(6rem, 22vw, 15rem); line-height: 0.9; color: var(--terra); font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--paper); padding: 0.8rem 1.2rem; border-radius: 999px; font-size: 0.92rem; z-index: 120; transition: opacity 0.3s, transform 0.4s var(--ease); pointer-events: none; max-width: calc(100% - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- animazioni */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__drawing path, .hero__drawing circle, .hero__drawing line { stroke-dashoffset: 0; }
}
