/* ===== Davide Zaffino — revised with fallbacks ===== */
:root {
  --ink: #1a1a2e;
  --muted: #555;
  --accent: #0075c1;
  --accent-light: #dceaf5;
  --card-bg: #fff;
  --bg: #f5f5f0;
  --line: #ddd;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 5vw;
  background: rgba(245,245,240,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-color: var(--line); }
.brand {
  font-family: var(--serif); font-size: 1.2rem;
  color: var(--ink); text-decoration: none;
}
.nav { display: flex; gap: 1.5rem; }
.nav a {
  color: var(--ink); text-decoration: none;
  font-size: .9rem; font-weight: 500; opacity: .7;
  transition: opacity .2s;
}
.nav a:hover { opacity: 1; }

/* ===== Container ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 5vw; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 7rem 5vw 4rem; position: relative; overflow: hidden;
  /* SOLID fallback background — always visible even if image fails */
  background: #1a1a2e;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('hero-bg.jpg') center / cover no-repeat;
  background-color: #1a1a2e; /* same as hero bg — fallback while loading */
  transform: scale(1.05);
  filter: brightness(.35) saturate(.8);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,117,193,.15) 0%, transparent 60%);
}
.hero-inner {
  position: relative; z-index: 1; width: 100%; max-width: 1100px; margin: 0 auto;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 7rem); line-height: 1.02; color: #fff;
}
.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  color: #88c8f5; margin-top: .5rem; font-weight: 500;
}
.hero-lede {
  margin-top: 1.5rem; max-width: 34rem;
  font-size: 1.1rem; color: rgba(255,255,255,.7);
}
.hero-cta { margin-top: 2.25rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: .8rem 1.6rem;
  border-radius: 4px; text-decoration: none;
  font-weight: 600; font-size: .95rem;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0,117,193,.3); }
.btn-outline {
  border: 1.5px solid rgba(255,255,255,.6); color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-lg { font-size: 1.05rem; padding: .9rem 2rem; }

/* ===== Sections ===== */
section { padding: 5rem 0; }
.section-alt { background: var(--card-bg); }
.label {
  font-size: .75rem; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}
.section-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.1; margin-bottom: 2.5rem;
}

/* ===== About ===== */
.about-top {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2rem;
}
.about-block { margin-bottom: 2rem; max-width: 800px; }
.subhead {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.5rem; color: var(--accent);
  margin-bottom: .5rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--accent-light);
}
.about-block p { margin-bottom: .5rem; }
.about-block blockquote {
  border-left: 3px solid var(--accent); padding-left: 1.25rem;
  margin: .75rem 0; color: var(--muted); font-style: italic;
}
.about-block strong { color: var(--accent); }
.about-photo { margin-top: 2rem; }
.portrait {
  max-width: 320px; width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

/* ===== Cards (Career) ===== */
.card-list { display: grid; gap: 1rem; }
.card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.card-year {
  font-size: .7rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); display: block;
  margin-bottom: .35rem;
}
.card h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.2rem; margin-bottom: .3rem;
}
.card p { font-size: .95rem; color: var(--muted); }

/* ===== Projects ===== */
.project-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(2,1fr); }
.project-card {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; transition: transform .2s, box-shadow .25s;
}
.project-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.project-img-wrap { width: 100%; height: 220px; overflow: hidden; }
.project-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 1.25rem; }
.project-body h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.3rem; margin-bottom: .4rem;
}
.project-body p { font-size: .95rem; color: var(--muted); }

/* ===== Charities ===== */
.charities-intro {
  max-width: 700px;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  color: var(--muted);
}
.charity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.charity-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  transition: transform .2s, box-shadow .25s;
}
.charity-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.charity-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  margin: .75rem 0 .4rem;
}
.charity-card p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.5;
}
.charity-fundraiser {
  margin-top: 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--accent-light);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}
.charity-fundraiser p + p {
  margin-top: .5rem;
}

@media (max-width: 800px) {
  .charity-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .charity-grid { grid-template-columns: 1fr; }
}

/* ===== Contact ===== */
.social-links {
  margin-top: 2rem; display: flex; justify-content: center; gap: 2rem;
}
.social-links a {
  color: var(--muted); text-decoration: none;
  font-size: .95rem; font-weight: 500; transition: color .2s;
}
.social-links a:hover { color: var(--accent); }
.social-icon { width: 28px; height: 28px; display: block; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line); padding: 2rem 0;
  text-align: center; color: var(--muted); font-size: .85rem;
}
.footer-nav { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: .75rem; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.footer-nav a:hover { color: var(--accent); }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .about-top { grid-template-columns: 1fr; gap: 1.5rem; }
  .project-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav { gap: .8rem; }
  .nav a { font-size: .82rem; }
  .hero { padding-top: 5rem; }
  .subscribe-form { flex-direction: column; }
  .input-email { width: 100%; }
}
@media (min-width: 2000px) { html { font-size: 18px; } }
@media (min-width: 2800px) { html { font-size: 22px; } }