:root {
  --bg: #23153c;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.16);
  --accent: #8894f2;
  --radius: 9px;
  --header-h: 82px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 16.75px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--bg);
}

.vanta-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.vanta-background canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: rgba(35, 21, 60, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  position: relative;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.404rem;
}

.logo::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.18s ease;
}

.logo:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.nav a {
  position: relative;
  color: var(--muted);
  font-size: 1.04rem;
  transition: color 0.16s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
}

.nav a:not(.icon-link)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.18s ease;
}

.nav a:not(.icon-link):hover::after,
.nav a:not(.icon-link).is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-split {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.14);
}

.icon-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
}

.icon-link:hover {
  color: var(--text);
}

.icon-link.is-active {
  color: var(--text);
}

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  color: var(--muted);
  transition: color 0.16s ease;
}

.menu-btn:hover {
  color: var(--text);
}

.external-link-dialog {
  width: min(430px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  color: var(--text);
  background: #2a1946;
  box-shadow: 0 24px 70px rgba(12, 6, 24, 0.42);
  animation: dialog-enter 0.18s ease-out;
}

.external-link-dialog::backdrop {
  background: rgba(20, 10, 36, 0.82);
}

.external-dialog-content {
  padding: 26px;
}

.external-dialog-content h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.external-dialog-content p {
  margin: 10px 0 0;
  color: var(--muted);
}

.external-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.external-dialog-actions .btn {
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.external-dialog-confirm {
  color: #23153c;
  border-color: #ffffff;
  background: #ffffff;
}

.external-dialog-confirm:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.48);
  background: transparent;
}

.external-dialog-cancel:hover {
  color: #23153c;
  border-color: #ffffff;
  background: #ffffff;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
  user-select: none;
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
}

.hero {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 0 72px;
}

.hero-inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  transform: translateY(-3vh);
}

.home-page .hero {
  text-align: left;
}

.home-page .hero-inner {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
  justify-items: start;
}

.home-page .hero-actions {
  justify-content: flex-start;
}

.avatar-ring {
  position: relative;
  width: 160px;
  height: 160px;
  padding: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #23153c;
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
}

