/* Matteo Giordano — site.css v2. Warm paper, ink, one accent. Single column, cards. Plain CSS. */

@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/SourceSerif4-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/SourceSerif4-Italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/SourceSerif4-Semibold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }

:root {
  --paper: #F6F2EA; --paper-2: #EDE7DB; --ink: #1B1D22; --muted: #6B6F76;
  --rule: rgba(27, 29, 34, 0.14); --rule-strong: rgba(27, 29, 34, 0.32); --accent: #1F6FB5; --accent-soft: rgba(31, 111, 181, 0.35);
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --wide: 1200px; --text: 100%; --gutter: 20px; --nav-h: 68px; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 768px) { :root { --gutter: 32px; --nav-h: 76px; } }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh; display: flex; flex-direction: column; }
@media (min-width: 768px) { body { font-size: 1.125rem; } }
main { flex: 1 0 auto; }
h1, h2, h3 { margin: 0; font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
em, i { font-style: italic; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
:target { scroll-margin-top: calc(var(--nav-h) + 16px); }
.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; font-family: var(--sans); font-weight: 500; }
.skip-link:focus { top: 12px; }
/* One container on every page; text blocks cap at --text so prose, ledes and lists share one left edge. */
.col { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.col--wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: var(--muted); }
.eyebrow a:hover { color: var(--accent); }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-28 { margin-top: 28px; }

/* Inline links in prose */
.prose a, .abstract a, .area__text a, .bio a, .lines a, .note a, .engage a, .delivered a, .pubs a, .papers a, .positions a, .background a {
  color: var(--ink); border-bottom: 1px solid var(--accent-soft); transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.prose a:hover, .abstract a:hover, .area__text a:hover, .bio a:hover, .lines a:hover, .note a:hover, .engage a:hover, .delivered a:hover, .pubs a:hover, .papers a:hover, .positions a:hover, .background a:hover { color: var(--accent); border-color: var(--accent); }
.link { color: var(--ink); border-bottom: 1px solid var(--accent-soft); padding-bottom: 1px; transition: color 200ms var(--ease), border-color 200ms var(--ease); }
.link:hover { color: var(--accent); border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 22px; border: 1px solid var(--ink); border-radius: 0; font-family: var(--sans); font-weight: 500; font-size: 0.9375rem; line-height: 1.2; white-space: nowrap; color: var(--ink); background: transparent; transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Logo */
.logo { display: inline-flex; align-items: center; flex-shrink: 0; color: var(--ink); }
.logo__text { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.logo:hover { color: var(--accent); }

/* Nav */
.nav { position: relative; z-index: 30; min-height: var(--nav-h); display: flex; align-items: center; border-bottom: 1px solid var(--rule-strong); }
.nav__bar { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: var(--nav-h); }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__item { position: relative; }
.nav__link { font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: var(--ink); transition: color 200ms var(--ease); display: inline-flex; align-items: center; gap: 6px; padding: 6px 0 4px; border-bottom: 2px solid transparent; }
.nav__link:hover { color: var(--accent); }
.nav__link[aria-current="page"] { border-bottom-color: var(--ink); }
.nav__caret { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.nav__cta { margin-left: 4px; background: var(--ink); color: var(--paper); }
.nav__cta:hover, .nav__cta[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
/* dropdown panel (desktop) */
.nav__menu { display: none; position: absolute; top: calc(100% + 10px); left: -16px; min-width: 300px; padding: 14px 16px 16px; background: var(--paper); border: 1px solid var(--rule-strong); box-shadow: 0 12px 32px rgba(27, 29, 34, 0.10); }
.nav__menu::before { content: ''; position: absolute; left: 0; right: 0; top: -11px; height: 11px; } /* hover bridge */
.nav__item--menu:hover .nav__menu, .nav__item--menu:focus-within .nav__menu { display: block; }
.nav__menu-all { display: block; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: var(--ink); padding: 4px 0 10px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.nav__menu-group { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.nav__menu a:not(.nav__menu-all) { display: block; font-family: var(--sans); font-size: 0.9375rem; color: var(--ink); padding: 5px 0; }
.nav__menu a:hover, .nav__menu-all:hover, .nav__menu a[aria-current="page"] { color: var(--accent); }
.nav__toggle { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; z-index: 41; position: relative; font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.nav__toggle-icon { position: relative; width: 20px; height: 12px; }
.nav__toggle-icon::before, .nav__toggle-icon::after { content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform 200ms var(--ease), top 200ms var(--ease), bottom 200ms var(--ease); }
.nav__toggle-icon::before { top: 0; }
.nav__toggle-icon::after { bottom: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-icon::before { top: 5px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-icon::after { bottom: 5px; transform: rotate(-45deg); }
@media (max-width: 899px) {
  .nav__toggle { display: inline-flex; }
  .nav__links { display: none; position: fixed; inset: 0; z-index: 40; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: calc(var(--nav-h) + 16px) var(--gutter) 40px; background: var(--paper); overflow-y: auto; }
  .nav__links.is-open { display: flex; }
  .nav .logo { position: relative; z-index: 41; }
  .nav__link { font-size: 1.625rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); padding: 10px 0; border-bottom: 0; }
  .nav__caret { display: none; }
  .nav__menu { display: block; position: static; min-width: 0; padding: 0 0 8px 0; border: 0; box-shadow: none; background: transparent; }
  .nav__menu::before { content: none; }
  .nav__menu-all { display: none; }
  .nav__menu-group { margin: 8px 0 2px; }
  .nav__menu a:not(.nav__menu-all) { font-size: 1.0625rem; padding: 6px 0; }
  .nav__cta { margin: 28px 0 0; align-self: flex-start; }
  body.nav-open { overflow: hidden; }
}

/* Hero (home) */
.hero { padding: 48px 0 44px; }
@media (min-width: 768px) { .hero { padding: 72px 0 64px; } }
.hero__grid { display: grid; gap: 36px; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 72px; align-items: start; } }
.hero__lede { margin-top: 22px; font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.55; max-width: var(--text); }
.glance { border-top: 2px solid var(--ink); padding-top: 14px; }
.glance__block + .glance__block { margin-top: 22px; }
.glance__label { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.glance ul { display: grid; }
.glance li { font-family: var(--sans); font-size: 0.9375rem; line-height: 1.45; padding: 7px 0; border-top: 1px solid var(--rule); }
.glance li:first-child { border-top: 0; }
.glance li a { color: var(--ink); border-bottom: 1px solid var(--accent-soft); }
.glance li a:hover { color: var(--accent); border-color: var(--accent); }
.glance .where { color: var(--muted); }
ul.tags { display: flex; flex-wrap: wrap; gap: 8px; }
ul.tags li { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.01em; line-height: 1.3; padding: 5px 10px; border: 1px solid var(--rule-strong); }
.glance ul.tags li { border-top: 1px solid var(--rule-strong); }
.hero .eyebrow { margin-bottom: 18px; }
.hero__title { font-size: clamp(2.125rem, 4.4vw, 3.375rem); line-height: 1.06; letter-spacing: -0.03em; max-width: var(--text); }
.hero__roles { margin-top: 24px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.02em; color: var(--muted); line-height: 1.7; }
.hero__roles .sep { color: var(--accent); padding: 0 6px; }
@media (max-width: 599px) { .hero__roles > span:not(.sep) { display: block; } .hero__roles .sep { display: none; } }
.hero__links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; }
.hero__links a { color: var(--ink); border-bottom: 1px solid var(--accent-soft); padding-bottom: 2px; transition: color 200ms var(--ease), border-color 200ms var(--ease); }
.hero__links a:hover { color: var(--accent); border-color: var(--accent); }

/* Sections and headers */
.section { padding: 40px 0; border-top: 1px solid var(--rule); }
@media (min-width: 768px) { .section { padding: 56px 0; } }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); }
.section__title { font-size: 1.25rem; letter-spacing: -0.02em; }
@media (min-width: 768px) { .section__title { font-size: 1.375rem; } }
.section__more { font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.section__more:hover { color: var(--accent); }
.section__intro { color: var(--muted); max-width: var(--text); margin: -8px 0 20px; }
.page-head { padding: 44px 0 28px; }
@media (min-width: 768px) { .page-head { padding: 72px 0 40px; } }
.page-head .eyebrow { margin-bottom: 16px; }
.page-title { font-size: clamp(1.875rem, 3.8vw, 2.625rem); line-height: 1.08; letter-spacing: -0.03em; max-width: var(--text); }
.lede { margin-top: 18px; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.5; color: var(--muted); max-width: var(--text); }
.lede--ink { color: var(--ink); }
.page-head .actions { margin-top: 24px; }
.meta { margin-top: 14px; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); letter-spacing: 0.01em; }

/* Cards */
.cards { display: grid; gap: 14px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (min-width: 900px) { .cards--3 { grid-template-columns: 1fr 1fr 1fr; } }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; border: 1px solid var(--rule-strong); border-radius: 0; background: transparent; transition: border-color 200ms var(--ease), background-color 200ms var(--ease); min-height: 100%; }
a.card:hover { border-color: var(--ink); background: var(--paper-2); }
.card__n { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; color: var(--accent); }
.card__title { font-size: 1.125rem; line-height: 1.25; letter-spacing: -0.015em; }
.card__meta { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.card__text { font-size: 0.9375rem; line-height: 1.5; color: var(--ink); }
.card__more { margin-top: auto; padding-top: 8px; font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--muted); }
a.card:hover .card__more { color: var(--accent); }

/* Latest strip (home) */
.latest { display: grid; gap: 14px; }
@media (min-width: 640px) { .latest { grid-template-columns: 1fr 1fr; gap: 16px; } }
.latest__item { padding: 16px 0 0; border-top: 1px solid var(--rule); }
.latest__label { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.latest__title { font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.latest__title a { color: var(--ink); border-bottom: 1px solid var(--accent-soft); }
.latest__title a:hover { color: var(--accent); border-color: var(--accent); }
.latest__meta { margin-top: 6px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }

/* Theme groups (research hub) */
.theme { padding: 32px 0; border-top: 1px solid var(--rule); }
.theme:first-of-type { border-top: 0; padding-top: 8px; }
.theme__title { font-size: 1.25rem; margin-bottom: 6px; }
.theme__text { color: var(--muted); max-width: var(--text); margin-bottom: 18px; }

/* Project pages */
.abstract { font-size: clamp(1.125rem, 1.7vw, 1.3125rem); line-height: 1.5; margin-bottom: 28px; max-width: var(--text); }
.prose h2 { font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 32px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: var(--text); }
.prose ul { display: grid; gap: 8px; }
.prose ul li { padding-left: 18px; position: relative; }
.prose ul li::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 8px; height: 1px; background: var(--accent); }
.figure { margin: 24px 0; max-width: 900px; }
.figure img { width: 100%; height: auto; background: var(--paper-2); border: 1px solid var(--rule-strong); }
.figure--cover { max-width: 220px; }
.figure__caption { margin-top: 8px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }
.figure__link { white-space: nowrap; }
.figure__link::before { content: '·'; color: var(--accent); padding: 0 6px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; }
.links a { color: var(--ink); border-bottom: 1px solid var(--accent-soft); }
.links a:hover { color: var(--accent); border-color: var(--accent); }
.prose ul.links li { padding-left: 0; }
.prose ul.links li::before { content: none; }
.papers { display: grid; gap: 10px; }
.papers li { font-size: 1rem; line-height: 1.5; }
.prose ul.papers li { padding-left: 0; }
.prose ul.papers li::before { content: none; }
.pager { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; max-width: var(--text); }
.pager a { color: var(--muted); }
.pager a:hover { color: var(--accent); }

/* About */
.bio { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.55; max-width: var(--text); }
.positions { display: grid; gap: 10px; max-width: var(--text); }
.positions li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-top: 1px solid var(--rule); }
@media (min-width: 640px) { .positions li { grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: baseline; } }
.positions li:last-child { border-bottom: 1px solid var(--rule); }
.positions strong { font-weight: 600; }
.positions .where { color: var(--muted); }
.positions .when { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.background { color: var(--ink); max-width: var(--text); }
.cv-links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; }
.cv-links a { color: var(--ink); border-bottom: 1px solid var(--accent-soft); }
.cv-links a:hover { color: var(--accent); border-color: var(--accent); }

/* Publications */
.pubs { display: grid; gap: 12px; counter-reset: pub; }
.pubs li { position: relative; padding-left: 2.25rem; line-height: 1.5; font-size: 1rem; max-width: var(--text); }
.pubs li::before { counter-increment: pub; content: counter(pub); position: absolute; left: 0; top: 0.15em; font-family: var(--sans); font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.pubs--plain li { padding-left: 0; }
.pubs--plain li::before { content: none; }
.pubs .where { color: var(--muted); }

/* Advisory */
.area__title { font-size: 1.0625rem; margin-bottom: 6px; }
.area__text { font-size: 0.9375rem; line-height: 1.5; }
.engage { display: grid; gap: 8px; }
.engage li, .delivered li { max-width: var(--text); }
.engage strong, .delivered strong { font-weight: 600; }
.delivered { display: grid; gap: 12px; }
.note { margin-top: 24px; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); max-width: var(--text); }
.closing { padding: 40px 0 72px; border-top: 1px solid var(--rule); }
.closing__line { font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.4; max-width: var(--text); margin-bottom: 20px; }

/* Cargo & Collateral */
.wordmark { width: 100%; max-width: 360px; margin: 0 0 24px; }
.writing { display: grid; max-width: var(--text); }
.writing__item { padding: 16px 0; border-top: 1px solid var(--rule); display: grid; gap: 4px; }
.writing__item:last-child { border-bottom: 1px solid var(--rule); }
.writing__date { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.writing__title { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.writing__title:hover { color: var(--accent); }

/* Prose pages: disclaimer, 404 */
.page-head--tall { min-height: 60vh; display: flex; align-items: center; }
.prose-page { padding: 8px 0 80px; }
.prose-page h2 { max-width: var(--text); }
.prose-page h2 { font-size: 1.125rem; margin: 28px 0 8px; letter-spacing: -0.02em; text-transform: none; color: var(--ink); }

/* Footer */
.footer { padding: 36px 0 28px; border-top: 1px solid var(--rule-strong); }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 40px; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }
.footer__links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; }
.footer__links a { color: var(--muted); border-bottom: 1px solid transparent; }
.footer__links a:hover { color: var(--accent); border-color: var(--accent); }
.footer__tag { margin-top: 10px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }

/* Reveal */
/* Fade-in only when JS runs (site.js adds .js to <html>); without JS everything is visible. */
.js .reveal { opacity: 0; transition: opacity 300ms var(--ease); }
.js .reveal.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
