:root {
  --bg: #050816;
  --bg-soft: #0a1231;
  --panel: rgba(11, 18, 48, 0.58);
  --panel-strong: rgba(17, 25, 61, 0.82);
  --line: rgba(160, 182, 255, 0.16);
  --text: #edf2ff;
  --muted: #a6b3db;
  --accent: #8e7dff;
  --accent-2: #45c1ff;
  --accent-3: #7a5cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(69, 193, 255, 0.16), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(142, 125, 255, 0.28), transparent 26%),
    radial-gradient(circle at 50% 90%, rgba(34, 76, 200, 0.16), transparent 35%),
    linear-gradient(180deg, #050816 0%, #060b1c 50%, #040611 100%);
  background-attachment: fixed;
}

body.modal-open {
  overflow: hidden;
}

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

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

.site-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(10, 16, 41, 0.5);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}

.brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: 220ms ease;
}

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

.glass-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(14, 22, 56, 0.7), rgba(7, 12, 30, 0.72));
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.hero-page {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  padding: 18px 0 24px;
}

.hero-media {
  position: relative;
  padding: 24px;
  animation: riseIn 900ms ease both;
}

.hero-viewer {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  padding: 0;
}

.hero-3d-view {
  width: 100%;
  height: 620px;
  background:
    radial-gradient(circle at 50% 35%, rgba(69, 193, 255, 0.12), transparent 22%),
    radial-gradient(circle at 50% 80%, rgba(142, 125, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(9, 15, 38, 0.95), rgba(5, 8, 22, 0.98));
}

.hero-3d-view canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-overlay {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(7, 12, 30, 0.54);
  backdrop-filter: blur(14px);
}

.viewer-label,
.viewer-hint {
  margin: 0;
}

.viewer-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  color: #edf2ff;
}

.viewer-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-copy {
  position: relative;
  padding: 42px;
  animation: fadeInUp 900ms ease 120ms both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.02;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
}

.hero-role {
  margin: 14px 0 0;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  color: #d8dcff;
}

.hero-description,
.page-hero p,
.about-copy p,
.info-card p,
.content-card-copy p,
.post-card p,
.markdown-note p,
.markdown-body p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font: inherit;
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: #050816;
}

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

.button-tertiary {
  margin-top: 8px;
  width: fit-content;
}

.social-button {
  flex: 0 0 auto;
  gap: 12px;
  padding: 10px 15px;
}

.social-button img {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  display: block;
  object-fit: contain;
}

.social-button span {
  line-height: 1;
}

.modal-link-button img {
  width: 18px;
  height: 18px;
}

.copy-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(10, 14, 28, 0.88);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 20;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
}

.ambient-one {
  width: 240px;
  height: 240px;
  right: 4%;
  top: 10%;
  background: rgba(142, 125, 255, 0.28);
}

.ambient-two {
  width: 320px;
  height: 180px;
  left: 10%;
  bottom: 8%;
  background: rgba(69, 193, 255, 0.15);
}

.page-layout {
  display: grid;
  gap: 24px;
}

.page-hero,
.markdown-note,
.post-shell {
  padding: 32px;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  margin-top: 6px;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
}

.portrait-card,
.about-copy,
.info-card {
  padding: 24px;
}

.portrait-frame {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at top, rgba(69, 193, 255, 0.16), rgba(8, 12, 28, 0.8));
}

.muted,
.card-meta {
  color: var(--muted);
}

.about-title,
.card-subtitle {
  margin: 10px 0 14px;
  color: #ccd6ff;
  font-weight: 700;
}

.publication-authors {
  line-height: 1.6;
}

.publication-author {
  font-weight: 500;
}

.publication-author-highlight {
  color: var(--text);
  font-weight: 800;
}

.publication-author-note {
  color: var(--muted);
  font-weight: 500;
}

.info-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.tag-list li {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dae4ff;
}

.section-heading {
  margin: 4px 0 14px;
}

.section-heading h2 {
  font-size: 1.6rem;
}

.card-list,
.post-grid {
  display: grid;
  gap: 20px;
}

.content-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  padding: 20px;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.content-card:hover,
.content-card:focus-visible,
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(142, 125, 255, 0.45);
  box-shadow: 0 28px 60px rgba(27, 40, 120, 0.32);
}

.content-card:focus-visible {
  outline: 2px solid rgba(69, 193, 255, 0.8);
  outline-offset: 2px;
}

.content-card-image {
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.content-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.content-card-copy h3,
.post-card h3 {
  margin-top: 4px;
  font-size: 1.6rem;
}

.post-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.post-card {
  padding: 24px;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 40;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 18, 0.74);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(920px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
}

.modal-image-wrap {
  overflow: hidden;
  border-radius: 20px;
}

.post-shell {
  max-width: 860px;
  margin: 0 auto;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 28px 0 12px;
}

.markdown-body ul {
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.markdown-body code {
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-family: Consolas, monospace;
}

.markdown-body pre {
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.3);
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body a {
  color: var(--accent-2);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 960px) {
  .hero-page,
  .about-grid,
  .info-grid,
  .content-card,
  .modal-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .page-hero,
  .markdown-note,
  .post-shell {
    padding: 24px;
  }

  .hero-viewer,
  .hero-3d-view {
    min-height: 460px;
    height: 460px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 14px;
  }

  .topbar {
    top: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero-copy h1 {
    font-size: 2.6rem;
  }

  .viewer-overlay {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-viewer,
  .hero-3d-view {
    min-height: 380px;
    height: 380px;
  }
}
