:root {
  --bg: #07080c;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.22);
  --text: #eef0f6;
  --muted: rgba(238, 240, 246, 0.62);
  --soft: rgba(238, 240, 246, 0.42);
  --accent: #a5c8f0;
  --accent-glow: rgba(165, 200, 240, 0.15);
  --gold: #c9a96e;
  --max-width: 1160px;
  --radius: 24px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(100, 160, 230, 0.09), transparent),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(180, 140, 80, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(var(--max-width), calc(100% - 2.5rem));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  background: rgba(7, 8, 12, 0.78);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.brand-kicker {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.55rem;
  color: var(--text);
  letter-spacing: 0.01em;
  font-weight: 400;
}

.brand-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(238, 240, 246, 0.72);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-subtitle span {
  color: var(--gold);
  opacity: 0.9;
  font-size: 0.58rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  letter-spacing: 0.01em;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

main {
  padding: 2.5rem 0 5rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.3s ease;
}

.grid-hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  align-items: start;
}

.hero-card {
  padding: 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(165, 200, 240, 0.08), transparent 70%);
  pointer-events: none;
}

.hero-title {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1.1;
  max-width: 14ch;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-text {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.02rem;
  margin: 1.75rem 0 0;
  font-weight: 300;
  line-height: 1.75;
  text-align: justify;
  hyphens: auto;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover { transform: translateY(-2px); }

.button-primary {
  background: var(--text);
  color: #07080c;
  border-color: var(--text);
}

.button-primary:hover {
  box-shadow: 0 8px 24px rgba(238,240,246,0.15);
}

.button-secondary {
  background: transparent;
  color: var(--text);
}

.button-secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-hover);
}

.stack {
  display: grid;
  grid-template-rows: 3fr 2fr;
  gap: 1.25rem;
  min-height: 0;
}

.photo-card {
  padding: 0;
  overflow: hidden;
  position: relative;
}

.photo-card,
.facts-card {
  min-height: 0;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(145deg, rgba(165, 200, 240, 0.07), rgba(100, 140, 200, 0.03));
  position: relative;
}

.photo-placeholder,
.photo-placeholder img {
  width: 100%;
  height: 100%;
}

.photo-placeholder img {
  object-fit: cover;
  object-position: center top;
  display: block;
}

.photo-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
}

.photo-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(165, 200, 240, 0.1);
  border: 1px solid rgba(165, 200, 240, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-icon svg {
  width: 28px;
  height: 28px;
  opacity: 0.5;
}

.photo-label {
  font-size: 0.78rem;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}

.section-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 600;
}

.highlight-title {
  margin: 0.6rem 0 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1.2;
  font-weight: 400;
}

.muted { color: var(--muted); }

.facts-card {
  padding: 2rem 2.25rem;
  height: 100%;
  min-height: 0;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  margin-top: 1.25rem;
}

.fact-label {
  color: var(--soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
  font-weight: 500;
}

.fact-value {
  margin: 0.4rem 0 0;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text);
}

.section-card {
  padding: 2.5rem;
  margin-bottom: 1.25rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  margin: 0.5rem 0 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  line-height: 1.15;
  font-weight: 400;
}

.section-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.section-link:hover { opacity: 0.7; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.project-item {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
  transition: background 0.2s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.project-item:hover {
  background: var(--panel-strong);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.project-preview {
  height: 9rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: flex-end;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  color: var(--soft);
  position: relative;
  overflow: hidden;
}

.project-preview-1 {
  background: linear-gradient(135deg, rgba(165,200,240,0.18) 0%, rgba(100,140,200,0.06) 100%);
}

.project-preview-2 {
  background: linear-gradient(135deg, rgba(201,169,110,0.16) 0%, rgba(150,110,60,0.05) 100%);
}

.project-preview-3 {
  background: linear-gradient(135deg, rgba(150,200,160,0.14) 0%, rgba(80,150,100,0.05) 100%);
}

.project-preview-label {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--soft);
}

.item-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0;
  line-height: 1.35;
}

.item-text {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.6rem 0 0;
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.tag, .skill-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  color: var(--soft);
  background: rgba(255,255,255,0.03);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.item-grid { display: grid; gap: 0.75rem; }

.list-item {
  display: block;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.list-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.list-source {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.list-year {
  color: var(--accent);
  font-size: 0.88rem;
  white-space: nowrap;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(165,200,240,0.2);
  background: rgba(165,200,240,0.06);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.skill-pill {
  font-size: 0.82rem;
  padding: 0.4rem 1rem;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.skill-pill:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}

.contact-card { padding: 2.5rem; }

.contact-text {
  margin-top: 1rem;
  font-size: 0.97rem;
  max-width: 44rem;
  font-weight: 300;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.contact-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.contact-link.primary {
  background: var(--text);
  color: #07080c;
  border-color: var(--text);
}

.contact-link.primary:hover {
  box-shadow: 0 8px 24px rgba(238,240,246,0.15);
}

.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 3rem;
  margin-top: 0.25rem;
}

.about-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.85;
  font-weight: 300;
  text-align: justify;
  hyphens: auto;
}

.cv-block-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--soft);
  font-weight: 500;
  margin: 0 0 1rem;
}

.cv-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.cv-item-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cv-thesis {
  margin: 0.5rem 0 0;
  font-size: 0.84rem;
  color: var(--soft);
  font-style: italic;
  line-height: 1.55;
  max-width: 52rem;
}

.cv-year-badge {
  background: rgba(165, 200, 240, 0.1);
  color: var(--accent);
  border-color: rgba(165, 200, 240, 0.25);
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
}

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

.hero-card,
.facts-card { animation: fadeUp 0.55s ease both; }
.facts-card { animation-delay: 0.12s; }

@media (max-width: 980px) {
  .grid-hero,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-card {
    padding: 2.25rem;
  }

  .section-card,
  .highlight-card,
  .facts-card,
  .contact-card {
    padding: 1.75rem;
  }

  .stack {
    grid-template-rows: auto auto;
    height: auto !important;
  }

  .photo-card {
    height: clamp(260px, 52vw, 420px);
  }
}

@media (max-width: 720px) {
  .about-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), calc(100% - 1.5rem));
  }

  .facts-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 0.1rem;
  }

  .nav a {
    font-size: 0.82rem;
    padding: 0.3rem 0.55rem;
  }

  .photo-card {
    height: clamp(220px, 68vw, 320px);
  }
}