:root {
  --bg: #f4f7fb;
  --bg-strong: #0f172a;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-muted: #e8eef7;
  --text: #18212f;
  --text-soft: #5f6b7a;
  --line: rgba(24, 33, 47, 0.12);
  --brand: #0f4c81;
  --brand-strong: #133a5c;
  --accent: #1f7a8c;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --container: min(1120px, calc(100vw - 2rem));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(31, 122, 140, 0.18), transparent 30rem),
    radial-gradient(circle at top right, rgba(15, 76, 129, 0.16), transparent 28rem),
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 55%, #edf2f9 100%);
}

img,
video,
iframe {
  display: block;
  width: 100%;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  overflow: clip;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(244, 247, 251, 0.72);
  border-bottom: 1px solid rgba(24, 33, 47, 0.08);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand {
  font-family: "Newsreader", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

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

.site-nav a {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(15, 76, 129, 0.08);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.hero,
.page-hero {
  padding: 5.5rem 0 2rem;
}

.hero-grid,
.section-grid,
.contact-panel {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  grid-template-columns: 1.5fr 0.9fr;
  align-items: start;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

h1,
h2 {
  font-family: "Newsreader", serif;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 6vw, 5.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0;
  line-height: 1.75;
}

.hero-text,
.page-hero-copy p,
.section-note,
.contact-text,
.profile-meta p,
.paper-content p,
.timeline-card p,
.prose-card p {
  color: var(--text-soft);
}

.hero-copy {
  display: grid;
  gap: 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 76, 129, 0.22);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.75);
  color: var(--brand-strong);
  border: 1px solid rgba(15, 76, 129, 0.12);
}

.stat-list,
.tag-row,
.contact-links,
.paper-links,
.timeline-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.stat-list li,
.profile-card,
.card,
.media-card,
.timeline-card,
.paper-card,
.contact-link {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.stat-list li {
  padding: 1rem 1.1rem;
}

.stat-list strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.stat-list span {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.profile-card {
  display: grid;
  gap: 1.75rem;
  padding: 2rem;
}

.profile-photo {
  width: min(260px, 100%);
  height: auto;
  object-fit: contain;
  border-radius: 22px;
  justify-self: center;
  border: 1px solid rgba(15, 76, 129, 0.12);
}

.profile-role {
  margin-bottom: 0.45rem;
  color: var(--text);
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-row span,
.paper-year,
.paper-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.84rem;
}

.tag-row span {
  background: rgba(15, 76, 129, 0.08);
  color: var(--brand-strong);
}

.section {
  padding: 2rem 0;
}

.section-grid {
  grid-template-columns: 0.9fr 1.3fr;
  align-items: start;
}

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

.section-note {
  max-width: 32rem;
}

.card,
.timeline-card,
.paper-content,
.contact-link {
  padding: 1.5rem;
}

.prose-card {
  display: grid;
  gap: 1rem;
}

.media-grid,
.paper-grid {
  display: grid;
  gap: 1.2rem;
}

.media-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-card {
  overflow: hidden;
}

.media-frame {
  aspect-ratio: 16 / 10;
  background: var(--bg-strong);
}

.media-frame iframe,
.media-frame video,
.paper-video iframe,
.paper-image {
  height: 100%;
  border: 0;
  object-fit: cover;
}

.media-copy {
  display: grid;
  gap: 0.6rem;
  padding: 1.25rem 1.25rem 1.35rem;
}

.media-copy p {
  color: var(--text-soft);
}

.timeline {
  display: grid;
  gap: 1.1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem;
  align-items: start;
}

.timeline-date {
  padding-top: 1rem;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-card {
  display: grid;
  gap: 0.75rem;
}

.timeline-card ul {
  display: grid;
  gap: 0.45rem;
}

.timeline-card li {
  position: relative;
  padding-left: 1rem;
  color: var(--text-soft);
}

.timeline-card li::before {
  content: "";
  position: absolute;
  top: 0.78rem;
  left: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--accent);
}

.contact-panel {
  grid-template-columns: 1fr 0.95fr;
  align-items: start;
}

.apps-grid {
  display: grid;
  gap: 1.2rem;
}

.app-card {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.app-summary {
  display: grid;
  align-content: start;
  gap: 1.15rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.75rem;
  height: 5.75rem;
  padding: 0.45rem;
  border-radius: 1.5rem;
  background: radial-gradient(circle at top right, rgba(31, 122, 140, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(15, 76, 129, 0.16), rgba(15, 76, 129, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.app-icon {
  width: 100%;
  height: 100%;
  border-radius: 1.2rem;
  object-fit: cover;
}

.app-title-block {
  display: grid;
  gap: 0.3rem;
}

.app-title-block h3 {
  font-size: 1.8rem;
}

.app-url {
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 700;
}

.app-description {
  color: var(--text-soft);
}

.app-feature-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-feature-list li {
  position: relative;
  padding-left: 1rem;
  color: var(--text-soft);
}

.app-feature-list li::before {
  content: "";
  position: absolute;
  top: 0.78rem;
  left: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--accent);
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

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

.app-link-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 76, 129, 0.18);
}

.app-link-secondary {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 76, 129, 0.12);
  color: var(--brand-strong);
}

.app-screenshots {
  display: grid;
  grid-template-columns: minmax(0, 0.28fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
}

.app-screenshots-portrait {
  grid-template-columns: repeat(2, minmax(0, 13rem));
  align-items: start;
}

.app-screenshot {
  min-width: 0;
  margin: 0;
}

.app-screenshot a {
  display: block;
  border-radius: 1rem;
}

.app-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.app-screenshot figcaption {
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .app-screenshots {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-screenshots-portrait {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-screenshot-ios {
    width: min(100%, 16rem);
    justify-self: center;
  }
}

.contact-links {
  display: grid;
  gap: 1rem;
}

.contact-link {
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.contact-link:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 76, 129, 0.18);
}

.contact-link span {
  color: var(--text-soft);
}

.page-hero-copy {
  max-width: 44rem;
  display: grid;
  gap: 1rem;
}

.papers-section {
  display: grid;
  gap: 1.25rem;
}

.paper-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.paper-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.paper-card {
  overflow: hidden;
}

.paper-card-featured {
  display: grid;
  grid-template-rows: 16rem 1fr;
}

.paper-image,
.paper-video {
  aspect-ratio: 16 / 10;
  background: var(--bg-strong);
}

.paper-content {
  display: grid;
  gap: 0.95rem;
}

.paper-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.paper-year {
  background: rgba(15, 76, 129, 0.12);
  color: var(--brand-strong);
  font-weight: 800;
}

.paper-type {
  background: rgba(31, 122, 140, 0.10);
  color: #0d5f6d;
  font-weight: 700;
}

.paper-meta {
  font-size: 0.95rem;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.85rem;
  background: var(--surface-muted);
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 0.95rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-size: 1.1rem;
  line-height: 1;
}

details[open] summary::after {
  content: "−";
}

details p {
  margin-top: 0.85rem;
}

.paper-card-thesis {
  max-width: 54rem;
}

.site-footer {
  padding: 2.5rem 0 3rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(24, 33, 47, 0.08);
  color: var(--text-soft);
}

.footer-row a {
  color: var(--brand);
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero-grid,
  .section-grid,
  .contact-panel,
  .app-card,
  .paper-grid,
  .paper-grid-compact,
  .media-grid,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .hero,
  .page-hero {
    padding-top: 4.5rem;
  }

  h1 {
    max-width: none;
  }

  .stat-list {
    grid-template-columns: 1fr;
  }

  .timeline-date {
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  .nav-row,
  .section-header,
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .hero,
  .page-hero,
  .section,
  .site-footer {
    padding-left: 0;
    padding-right: 0;
  }

  .paper-card-featured {
    grid-template-rows: auto 1fr;
  }

  .paper-image,
  .paper-video,
  .media-frame {
    aspect-ratio: 16 / 11;
  }
}
