/* ==========================================================================
   Brais Suárez-Eiroa — academic site
   Formal, restrained. Ecological/post-growth palette (deep green + ochre).
   Shared across index.html / research.html / projects.html
   ========================================================================== */

:root {
  /* Universidade de Vigo institutional palette: deep navy + bright cyan.
     Body stays mostly white; alt sections use a soft light-blue tint. */
  --bg:        #ffffff;
  --surface:   #ffffff;
  --surface-2: #eaf2f8;
  --ink:       #0f2a3b;
  --muted:     #46586a;
  --primary:   #12678f;
  --primary-d: #073349;
  --accent:    #2196c9;
  --accent-soft:#dcecf7;
  --line:      #d2dce4;
  --ring:      rgba(18, 103, 143, 0.4);

  --maxw: 940px;
  --maxw-wide: 1100px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0 0 1.05rem; }
strong { font-weight: 600; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2.5rem, var(--maxw-wide)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; top: .6rem; left: .6rem; z-index: 100; background: var(--primary); color: #fff; padding: .55rem 1rem; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 3px; }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--primary); --_fg: #fff;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: 6px;
  font-family: var(--sans); font-weight: 600; font-size: .93rem;
  background: var(--_bg); color: var(--_fg); border: 1.5px solid var(--_bg);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-ghost { --_bg: transparent; --_fg: var(--primary-d); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); background: #fff; }
.btn-sm { padding: .5rem .95rem; font-size: .88rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,51,73,.96);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; color: #fff; letter-spacing: -0.01em; display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; }
@media (max-width: 520px) { .brand-logo { height: 26px; } }
.nav-menu { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-menu a { color: #cfdde7; font-weight: 500; font-size: .92rem; letter-spacing: .01em; }
.nav-menu a:hover { color: #fff; text-decoration: none; }
.nav-menu a.active { color: #fff; }
.nav-menu a.active::after { content: ""; display: block; height: 2px; background: var(--accent); margin-top: 3px; }
.nav-toggle { display: none; }

/* ---------- Generic section ---------- */
.section { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.kicker {
  display: block; text-transform: uppercase; letter-spacing: .16em;
  font-size: .72rem; font-weight: 700; color: var(--accent);
  margin-bottom: .6rem; font-family: var(--sans);
}
.section-title { font-size: clamp(1.55rem, 3.2vw, 2.1rem); margin: 0 0 1.4rem; }
.section-title-rule { padding-bottom: .6rem; border-bottom: 2px solid var(--line); }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.2rem); color: var(--muted); }

/* ---------- Hero (home) ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 600; color: var(--primary); margin: 0 0 .9rem; font-family: var(--sans); }
.hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.2rem); margin: 0 0 .8rem; }
.hero-affil { font-size: 1.08rem; color: var(--ink); max-width: 50ch; margin: 0 0 1rem; }
.hero-affil a { color: var(--primary-d); }
.hero-lead { font-size: 1.05rem; color: var(--muted); max-width: 50ch; margin: 0; }
.hero-contact { margin: 0 0 1.3rem; font-size: .96rem; }
.hero-contact p { margin: 0 0 .35rem; }
.hero-contact .contact-address { color: var(--muted); font-size: .92rem; line-height: 1.55; }
.ci-label { color: var(--muted); font-weight: 600; margin-right: .35rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.4rem; }
.profile-links { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; list-style: none; padding: 0; margin: 0; }
.profile-links a { font-size: .9rem; font-weight: 500; color: var(--muted); }
.profile-links a:hover { color: var(--primary-d); }
.hero-photo img { width: 100%; border-radius: 10px; aspect-ratio: 4/5; object-fit: cover; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(23,35,30,.12); }

/* ---------- Vision ---------- */
.vision-inner { max-width: 68ch; }
.vision-inner p { font-size: 1.06rem; }
.pull {
  font-family: var(--serif); font-size: clamp(1.2rem, 2.4vw, 1.55rem); line-height: 1.4;
  color: var(--primary-d); border-left: 3px solid var(--accent); padding-left: 1.1rem; margin: 0 0 1.6rem;
}
.draft-note {
  display: inline-block; font-size: .82rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: .4rem .8rem; margin-bottom: 1.4rem;
}

/* ---------- Info blocks / find me ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.info-block h3 { font-size: 1.15rem; margin: 0 0 .6rem; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .96rem; }
.info-list li:last-child { border-bottom: none; }
.info-list .label { color: var(--muted); }

/* CV download — PDF-style card */
.cv-cards { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.cv-doc {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.1rem; width: 200px; min-height: 250px; padding: 1.8rem 1.2rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 18px rgba(23,35,30,.07); text-decoration: none; color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cv-doc:hover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(23,35,30,.14); border-color: var(--primary); text-decoration: none; }
.cv-doc:focus-visible { border-color: var(--primary); }
.cv-doc-badge svg { display: block; width: 80px; height: 100px; filter: drop-shadow(0 5px 10px rgba(226,69,60,.28)); }
.cv-doc-label { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); text-align: center; }

/* ---------- Contact ---------- */
.contact-line { font-size: 1.05rem; }
.contact-line a { color: var(--primary-d); }
.email { color: var(--primary-d); }
.contact-address { color: var(--muted); font-size: .96rem; margin-top: 1rem; line-height: 1.6; }

/* ---------- Publications ---------- */
.pub-group { margin-bottom: 2.4rem; }
.pub-group h3 { font-size: 1.2rem; margin: 0 0 1rem; color: var(--ink); }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li {
  position: relative; padding: 0 0 1rem 0; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line); font-size: .97rem; line-height: 1.6;
}
.pub-list li:last-child { border-bottom: none; }
.pub-list .pub-authors { color: var(--ink); }
.pub-list .pub-title { font-style: italic; }
.pub-list .pub-venue { color: var(--muted); }
.pub-list .pub-year { font-weight: 600; }
.pub-list a.doi { color: var(--primary-d); font-weight: 500; white-space: nowrap; }
.tag-review { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 .35rem; margin-left: .3rem; }

/* Simple list (conferences, teaching) */
.simple-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.simple-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .96rem; }
.simple-list li:last-child { border-bottom: none; }
.simple-list .meta { color: var(--muted); }
.subhead { font-size: 1.1rem; margin: 1.6rem 0 .7rem; color: var(--primary-d); }

/* ---------- Projects ---------- */
.project { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.project:first-of-type { border-top: none; }
.project h3 { font-size: 1.28rem; margin: 0 0 .25rem; }
.project .project-meta { display: block; color: var(--accent); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-family: var(--sans); margin: 0 0 .5rem; }
.project p { margin: .3rem 0 .7rem; color: var(--ink); }
.project-links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; list-style: none; padding: 0; margin: 0; }
.project-links a { font-size: .9rem; font-weight: 500; }
.compact-projects { list-style: none; padding: 0; margin: .6rem 0 0; }
.compact-projects li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.compact-projects li:last-child { border-bottom: none; }
.compact-projects .cp-title { font-weight: 600; }
.compact-projects .cp-meta { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c3d4e0; padding: 2.2rem 0; margin-top: 3rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.4rem; }
.footer-grid h4 { color: #fff; font-size: .95rem; margin: 0 0 .6rem; font-family: var(--sans); font-weight: 600; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.footer-links a { color: #c3d4e0; font-size: .9rem; }
.footer-links a:hover { color: #fff; }
.footer-logos { margin-top: 1.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.footer-logos .logo-chip { background: #fff; border-radius: 8px; padding: 8px 12px; display: inline-flex; align-items: center; }
.footer-logos img { height: 32px; width: auto; display: block; }
.footer-bottom { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; font-size: .85rem; color: #93a7b8; }
.footer-bottom a { color: #c3d4e0; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 260px; }
  .grid-2 { grid-template-columns: 1fr; gap: 2rem; }

  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 38px; background: none; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; cursor: pointer;
  }
  .nav-toggle span:not(.sr-only) { display: block; width: 20px; height: 2px; background: #fff; margin-inline: auto; }
  .nav-menu {
    position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--primary-d); border-bottom: 1px solid rgba(255,255,255,.12); padding: .4rem 1.25rem 1rem;
    box-shadow: 0 10px 24px rgba(7,51,73,.35);
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height .25s ease, opacity .2s ease;
  }
  .nav-menu.open { max-height: 340px; opacity: 1; pointer-events: auto; }
  .nav-menu li { border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-menu a { display: block; padding: .8rem .1rem; font-size: 1rem; }
  .nav-menu a.active::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}
