/* ============================================================
   Giulia Crippa — personal site
   Minimal / clean academic portfolio
   ============================================================ */

:root {
  --ink:        #1a1a1a;
  --ink-soft:   #454545;
  --ink-faint:  #8a8a8a;
  --line:       #e8e8e8;
  --bg:         #ffffff;
  --bg-card:    #ffffff;
  --accent:     #b31b1b;   /* Cornell red */
  --accent-ink: #8a1515;
  --max:        880px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #ededed;
    --ink-soft:   #b6b6b6;
    --ink-faint:  #858585;
    --line:       #2a2a2a;
    --bg:         #141414;
    --bg-card:    #1c1c1c;
    --accent:     #e05a5a;
    --accent-ink: #ef7a7a;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 13px;   /* global type scale — lower this to shrink everything */
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: var(--accent); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.nav__name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  border: none;
}
.nav__name:hover { color: var(--accent); }
.nav__links {
  display: flex;
  gap: 22px;
  font-size: .92rem;
}
.nav__links a {
  color: var(--ink-soft);
  border: none;
}
.nav__links a:hover { color: var(--accent); }

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.section__title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 64px;
  display: flex;
  align-items: flex-start;
  gap: 44px;
}
.hero__text { flex: 1 1 auto; min-width: 0; }
.hero__photo {
  flex: 0 0 auto;
  order: 2;              /* image sits to the right of the text */
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
}
.hero__photo img {
  width: 230px;
  height: auto;          /* transparent portrait cutout — no crop */
  display: block;
  border-radius: 4px;
}
@media (max-width: 620px) {
  .hero {
    flex-direction: column-reverse;  /* photo on top, then text, on mobile */
    align-items: flex-start;
    gap: 20px;
  }
  .hero__photo img { width: 170px; }
}
.hero__namerow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
}
.hero__emblem { flex: 0 0 auto; display: inline-flex; }
.hero__emblem img {
  width: clamp(2.4rem, 7vw, 3.3rem);   /* rem-based so it scales with the type */
  height: auto;
  display: block;
}
.hero__emblem .logo--dark { display: none; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}
.hero__role {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
  line-height: 1.55;
}
.hero__blurb {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 30px;
}
.hero__links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .96rem;
}
.hero__links span { color: var(--ink-faint); }

/* ---------- Prose ---------- */
.prose p { color: var(--ink-soft); margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose__subhead {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin: 32px 0 14px;
}
.prose__aside {
  font-size: .95rem;
  color: var(--ink-faint);
  font-style: italic;
}

.facts { list-style: none; padding: 0; margin: 0 0 18px; }
.facts li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.facts li:first-child { border-top: 1px solid var(--line); }
.facts__what { display: block; color: var(--ink); font-weight: 500; }
.facts__where { display: block; color: var(--ink-faint); font-size: .92rem; margin-top: 2px; }

/* ---------- Publications ---------- */
.group__label {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 36px 0 4px;
}
.group__label:first-of-type { margin-top: 0; }

.pubs {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pub {
  padding: 12px 0;
}

/* Continuous numbering across the article lists (not Work in Progress) */
#research { counter-reset: pub; }
.pubs--numbered > .pub {
  counter-increment: pub;
  position: relative;
  padding-left: 2rem;
}
.pubs--numbered > .pub::before {
  content: counter(pub) ".";
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 500;
  color: var(--ink-faint);
}
.pub__title {
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 6px;
}
.pub__meta {
  font-size: .92rem;
  color: var(--ink-faint);
  margin: 0 0 4px;
}
.pub__venue {
  font-size: .96rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.pub__venue--muted { color: var(--ink-faint); font-style: italic; }
.pub__links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .9rem;
  margin: 0;
}
.pub__links span[aria-hidden] { color: var(--ink-faint); }
.pub__note { color: var(--ink-faint); }

/* ---------- Teaching ---------- */
.teach { margin-bottom: 34px; }
.teach:last-child { margin-bottom: 0; }
.teach__inst {
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.teach__role {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.courses { list-style: none; padding: 0; margin: 0; }
.courses li {
  padding: 5px 0;
  color: var(--ink-soft);
  font-size: .98rem;
}
.courses__code {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
  margin-right: 4px;
}
.courses__meta { color: var(--ink-faint); font-size: .88rem; }
.courses__term { color: var(--ink-faint); font-size: .86rem; white-space: nowrap; }
.teach__award {
  font-size: .92rem;
  color: var(--accent-ink);
  margin: 12px 0 0;
  font-style: italic;
}

/* ---------- Contact / footer ---------- */
.section--contact .prose p { color: var(--ink-soft); line-height: 1.7; font-size: .85rem; }
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 56px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: .85rem;
}
@media (prefers-color-scheme: dark) {
  .hero__emblem .logo--light { display: none; }
  .hero__emblem .logo--dark  { display: block; }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 44px 0; }
  .courses__term { display: block; margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
