/* Endurian — foglio di stile unico. Nessuna dipendenza esterna. */
:root {
  --bg: #f5efdd;
  --bg-soft: #fbf7ea;
  --ink: #1d2a21;
  --muted: #55604f;
  --accent: #2c6a39;
  --accent-ink: #f5efdd;
  --accent-soft: #e3ebd2;
  --border: #ddd3b6;
  --shadow: 0 1px 2px rgba(29, 42, 33, .06), 0 6px 18px rgba(29, 42, 33, .06);
  --radius: 14px;
  --maxw: 880px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111915;
    --bg-soft: #182119;
    --ink: #e9ecde;
    --muted: #a0ad9c;
    --accent: #78c48c;
    --accent-ink: #0f1a13;
    --accent-soft: #1f2f24;
    --border: #2b3a30;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Intestazione */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.2rem; letter-spacing: .01em; }
.mark { position: relative; flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.35rem; line-height: 1; overflow: hidden; }
.mark::after { content: ""; position: absolute; right: -3px; bottom: 0; width: 20px; height: 13px; background: rgba(245, 239, 221, .22); clip-path: polygon(0 100%, 45% 0, 100% 100%); }
.mark > span { position: relative; z-index: 1; }
.mark img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; object-fit: cover; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 4px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.lang { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lang a { display: block; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--ink); border-color: var(--accent); }
.lang a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) { .nav { margin-left: 0; width: 100%; order: 3; } }

/* Home */
.hero { padding: 54px 0 34px; display: grid; gap: 28px; grid-template-columns: 1fr; align-items: center; }
.hero .appicon { position: relative; width: 112px; height: 112px; border-radius: 26px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 4.2rem; font-weight: 800; overflow: hidden; box-shadow: var(--shadow); }
.hero .appicon::after { content: ""; position: absolute; right: -8px; bottom: 0; width: 70px; height: 46px; background: rgba(245, 239, 221, .22); clip-path: polygon(0 100%, 45% 0, 100% 100%); }
.hero .appicon > span { position: relative; z-index: 1; line-height: 1; }
.hero .appicon img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; object-fit: cover; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); line-height: 1.12; margin: 0 0 14px; letter-spacing: -.01em; }
.lead { font-size: 1.18rem; color: var(--muted); margin: 0 0 20px; max-width: 40em; }
.badge { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border); font-weight: 650; font-size: .95rem; }
@media (min-width: 720px) { .hero { grid-template-columns: auto 1fr; gap: 40px; padding: 72px 0 44px; } }
section.block { padding: 30px 0; }
section.block > h2 { font-size: 1.55rem; margin: 0 0 6px; line-height: 1.25; }
section.block > p.sub { color: var(--muted); margin: 0 0 20px; max-width: 42em; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; list-style: none; }
.chips li { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); font-size: .9rem; }
.note { font-size: .88rem; color: var(--muted); }

/* Testo legale / pagine interne */
.prose { padding: 38px 0 56px; }
.prose h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); line-height: 1.2; margin: 0 0 6px; }
.prose .updated { color: var(--muted); margin: 0 0 26px; font-size: .95rem; }
.prose h2 { font-size: 1.3rem; line-height: 1.3; margin: 2.1em 0 .5em; padding-top: .3em; }
.prose h3 { font-size: 1.05rem; margin: 1.5em 0 .3em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }
.callout { background: var(--accent-soft); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 0 0 1.4em; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout ul { padding-left: 1.2em; }
.warn { background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid #b9852a; border-radius: 10px; padding: 14px 18px; margin: 0 0 1.4em; }
.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; margin: 0 0 1.6em; font-size: .95rem; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 260px; }
.tablewrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--bg-soft); }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); min-width: 120px; }
th { background: var(--accent-soft); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
details { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 0 18px; margin: 0 0 10px; }
summary { cursor: pointer; font-weight: 650; padding: 13px 0; }
details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
details > :last-child { margin-bottom: 14px; }

/* Piè di pagina */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer p { margin: 0 0 8px; }
.langs404 { display: grid; gap: 10px; padding: 0; list-style: none; }
.langs404 a { font-weight: 650; }
@media print { .site-header .nav, .lang, .site-footer nav { display: none; } body { background: #fff; color: #000; } }
