/* ============================================================
   Deliberato — design system
   "studio notarile moderno": carta calda, grafite, un sigillo bordeaux
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* paper + ink */
  --paper:        #f4f1ea;
  --paper-deep:   #ece7db;
  --surface:      #fbfaf6;
  --surface-2:    #f7f4ed;
  --ink:          #17150f;
  --ink-2:        #36322a;
  --muted:        #6c685b;
  --faint:        #99947f;
  --line:         #e2dccd;
  --line-soft:    #ece7da;
  --line-strong:  #cfc8b6;

  /* singular accent — wax-seal bordeaux (tweakable) */
  --accent:       #7c241f;
  --accent-deep:  #5f1a16;
  --accent-tint:  #f0e4df;
  --on-accent:    #fbf6ee;

  /* type */
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans:  'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  /* rhythm */
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;

  --shadow-card: 0 1px 2px rgba(23,21,15,.04), 0 8px 24px -16px rgba(23,21,15,.18);
  --shadow-lift: 0 1px 2px rgba(23,21,15,.05), 0 18px 50px -22px rgba(23,21,15,.30);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }

.serif { font-family: var(--serif); }

/* ---- layout shell ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 860px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow.neutral { color: var(--faint); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand__mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand__dot { color: var(--accent); }
.brand__tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap;
  padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line-strong);
}
@media (max-width: 760px) { .brand__tag { display: none; } }

.site-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); }
.site-nav__link {
  text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  letter-spacing: 0.005em; white-space: nowrap; transition: color .16s;
}
.site-nav__link:hover { color: var(--accent); }
.site-nav__link[aria-current="page"] { color: var(--ink); }
.site-nav__link[aria-current="page"]::after {
  content: ""; display: block; height: 2px; background: var(--accent);
  margin-top: 3px; border-radius: 2px;
}
/* primary CTA in nav */
.site-nav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper); text-decoration: none;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  transition: background .16s, box-shadow .16s, transform .12s;
}
.site-nav__cta:hover { background: var(--accent); box-shadow: 0 8px 20px -12px var(--accent); }
.site-nav__cta:active { transform: translateY(1px); }

/* day / night toggle */
.theme-toggle {
  appearance: none; cursor: pointer; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-strong);
  transition: color .16s, border-color .16s, background .16s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); }
.theme-toggle svg { width: 18px; height: 18px; display: none; }
html[data-theme="giorno"] .theme-toggle .ico-moon { display: block; } /* in giorno offri la notte */
html[data-theme="notte"]  .theme-toggle .ico-sun  { display: block; }
/* fallback quando nessun tema esplicito (mostra luna) */
html:not([data-theme="notte"]) .theme-toggle .ico-moon { display: block; }

@media (max-width: 880px) {
  .site-nav__hideable { display: none; }
}

/* ---- mobile nav: dettagli minimi ---- */
.nav-spacer { flex: 1; }

/* ---- buttons ---- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 16px; letter-spacing: 0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 26px; height: 54px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--accent); box-shadow: 0 10px 26px -14px var(--accent); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn--sm { height: 44px; font-size: 14.5px; padding: 0 20px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- generic section ---- */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { max-width: 640px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin-top: 14px;
}
.section-head p { color: var(--muted); margin-top: 16px; font-size: 18px; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* utility */
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   FOOTER condiviso (espanso)
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); }
.site-footer__inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
  padding-block: 56px 40px;
}
.site-footer__brand { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.site-footer__brand .brand__dot { color: var(--accent); }
.site-footer__blurb { margin-top: 12px; font-size: 14.5px; line-height: 1.55; color: var(--muted); max-width: 38ch; }
.site-footer__coltitle {
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 14px;
}
.site-footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.site-footer__col a { color: var(--ink-2); text-decoration: none; transition: color .16s; width: fit-content; }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__col a .ext { font-size: 11px; color: var(--faint); margin-left: 5px; }
.site-footer__inline { color: var(--faint); }
.site-footer__inline a { display: inline; }
.site-footer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-block: 22px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--faint);
}
.site-footer__legal { line-height: 1.5; max-width: 70ch; }
.site-footer__elisa { display: inline-flex; align-items: center; gap: 9px; color: var(--faint); text-decoration: none; transition: color .16s; white-space: nowrap; }
.site-footer__elisa:hover { color: var(--accent); }
.site-footer__elisa strong { color: var(--ink-2); font-weight: 600; }
.site-footer__elisa img { height: 20px; width: auto; display: block; }
[data-theme="notte"] .site-footer__elisa img { filter: invert(1) brightness(1.9); }
@media (max-width: 760px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .site-footer__brandcol { grid-column: 1 / -1; }
}
@media (max-width: 460px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ============================================================
   PAGINE PROSA (Skill per Claude, legali)
   ============================================================ */
.page-hero { padding-top: clamp(44px, 7vw, 92px); padding-bottom: clamp(28px, 4vw, 44px); }
.page-hero__inner { max-width: 820px; }
.page-hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -0.022em;
  margin-top: 18px; color: var(--ink); text-wrap: balance;
}
.page-hero h1 .accent { color: var(--accent); font-style: italic; }
.page-hero__lead {
  margin-top: 22px; font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--ink-2);
  max-width: 62ch;
}

.prose { max-width: 740px; }
.prose > * + * { margin-top: 18px; }
.prose h2 {
  font-family: var(--serif); font-size: clamp(23px, 2.6vw, 30px); font-weight: 600;
  letter-spacing: -.015em; color: var(--ink); margin-top: 48px; padding-top: 26px;
  border-top: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); margin-top: 30px; }
.prose p, .prose li { font-size: 16.5px; line-height: 1.65; color: var(--ink-2); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent-deep); }
.prose ul, .prose ol { margin: 14px 0; padding-left: 22px; display: grid; gap: 9px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code, .cmd code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.92em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--ink);
}
.prose .lead { font-size: 18.5px; line-height: 1.6; color: var(--ink); }
.prose__updated { font-size: 13.5px; color: var(--faint); margin-top: 6px; }

/* command / prompt block */
.cmd {
  position: relative; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 22px 18px 16px; margin: 18px 0;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.55;
  color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.cmd::before {
  content: attr(data-label); position: absolute; top: -9px; left: 14px;
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent); padding: 2px 8px; border-radius: 4px;
}
.cmd code { background: none; border: 0; padding: 0; color: inherit; }

/* numbered install steps */
.steps { display: grid; gap: 18px; margin-top: 8px; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 20px; align-items: start;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; padding-top: 0; }
.step__n {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.step h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); margin: 4px 0 0; }
.step p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }

/* feature / mode grid (skill page) */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 680px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px;
}
.feature__name { font-family: var(--serif); font-size: 18.5px; font-weight: 600; color: var(--ink); }
.feature__name::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.feature__roles { margin-top: 8px; font-size: 13px; color: var(--faint); line-height: 1.5; }
.feature__desc { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
