:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --bg-alt: #ffffff;
  --ink: #141414;
  --muted: #5c5c5c;
  --line: #e2e3dc;
  --accent: #184559;
  --accent-light: #1e5a73;
  --shadow: 0 24px 60px rgba(12, 18, 28, 0.08);
  --shadow-hover: 0 32px 80px rgba(12, 18, 28, 0.12);
  --font-body: "Manrope", "Helvetica Neue", sans-serif;
  --font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg-alt);
  padding: 12px 24px;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  font-size: 0.9rem;
  z-index: 1000;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(24, 69, 89, 0.12), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(188, 176, 150, 0.2), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(247, 247, 244, 1) 55%);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 20, 20, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.4;
  mix-blend-mode: multiply;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 96px 28px 120px;
}

.hero {
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 2.2rem + 3vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  color: var(--accent);
  max-width: 65ch;
  font-weight: 400;
  line-height: 1.5;
}

.hero p {
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.button,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 200ms ease, border-color 200ms ease,
    box-shadow 200ms ease, color 200ms ease;
}

.button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--bg-alt);
  border: 1px solid var(--accent);
  box-shadow: 0 4px 14px rgba(24, 69, 89, 0.25);
  font-weight: 500;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(24, 69, 89, 0.35);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.ghost:hover,
.ghost:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0;
  margin: 0 -28px;
  padding-left: 28px;
  padding-right: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-nav a {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color var(--transition-base), border-color var(--transition-base), background-color var(--transition-base);
}

.section-nav a:hover,
.section-nav a:focus-visible {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.content-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

.content-section:last-of-type {
  border-bottom: 0;
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.5rem + 0.8vw, 2.3rem);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--ink);
  position: relative;
  display: inline-block;
}

.content-section h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
}

.content-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 24px 0 10px;
}

.content-section p {
  max-width: 75ch;
  color: var(--ink);
  margin-bottom: 16px;
}

/* Profile section with photo */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 16px;
}

.profile-photo {
  flex-shrink: 0;
}

.profile-photo img {
  width: 140px;
  height: 170px;
  border-radius: 16px;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid white;
  box-shadow: var(--shadow);
}

.profile-intro {
  flex: 1;
}

.profile-intro h2 {
  margin-bottom: 12px;
}

.profile-intro p {
  margin-bottom: 0;
}

.stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.block {
  padding: 22px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  transition: transform var(--transition-base), box-shadow var(--transition-slow), border-color var(--transition-base);
}

.block:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(24, 69, 89, 0.2);
}

.block-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(24, 69, 89, 0.1) 0%, rgba(30, 90, 115, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}

.block h3 {
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 12px;
}

ul {
  margin-left: 18px;
  color: var(--muted);
}

li {
  margin-bottom: 8px;
}

.split-list {
  list-style: none;
  margin-left: 0;
  display: grid;
  gap: 16px;
  color: var(--ink);
}

