:root {
  --bg: #ffffff;
  --surface: #f7f7f5;
  --text: #111111;
  --muted: #5b5b5b;
  --line: #e6e6e1;
  --accent: #0f172a;
  --max: 1000px;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(var(--max), calc(100% - 6rem));
  margin: 0 auto;
}

header,
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.links,
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.nav-link {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  background: var(--accent);
  color: white;
}

.nav-cta {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: #111827;
  color: white;
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.25rem;
}

.nav-cta:hover {
  background: #000000;
  text-decoration: none;
}

.menu-shell {
  position: relative;
}

.menu-shell summary {
  list-style: none;
}

.menu-shell summary::-webkit-details-marker {
  display: none;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.menu-btn::after {
  content: "▾";
  font-size: 0.8rem;
  line-height: 1;
}

.menu-shell[open] .menu-btn::after {
  content: "▴";
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.75rem);
  width: min(320px, calc(100vw - 2rem));
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  display: grid;
  gap: 0.85rem;
  z-index: 30;
}

.menu-panel-wide {
  width: min(420px, calc(100vw - 2rem));
}

.menu-group {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.menu-group + .menu-group {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.menu-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.menu-panel a {
  display: block;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
}

.menu-panel a:hover {
  background: var(--surface);
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  padding: 5rem 0 3rem;
}

.eyebrow {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 0 0 1rem;
}

h2 {
  letter-spacing: -0.02em;
}

.lede {
  color: var(--muted);
  max-width: 60ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 600;
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.profile {
  align-self: start;
}

.avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #dfe7f5, #f3efe7);
  margin-bottom: 1rem;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

section {
  padding: 2rem 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.list {
  display: grid;
  gap: 1rem;
}

.item {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.footer {
  padding: 3rem 0;
  color: var(--muted);
}

.news-card h2 {
  margin-top: 0.5rem;
}

body[data-page="welcome"] .nav-link[href="index.html"],
body[data-page="about"] .nav-link[href="about.html"],
body[data-page="projects"] .nav-link[href="projects.html"],
body[data-page="news"] .nav-link[href="news.html"],
body[data-page="cv"] .nav-link[href="cv.html"],
body[data-page="ecmo"] .nav-link[href="ecmo.html"] {
  background: var(--accent);
  color: white;
}



@media (max-width: 900px) {
  .hero,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
  }

  .menu-panel,
  .menu-panel-wide {
    position: static;
    width: 100%;
    margin-top: 0.75rem;
  }

  .wrap {
    width: min(var(--max), calc(100% - 2rem));
  }

  .site-nav,
  .links {
    justify-content: center;
  }
}