:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --ink: #0b3b3c;
  --text: #1c2b2b;
  --muted: #5a6b6a;
  --line: #d9dcd6;
  --accent: #1f9e89;
  --on-ink: #f6f5f0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1a1b;
    --surface: #132526;
    --ink: #e9f0ea;
    --text: #dfe7e2;
    --muted: #9fb0ab;
    --line: #26393a;
    --accent: #5ec962;
    --on-ink: #0d1a1b;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

/* language switch: only the active language is shown */
html[data-lang="it"] [lang="en"],
html[data-lang="en"] [lang="it"] { display: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

a { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.logo-bg { fill: #0b3b3c; }

.nav nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}

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

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

.lang {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.lang:hover { border-color: var(--ink); }

/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 56px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.lead {
  margin: 0 0 28px;
  font-size: 19px;
  color: var(--muted);
  max-width: 34em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.btn:hover { background: var(--surface); }

.btn.primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn.primary:hover { opacity: 0.9; background: var(--ink); }

figure { margin: 0; }

figure img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.hero-map img { max-height: 520px; object-fit: contain; }

.hero-map figcaption { text-align: center; }

/* three facts */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.facts h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.facts p {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

/* sections */
.section-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.example,
.tools,
.credits {
  padding-top: 56px;
  padding-bottom: 8px;
}

.example figure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px 14px;
}

.note {
  margin: 18px 0 22px;
  color: var(--muted);
  max-width: 46em;
}

.tools p {
  margin: 0;
  color: var(--muted);
  max-width: 46em;
}

/* credits */
.credits dl { margin: 0; }

.credits dl > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.credits dt { color: var(--muted); }

.credits dd { margin: 0; }

.credits cite { font-style: italic; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

/* small screens */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav nav { gap: 14px; font-size: 14px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 24px; padding-bottom: 36px; }
  .hero-map img { max-height: 340px; }
  .lead { font-size: 17px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .credits dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .section-title { font-size: 26px; }
}

@media (max-width: 480px) {
  .nav nav a[href="#tools"] { display: none; }
}
