:root {
  --bg: #ffffff;
  --surface: #f6f5f8;
  --fg: #1f1d23;
  --muted: #625d6b;
  --line: #e3e0e8;
  --accent: #6b21a8;
  --accent-soft: #f1e8fa;
  --danger: #b00020;
  --ok: #1b7a3d;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151318;
    --surface: #1e1b23;
    --fg: #ece9f0;
    --muted: #a9a2b3;
    --line: #34303b;
    --accent: #c89bf0;
    --accent-soft: #2b2236;
    --danger: #ff7a8a;
    --ok: #6fd394;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Intestazione */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; margin-right: auto; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 2px 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--fg); }
.site-header nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

main.wrap { padding-top: 32px; padding-bottom: 48px; }

/* Testi */
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
h3 { font-size: 1.05rem; margin: 24px 0 8px; }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
small, .small { font-size: .875rem; }

/* Home */
/* Fascia a tutta larghezza: esce dal contenitore centrale fino ai bordi della finestra.
   Ha colori propri, uguali nel tema chiaro e in quello scuro. */
body { overflow-x: clip; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  margin: -32px calc(50% - 50vw) 0;
  padding: 72px max(16px, calc(50vw - 414px)) 80px;
  color: #fff;
  background:
    radial-gradient(ellipse at 85% 20%, rgb(200 155 240 / .35), transparent 55%),
    linear-gradient(135deg, #2a0b47 0%, #4c1580 45%, #6b21a8 100%);
}
.hero .network { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; color: #fff; opacity: .14; }
.hero h1 { font-size: 2.6rem; color: #fff; }
.hero .eyebrow { color: #e3c8fb; }
.hero .lead { max-width: 620px; color: rgb(255 255 255 / .85); }
.hero .button { background: #fff; color: #4c1580; }
.hero .button.secondary { background: transparent; color: #fff; border-color: rgb(255 255 255 / .7); }
.hero .button.secondary:hover { background: rgb(255 255 255 / .1); }
@media (max-width: 680px) {
  .hero { padding-top: 48px; padding-bottom: 56px; }
  .hero h1 { font-size: 2.1rem; }
}
.card-icon { display: inline-flex; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .button { margin-top: 4px; }
.cards.sections { margin-top: 40px; }
.cards.sections li { position: relative; transition: border-color .15s; }
.cards.sections li:hover { border-color: var(--accent); }
.cards.sections h2 { font-size: 1.1rem; margin: 0 0 6px; padding: 0; border: 0; }
.cards.sections a { text-decoration: none; }
.cards.sections a::after { content: ""; position: absolute; inset: 0; }   /* tutta la card è cliccabile */

/* Profilo */
.profile { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 3px solid var(--accent-soft); }
.motto { font-style: italic; font-weight: 600; color: var(--accent); }

.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--accent-soft); border-radius: 999px; padding: 3px 12px; font-size: .9rem; }

.timeline { list-style: none; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .when { display: block; color: var(--muted); font-size: .875rem; }

/* Elenchi di link e card */
.links { list-style: none; padding: 0; margin: 0; }
.links li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.links a { font-weight: 600; }
.links .desc { display: block; color: var(--muted); font-size: .9rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cards h3 { margin-top: 0; }
.cards p { margin-bottom: 0; color: var(--muted); font-size: .95rem; }

/* Tabelle degli appunti */
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--surface); padding: 1px 5px; border-radius: 4px; }

.breadcrumb { font-size: .9rem; margin-bottom: 8px; }
.userbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 12px; margin-bottom: 24px; background: var(--surface); border-radius: var(--radius); }
.source { font-size: .875rem; color: var(--muted); font-style: italic; }

/* Moduli */
form.box { max-width: 380px; }
label { display: block; font-weight: 600; margin-top: 14px; }
input[type=text], input[type=email], input[type=password] {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit;
  color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.hp { position: absolute; left: -9999px; }

button, .button {
  display: inline-block; margin-top: 18px; padding: 9px 18px; font: inherit; font-weight: 600;
  color: #fff; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; text-decoration: none;
}
@media (prefers-color-scheme: dark) { button, .button { color: #151318; } }
button.secondary, .button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.small { margin-top: 0; padding: 4px 10px; font-size: .875rem; }
.inline { display: inline; }

.msg { padding: 10px 14px; border-radius: 6px; margin: 16px 0; }
.msg.error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.msg.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }

.status { font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.status.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.status.wait { background: var(--accent-soft); color: var(--accent); }

/* Piè di pagina */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.site-footer a { color: var(--muted); }
