/* Domenico Pastore — sito personale */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f2;
  --text: #16181a;
  --muted: #565b60;
  --line: #e4e4de;
  --accent: #2f5d50;        /* verde salvia scuro — contrasto 7.4:1 su bianco */
  --accent-strong: #234a3f;
  --accent-soft: #e8efec;
  --focus: #1f6feb;
  --radius: 14px;
  --wrap: 1080px;
  --gutter: 20px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.375rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand:hover { color: var(--text); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: .95rem; color: var(--text); cursor: pointer;
}
.nav-toggle-bar { width: 16px; height: 2px; background: currentColor; position: relative; display: block; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; }
.nav-toggle-bar::before { top: -5px; } .nav-toggle-bar::after { top: 5px; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 64px;
  background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 12px 0; color: var(--text); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a:hover { color: var(--accent); }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; padding: 0; border: 0; background: none; }
  .site-nav ul { display: flex; gap: 28px; align-items: center; }
  .site-nav a { padding: 6px 0; border: 0; font-size: .95rem; color: var(--muted); }
  .site-nav a:hover { color: var(--text); }
  .site-nav .nav-cta {
    color: #fff; background: var(--accent); padding: 8px 16px; border-radius: 999px;
  }
  .site-nav .nav-cta:hover { color: #fff; background: var(--accent-strong); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--accent); transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-soft { background: var(--bg-soft); border-top: 0 !important; }
.section-soft + .section { border-top: 0; }
.eyebrow {
  display: block; font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); margin-bottom: 12px;
}
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); margin-top: 14px; }
@media (min-width: 860px) { .section { padding: 104px 0; } }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 72px; }
.hero-grid { display: grid; gap: 32px; }
.hero-photo {
  width: 136px; height: 136px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.hero h1 { margin-bottom: 18px; }
.hero-lead { font-size: clamp(1.15rem, 2.4vw, 1.375rem); color: var(--muted); max-width: 40ch; margin-bottom: 30px; line-height: 1.5; }
.hero-lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { margin-top: 28px; font-size: .95rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero-meta span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
@media (min-width: 860px) {
  .hero { padding: 96px 0 120px; }
  .hero-grid { grid-template-columns: 1fr auto; align-items: center; gap: 64px; }
  .hero-grid > picture { order: 2; }
  .hero-photo { width: 240px; height: 240px; box-shadow: 0 0 0 10px var(--accent-soft); }
}

/* ---------- Chi sono ---------- */
.about-grid { display: grid; gap: 32px; }
.about-text p { font-size: 1.125rem; }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .975rem; }
.facts dt, .facts .k { color: var(--muted); }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1.4fr 1fr; gap: 72px; } }

/* ---------- Progetti ---------- */
.cards { display: grid; gap: 16px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 22px; transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #cfd6d2; box-shadow: 0 6px 24px rgba(22,24,26,.06); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.badge {
  flex-shrink: 0; font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap;
}
.badge-wip { background: #f6efe1; color: #6b4e12; }
.card-role { font-size: .9rem; color: var(--muted); margin: 0 0 12px; }
.card p.card-desc { margin-bottom: 18px; }
.card-stat { font-weight: 600; color: var(--text); }
.card-link { margin-top: auto; font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.card-link .arrow { transition: transform .15s; }
.card:hover .card-link .arrow { transform: translateX(3px); }

.more { margin-top: 56px; }
.more h3 { margin-bottom: 8px; }
.more > p { color: var(--muted); margin-bottom: 20px; }
.more-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.more-list li { border-bottom: 1px solid var(--line); }
.more-list a {
  display: grid; grid-template-columns: 1fr; gap: 2px; padding: 16px 0;
  text-decoration: none; color: var(--text);
}
.more-list a:hover .more-name { color: var(--accent); }
.more-name { font-weight: 600; }
.more-desc { color: var(--muted); font-size: .95rem; }
@media (min-width: 700px) {
  .more-list a { grid-template-columns: 260px 1fr auto; gap: 24px; align-items: baseline; }
  .more-list a::after { content: "→"; color: var(--muted); }
}

/* ---------- Blog ---------- */
.posts { display: grid; gap: 16px; margin-bottom: 28px; }
@media (min-width: 860px) { .posts { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.post {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff;
}
.post time { font-size: .85rem; color: var(--muted); }
.post h3 { font-size: 1.1rem; margin: 6px 0 8px; }
.post a { color: var(--text); text-decoration: none; }
.post a::after { content: ""; position: absolute; inset: 0; }
.post:hover { border-color: #cfd6d2; }
.post p { color: var(--muted); font-size: .95rem; margin: 0; }
.blog-empty {
  border: 1px dashed #cfd6d2; border-radius: var(--radius); padding: 28px 24px; background: #fff; margin-bottom: 28px;
}
.blog-empty p { margin: 0; color: var(--muted); }

/* ---------- Calendario ---------- */
.cal-box {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
}
.cal-intro { padding: 28px 24px; display: grid; gap: 18px; }
.cal-intro p { margin: 0; color: var(--muted); }
.cal-actions { display: flex; flex-wrap: wrap; gap: 12px; }
#cal-inline { min-height: 0; }
#cal-inline.is-loaded { min-height: 620px; border-top: 1px solid var(--line); }
@media (min-width: 860px) { .cal-intro { grid-template-columns: 1fr auto; align-items: center; padding: 32px; } }

/* ---------- Contatti ---------- */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.3fr; gap: 72px; } }
.contact-list { list-style: none; margin: 0 0 24px; padding: 0; }
.contact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.contact-list .k { color: var(--muted); font-size: .95rem; }
.contact-list a { word-break: break-word; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: #fff; border: 1.5px solid #cfd2cc; border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; gap: 18px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.form-status { margin: 0; font-size: .95rem; min-height: 1.5em; }
.form-status.ok { color: var(--accent-strong); font-weight: 600; }
.form-status.err { color: #a12a1a; font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: .925rem; color: var(--muted); }
.footer-grid { display: grid; gap: 20px; }
.footer-grid p { margin: 0; }
.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.social a, .footer-links a { color: var(--muted); }
.social a:hover, .footer-links a:hover { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr auto; align-items: center; } }

/* ---------- Pagine interne ---------- */
.page { padding: 56px 0 88px; }
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-bottom: 12px; }
.prose h2 { font-size: 1.35rem; margin: 40px 0 10px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose .updated { color: var(--muted); font-size: .95rem; margin-bottom: 32px; }
.center-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 72px 0; }
.center-page p { color: var(--muted); max-width: 46ch; margin: 14px auto 28px; }
