/* Luigi Carratino — personal site
   Clean, Google Research-inspired layout. */

:root {
  --bg: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --btn-bg: transparent;
  --btn-bg-hover: #f1f3f4;
  --border: #ececec;
  --max-width: 920px;
  --header-height: 60px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--text-secondary); }

h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.3; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .header-inner {
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.site-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); }

/* ---------- Sections ---------- */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section h1 {
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 28px;
}

/* ---------- Hero ---------- */
.hero { padding-top: 64px; }
.hero .hero-name {
  font-size: 36px;
  font-weight: 400;
  margin: 0 0 6px;
}
.hero .hero-role {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 0 0 36px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}
.hero-photo img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.hero-social {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.hero-social a { color: var(--text-secondary); display: inline-flex; }
.hero-social a:hover { color: var(--text); }
.hero-bio p { font-size: 17px; margin: 0 0 16px; }
.hero-bio p:last-child { margin-bottom: 0; }

/* ---------- Lists (publications, talks, teaching) ---------- */
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-list > li { padding: 18px 0; border-bottom: 1px solid var(--border); }
.entry-list > li:last-child { border-bottom: none; }
/* Neutralize per-item inline margins so vertical rhythm is uniform */
.entry-list > li > div { margin: 0 !important; }
.entry-list h4 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 4px !important;
}
.entry-list h6 {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0;
}
.entry-list .auth { margin-right: 8px; }
.entry-list .conf { color: var(--text-secondary); }

/* Pill buttons (pdf / poster / talk / code / slides / material / Send) */
.ic { display: inline-block; margin: 8px 8px 0 0; }
.ic a,
a.material-btn,
.button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: #5f6368;
  background: var(--btn-bg);
  border: 1px solid #dadce0;
  border-radius: 999px;
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.ic a:hover,
a.material-btn:hover,
.button:hover { background: var(--btn-bg-hover); color: #3c4043; }
.ic .material-icons { font-size: 17px; }
/* Teaching uses .ic to wrap a meta line, not a link — keep that as plain text */
.entry-list .ic:has(h6) {
  display: block;
  margin: 0;
  background: none;
  padding: 0;
}
.entry-list .ic h6 { font-size: 15px; color: var(--text-secondary); }

/* Talks: venue title matches publication titles; rest is light meta */
.talk-meta { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }
.talk-meta .loc:first-child { font-size: 17px; font-weight: 500; color: var(--text); }

/* ---------- Contact form ---------- */
.lead { color: var(--text-secondary); margin: 0 0 28px; max-width: 640px; }
#contact-form { max-width: 640px; }
#contact-form label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
#contact-form input,
#contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 16px;
}
#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(32, 33, 36, 0.12);
}
#contact-form .contact-row { display: flex; gap: 16px; }
#contact-form .contact-row > div { flex: 1; min-width: 0; }
#contact-form .contact-form-honeypot { display: none; }
#contact-form textarea { min-height: 200px; max-height: 500px; resize: vertical; }

.button { font-size: 14px; padding: 10px 22px; }
.button:disabled { opacity: 0.6; cursor: default; }

#contact-form-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  display: none;
}
#contact-form-status.is-sending { display: block; background: rgba(0,0,0,.04); color: #555; }
#contact-form-status.is-success { display: block; background: rgba(0,0,0,.05); color: #202124; }
#contact-form-status.is-error   { display: block; background: rgba(204,0,0,.06); color: #c00; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { max-width: 200px; }
  .hero .hero-name { font-size: 32px; }
  .section { padding: 48px 0; }
  .site-header .header-inner { flex-direction: column; height: auto; padding: 12px 24px; gap: 8px; }
  html { scroll-padding-top: 100px; }
  .site-nav ul { gap: 14px; justify-content: center; }
  #contact-form .contact-row { flex-direction: column; gap: 0; }
}