.split-list li {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.split-list span {
  color: var(--muted);
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 32px;
  background: var(--bg-alt);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  transition: transform var(--transition-base), box-shadow var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
}

.project-subtitle {
  color: var(--muted);
  font-size: 1rem;
}

.media-list {
  list-style: none;
  margin-left: 0;
  display: grid;
  gap: 14px;
}

.media-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.placeholder {
  font-size: 0.92rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.contact-link {
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 200ms ease, transform 200ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 800ms ease forwards;
  animation-delay: var(--delay, 0ms);
}

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

@media (max-width: 720px) {
  .page {
    padding: 56px 16px 80px;
  }

  .hero {
    padding-bottom: 40px;
    gap: 16px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
    line-height: 1.4;
  }

  .hero > p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .eyebrow {
    font-size: 0.7rem;
  }

  .section-nav {
    gap: 6px;
    margin: 0 -16px;
    padding: 14px 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section-nav::-webkit-scrollbar {
    display: none;
  }

  .section-nav a {
    font-size: 0.75rem;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .content-section {
    padding: 36px 0;
  }

  .content-section h2 {
    font-size: 1.4rem;
  }

  .content-section h3 {
    font-size: 1rem;
    margin: 20px 0 8px;
  }

  .content-section p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 4px;
  }

  .hero-actions .button,
  .hero-actions .ghost {
    text-align: center;
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .stack {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .block {
    padding: 18px 16px;
  }

  .block h3 {
    font-size: 1rem;
  }

  .block ul {
    font-size: 0.9rem;
  }

  .block-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
  }

  .block-icon svg {
    width: 20px;
    height: 20px;
  }

  .block:hover,
  .project-card:hover,
  .media-card:hover {
    transform: none;
  }

  /* Profile photo en móvil */
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .profile-photo img {
    width: 110px;
    height: 135px;
    border-radius: 12px;
  }

  .profile-intro h2::after {
    left: 50%;
    transform: translateX(-50%);
  }

  /* Award en móvil */
  .award-highlight {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 16px;
  }

  .award-badge {
    width: 64px;
    height: 64px;
    font-size: 0.7rem;
  }

  .award-content h3 {
    font-size: 1rem;
  }

  .award-content p {
    font-size: 0.9rem;
  }

  .award-value {
    padding: 16px;
  }

  .award-value h4 {
    font-size: 0.9rem;
  }

  .award-value ul {
    font-size: 0.85rem;
  }

  /* Project cards en móvil */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-card {
    padding: 20px 18px;
  }

  .project-card h3 {
    font-size: 1.1rem;
  }

  .project-subtitle {
    font-size: 0.9rem;
  }

  .project-card p {
    font-size: 0.9rem;
  }

  .project-badge {
    font-size: 0.65rem;
    padding: 5px 10px;
  }

  .project-links {
    gap: 8px;
  }

  .project-link {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  /* Teaching grid en móvil */
  .teaching-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .teaching-item {
    padding: 14px 16px;
  }

  .teaching-item strong {
    font-size: 0.9rem;
  }

  .teaching-item span {
    font-size: 0.8rem;
  }

  /* Media grid en móvil */
  .media-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .media-card {
    padding: 14px 16px;
    gap: 6px;
  }

  .media-logo {
    height: 24px;
  }

  .media-name {
    font-size: 0.9rem;
  }

  .media-desc {
    font-size: 0.8rem;
  }

  /* Split list en móvil */
  .split-list li {
    padding: 14px 16px;
  }

  .split-list strong {
    font-size: 0.95rem;
  }

  .split-list span {
    font-size: 0.85rem;
  }

  /* Contact en móvil */
  .contact-grid {
    flex-direction: column;
    gap: 10px;
  }

  .contact-link {
    text-align: center;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  /* Footer en móvil */
  .footer {
    margin-top: 48px;
    padding: 24px 0;
  }

  .footer p {
    font-size: 0.8rem;
  }

  /* Lists en móvil */
  ul {
    font-size: 0.9rem;
  }

  li {
    margin-bottom: 6px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .button,
  .ghost,
  .contact-link,
  .block,
  .project-card {
    transition: none;
  }
}

/* Focus visible styles for better keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Selection styling */
::selection {
  background: rgba(24, 69, 89, 0.2);
  color: var(--ink);
}

/* Award highlight */
.award-highlight {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(24, 69, 89, 0.08) 0%, rgba(30, 90, 115, 0.03) 100%);
  border: 1px solid rgba(24, 69, 89, 0.15);
  border-radius: 20px;
  margin-bottom: 24px;
}

.award-badge {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(24, 69, 89, 0.3);
}

.award-content h3 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 1.15rem;
}

.award-project {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px !important;
}

.award-value {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.award-value h4 {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 12px;
}

/* Project card enhancements */
.project-card.featured {
  border-color: rgba(24, 69, 89, 0.2);
  background: linear-gradient(180deg, var(--bg-alt) 0%, rgba(24, 69, 89, 0.02) 100%);
}

.project-card.featured::before {
  opacity: 1;
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.project-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  margin-bottom: 12px;
}

.project-badge.finalist {
  background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.project-link {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent);
  font-size: 0.9rem;
  transition: all var(--transition-base);
}

.project-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Teaching grid */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.teaching-item {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teaching-item strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.teaching-item span {
  color: var(--accent);
  font-size: 0.85rem;
}

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0 24px;
}

.media-card {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-base);
}

.media-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.media-logo {
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 4px;
  filter: grayscale(30%);
  opacity: 0.85;
  transition: all var(--transition-base);
}

.media-card:hover .media-logo {
  filter: grayscale(0%);
  opacity: 1;
}

.media-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.media-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.media-desc {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Inline link */
.inline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-base);
}

.inline-link:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.split-list .inline-link {
  margin-top: 8px;
  display: inline-block;
  font-size: 0.9rem;
}

/* Footer */
.footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer p {
  font-size: 0.9rem;
  color: var(--muted);
}
