:root {
  color-scheme: light dark;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 34rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 48%, #f0fdfa 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -24%;
  pointer-events: none;
}

body::before {
  z-index: -2;
  opacity: 0.42;
  background:
    radial-gradient(circle at 24% 22%, rgba(20, 184, 166, 0.26), transparent 18%),
    radial-gradient(circle at 72% 26%, rgba(99, 102, 241, 0.18), transparent 20%),
    radial-gradient(circle at 48% 82%, rgba(14, 165, 233, 0.14), transparent 22%);
  filter: blur(28px);
  animation: background-ripple 18s ease-in-out infinite alternate;
}

body::after {
  z-index: -1;
  opacity: 0.34;
  background:
    radial-gradient(ellipse at 18% 24%, rgba(20, 184, 166, 0.32), transparent 26%),
    radial-gradient(ellipse at 82% 70%, rgba(99, 102, 241, 0.24), transparent 28%);
  filter: blur(10px);
  animation: background-drift 26s ease-in-out infinite alternate;
}

body > header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(18px);
}

body > header::before {
  content: "";
  position: absolute;
  inset: -120% -24%;
  z-index: -1;
  opacity: 0.48;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 50%, rgba(20, 184, 166, 0.32), transparent 18%),
    radial-gradient(circle at 48% 42%, rgba(14, 165, 233, 0.16), transparent 16%),
    radial-gradient(circle at 88% 54%, rgba(99, 102, 241, 0.24), transparent 20%);
  filter: blur(18px);
  animation: topbar-ripple 12s ease-in-out infinite alternate;
}

body > header > * {
  position: relative;
  z-index: 1;
}

@supports (padding: max(0px)) {
  body > header {
    top: max(0.75rem, env(safe-area-inset-top));
  }
}

html[data-theme="dark"] body > header {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] body > header::before {
  opacity: 0.5;
  background:
    radial-gradient(circle at 14% 50%, rgba(45, 212, 191, 0.28), transparent 18%),
    radial-gradient(circle at 48% 42%, rgba(56, 189, 248, 0.14), transparent 16%),
    radial-gradient(circle at 88% 54%, rgba(129, 140, 248, 0.22), transparent 20%);
}

.avatar-frame {
  position: relative;
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border-radius: 999px;
  isolation: isolate;
}

.avatar-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #14b8a6, #38bdf8, #818cf8, #14b8a6);
  animation: avatar-line-spin 4s linear infinite;
}

.avatar-frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.86);
}

.avatar-frame img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: inherit;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .avatar-frame::after {
  background: rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] .avatar-frame img {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] body {
  color: #cbd5e1;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.24), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.18), transparent 32rem),
    linear-gradient(135deg, #020617 0%, #0f172a 52%, #111827 100%);
}

html[data-theme="dark"] body::before {
  opacity: 0.38;
  background:
    radial-gradient(circle at 24% 22%, rgba(45, 212, 191, 0.24), transparent 18%),
    radial-gradient(circle at 72% 26%, rgba(129, 140, 248, 0.18), transparent 20%),
    radial-gradient(circle at 48% 82%, rgba(56, 189, 248, 0.14), transparent 22%);
}

html[data-theme="dark"] body::after {
  opacity: 0.38;
  background:
    radial-gradient(ellipse at 18% 24%, rgba(20, 184, 166, 0.36), transparent 28%),
    radial-gradient(ellipse at 82% 70%, rgba(79, 70, 229, 0.30), transparent 30%);
}

.glass {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .glass {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.nav-link {
  color: #475569;
  transition: color 180ms ease, background-color 180ms ease;
}

html[data-theme="dark"] .nav-link {
  color: #cbd5e1;
}

.nav-link:hover,
.nav-link.active {
  color: #0f172a;
  background: rgba(20, 184, 166, 0.12);
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
  color: #f8fafc;
  background: rgba(45, 212, 191, 0.16);
}

.social-link {
  color: #475569;
  transition: transform 180ms ease, color 180ms ease, background-color 180ms ease;
}

html[data-theme="dark"] .social-link {
  color: #d1d5db;
  background: rgba(15, 23, 42, 0.86);
}

.social-link:hover {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.12);
  transform: translateY(-2px);
}

html[data-theme="dark"] .social-link:hover {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.16);
}

.card-hover {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

html[data-theme="dark"] .card-hover {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.74);
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 184, 166, 0.34);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] .card-hover:hover {
  border-color: rgba(45, 212, 191, 0.38);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.28);
}

.section-title {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0;
}

html[data-theme="dark"] .section-title {
  color: #f8fafc;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  background: rgba(240, 253, 250, 0.78);
  padding: 0.35rem 0.7rem;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
}

html[data-theme="dark"] .tag {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(19, 78, 74, 0.36);
  color: #99f6e4;
}

