:root {
  --accent: #4ecdc4;
  --accent-strong: #83e5dd;
  --accent-ink: #071615;
  --background: #0f1113;
  --surface: #171a1d;
  --surface-raised: #1d2226;
  --surface-soft: #131619;
  --border: rgba(229, 232, 235, 0.12);
  --border-strong: rgba(229, 232, 235, 0.2);
  --text: #f2f4f5;
  --text-soft: #d7dcde;
  --muted: #aab3b8;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --container: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    linear-gradient(180deg, rgba(78, 205, 196, 0.07), transparent 24rem),
    var(--background);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
iframe {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(78, 205, 196, 0.55);
  outline-offset: 3px;
}

p {
  margin-top: 0;
}

strong {
  color: var(--text);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 19, 0.9);
  backdrop-filter: blur(14px);
}

.site-header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.logo-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(78, 205, 196, 0.26);
  border-radius: var(--radius);
  background: rgba(78, 205, 196, 0.08);
  color: var(--accent);
}

.brand-name,
.brand-title {
  margin: 0;
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.menu-toggle {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

.nav-links {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  left: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.nav-links.is-open {
  display: flex;
}

.nav-links a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-links a:not(.nav-github) {
  padding: 0 0.7rem;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a[aria-current="page"] {
  color: var(--accent-strong);
}

.nav-links a.nav-github {
  width: 42px;
  justify-content: center;
}

.nav-links a.nav-github svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

main {
  flex: 1;
  padding: clamp(2.4rem, 6vw, 4.8rem) 0;
}

main.subpage {
  padding-top: clamp(1.8rem, 4vw, 3rem);
}

.hero {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hero-eyebrow,
.eyebrow,
.about-eyebrow,
.section-header-text p,
.mini-label {
  margin: 0 0 0.55rem;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.hero-content h1 {
  max-width: 13ch;
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: clamp(2.25rem, 7vw, 4.35rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.subpage .hero h1 {
  max-width: 15ch;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.08;
}

.subpage .hero {
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.hero p,
.subtitle,
.hero-body {
  max-width: 760px;
  color: var(--text-soft);
  font-size: clamp(1rem, 2vw, 1.13rem);
}

.subtitle {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.hero-card {
  display: grid;
  gap: clamp(1.75rem, 5vw, 3rem);
  align-items: center;
  padding: clamp(1.3rem, 5vw, 3.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(255, 255, 255, 0.025)),
    var(--surface);
  box-shadow: var(--shadow);
}

.home-hero {
  margin-bottom: clamp(1.4rem, 4vw, 2.6rem);
}

.home-hero .hero-card {
  gap: clamp(1.3rem, 4vw, 2.35rem);
  padding: clamp(1.15rem, 4vw, 2.65rem);
}

.home-hero .hero-content {
  gap: 0.62rem;
}

.home-hero .hero-content h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.35rem, 6vw, 4rem);
}

.home-hero .hero-body {
  max-width: 700px;
}

.home-hero .profile-frame {
  justify-self: center;
  width: 100%;
  max-width: 360px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-frame {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profile-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about-section {
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.about-card,
.about-mini,
.card,
.info-card,
.doc-viewer,
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.about-card {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-content h2,
.about-mini h2,
.section-header h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.18;
}

.about-content p,
.about-mini p,
.card p,
.info-card li,
.project-meta p,
.viewer-note,
.form-note,
label {
  color: var(--muted);
}

.about-interests h3,
.card h3,
.info-card h3,
.project-meta h3 {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.25;
}

.interest-tags,
.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.interest-tags li,
.mini-tags li,
.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(78, 205, 196, 0.28);
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.08);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.interest-tags li,
.mini-tags li {
  min-height: 32px;
  padding: 0.28rem 0.7rem;
}

.tag {
  max-width: 100%;
  padding: 0.3rem 0.68rem;
}

.content-section + .content-section {
  margin-top: clamp(2.25rem, 6vw, 4rem);
}

.projects + .content-section,
.info-grid + .content-section {
  margin-top: clamp(2.25rem, 6vw, 4rem);
}

.section-header {
  display: grid;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1.2rem;
}

.link-arrow,
.card-link,
.project-source,
.social-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.link-arrow,
.card-link,
.project-source {
  font-size: 0.92rem;
}

.card-grid,
.info-grid,
.projects,
.contact-grid {
  display: grid;
  gap: 1rem;
}

.focus-panel {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(78, 205, 196, 0.08), rgba(255, 255, 255, 0.02)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.focus-item {
  display: grid;
  gap: 0.45rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--border);
}

.focus-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.focus-item h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
}

.focus-item p {
  margin: 0;
  color: var(--muted);
}

.item-status,
.project-status {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card,
.info-card,
.about-mini {
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.card p,
.card h3 {
  margin: 0;
}

.card-link {
  margin-top: auto;
}

.cta-button,
.download-btn,
.submit-btn {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid rgba(78, 205, 196, 0.38);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.78rem 1.1rem;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cta-button:hover,
.cta-button:focus,
.download-btn:hover,
.download-btn:focus,
.submit-btn:hover,
.submit-btn:focus {
  background: var(--accent-strong);
  color: var(--accent-ink);
  box-shadow: 0 10px 22px rgba(78, 205, 196, 0.18);
  transform: translateY(-1px);
}

.download-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.projects {
  gap: 1.2rem;
}

.project-card {
  display: grid;
  gap: 1.2rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.research-page .projects {
  gap: 1rem;
}

.research-page .project-card {
  gap: 1rem;
  padding: clamp(0.95rem, 2.4vw, 1.25rem);
}

.project-card,
.content-section {
  scroll-margin-top: 96px;
}

.project-figure {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.project-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--surface-soft);
}

.research-page .project-figure img {
  aspect-ratio: 16 / 9;
}

.project-figure span {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(15, 17, 19, 0.56));
}

.project-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.75rem;
}

.research-page .project-meta {
  gap: 0.55rem;
}

.project-meta h3 {
  font-size: clamp(1.16rem, 2vw, 1.45rem);
}

.research-page .project-meta h3 {
  font-size: clamp(1.08rem, 1.75vw, 1.32rem);
  line-height: 1.22;
}

.project-meta p {
  margin: 0;
}

.project-facts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-facts li {
  color: var(--muted);
  line-height: 1.5;
}

.project-facts strong {
  color: var(--text-soft);
}

.project-footer,
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.project-footer {
  justify-content: space-between;
  margin-top: 0.2rem;
}

.project-actions {
  justify-content: flex-start;
}

.project-source {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-viewer {
  overflow: hidden;
  margin-bottom: 1rem;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.viewer-frame {
  display: grid;
  gap: 0.85rem;
}

.pdf-viewer {
  width: 100%;
  min-height: min(76vh, 760px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.viewer-note,
.form-note {
  margin: 0;
  font-size: 0.9rem;
}

.form-note--first {
  margin-bottom: 1rem;
}

.info-grid {
  margin-top: 1rem;
}

.info-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.info-card li + li {
  margin-top: 0.45rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group + .form-group {
  margin-top: 1rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  padding: 0.9rem 0.95rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #7f8a90;
}

input:focus,
textarea:focus {
  border-color: rgba(78, 205, 196, 0.65);
  box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.honeypot {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contact-info,
.info-text,
.social-list {
  display: flex;
  flex-direction: column;
}

.contact-info {
  gap: 0.9rem;
}

.info-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.info-item svg {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: var(--accent);
}

.info-text {
  gap: 0.1rem;
}

.info-title {
  color: var(--muted);
  font-size: 0.84rem;
}

.info-value {
  color: var(--text);
  font-weight: 700;
}

.social-list {
  gap: 0.55rem;
  margin-top: 1rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.35rem 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (min-width: 720px) {
  .menu-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-links a:not(.nav-github) {
    padding: 0 0.5rem;
  }

  .section-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

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

  .focus-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .focus-item {
    padding: 0 1rem 0 0;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .focus-item:last-child {
    padding-right: 0;
    border-right: 0;
  }

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

  .project-card {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: start;
  }
}

@media (min-width: 900px) {
  .hero-card {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  }

  .home-hero .hero-card {
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.62fr);
  }

  .home-hero .profile-frame {
    justify-self: end;
  }

  .about-card {
    grid-template-columns: minmax(0, 0.95fr);
  }
}

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

  .site-header .container {
    min-height: 68px;
  }

  .brand-name,
  .brand-title {
    font-size: 0.98rem;
  }

  .hero h1,
  .hero-content h1 {
    font-size: 2.25rem;
  }

  .project-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .cta-button,
  .download-btn,
  .submit-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
