/* ============================================================
   site.css — modern design system for eliapizzati.github.io
   Adapted from the thesis_webpage look: Inter, apple-green,
   light/dark mode, glassmorphism cards. Pairs with Font Awesome 5.
   ============================================================ */

:root {
  --primary: #8a9a13;          /* apple green, contrast-safe on white */
  --primary-bright: #9aac15;
  --secondary: #9ec532;
  --text: #1b1b1b;
  --muted: #5b6157;
  --bg: #f7f8f4;
  --card-bg: #ffffff;
  --border: rgba(27, 27, 27, 0.08);
  --nav-bg: rgba(247, 248, 244, 0.85);
  --footer-bg: #1c1f1a;
  --footer-text: #e8f0df;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #b6c83a;
    --primary-bright: #c4d84a;
    --text: #e8f5e9;
    --muted: #a7b0a2;
    --bg: #14171a;
    --card-bg: #1b1f1a;
    --border: rgba(255, 255, 255, 0.10);
    --nav-bg: rgba(20, 23, 26, 0.85);
    --footer-bg: #0e100d;
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
nav.site {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav.site .brand { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.3px; color: var(--text); }
nav.site .brand:hover { text-decoration: none; }
nav.site ul { list-style: none; display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
nav.site a.link { color: var(--muted); font-weight: 500; font-size: 0.95rem; position: relative; }
nav.site a.link:hover { color: var(--text); text-decoration: none; }
nav.site a.link.active { color: var(--text); }
nav.site a.link.active::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  height: 2px; width: 100%; background: var(--primary-bright); border-radius: 2px;
}

/* ---------- Hero (home): generative deep-space / cosmic-web backdrop ---------- */
header.hero {
  position: relative; text-align: center; color: #fff; overflow: hidden;
  padding: 6.5rem 1.5rem 7.5rem;
  background-color: #080b14;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover, auto, auto, auto, auto;
  background-image:
    /* cosmic-web filaments (inline SVG data-URI, CSS-only) */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 620' preserveAspectRatio='xMidYMid slice'%3E%3Cg stroke='%23aebfe0' stroke-width='0.7' stroke-opacity='0.13'%3E%3Cline x1='874' y1='412' x2='772' y2='373'/%3E%3Cline x1='757' y1='232' x2='772' y2='373'/%3E%3Cline x1='1130' y1='215' x2='1020' y2='355'/%3E%3Cline x1='113' y1='155' x2='137' y2='181'/%3E%3Cline x1='982' y1='379' x2='998' y2='470'/%3E%3Cline x1='1003' y1='370' x2='1020' y2='355'/%3E%3Cline x1='762' y1='35' x2='757' y2='232'/%3E%3Cline x1='274' y1='313' x2='219' y2='443'/%3E%3Cline x1='955' y1='425' x2='982' y2='379'/%3E%3Cline x1='959' y1='24' x2='837' y2='47'/%3E%3Cline x1='955' y1='425' x2='956' y2='443'/%3E%3Cline x1='772' y1='373' x2='666' y2='417'/%3E%3Cline x1='1020' y1='355' x2='1168' y2='391'/%3E%3Cline x1='762' y1='35' x2='837' y2='47'/%3E%3Cline x1='339' y1='149' x2='284' y2='188'/%3E%3Cline x1='128' y1='76' x2='137' y2='181'/%3E%3Cline x1='774' y1='336' x2='642' y2='584'/%3E%3Cline x1='982' y1='379' x2='1020' y2='355'/%3E%3Cline x1='339' y1='149' x2='286' y2='39'/%3E%3Cline x1='51' y1='135' x2='137' y2='181'/%3E%3Cline x1='956' y1='443' x2='998' y2='470'/%3E%3Cline x1='642' y1='584' x2='666' y2='417'/%3E%3Cline x1='1055' y1='70' x2='959' y2='24'/%3E%3Cline x1='774' y1='336' x2='666' y2='417'/%3E%3Cline x1='1055' y1='70' x2='1130' y2='215'/%3E%3Cline x1='1003' y1='370' x2='982' y2='379'/%3E%3Cline x1='509' y1='37' x2='415' y2='110'/%3E%3Cline x1='284' y1='188' x2='286' y2='39'/%3E%3Cline x1='1130' y1='215' x2='1168' y2='391'/%3E%3Cline x1='274' y1='313' x2='284' y2='188'/%3E%3Cline x1='1003' y1='370' x2='1168' y2='391'/%3E%3Cline x1='874' y1='412' x2='774' y2='336'/%3E%3Cline x1='955' y1='425' x2='1003' y2='370'/%3E%3Cline x1='339' y1='149' x2='415' y2='110'/%3E%3Cline x1='276' y1='362' x2='459' y2='340'/%3E%3Cline x1='874' y1='412' x2='955' y2='425'/%3E%3Cline x1='276' y1='362' x2='330' y2='563'/%3E%3Cline x1='276' y1='362' x2='210' y2='240'/%3E%3Cline x1='956' y1='443' x2='982' y2='379'/%3E%3Cline x1='955' y1='425' x2='998' y2='470'/%3E%3Cline x1='51' y1='135' x2='128' y2='76'/%3E%3Cline x1='415' y1='110' x2='449' y2='142'/%3E%3Cline x1='128' y1='76' x2='113' y2='155'/%3E%3Cline x1='330' y1='563' x2='219' y2='443'/%3E%3Cline x1='642' y1='584' x2='772' y2='373'/%3E%3Cline x1='774' y1='336' x2='757' y2='232'/%3E%3Cline x1='51' y1='135' x2='113' y2='155'/%3E%3Cline x1='774' y1='336' x2='772' y2='373'/%3E%3Cline x1='837' y1='47' x2='757' y2='232'/%3E%3Cline x1='284' y1='188' x2='210' y2='240'/%3E%3Cline x1='274' y1='313' x2='276' y2='362'/%3E%3Cline x1='1055' y1='70' x2='837' y2='47'/%3E%3Cline x1='762' y1='35' x2='959' y2='24'/%3E%3Cline x1='274' y1='313' x2='459' y2='340'/%3E%3Cline x1='509' y1='37' x2='449' y2='142'/%3E%3Cline x1='339' y1='149' x2='509' y2='37'/%3E%3Cline x1='137' y1='181' x2='210' y2='240'/%3E%3Cline x1='274' y1='313' x2='330' y2='563'/%3E%3Cline x1='459' y1='340' x2='449' y2='142'/%3E%3Cline x1='274' y1='313' x2='210' y2='240'/%3E%3Cline x1='276' y1='362' x2='219' y2='443'/%3E%3Cline x1='955' y1='425' x2='1020' y2='355'/%3E%3Cline x1='874' y1='412' x2='956' y2='443'/%3E%3Cline x1='339' y1='149' x2='449' y2='142'/%3E%3Cline x1='415' y1='110' x2='286' y2='39'/%3E%3C/g%3E%3Cg%3E%3Ccircle cx='762' cy='35' r='2.5' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='339' cy='149' r='1.8' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='874' cy='412' r='1.7' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='1055' cy='70' r='2.9' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='509' cy='37' r='2.8' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='274' cy='313' r='2.5' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='51' cy='135' r='2.4' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='774' cy='336' r='2.0' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='276' cy='362' r='2.9' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='959' cy='24' r='2.1' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='955' cy='425' r='2.4' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='415' cy='110' r='1.8' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='1130' cy='215' r='2.3' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='128' cy='76' r='1.8' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='1003' cy='370' r='2.3' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='956' cy='443' r='3.4' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='642' cy='584' r='2.0' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='459' cy='340' r='1.8' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='982' cy='379' r='3.0' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='1020' cy='355' r='2.2' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='837' cy='47' r='2.1' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='284' cy='188' r='1.5' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='113' cy='155' r='1.6' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='137' cy='181' r='2.4' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='757' cy='232' r='2.7' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='449' cy='142' r='2.7' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='330' cy='563' r='1.5' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='772' cy='373' r='2.0' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='219' cy='443' r='3.0' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='210' cy='240' r='2.2' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='1168' cy='391' r='3.6' fill='%23b6c83a' fill-opacity='0.5'/%3E%3Ccircle cx='666' cy='417' r='2.8' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='998' cy='470' r='1.4' fill='%23dce8ff' fill-opacity='0.45'/%3E%3Ccircle cx='286' cy='39' r='2.6' fill='%23dce8ff' fill-opacity='0.45'/%3E%3C/g%3E%3C/svg%3E"),
    /* nebula glows (apple-green + violet) */
    radial-gradient(ellipse 55% 50% at 28% 32%, rgba(154, 172, 21, 0.22), transparent 70%),
    radial-gradient(ellipse 48% 42% at 78% 26%, rgba(110, 80, 175, 0.24), transparent 70%),
    radial-gradient(ellipse 60% 55% at 60% 90%, rgba(40, 90, 120, 0.20), transparent 70%),
    /* base deep-space gradient */
    linear-gradient(135deg, #070a13 0%, #0a0f0b 100%);
}
/* Two tiled star layers drifting slowly for depth */
header.hero::before,
header.hero::after {
  content: ""; position: absolute; inset: -50% -50% -50% -50%; z-index: 0;
  pointer-events: none;
}
header.hero::before {
  background-image:
    radial-gradient(1px 1px at 40px 60px, #ffffff, transparent),
    radial-gradient(1px 1px at 130px 20px, #e8f0ff, transparent),
    radial-gradient(1px 1px at 90px 150px, #ffffff, transparent),
    radial-gradient(1px 1px at 200px 110px, #d8e6ff, transparent),
    radial-gradient(1.5px 1.5px at 170px 50px, #ffffff, transparent);
  background-size: 240px 240px;
  background-repeat: repeat;
  opacity: 0.7;
  animation: starDrift 120s linear infinite;
}
header.hero::after {
  background-image:
    radial-gradient(2px 2px at 60px 120px, #ffffff, transparent),
    radial-gradient(1.5px 1.5px at 220px 200px, #cfe0ff, transparent),
    radial-gradient(2px 2px at 300px 80px, #ffffff, transparent);
  background-size: 380px 380px;
  background-repeat: repeat;
  opacity: 0.55;
  animation: starDrift 200s linear infinite reverse;
}
header.hero h1, header.hero p, header.hero .scroll { position: relative; z-index: 1; }
@keyframes starDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(-240px, -120px); }
}
@media (prefers-reduced-motion: reduce) {
  header.hero::before, header.hero::after { animation: none; }
}
header.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: 0.5px; }
header.hero p.role { margin-top: 0.6rem; font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 500; opacity: 0.97; }
header.hero .scroll { display: inline-block; margin-top: 1.8rem; color: #fff; font-size: 1.5rem; opacity: 0.9; }
header.hero .scroll:hover { text-decoration: none; opacity: 1; }

/* ---------- Page header (sub-pages) ---------- */
header.page-header {
  text-align: center; color: #fff; padding: 3.2rem 1.5rem;
  background: linear-gradient(135deg, #6f7d10, #9aac15);
}
header.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: 0.4px; }
header.page-header p { margin-top: 0.4rem; opacity: 0.95; font-weight: 500; }

/* ---------- Layout ---------- */
main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; flex: 1 0 auto; }

/* ---------- Intro card (home) ---------- */
.intro {
  display: flex; gap: 2.4rem; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 1.1rem; padding: 2rem; margin: -4rem auto 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); position: relative;
}
.intro img { width: 250px; height: auto; border-radius: 0.8rem; flex-shrink: 0; display: block; }
.intro h2 { font-size: 1.35rem; margin-bottom: 0.6rem; }
.intro p { color: var(--muted); }
.intro p a { font-weight: 600; }

/* ---------- Feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem; margin-bottom: 3.5rem; }
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.6rem; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(154, 172, 21, 0.4); }
.card .icon { font-size: 1.6rem; color: var(--primary); margin-bottom: 0.7rem; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.card a.cta { margin-top: 1rem; font-weight: 600; color: var(--primary); align-self: flex-start; }

/* ---------- Prose (article content) ---------- */
.prose { margin: 2.5rem 0 3.5rem; }
.prose h2 { font-size: 1.6rem; font-weight: 700; margin: 2rem 0 0.8rem; }
.prose h3 { font-size: 1.2rem; font-weight: 600; margin: 1.6rem 0 0.6rem; color: var(--primary); }
.prose p { margin-bottom: 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a { font-weight: 600; }
.prose img { max-width: 100%; height: auto; border-radius: 0.6rem; }

.prose .lead { font-size: 1.1rem; color: var(--muted); }

/* About page: photo + text */
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2.4rem; align-items: start; }
.about-grid .photo { width: 100%; border-radius: 0.9rem; box-shadow: var(--shadow-sm); }

/* Button */
.btn {
  display: inline-block; background: var(--primary); color: #fff !important;
  padding: 0.7rem 1.4rem; border-radius: 0.6rem; font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: #6f7d10; text-decoration: none; transform: translateY(-1px); }

/* Research group dividers */
.prose h2.research-group {
  font-size: 1.55rem; margin: 2.8rem 0 1.3rem; padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--primary); color: var(--text);
}
.prose h2.research-group:first-of-type { margin-top: 1.5rem; }

/* Research sections as cards */
.prose section[id] {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.6rem 1.8rem; margin: 2rem 0; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.prose section[id] header { margin-bottom: 0.6rem; }
.prose section[id] h2 { margin-top: 0; font-size: 1.35rem; }
.research-figure { float: left; width: 300px; max-width: 42%; margin: 0.2rem 1.6rem 1rem 0; }
.research-figure img { width: 100%; border-radius: 0.6rem; display: block; }
.research-text { font-size: 1rem; }
.research-text::after { content: ""; display: block; clear: both; }

/* Publication list */
.pub-list { list-style: decimal; margin-left: 1.4rem; }
.pub-list li { margin-bottom: 0.9rem; }

/* Per-section "relevant publications" block */
.relevant-pubs { clear: both; margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.relevant-pubs h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--primary); margin-bottom: 0.5rem;
}
.relevant-pubs ul { margin: 0 0 0 1.2rem; font-size: 0.92rem; }
.relevant-pubs li { margin-bottom: 0.4rem; }
.fig-credit { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; font-style: italic; }

/* ---------- Footer ---------- */
footer.site { background: var(--footer-bg); color: var(--footer-text); padding: 2.5rem 1.5rem; flex-shrink: 0; }
footer.site .wrap { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
footer.site h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.7rem; color: var(--primary-bright); }
footer.site a { color: var(--footer-text); }
footer.site ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.92rem; }
footer.site .socials { flex-direction: row; gap: 1rem; font-size: 1.3rem; margin-top: 0.2rem; }
footer.site .copyright { max-width: 1040px; margin: 1.8rem auto 0; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.82rem; opacity: 0.8; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  nav.site { gap: 0.6rem; }
  nav.site ul { gap: 1rem; }
}
@media (max-width: 640px) {
  .intro { flex-direction: column; text-align: center; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .photo { max-width: 260px; margin: 0 auto; }
  .research-figure { float: none; width: 100%; max-width: 100%; margin: 0 0 1rem; }
  nav.site { flex-direction: column; gap: 0.5rem; padding: 0.75rem 1rem; }
  nav.site ul { gap: 0.7rem 1.1rem; justify-content: center; font-size: 0.9rem; }
}