.timeline-dot::before {
  content: "";
  position: absolute;
  left: -0.42rem;
  top: 1.75rem;
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  background: #14b8a6;
  box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.14);
}

html[data-theme="dark"] .timeline-dot::before {
  background: #5eead4;
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.14);
}

.theme-toggle {
  color: #475569;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.theme-toggle:hover {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.28);
}

html[data-theme="dark"] .theme-toggle {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.78);
}

html[data-theme="dark"] .theme-toggle:hover {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.14);
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white\/80,
html[data-theme="dark"] .bg-white\/85,
html[data-theme="dark"] .bg-white\/88 {
  background-color: rgba(15, 23, 42, 0.78) !important;
}

html[data-theme="dark"] .bg-teal-50 {
  background-color: rgba(20, 184, 166, 0.14) !important;
}

html[data-theme="dark"] .bg-slate-950 {
  background-color: #020617 !important;
}

html[data-theme="dark"] .text-slate-950,
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-700 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500 {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-teal-700 {
  color: #5eead4 !important;
}

html[data-theme="dark"] .text-teal-600 {
  color: #2dd4bf !important;
}

html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-white\/80,
html[data-theme="dark"] .border-t {
  border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .ring-teal-200 {
  --tw-ring-color: rgba(45, 212, 191, 0.48) !important;
}

@media (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  body::before,
  body::after {
    inset: -12%;
    filter: blur(18px);
  }

  body > header {
    left: 0;
    right: 0;
    width: calc(100% - 1rem);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem !important;
    border-radius: 1.35rem;
    gap: 0.75rem !important;
  }

  @supports (padding: max(0px)) {
    body > header {
      top: max(0.5rem, env(safe-area-inset-top));
    }
  }

  body > header > a {
    width: 100%;
    justify-content: center;
  }

  body > header > a > span:last-child {
    font-size: 1rem;
  }

  body > header nav {
    width: 100%;
    justify-content: center;
    gap: 0.35rem !important;
  }

  .avatar-frame {
    width: 2.75rem;
    height: 2.75rem;
  }

  .avatar-frame img {
    width: 2.35rem;
    height: 2.35rem;
  }

  .nav-link,
  body > header nav > a:not(.nav-link) {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
  }

  .theme-toggle {
    width: 2.15rem !important;
    height: 2.15rem !important;
    min-width: 2.15rem;
  }

  main {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
    padding-bottom: 3rem !important;
  }

  .glass {
    border-radius: 1.35rem !important;
    padding: 1.1rem !important;
  }

  .section-title,
  h1.section-title {
    font-size: clamp(2rem, 9vw, 2.65rem) !important;
    line-height: 1.08 !important;
  }

  h2.section-title {
    font-size: 1.45rem !important;
  }

  p,
  li {
    line-height: 1.65;
  }

  .glass .text-lg {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  .glass.grid {
    gap: 1.4rem !important;
  }

  .glass.grid > .relative img.aspect-\[4\/5\] {
    max-height: 23rem;
    object-position: center 18%;
  }

  .glass.grid > .relative > .absolute {
    position: static !important;
    margin-top: 0.85rem;
    padding: 1rem !important;
    border-radius: 1.1rem !important;
  }

  .glass .aspect-square {
    max-width: 17rem;
    margin-left: auto;
    margin-right: auto;
  }

  .card-hover {
    border-radius: 1.25rem !important;
  }

  .card-hover.p-6,
  .card-hover .p-6 {
    padding: 1.1rem !important;
  }

  .card-hover h2,
  .card-hover h3 {
    font-size: 1.08rem !important;
  }

  .tag {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
  }

  .timeline-dot {
    padding: 1.1rem !important;
    border-radius: 1.25rem !important;
  }

  .timeline-dot::before {
    left: -0.31rem;
    top: 1.55rem;
    width: 0.62rem;
    height: 0.62rem;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
  }

  .timeline-dot h2 {
    font-size: 1.12rem !important;
    line-height: 1.25;
  }

  .timeline-dot .tag {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .nav-link,
  body > header nav > a:not(.nav-link) {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
    font-size: 0.74rem;
  }

  body > header {
    width: calc(100% - 0.75rem);
  }

  main {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .timeline-dot::before {
    left: -0.29rem;
  }
}

@keyframes background-ripple {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  50% {
    transform: translate3d(1%, 1.5%, 0) scale(1.035);
  }

  100% {
    transform: translate3d(2%, -0.5%, 0) scale(1.07);
  }
}

@keyframes background-drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  100% {
    transform: translate3d(-2%, 1.5%, 0) rotate(4deg);
  }
}

@keyframes topbar-ripple {
  0% {
    transform: translateX(-4%) scale(1);
  }

  50% {
    transform: translateX(3%) scale(1.04);
  }

  100% {
    transform: translateX(5%) scale(1.08);
  }
}

@keyframes avatar-line-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  body > header::before,
  .avatar-frame::before {
    animation: none;
  }
}
