/* Reset minimo */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { min-height: 100dvh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul[role="list"] { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Token comuni */
:root {
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 44px);
  --radius: 10px;
  --pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Tema Notte */
html[data-theme="notte"] {
  --bg: #140C0A;
  --bg-2: #1c110e;
  --ink: #F2E6D3;
  --ink-2: rgba(242, 230, 211, .78);
  --acc: #E0A43C;
  --bord: #7A2E2A;
  --line: rgba(242, 230, 211, .14);
  --paper: #F4ECDC;         /* fondo pagine interne di testo */
  --paper-ink: #2B1A14;
  --font-display: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  --font-body: 'DM Sans Variable', system-ui, sans-serif;
  --h1-weight: 500;
  --h1-track: -.035em;
  --h1-case: uppercase;
}

/* Tema Farina */
html[data-theme="farina"] {
  --bg: #F4ECDC;
  --bg-2: #EFE3CC;
  --ink: #2B1A14;
  --ink-2: #4a3a30;
  --acc: #B5541C;
  --bord: #340005;
  --oro: #FCD255;
  --mut: #8A7A66;
  --line: rgba(52, 0, 5, .14);
  --paper: #F4ECDC;
  --paper-ink: #2B1A14;
  --font-display: 'Fraunces Variable', Georgia, serif;
  --font-body: 'Instrument Sans Variable', system-ui, sans-serif;
  --h1-weight: 300;
  --h1-track: -.02em;
  --h1-case: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; font-weight: 400; }
h1 { font-weight: var(--h1-weight); letter-spacing: var(--h1-track); text-transform: var(--h1-case); font-size: clamp(2.4rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -.01em; }
h3 { font-size: 1.3rem; }
html[data-theme="farina"] h1 { font-variation-settings: "opsz" 144; }
html[data-theme="farina"] h1 em { font-style: italic; font-weight: 400; color: var(--acc); }
html[data-theme="notte"] h1 em { font-style: normal; color: var(--acc); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.kicker { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--acc); }
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.4em; border-radius: var(--pill); border: 1.5px solid var(--bord); color: var(--bord); font-weight: 500; text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.btn--fill { background: var(--bord); color: var(--paper); }
html[data-theme="notte"] .btn { border-color: var(--acc); color: var(--acc); }
html[data-theme="notte"] .btn--fill { background: var(--acc); color: var(--bg); }
.btn:hover { background: var(--bord); color: var(--paper); }
html[data-theme="notte"] .btn:hover { background: var(--acc); color: var(--bg); }

.skip { position: absolute; left: -999px; top: 8px; padding: .6em 1em; background: var(--bord); color: #fff; border-radius: var(--radius); z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* Pagine di testo: sempre chiare, anche in Notte */
.paper { background: var(--paper); color: var(--paper-ink); }
.prose { max-width: 68ch; }
.prose p + p { margin-top: 1em; }
.prose h2 { margin-block: 2em .6em; }
.prose a { color: var(--acc); }