.hero h1 {
  margin: 10px 0 0;
  padding-inline: 0.06em;
  margin-inline: -0.06em;
  font-size: clamp(2.46rem, 6.1vw, 4.52rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text);
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: var(--text);
  background: transparent;
  font-weight: 600;
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

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

.btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.btn-secondary:hover {
  color: #23153c;
  border-color: #ffffff;
  background: #ffffff;
}

.btn .material-symbols-rounded {
  font-size: 20px;
}

.btn .material-symbol-svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.hero-actions .btn {
  min-height: 48px;
  padding-inline: 19px;
  font-size: 1.02rem;
}

.hero-actions .btn .material-symbols-rounded,
.hero-actions .btn .github-mark {
  width: 21px;
  height: 21px;
  font-size: 21px;
}

.github-mark {
  width: 20px;
  height: 20px;
  flex: none;
}

.page-main {
  padding: 72px 0 104px;
}

.page-intro {
  margin-bottom: 46px;
}

.section-index {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  max-width: 48rem;
  font-size: clamp(3rem, 7vw, 5.3rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.page-lead {
  margin: 18px 0 0;
  color: var(--muted);
  max-width: 42rem;
  font-size: 1.06rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(35, 21, 60, 0.72);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(42, 25, 70, 0.86);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.project-logo {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 16px;
}

.project-heading {
  min-width: 0;
}

.project-heading h2 {
  margin: 5px 0 0;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 600;
}

.project-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
}

.project-description {
  max-width: 36rem;
  margin: 20px 0 0;
  color: var(--muted);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.project-tags li {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  font-size: 0.76rem;
  line-height: 1.45;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}

.about {
  display: grid;
  gap: 28px;
  max-width: 42rem;
}

.about p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.contact {
  display: grid;
  place-items: center;
  padding: 64px 20px 80px;
  text-align: center;
}

.contact-inner {
  width: min(1180px, 100%);
  transform: translateY(-2vh);
}

.contact-eyebrow {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.contact-email {
  display: inline-block;
  margin: -0.22em -0.06em;
  padding: 0.22em 0.06em;
  color: rgba(244, 244, 247, 0.8);
  font-size: clamp(2.5rem, 5.25vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.055em;
  white-space: nowrap;
  transform: translate3d(var(--email-shift-x, 0), var(--email-shift-y, 0), 0)
    perspective(1000px)
    rotateX(var(--email-tilt-x, 0deg))
    rotateY(var(--email-tilt-y, 0deg))
    rotateZ(var(--email-rotation, 0deg))
    skewX(var(--email-skew, 0deg));
  transform-origin: center;
  transform-style: preserve-3d;
  will-change: transform;
  outline: none;
}

.contact-letter {
  display: inline-block;
  color: var(--letter-color);
  text-shadow: 0 0 10px var(--letter-color), 0 0 24px rgba(82, 172, 255, 0.22);
  transform: translate3d(0, var(--letter-y, 0), 0) scale(var(--letter-scale, 1));
  transform-origin: 50% 68%;
  transition: text-shadow 0.2s ease;
  will-change: transform;
}

.contact-email:hover .contact-letter,
.contact-email:focus-visible .contact-letter {
  text-shadow: 0 0 14px var(--letter-color), 0 0 30px rgba(82, 172, 255, 0.3);
}

.contact-email:focus-visible {
  text-decoration: underline;
  text-decoration-color: rgba(105, 228, 155, 0.6);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.motion-permission {
  display: block;
  margin: 16px auto 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(18, 22, 40, 0.85);
  font-size: 0.78rem;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.motion-permission[hidden] {
  display: none;
}

.motion-permission:hover:not(:disabled),
.motion-permission:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(22, 28, 48, 0.92);
}

.motion-permission:focus-visible {
  outline: 2px solid rgba(105, 228, 155, 0.65);
  outline-offset: 3px;
}

.motion-permission:disabled {
  cursor: default;
  opacity: 0.65;
}

.contact-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(35, 21, 60, 0.72);
}

.interior-page .site-footer {
  border-top: 0;
}

.footer-inner {
  min-height: 103px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: -10px;
}

.footer-social-link {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.footer-social-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.footer-social-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.footer-social-link .material-symbols-rounded {
  font-size: 23px;
}

.footer-social-link .github-mark {
  width: 26px;
  height: 26px;
}

.footer-social-link .x-mark {
  width: 23px;
  height: 23px;
}

.footer-quote {
  margin: 0;
  color: var(--muted);
  font-size: 0.89rem;
}

.footer-quote q::before,
.footer-quote q::after {
  color: rgba(244, 244, 247, 0.38);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .project-card,
  .footer-social-link,
  .contact-email,
  .contact-letter,
  .hero h1,
  .external-link-dialog {
    transition: none;
    animation: none;
  }

}

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

@media (max-width: 760px) {
  .logo::after,
  .nav a:not(.icon-link)::after {
    display: none;
  }

  .menu-btn {
    display: grid;
    place-items: center;
  }

  .nav {
    position: absolute;
    top: var(--header-h);
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(35, 21, 60, 0.97);
  }

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

  .nav a,
  .icon-link {
    padding: 12px;
  }

  .nav-split {
    display: none;
  }

  .hero {
    padding-block: 48px 64px;
  }

  .hero-inner {
    transform: translateY(-2vh);
  }

  .home-page .hero {
    text-align: center;
  }

  .home-page .hero-inner {
    justify-items: center;
  }

  .home-page .hero-actions {
    justify-content: center;
  }

  .page-main {
    padding-block: 52px 80px;
  }

  .page-intro {
    margin-bottom: 34px;
  }

  .page-title {
    font-size: clamp(2.75rem, 15vw, 4.25rem);
  }

  .footer-inner {
    min-height: 88px;
    justify-content: center;
  }

  .footer-socials {
    margin-left: 0;
  }

  .footer-quote {
    display: none;
  }

  .project-card {
    padding: 20px;
  }

  .project-actions .btn {
    flex: 1 1 auto;
  }

  .external-dialog-actions {
    flex-direction: column-reverse;
  }

  .external-dialog-actions .btn {
    width: 100%;
  }

  .contact {
    padding-inline: 20px;
  }

  .contact-inner {
    transform: translateY(-1vh);
  }

  .contact-email {
    font-size: clamp(1.85rem, 8.2vw, 3rem);
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (hover: none) {
  .contact-letter {
    color: var(--letter-color);
    text-shadow: 0 0 12px rgba(82, 172, 255, 0.24);
  }
}
