/* proviamo — stile da corrispondenza cartacea: carta, inchiostro, timbro. */

/* Font ospitati qui (licenza OFL): nessuna richiesta a Google, nessun cookie. */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/space-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #efe8da;
  --sheet: #fffdf7;
  --sheet-2: #f7f1e4;
  --ink: #2b2622;
  --ink-soft: #5e554b;
  --muted: #8f8477;
  --line: #e2d8c6;
  --dash: #cdbfa8;
  --stamp: #b8452f;
  --stamp-dark: #963522;
  --ok: #3f7a4f;
  --warn: #a8741a;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "Space Mono", "Courier New", Courier, ui-monospace, monospace;

  --radius: 4px;
  --shadow: 0 1px 0 rgba(43, 38, 34, .04), 0 12px 30px -18px rgba(43, 38, 34, .35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

a { color: var(--stamp); text-underline-offset: 3px; }
a:hover { color: var(--stamp-dark); }

img { max-width: 100%; }

/* Titoli in Bricolage Grotesque, testo in Figtree. */
h1, h2, h3,
.stamp strong, .steps li::before, .archive-list strong {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.025em;
  font-optical-sizing: auto;
}
h1 em, h2 em { font-style: normal; }

.wrap { width: min(100% - 32px, 980px); margin-inline: auto; }
.wrap--narrow { width: min(100% - 32px, 680px); margin-inline: auto; }

/* ---- testata e piede ---------------------------------------------------- */

.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.brand { text-decoration: none; color: var(--ink); display: inline-flex; flex-direction: column; line-height: 1; }
.brand__kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--stamp); margin-bottom: 4px; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.035em; }

.nav { display: flex; gap: 18px; font-size: 16px; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--stamp); }

.site-footer { padding: 48px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; border-top: 1px dashed var(--dash); padding-top: 20px; }
.site-footer a { color: var(--muted); }

/* ---- elementi ricorrenti ------------------------------------------------- */

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--stamp);
}

.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stamp {
  display: inline-grid;
  place-items: center;
  width: 86px;
  height: 100px;
  border: 2px dashed var(--stamp);
  outline: 4px solid var(--sheet);
  outline-offset: -8px;
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(4deg);
  background: var(--sheet-2);
}
.stamp strong { display: block; font-size: 24px; text-transform: none; }

.postmark {
  position: absolute;
  width: 120px; height: 120px;
  border: 2px solid rgba(184, 69, 47, .45);
  border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(184, 69, 47, .7);
  font-family: var(--mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; text-align: center;
  transform: rotate(-12deg);
  pointer-events: none;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 3px;
  background: var(--stamp);
  color: var(--sheet);
  font: inherit;
  font-size: 17px;
  padding: 12px 26px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--stamp-dark); color: var(--sheet); }
.btn--ghost { background: transparent; color: var(--stamp); border: 1px solid var(--stamp); }
.btn--ghost:hover { background: var(--stamp); color: var(--sheet); }
.btn--small { font-size: 15px; padding: 7px 14px; }
.btn--quiet { background: transparent; color: var(--ink-soft); border: 1px solid var(--dash); }
.btn--quiet:hover { background: var(--sheet-2); color: var(--ink); }

/* ---- form -------------------------------------------------------------- */

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field .field__label { font-size: 15px; color: var(--ink-soft); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url],
.field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--dash);
  border-radius: 3px;
  padding: 10px 12px;
}
.field textarea { min-height: 120px; line-height: 1.55; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(184, 69, 47, .35); border-color: var(--stamp); }
.field__error, .form-error { color: var(--stamp-dark); font-size: 15px; }
.field__hint { color: var(--muted); font-size: 14px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); margin-bottom: 18px; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--stamp); flex: none; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- home -------------------------------------------------------------- */

.hero { padding: 20px 0 56px; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.05; letter-spacing: -.02em; margin: 14px 0 18px; }
.hero h1 em { color: var(--stamp); }
.hero__lead { font-size: 20px; color: var(--ink-soft); margin: 0 0 22px; max-width: 30em; }
.hero__rules { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); list-style: none; padding: 0; margin: 0; }
.hero__rules li::before { content: "✓ "; color: var(--stamp); }

.envelope { position: relative; padding: 28px 28px 24px; }
.envelope .stamp { position: absolute; top: -18px; right: 18px; }
.envelope h2 { font-size: 26px; margin: 0 0 6px; }
.envelope p.muted { margin: 0 0 20px; color: var(--ink-soft); font-size: 16px; padding-right: 90px; }

.section { padding: 48px 0; }
.section h2 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 8px 0 24px; letter-spacing: -.01em; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { padding: 22px; counter-increment: step; }
.steps li::before { content: counter(step); display: block; font-size: 40px; color: var(--stamp); line-height: 1; margin-bottom: 10px; }
.steps h3 { margin: 0 0 6px; font-size: 20px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 16px; }

.letter { position: relative; padding: 36px 40px; }
.letter .postmark { top: 18px; right: 22px; }
.letter__greeting { margin-top: 0; }
.letter__sign { font-style: italic; }

.challenge-box { background: var(--sheet-2); border-left: 4px solid var(--stamp); padding: 18px 22px; margin: 22px 0; }
.challenge-box h3 { font-size: 24px; margin: 4px 0 10px; line-height: 1.25; }
.challenge-box p:last-child { margin-bottom: 0; }

.friend-card { border: 2px dashed var(--dash); padding: 18px 22px; margin-top: 8px; position: relative; }
.friend-card::before { content: "✂"; position: absolute; top: -14px; left: 14px; background: var(--sheet); padding: 0 6px; color: var(--muted); font-size: 18px; }
.friend-card__text { font-style: italic; }
.friend-card__text p { margin: 0 0 10px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

/* ---- archivio ---------------------------------------------------------- */

.archive-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.archive-list a { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 18px 22px; text-decoration: none; color: var(--ink); }
.archive-list a:hover { border-color: var(--stamp); }
.archive-list time { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 4px; }
.archive-list strong { font-size: 21px; display: block; line-height: 1.3; }
.archive-list span.cat { font-size: 14px; color: var(--ink-soft); }

.page { padding: 12px 0 40px; }
.page h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.1; margin: 10px 0 20px; letter-spacing: -.01em; }
.prose h2 { font-size: 24px; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink); }

.notice { padding: 28px 32px; }
.notice h1 { margin-top: 0; }

/* ---- messaggi ------------------------------------------------------------ */

.flash { padding: 12px 16px; border-radius: 3px; margin-bottom: 16px; font-size: 16px; border: 1px solid; }
.flash--success { background: #eef5ef; border-color: #bcd6c2; color: #2d5a39; }
.flash--info { background: #f1f0ea; border-color: var(--dash); color: var(--ink-soft); }
.flash--warning, .flash--danger { background: #fbefe9; border-color: #ecc4b6; color: var(--stamp-dark); }

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 820px) {
  .hero__grid, .split { grid-template-columns: 1fr; gap: 28px; }
  .steps { grid-template-columns: 1fr; }
  .letter { padding: 28px 22px; }
  .letter .postmark { display: none; }
  .archive-list a { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  .envelope { padding: 24px 18px 20px; }
  .envelope .stamp { width: 70px; height: 82px; font-size: 10px; right: 10px; }
  .envelope .stamp strong { font-size: 21px; }
  .envelope p.muted { padding-right: 60px; }
}
