/* Darío González Picos — single-page academic site */

/* Light theme (default) */
:root,
[data-theme="light"] {
  --accent: #1a7a6d;
  --accent-soft: rgba(26, 122, 109, 0.12);
  --accent-strong: #0f5c52;
  --accent-link: #147065;
  --accent-link-hover: #0b4f46;
  --bg: #f3f6f5;
  --bg-nav: rgba(243, 246, 245, 0.88);
  --bg-nav-menu: #eef3f1;
  --bg-panel: rgba(255, 255, 255, 0.86);
  --bg-pub: #ffffff;
  --bg-pub-hover: #f0f7f5;
  --bg-btn: rgba(26, 122, 109, 0.04);
  --text: #1c2a28;
  --text-muted: #4a5c58;
  --text-faint: #6a7c78;
  --text-on-accent: #ffffff;
  --border: rgba(28, 42, 40, 0.14);
  --border-strong: rgba(26, 122, 109, 0.4);
  --shadow: 0 16px 40px rgba(28, 42, 40, 0.1);
  --bg-grad-1: rgba(26, 122, 109, 0.1);
  --bg-grad-2: rgba(70, 120, 140, 0.08);
  --bg-grad-3: rgba(26, 122, 109, 0.06);
  --bg-base-1: #f7faf9;
  --bg-base-2: #eef4f2;
  --bg-base-3: #f3f6f5;
  --max: 1080px;
  --nav-h: 3.6rem;
  --radius: 0.35rem;
  --font-sans: "DM Sans", "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
  --accent: #3dbaa8;
  --accent-soft: rgba(61, 186, 168, 0.16);
  --accent-strong: #2a9a8a;
  --accent-link: #5ecfbf;
  --accent-link-hover: #8fe4d7;
  --bg: #0e1618;
  --bg-nav: rgba(10, 16, 18, 0.82);
  --bg-nav-menu: rgba(10, 16, 18, 0.96);
  --bg-panel: rgba(18, 30, 34, 0.78);
  --bg-pub: rgba(16, 26, 29, 0.7);
  --bg-pub-hover: rgba(22, 38, 42, 0.85);
  --bg-btn: rgba(255, 255, 255, 0.04);
  --text: #e8eeec;
  --text-muted: #a7bbb6;
  --text-faint: #859992;
  --text-on-accent: #06211d;
  --border: rgba(154, 173, 168, 0.2);
  --border-strong: rgba(94, 207, 191, 0.45);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --bg-grad-1: rgba(26, 122, 109, 0.28);
  --bg-grad-2: rgba(62, 110, 140, 0.22);
  --bg-grad-3: rgba(18, 70, 64, 0.2);
  --bg-base-1: #0b1214;
  --bg-base-2: #121c20;
  --bg-base-3: #0e1719;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 12% -10%, var(--bg-grad-1), transparent 55%),
    radial-gradient(900px 600px at 95% 8%, var(--bg-grad-2), transparent 50%),
    radial-gradient(800px 500px at 70% 90%, var(--bg-grad-3), transparent 45%),
    linear-gradient(165deg, var(--bg-base-1) 0%, var(--bg-base-2) 42%, var(--bg-base-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-link-hover);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 1.55rem;
  height: 1.55rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-btn);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.4rem;
  min-width: 2.4rem;
  min-height: 2.35rem;
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
}

/* Show the destination theme icon */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
}

/* Layout */
.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

main {
  padding-bottom: 4rem;
}

.section {
  padding: 3.5rem 0 1.5rem;
  border-top: 1px solid transparent;
}

.section + .section {
  border-top-color: var(--border);
  margin-top: 1rem;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.55rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  margin: 0 0 1.25rem;
}

h3 {
  font-size: 1.28rem;
  margin: 0 0 0.65rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 42rem;
}

/* Hero / Summary */
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}

.hero-copy p {
  color: var(--text-muted);
}

.role-line {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.role-line a {
  color: var(--accent-link);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
}

.role-line a:hover {
  color: var(--accent-link-hover);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.4rem 0 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-btn);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--text-on-accent);
}

.profile-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.profile-photo {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
  border-radius: 0.7rem;
  margin-bottom: 1rem;
  filter: saturate(1.05) contrast(1.02);
}

.profile-panel .icon-links {
  justify-content: center;
}

.icon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.icon-links a {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  background: var(--bg-btn);
}

.icon-links a:hover {
  color: var(--accent-link-hover);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

/* About + highlights */
.prose {
  max-width: 46rem;
  color: var(--text-muted);
}

.prose p + p {
  margin-top: 1rem;
}

.prose strong {
  color: var(--text);
}

.highlight {
  margin: 2rem 0 0;
  padding: 0 0 0 1.15rem;
  border-left: 3px solid var(--accent);
}

.highlight h3 {
  margin-bottom: 0.5rem;
}

.highlight p {
  margin: 0;
  color: var(--text-muted);
  max-width: 46rem;
}

.highlight a {
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
}

/* Publications */
.pub-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.pub-item {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-pub);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pub-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-pub-hover);
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.pub-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pub-cite {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  background: var(--bg-btn);
}

.chip:hover {
  color: var(--accent-link-hover);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.chip-doi {
  color: var(--accent-link);
  border-color: var(--border-strong);
}

.pub-note {
  margin-top: 1.25rem;
  color: var(--text-faint);
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 2.5rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-footer a {
  color: var(--accent-link);
}

.site-footer a:hover {
  color: var(--accent-link-hover);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-grid,
  .highlight,
  .pub-item {
    animation: rise 0.7s ease both;
  }

  .highlight:nth-child(2) { animation-delay: 0.05s; }
  .highlight:nth-child(3) { animation-delay: 0.1s; }
  .highlight:nth-child(4) { animation-delay: 0.15s; }
  .highlight:nth-child(5) { animation-delay: 0.2s; }

  .pub-item:nth-child(1) { animation-delay: 0.05s; }
  .pub-item:nth-child(2) { animation-delay: 0.08s; }
  .pub-item:nth-child(3) { animation-delay: 0.11s; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    max-width: 26rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-nav-menu);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.55rem 0.2rem;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 1rem;
  }

  .section {
    padding-top: 2.5rem;
  }

  .brand span {
    display: none;
  }
}
