:root {
  --red: #ee5a59;
  --red-dark: #d94241;
  --black: #111;
  --grey: #555;
  --line: #e6e6e6;
  --soft: #f4f4f2;
  --bg: #fff;
  --max: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--black);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p a, li a, .text a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
p a:hover, li a:hover, .text a:hover { color: var(--black); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 21px; letter-spacing: -.02em;
  text-decoration: none; white-space: nowrap;
}
.brand img { width: 38px; height: 38px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--red); }

.btn {
  display: inline-block;
  background: var(--red); color: #fff !important;
  font-weight: 700; font-size: 15px;
  padding: 10px 22px; border-radius: 6px;
  text-decoration: none !important;
  transition: background .15s;
}
.btn:hover { background: var(--black); }
.btn-outline {
  background: transparent; color: var(--black) !important;
  border: 2px solid var(--black); padding: 8px 20px;
}
.btn-outline:hover { background: var(--black); color: #fff !important; }

.menu-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
}
.menu-toggle span {
  display: block; width: 24px; height: 2px; background: var(--black); margin: 5px 0;
}

/* ---------- Hero: text on the left, photo flush to the top and right edge ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  --edge: max(24px, calc((100vw - var(--max)) / 2 + 24px));
}
.hero-text { padding: 64px 56px 40px var(--edge); align-self: center; }
.hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.02; letter-spacing: -.035em;
  font-weight: 800; color: var(--red);
  margin: 0 0 24px;
}
.tagline {
  font-size: clamp(15px, 1.55vw, 18px); font-weight: 700; line-height: 1.4; margin: 0 0 24px;
  white-space: nowrap;
}
.tagline i { font-style: normal; color: var(--red); margin: 0 .3em; }
.quote { margin: 0; border-left: 3px solid var(--red); padding-left: 20px; }
.quote p { font-size: 16px; font-weight: 600; margin: 0 0 14px; color: var(--black); }
.quote footer { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--grey); }
.quote footer img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; filter: grayscale(1); }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
.bio { font-size: 15.5px; line-height: 1.6; color: var(--grey); margin: 0 0 36px; max-width: 520px; }
.bio strong { color: var(--black); }

/* ---------- Feature rows ---------- */
.feature { padding: 88px 0; }
.feature + .feature { padding-top: 0; }
.feature .wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.feature.reverse .text { order: 2; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--red);
  margin-bottom: 12px;
}
.feature h3 {
  font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -.025em;
  margin: 0 0 18px;
}
.feature p { margin: 0 0 28px; }
.media {
  border-radius: 4px; overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16 / 10; background: #f4f4f4;
}
.media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* YouTube facade: loads the player only after a click */
.video { position: relative; cursor: pointer; border: 0; padding: 0; width: 100%; display: block; }
.video::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.35));
}
.video .play {
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; transition: transform .15s, background .15s;
}
.video:hover .play { transform: translate(-50%, -50%) scale(1.08); background: var(--black); }
.video .play::before {
  content: ""; margin-left: 5px;
  border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent;
}
.media iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Book band ---------- */
.feature.book { background: var(--black); color: #fff; padding: 56px 0; }
.book .eyebrow { color: var(--red); }
.book h3 { color: #fff; }
.book p { color: #d6d6d6; }
.book .media { border-color: #333; }
.book .btn:hover { background: #fff; color: var(--black) !important; }

/* ---------- Publications (tabs by research area) ---------- */
.pubs { padding: 56px 0 56px; scroll-margin-top: 72px; }
#projectes { background: var(--soft); padding: 56px 0; }
#projectes .media { border-color: #ddd; }
.pubs > .wrap > h2 {
  font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 32px;
}
.lead { max-width: 760px; margin: 0 0 40px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tab {
  font: inherit; color: inherit; text-align: left; background: none; cursor: pointer;
  border: 0; border-bottom: 3px solid var(--line); padding: 0 0 14px;
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color .15s;
}
.tab img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px;
  filter: grayscale(1); opacity: .75; margin-bottom: 12px; transition: filter .25s, opacity .25s;
}
.tab-title { font-weight: 800; font-size: 19px; line-height: 1.25; letter-spacing: -.01em; }
.tab-count { font-size: 14px; color: var(--grey); }
.tab:hover img { opacity: 1; }
.tab[aria-selected="true"] { border-bottom-color: var(--red); }
.tab[aria-selected="true"] img { filter: none; opacity: 1; }
.tab[aria-selected="true"] .tab-title { color: var(--red); }
.panel { padding-top: 32px; }
.js .panel-title { display: none; }
.panel-title { font-size: 24px; margin: 24px 0 8px; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 16px;
}
.pub-list .year { font-weight: 800; color: var(--red); font-size: 15px; }
.pub-list .year small { display: block; font-weight: 500; color: var(--grey); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.pub-list a { word-break: break-word; }
.more { margin: 24px 0 0; color: var(--grey); font-size: 14px; }
.feature { scroll-margin-top: 72px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; font-size: 15px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--red); }
.social { display: flex; gap: 14px; }
.social a {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--black);
  display: grid; place-items: center; transition: all .15s;
}
.social a:hover { background: var(--red); border-color: var(--red); color: #fff; }
.social svg { width: 17px; height: 17px; fill: currentColor; }
.social .rg svg { width: 23px; height: 23px; }
.copy { color: var(--grey); width: 100%; margin: 0; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero, .feature .wrap { grid-template-columns: 1fr; gap: 36px; }
  .hero { gap: 0; }
  .hero-photo { order: -1; }
  .hero-photo img { height: auto; }
  .hero-text { padding: 40px 24px 56px; }
  .feature.reverse .text { order: 0; }
  .tagline { white-space: normal; }
  .tabs { gap: 10px; }
  .tab img { display: none; }
  .tab-title { font-size: 15px; }
  .tab-count { font-size: 12.5px; }
  .pubs { padding: 40px 0 44px; }
  .feature, .feature.book { padding: 44px 0; }
  #projectes { padding: 44px 0; }
  .pub-list li { grid-template-columns: 1fr; gap: 4px; }
  .pub-list .year small { display: inline; margin-left: 6px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero-text { padding: 36px 16px 48px; }
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 20px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav .btn { margin-top: 16px; text-align: center; border: 0; padding: 12px; }
}
