:root {
  --paper: #f7f4ee;
  --ink: #1e1b18;
  --muted: #6b645c;
  --accent: #b4651a;
  --rule: #e3ddd3;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, Cambria, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --ink: #ece6dc;
    --muted: #a39a8e;
    --accent: #e0954a;
    --rule: #2e2a25;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Testata */
.masthead { border-bottom: 1px solid var(--rule); }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.mark { width: 2.1rem; height: 2.1rem; flex: none; color: var(--ink); }

.wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav { display: flex; gap: 1.25rem; font-family: var(--sans); font-size: 0.9rem; }

.nav a { color: var(--muted); text-decoration: none; }

.nav a:hover { color: var(--ink); }

/* Contenuto */
main.wrap { padding-top: 3rem; padding-bottom: 4rem; }

h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.25; }

h1 { font-size: 2.1rem; margin: 0 0 1.25rem; }

h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; }

p { margin: 0 0 1.1rem; }

a { color: var(--accent); text-underline-offset: 0.18em; }

.lede, .standfirst { font-size: 1.25rem; }

.standfirst { color: var(--muted); }

.section-title {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.list { list-style: none; margin: 0; padding: 0; }

.item { padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }

.item-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 0.4rem;
}

.item-title:hover { color: var(--accent); }

.item p { margin: 0 0 0.4rem; color: var(--muted); font-size: 1.02rem; }

.meta, .kicker {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.kicker { margin-bottom: 0.75rem; }

.prose h2 { padding-top: 0.25rem; }

.byline {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}

/* Piede */
.footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer p { margin: 0 0 0.4rem; }

.footer a { color: var(--muted); }

@media (max-width: 520px) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.7rem; }
  .wordmark { font-size: 0.8rem; letter-spacing: 0.1em; }
  .mark { width: 1.8rem; height: 1.8rem; }
  .nav { gap: 0.9rem; font-size: 0.85rem; }
}

/* ---- Layout largo, home e articoli ---- */
main.wide { max-width: 68rem; }

.post { max-width: 42rem; margin: 0 auto; }

.hero {
  position: relative;
  max-width: 48rem;
  padding: 1rem 0 2.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -3rem;
  right: -22rem;
  width: 44rem;
  height: 26rem;
  background: linear-gradient(200deg, rgba(224, 149, 74, 0.28), rgba(224, 149, 74, 0) 60%);
  clip-path: polygon(100% 0, 100% 22%, 0 100%, 0 92%);
  pointer-events: none;
}

.hero h1 { font-size: 2.9rem; letter-spacing: -0.01em; }

.eyebrow, .tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow { margin-bottom: 1rem; }

.tag { display: inline-block; margin-right: 0.5rem; }

/* Articolo in evidenza */
.feature {
  display: block;
  padding: 2rem 2.25rem;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--paper) 88%, var(--accent));
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.feature:hover { transform: translateY(-2px); }

.feature-title {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.6rem 0 0.75rem;
}

/* Griglia schede */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.25rem;
}

.grid-3 { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }

.card-text { color: var(--muted); font-size: 1rem; line-height: 1.6; flex: 1; }

.feature .card-text { font-size: 1.1rem; }

/* Progetti */
.projects {
  margin-top: 4rem;
  padding: 0.5rem 2.25rem 2.25rem;
  border-radius: 8px;
  background: #1e1b18;
  color: #ece6dc;
}

.projects .section-title { color: #a39a8e; border-top: 0; }

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.75rem;
}

.project { border-top: 2px solid #e0954a; padding-top: 1rem; }

.project-name {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ece6dc;
  text-decoration: none;
  margin-bottom: 0.4rem;
}

.project-name:hover { color: #e0954a; }

.project p { color: #c9c0b3; font-size: 1rem; line-height: 1.6; margin: 0; }

@media (prefers-color-scheme: dark) {
  .projects { background: #24201c; }
}

/* Articolo */
.prose p:first-of-type::first-letter {
  float: left;
  font-size: 3.4rem;
  line-height: 0.9;
  padding: 0.3rem 0.5rem 0 0;
  color: var(--accent);
  font-weight: 700;
}

.more { max-width: 68rem; margin: 3rem auto 0; }

.more .card-title { font-size: 1.05rem; }

@media (max-width: 520px) {
  .hero h1 { font-size: 2rem; }
  .hero::before { right: -30rem; }
  .feature { padding: 1.5rem; }
  .feature-title { font-size: 1.45rem; }
  .projects { padding: 0.5rem 1.25rem 1.5rem; }
}

/* Allineamenti */
.masthead .wrap, .footer .wrap { max-width: 68rem; }
.feature .card-text, .feature .meta { display: block; }
.feature .meta { margin-top: 0.75rem; }
.more { max-width: 42rem; }
.more .grid-3 { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }

body { overflow-x: hidden; }
html { overflow-x: clip; }
main { overflow-x: clip; }

.projects { margin-top: 2.5rem; }
