html {
  color-scheme: dark;
}
body {
  background:
    radial-gradient(
      circle at 14% 8%,
      rgba(45, 212, 191, 0.18),
      transparent 30rem
    ),
    radial-gradient(
      circle at 86% 18%,
      rgba(245, 158, 11, 0.13),
      
      transparent 30rem
    ),
    linear-gradient(180deg, #080b10 0%, #0b1017 44%, #080b10 100%);
}
.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 720ms ease,
    transform 720ms ease;
}
.reveal.slide-left {
  transform: translateX(-32px);
}
.reveal.slide-right {
  transform: translateX(32px);
}
.reveal.is-visible,
.reveal.slide-left.is-visible,
.reveal.slide-right.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}
.stagger {
  transition-delay: calc(var(--delay, 0) * 95ms);
}
.surface {
  background: linear-gradient(
    145deg,
    rgba(22, 30, 39, 0.96),
    rgba(13, 19, 27, 0.96)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.surface-hover {
  position: relative;
  overflow: hidden;
}
.surface-hover::before {
  background: radial-gradient(
    520px circle at var(--x, 50%) var(--y, 50%),
    rgba(45, 212, 191, 0.16),
    transparent 42%
  );
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 220ms ease;
}
.surface-hover:hover::before {
  opacity: 1;
}
.surface-hover > * {
  position: relative;
  z-index: 1;
}
.nav-link.is-active {
  color: #2dd4bf;
}
.role-word {
  position: absolute;
  opacity: 0;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.role-word.is-visible {
  opacity: 1;
}
.terminal-line {
  min-height: 1.8rem;
}
@keyframes formGlow {
  0% {
    box-shadow: 0 0 0 rgba(45, 212, 191, 0);
  }
  50% {
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.3);
  }
  100% {
    box-shadow: 0 0 0 rgba(45, 212, 191, 0);
  }
}

#modal-box {
  animation: formGlow 2.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

.animate-spin-slow {
  animation: spinSlow 12s linear infinite;
}

.animate-spin-reverse {
  animation: spinReverse 18s linear infinite;
}

.input {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  transition: all 0.25s ease;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.input:focus {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2);
  outline: none;
  background: rgba(255, 255, 255, 0.06);
}

/* Button */
.btn-primary {
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #080b10;
  font-weight: 600;
  padding: 14px;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(45, 212, 191, 0.25);
}

/* Animation Rings */
@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

.animate-spin-slow {
  animation: spinSlow 18s linear infinite;
}

.animate-spin-reverse {
  animation: spinReverse 14s linear infinite;
}

/* glow breathing effect */
@keyframes glowPulse {
  0% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
}

.animate-glow {
  animation: glowPulse 4s ease-in-out infinite;
}

/* smooth hover lift */
.surface {
  transition: all 0.3s ease;
}

.surface:hover {
  transform: translateY(-6px);
}

.center-glow:hover i {
  transform: translateY(-2px) scale(1.05);
  transition: 0.25s ease;
}

.dropdown-item {
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
}

.contact-form-card {
  max-height: 100%;
}

.contact-field {
  display: grid;
  gap: 0.35rem;
}

.contact-field > span {
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-page .input {
  min-height: 2.9rem;
  padding: 0.72rem 0.85rem;
}

.contact-page .btn-primary {
  min-height: 2.9rem;
  padding: 0.72rem 1rem;
}

.contact-message {
  height: clamp(6rem, 16vh, 9rem);
}

.ring {
  position: absolute;
  border-radius: 50%;
}

.ring-1 {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(45, 212, 191, 0.3);
  animation: spinSlow 20s linear infinite;
}

.ring-2 {
  width: 75%;
  height: 75%;
  border: 2px dashed rgba(45, 212, 191, 0.5);
  animation: spinReverse 14s linear infinite;
}

.ring-3 {
  width: 50%;
  height: 50%;
  border: 1px solid rgba(45, 212, 191, 0.4);
}

.center-core {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #0b1017;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(45, 212, 191, 0.4);
  box-shadow: 0 0 40px rgba(45, 212, 191, 0.5);
  transition: 0.3s ease;
}

.center-core:hover {
  transform: scale(1.08);
  box-shadow: 0 0 80px rgba(45, 212, 191, 0.8);
}

.blog-card {
  transition: all 0.35s ease;
  transform: translateY(0);
}

.blog-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(45, 212, 191, 0.15);
}

/* Modal backdrop smooth fade */
#contact-modal {
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease;
}

/* Modal box animation */
#modal-box {
  transition: all 0.25s ease;
}

/* Glow border (matches your theme) */
#modal-box {
  box-shadow:
    0 0 0 rgba(45, 212, 191, 0),
    0 20px 80px rgba(0, 0, 0, 0.5);
}

#modal-box:hover {
  box-shadow:
    0 0 30px rgba(45, 212, 191, 0.2),
    0 20px 80px rgba(0, 0, 0, 0.6);
}

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body,
a,
button,
input,
textarea,
.surface,
.surface-hover,
.blog-card,
.project-card {
  transition:
    background-color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    color 0.35s var(--ease),
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.surface {
  transform: translateY(0);
}

.surface:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(45, 212, 191, 0.1);
}

.hero-orb {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(45, 212, 191, 0.25),
    transparent 70%
  );
  filter: blur(80px);
  animation: floatOrb 8s ease-in-out infinite;
  z-index: 0;
}

.hero-orb.delay {
  animation-delay: 4s;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent 70%);
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(40px, -60px);
  }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
  mask-image: linear-gradient(to bottom, black, transparent);
  z-index: 0;
}

@keyframes gridMove {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(60px);
  }
}
.surface {
  animation: none;
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
section {
  padding-top: 90px;
  padding-bottom: 90px;
  position: relative;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 60%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(45, 212, 191, 0.4),
    transparent
  );
}

.section-highlight {
  position: relative;
  border-radius: 20px;
  padding: 40px;
  background: linear-gradient(
    145deg,
    rgba(20, 30, 40, 0.7),
    rgba(10, 15, 20, 0.7)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

/* .mouse-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(45,212,191,0.18),
    transparent 60%
  );
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity 0.2s ease;
} */

#projects {
  background:
    radial-gradient(circle at 20% 30%, rgba(45, 212, 191, 0.1), transparent),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.08), transparent);
}

.project-card {
  position: relative;
  transition: 0.4s;
}

.project-card:hover {
  transform: translateY(-8px);
}

nav {
  backdrop-filter: blur(14px);
  background: rgba(10, 15, 20, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

nav::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 40%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #2dd4bf, transparent);
}

/* body {
  background:
    radial-gradient(circle at 20% 10%, rgba(45,212,191,0.12), transparent),
    radial-gradient(circle at 80% 20%, rgba(245,158,11,0.08), transparent),
    linear-gradient(180deg, #080b10 0%, #0b1017 50%, #080b10 100%);
} */

.blog-content h2 {
  font-size: 1.8rem;
  margin-top: 2rem;
  color: #2dd4bf;
}

.blog-content p {
  line-height: 1.8;
  color: #cbd5e1;
}

.blog-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

.arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.surface-hover:hover {
  transform: translateY(-6px);
}

.blog-content {
  line-height: 1.8;
  font-size: 1.05rem;
  color: #cbd5e1;
}

.blog-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #22d3ee;
}

.blog-content p {
  margin-bottom: 1.2rem;
}

.blog-content ul {
  margin: 1rem 0;
  padding-left: 1.2rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
  list-style: disc;
}
.blog-content img {
  border-radius: 12px;
  margin: 1.5rem 0;
}

.blog-content code {
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 6px;
  border-radius: 6px;
}

.blog-content pre {
  background: #0b1017;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  margin-top: 1rem;
}

/* GLASS EFFECT */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* FADE IN */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  z-index: 9999;
  transition: width 0.15s linear;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

@media (max-width: 1023px) {
  .reveal.slide-left,
  .reveal.slide-right {
    transform: translateY(24px);
  }

  .hero-orb {
    height: 280px;
    width: 280px;
    filter: blur(56px);
  }

  .surface:hover,
  .surface-hover:hover,
  .project-card:hover,
  .blog-card:hover {
    transform: translateY(-3px);
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(
        circle at 20% 4%,
        rgba(45, 212, 191, 0.14),
        transparent 18rem
      ),
      linear-gradient(180deg, #080b10 0%, #0b1017 48%, #080b10 100%);
  }

  .grid-bg {
    background-size: 44px 44px;
  }

  section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  section::before {
    width: 82%;
  }

  .section-highlight {
    border-radius: 12px;
    padding: 14px 0;
  }

  .surface,
  .surface-hover,
  .blog-card {
    border-radius: 8px;
  }

  .input {
    padding: 12px;
  }

  .btn-primary {
    padding: 12px 14px;
  }

  .contact-page .input,
  .contact-page .btn-primary {
    min-height: 2.55rem;
    padding: 0.58rem 0.7rem;
  }

  .contact-field {
    gap: 0.22rem;
  }

  .contact-field > span {
    font-size: 0.66rem;
  }

  .contact-message {
    height: 5.5rem;
  }

  .terminal-line {
    min-height: 1.5rem;
    overflow-wrap: anywhere;
  }

  .role-word {
    white-space: normal;
  }

  .center-core {
    height: 76px;
    width: 76px;
  }

  .blog-content {
    font-size: 1rem;
  }

  .blog-content h2 {
    font-size: 1.45rem;
  }
}

@media (max-height: 720px) {
  .contact-page .input,
  .contact-page .btn-primary {
    min-height: 2.45rem;
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
  }

  .contact-field > span {
    font-size: 0.64rem;
  }

  .contact-message {
    height: 4.75rem;
  }
}

/* Professional polish overrides */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --aqua: #2dd4bf;
  --ink: #080b10;
}

html {
  text-rendering: optimizeLegibility;
}

a,
button,
input,
textarea,
.surface,
.surface-hover,
.blog-card,
.project-card {
  transition:
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    box-shadow 220ms var(--ease),
    color 220ms var(--ease),
    opacity 220ms var(--ease),
    transform 220ms var(--ease);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.72);
  outline-offset: 3px;
}

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(45, 212, 191, 0.15), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(245, 158, 11, 0.1), transparent 30rem),
    linear-gradient(180deg, #080b10 0%, #0b1017 44%, #080b10 100%);
}

.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.surface {
  background: linear-gradient(145deg, rgba(22, 30, 39, 0.94), rgba(13, 19, 27, 0.94));
  border-color: rgba(255, 255, 255, 0.095);
  box-shadow:
    0 20px 58px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transform: translateY(0);
}

.surface-hover::before {
  background: radial-gradient(
    520px circle at var(--x, 50%) var(--y, 50%),
    rgba(45, 212, 191, 0.12),
    transparent 42%
  );
  transition: opacity 180ms ease;
}

.surface:hover,
.surface-hover:hover,
.project-card:hover,
.blog-card:hover {
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.42),
    0 0 34px rgba(45, 212, 191, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
}

nav {
  background: rgba(8, 11, 16, 0.78);
  backdrop-filter: blur(16px);
}

nav::after {
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.62), transparent);
  width: min(28rem, 42%);
}

section {
  position: relative;
}

#home {
  padding-bottom: 4rem;
  padding-top: 4rem;
}

main > section:not(#home),
.section-highlight > section {
  padding-bottom: 6rem;
  padding-top: 6rem;
}

section::before {
  content: none;
}

main > section:not(#home)::before,
.section-highlight > section::before {
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.28), transparent);
  content: "";
  height: 1px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: min(44rem, 62%);
}

.section-highlight {
  background: linear-gradient(145deg, rgba(20, 30, 40, 0.38), rgba(10, 15, 20, 0.3));
  border-color: rgba(255, 255, 255, 0.055);
  border-left: 0;
  border-radius: 0;
  border-right: 0;
  padding: 0;
}

#projects {
  background:
    radial-gradient(circle at 20% 30%, rgba(45, 212, 191, 0.07), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.055), transparent 28rem);
}

.hero-orb {
  background: radial-gradient(circle, rgba(45, 212, 191, 0.2), transparent 70%);
  animation-duration: 9s;
}

.hero-orb.delay {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 70%);
}

.hero-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  animation-duration: 24s;
}

.input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.input::placeholder {
  color: rgba(203, 213, 225, 0.48);
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.16);
}

.btn-primary {
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 12px 26px rgba(45, 212, 191, 0.2);
}

.center-core {
  box-shadow: 0 0 36px rgba(45, 212, 191, 0.4);
}

.center-core:hover {
  box-shadow: 0 0 64px rgba(45, 212, 191, 0.58);
  transform: scale(1.05);
}

#modal-box {
  animation: none;
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

#modal-box:hover {
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.58),
    0 0 30px rgba(45, 212, 191, 0.16);
}

.blog-content h2 {
  color: var(--aqua);
}

.contact-main {
  min-height: calc(100dvh - 77px);
}

.contact-page .surface:hover {
  transform: translateY(-2px);
}

.contact-page .ring-2 {
  border-color: rgba(45, 212, 191, 0.42) !important;
}

.contact-page .center-core {
  box-shadow: 0 0 36px rgba(45, 212, 191, 0.38) !important;
}

.contact-page .center-core:hover {
  box-shadow: 0 0 56px rgba(45, 212, 191, 0.52) !important;
  transform: scale(1.04) !important;
}

.article-page {
  isolation: isolate;
}

.article-page h1 {
  max-width: 13ch;
}

.article-page .blog-content {
  color: #cbd5e1;
  font-size: 1.0625rem;
  letter-spacing: 0;
  line-height: 1.85;
  max-width: 68ch;
}

.article-page .blog-content p,
.article-page .blog-content li {
  color: #cbd5e1;
}

.article-page .blog-content p {
  margin-bottom: 1.35rem;
}

.article-page .blog-content h2,
.article-page .blog-content h3,
.article-page .blog-content h4 {
  color: #f8fafc;
  letter-spacing: 0;
  line-height: 1.2;
  position: relative;
  transition:
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    color 220ms var(--ease),
    padding-left 220ms var(--ease);
}

.article-page .blog-content h2 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  margin-bottom: 1rem;
  margin-top: 3rem;
  padding-bottom: 0.75rem;
}

.article-page .blog-content h3 {
  color: #e2e8f0;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: 0.85rem;
  margin-top: 2rem;
}

.article-page .blog-content h4 {
  color: #e2e8f0;
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.article-page .blog-content h2::before,
.article-page .blog-content h3::before {
  background: var(--aqua);
  border-radius: 999px;
  content: "";
  height: calc(100% - 0.55rem);
  left: -1rem;
  opacity: 0;
  position: absolute;
  top: 0.15rem;
  width: 3px;
}

.article-page .blog-content h2.is-reading,
.article-page .blog-content h3.is-reading {
  color: #ffffff;
  padding-left: 0.75rem;
}

.article-page .blog-content h2.is-reading::before,
.article-page .blog-content h3.is-reading::before {
  opacity: 1;
}

.article-page .blog-content h2.is-reading {
  border-bottom-color: rgba(45, 212, 191, 0.34);
}

.article-page .blog-content strong {
  color: #f8fafc;
  font-weight: 800;
}

.article-page .blog-content em {
  color: #e2e8f0;
}

.article-page .blog-content a {
  color: var(--aqua);
  font-weight: 600;
  text-underline-offset: 4px;
}

.article-page .blog-content a:hover {
  text-decoration: underline;
}

.article-page .blog-content h2,
.article-page .blog-content h3 {
  scroll-margin-top: 6.5rem;
}

.article-toc {
  max-height: calc(100dvh - 8rem);
  overflow: auto;
  scrollbar-width: thin;
}

.article-toc.is-empty,
.article-toc-mobile.is-empty {
  display: none !important;
}

.article-toc-shell {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.15rem;
}

.article-toc-kicker {
  color: var(--aqua);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.article-toc-rule {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.5), transparent);
  height: 1px;
  margin-top: 0.95rem;
  width: 100%;
}

.article-toc-list {
  counter-reset: toc;
  display: grid;
  gap: 0.15rem;
}

.article-toc-item {
  counter-increment: toc;
  list-style: none;
}

.article-toc-item.is-sub {
  padding-left: 0.85rem;
}

.toc-link {
  border-radius: 6px;
  color: #94a3b8;
  display: grid;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.55rem;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding: 0.46rem 0.45rem;
  position: relative;
}

.toc-link::before {
  color: rgba(148, 163, 184, 0.58);
  content: counter(toc, decimal-leading-zero);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.85;
}

.toc-link::after {
  background: var(--aqua);
  border-radius: 999px;
  content: "";
  height: calc(100% - 0.7rem);
  left: -1.22rem;
  opacity: 0;
  position: absolute;
  top: 0.35rem;
  width: 2px;
}

.toc-link:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
}

.toc-link.is-active {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.16), rgba(45, 212, 191, 0.055));
  border-color: rgba(96, 165, 250, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(96, 165, 250, 0.08),
    0 0 22px rgba(96, 165, 250, 0.08);
  color: #f8fafc;
}

.toc-link.is-active::before {
  color: #60a5fa;
}

.toc-link.is-active::after {
  background: #60a5fa;
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.64);
  opacity: 1;
}

.article-page .surface:hover {
  transform: translateY(-2px);
}

.article-page .article-toc.surface:hover {
  transform: none;
}

.article-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.article-toc-mobile summary span:last-child::after {
  content: "+";
  display: inline-block;
  font-size: 1rem;
  margin-left: 0.5rem;
  transition: transform 180ms var(--ease);
}

.article-toc-mobile[open] summary span:last-child::after {
  transform: rotate(45deg);
}

.article-page .blog-content :first-child {
  margin-top: 0;
}

.article-page .blog-content ul,
.article-page .blog-content ol {
  display: grid;
  gap: 0.65rem;
  margin: 1.25rem 0 1.5rem;
  padding-left: 1.25rem;
}

.article-page .blog-content ol li {
  list-style: decimal;
}

.article-page .blog-content li::marker {
  color: var(--aqua);
}

.article-page .blog-content blockquote {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(45, 212, 191, 0.55);
  border-radius: 10px;
  color: #e2e8f0;
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
}

.article-page .blog-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-page .blog-content img {
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  width: 100%;
}

.article-page .blog-content code {
  background: rgba(45, 212, 191, 0.09);
  border: 1px solid rgba(45, 212, 191, 0.16);
  color: #d9fffb;
}

.article-page .blog-content pre {
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.article-page .blog-content pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.article-page .blog-content table {
  border-collapse: collapse;
  display: block;
  margin: 1.5rem 0;
  overflow-x: auto;
  width: 100%;
}

.article-page .blog-content th,
.article-page .blog-content td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
}

.article-page .blog-content th {
  background: rgba(255, 255, 255, 0.055);
  color: #f8fafc;
}

@media (max-width: 1023px) {
  .surface:hover,
  .surface-hover:hover,
  .project-card:hover,
  .blog-card:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 20% 4%, rgba(45, 212, 191, 0.12), transparent 18rem),
      linear-gradient(180deg, #080b10 0%, #0b1017 48%, #080b10 100%);
  }

  main > section:not(#home)::before,
  .section-highlight > section::before {
    width: 82%;
  }

  #home {
    padding-bottom: 4rem;
    padding-top: 4rem;
  }

  main > section:not(#home),
  .section-highlight > section {
    padding-bottom: 4rem;
    padding-top: 4rem;
  }

  .contact-main {
    min-height: auto;
    padding-bottom: 2rem;
    padding-top: 2rem;
  }

  .contact-form-card {
    margin-inline: auto;
    max-width: 42rem;
  }

  .article-page {
    padding-bottom: 4rem;
    padding-top: 3rem;
  }

  .article-page h1 {
    max-width: none;
  }

  .article-page .blog-content {
    font-size: 1rem;
    line-height: 1.75;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .contact-page .input,
  .contact-page .btn-primary {
    min-height: 2.4rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .contact-message {
    height: 5rem;
  }
}

/* Blog detail reading polish */
.article-page {
  max-width: 1220px;
}

.article-page > .grid {
  align-items: start;
}

.article-page .blog-content {
  max-width: 72ch;
}

.article-toc {
  width: min(100%, 300px);
}

.article-toc-shell {
  background: linear-gradient(180deg, rgba(17, 24, 32, 0.72), rgba(10, 15, 22, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-left: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 12px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-height: calc(100dvh - 7.5rem);
  overflow: hidden;
  padding: 1rem;
}

.article-toc-kicker {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.article-toc-kicker::before {
  background: var(--aqua);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.5);
  content: "";
  height: 0.45rem;
  width: 0.45rem;
}

.article-toc-rule {
  margin-top: 0.9rem;
}

.article-toc-nav {
  max-height: calc(100dvh - 12.5rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.article-toc-nav::-webkit-scrollbar {
  width: 6px;
}

.article-toc-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.24);
  border-radius: 999px;
}

.article-toc-list {
  gap: 0.2rem;
}

.toc-link {
  border: 1px solid transparent;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  padding: 0.58rem 0.6rem;
}

.toc-link:hover {
  border-color: rgba(96, 165, 250, 0.28);
}

.toc-link.is-active {
  border-color: rgba(96, 165, 250, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(96, 165, 250, 0.08),
    0 0 22px rgba(96, 165, 250, 0.08);
}

.toc-link.is-active::after {
  left: -1.05rem;
}

.article-page .blog-content h2.is-reading,
.article-page .blog-content h3.is-reading {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.08), transparent 76%);
  border-radius: 8px;
}

@media (max-width: 1023px) {
  .article-page {
    max-width: 760px;
  }

  .article-toc-mobile {
    overflow: hidden;
  }

  .article-toc-mobile .article-toc-list {
    max-height: 18rem;
    overflow-y: auto;
    padding-right: 0.25rem;
  }
}

@media (max-width: 640px) {
  .article-page .blog-content h2.is-reading,
  .article-page .blog-content h3.is-reading {
    padding-left: 0.55rem;
  }
}

/* Premium blog TOC */
.article-page > .grid {
  grid-template-columns: minmax(0, 820px) minmax(13.75rem, 16.25rem);
}

.article-toc {
  max-height: calc(100dvh - 6.5rem);
  overflow: visible;
  width: min(100%, 16.25rem);
}

.article-toc-shell,
.article-toc-mobile {
  animation: tocFadeIn 480ms var(--ease) both;
  background:
    radial-gradient(circle at 18% 0%, rgba(45, 212, 191, 0.13), transparent 13rem),
    linear-gradient(180deg, rgba(17, 24, 32, 0.78), rgba(8, 11, 16, 0.56));
  backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.32),
    0 0 40px rgba(45, 212, 191, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}

.article-toc-shell::before,
.article-toc-mobile::before {
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.5), rgba(96, 165, 250, 0.22), transparent);
  content: "";
  height: 1px;
  inset: 0 1rem auto;
  opacity: 0.8;
  position: absolute;
}

.article-toc-shell {
  max-height: calc(100dvh - 7rem);
  padding: 1rem;
}

.article-toc-head {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.article-toc-kicker {
  color: rgba(45, 212, 191, 0.95);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-toc-progress-label {
  color: rgba(148, 163, 184, 0.78);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

.article-toc-progress {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  height: 3px;
  margin-top: 0.9rem;
  overflow: hidden;
}

.article-toc-progress span {
  background: linear-gradient(90deg, var(--aqua), #60a5fa);
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.55);
  display: block;
  height: 100%;
  transition: width 260ms var(--ease);
  width: 0;
}

.article-toc-nav {
  max-height: calc(100dvh - 12.25rem);
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: none;
}

.article-toc-nav::-webkit-scrollbar,
.article-toc-mobile .article-toc-list::-webkit-scrollbar {
  display: none;
}

.article-toc-list {
  counter-reset: toc;
  display: grid;
  gap: 0.28rem;
}

.article-toc-item {
  counter-increment: toc;
  list-style: none;
}

.article-toc-item.is-sub {
  padding-left: 0.8rem;
}

.toc-link {
  align-items: start;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(148, 163, 184, 0.82);
  display: grid;
  font-size: 0.84rem;
  font-weight: 600;
  gap: 0.62rem;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  line-height: 1.45;
  padding: 0.62rem 0.72rem;
  position: relative;
  transform: translateX(0) scale(1);
  transition:
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    box-shadow 220ms var(--ease),
    color 220ms var(--ease),
    transform 220ms var(--ease);
}

.toc-link::before {
  color: rgba(148, 163, 184, 0.52);
  content: counter(toc, decimal-leading-zero);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.8;
}

.toc-link::after {
  background: linear-gradient(180deg, var(--aqua), #60a5fa);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.5);
  content: "";
  height: 42%;
  left: -0.95rem;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scaleY(0.75);
  transition:
    opacity 220ms var(--ease),
    transform 220ms var(--ease);
  width: 3px;
}

.toc-link:hover {
  background: rgba(96, 165, 250, 0.095);
  border-color: rgba(96, 165, 250, 0.22);
  box-shadow: 0 10px 26px rgba(96, 165, 250, 0.07);
  color: #bfdbfe;
  transform: translateX(4px);
}

.toc-link.is-active {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.16), rgba(96, 165, 250, 0.07)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(45, 212, 191, 0.34);
  box-shadow:
    0 10px 28px rgba(45, 212, 191, 0.1),
    inset 0 0 0 1px rgba(45, 212, 191, 0.06);
  color: #f8fafc;
  transform: translateX(5px) scale(1.015);
}

.toc-link.is-active::before {
  color: var(--aqua);
}

.toc-link.is-active::after {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}

.article-toc-mobile {
  margin-inline: auto;
  max-width: 46rem;
}

.article-toc-mobile-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
  padding: 0.95rem 1rem;
}

.article-toc-mobile-summary::-webkit-details-marker {
  display: none;
}

.article-toc-mobile-summary span:first-child {
  color: var(--aqua);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-toc-mobile-summary span:last-child {
  align-items: center;
  color: rgba(203, 213, 225, 0.82);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
}

.article-toc-mobile-summary span:last-child::after {
  color: var(--aqua);
  content: "+";
  display: inline-block;
  font-size: 1.05rem;
  margin-left: 0.55rem;
  transition: transform 220ms var(--ease);
}

.article-toc-mobile[open] .article-toc-mobile-summary span:last-child::after {
  transform: rotate(45deg);
}

.article-toc-mobile-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem;
}

.article-toc-mobile .article-toc-list {
  max-height: min(54dvh, 23rem);
  overflow-y: auto;
  padding-right: 0.15rem;
  scrollbar-width: none;
}

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

@media (max-width: 1180px) {
  .article-page > .grid {
    grid-template-columns: minmax(0, 1fr) minmax(13.5rem, 15.5rem);
  }
}

@media (max-width: 1023px) {
  .article-page > .grid {
    display: block;
  }
}

@media (max-width: 640px) {
  .article-toc-mobile-summary {
    padding: 0.85rem 0.9rem;
  }

  .article-toc-mobile .toc-link {
    font-size: 0.82rem;
    padding: 0.55rem 0.62rem;
  }
}

/* Final TOC-only premium styling */
.article-toc {
  top: 6rem;
  width: min(100%, 18rem);
}

.article-toc-shell,
.article-toc-mobile {
  background:
    radial-gradient(circle at 16% 0%, rgba(45, 212, 191, 0.1), transparent 12rem),
    rgba(8, 11, 16, 0.68);
  backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.article-toc-shell {
  max-height: calc(100dvh - 7rem);
  padding: 1rem;
}

.article-toc-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.8rem;
}

.article-toc-kicker {
  color: rgba(45, 212, 191, 0.92);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.article-toc-nav {
  max-height: calc(100dvh - 12rem);
  overflow-y: auto;
  padding-right: 0.15rem;
  scrollbar-width: none;
}

.article-toc-nav::-webkit-scrollbar,
.article-toc-mobile .article-toc-list::-webkit-scrollbar {
  display: none;
}

.article-toc-list {
  gap: 0.42rem;
}

.article-toc-item.is-sub {
  padding-left: 0.9rem;
}

.toc-link {
  border-left: 2px solid transparent;
  border-radius: 0.75rem;
  color: rgba(148, 163, 184, 0.78);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.68rem 0.78rem;
  transition:
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    box-shadow 220ms var(--ease),
    color 220ms var(--ease),
    transform 220ms var(--ease);
}

.toc-link:hover {
  background: rgba(45, 212, 191, 0.07);
  border-left-color: rgba(45, 212, 191, 0.38);
  color: #ccfbf1;
  transform: translateX(5px);
}

.toc-link.is-active {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.16), rgba(45, 212, 191, 0.04)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(45, 212, 191, 0.4);
  border-left-color: var(--aqua);
  box-shadow:
    0 10px 28px rgba(45, 212, 191, 0.1),
    inset 0 0 0 1px rgba(45, 212, 191, 0.08);
  color: #f8fafc;
  transform: translateX(5px);
}

.toc-link::before {
  color: rgba(148, 163, 184, 0.5);
}

.toc-link.is-active::before {
  color: var(--aqua);
}

.toc-link::after {
  background: var(--aqua);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.6);
  height: 0.42rem;
  left: -0.38rem;
  opacity: 0;
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  width: 0.42rem;
}

.toc-link.is-active::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.article-toc-mobile-summary {
  padding: 0.95rem 1rem;
}

.article-toc-mobile-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.7rem;
}

.article-toc-mobile .article-toc-list {
  max-height: min(52dvh, 22rem);
  overflow-y: auto;
  scrollbar-width: none;
}

@media (max-width: 1023px) {
  .article-toc-mobile {
    margin-inline: auto;
    max-width: 46rem;
  }
}

/* Blog detail typography and reading rhythm */
.article-main {
  min-width: 0;
}

.article-page .article-title {
  max-width: min(100%, 760px);
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-size: clamp(2.25rem, 3.6vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 1rem;
}

.article-meta {
  margin-top: 1rem;
}

.article-content {
  max-width: 66ch;
  font-size: 1.075rem;
  line-height: 1.9;
  margin-top: 3.25rem;
}

.article-content p {
  margin-bottom: 1.55rem;
}

.article-content h2 {
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.22;
  margin-top: 3.4rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.8rem;
}

.article-content h3 {
  font-size: clamp(1.25rem, 1.65vw, 1.52rem);
  line-height: 1.28;
  margin-top: 2.45rem;
  margin-bottom: 0.95rem;
}

.article-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.article-content h2 + p,
.article-content h3 + p,
.article-content h4 + p {
  margin-top: 0;
}

.article-content ul,
.article-content ol {
  gap: 0.78rem;
  margin: 1.35rem 0 1.75rem;
  padding-left: 1.35rem;
}

.article-content li {
  padding-left: 0.15rem;
}

.article-content li > p {
  margin-bottom: 0.65rem;
}

.article-content blockquote,
.article-content pre,
.article-content table,
.article-content img {
  margin-bottom: 1.9rem;
  margin-top: 1.9rem;
}

@media (max-width: 1023px) {
  .article-page .article-title {
    font-size: clamp(2.15rem, 5.4vw, 3.15rem);
    max-width: min(100%, 700px);
  }

  .article-content {
    max-width: 68ch;
  }
}

@media (max-width: 640px) {
  .article-page .article-title {
    font-size: clamp(1.95rem, 8.5vw, 2.6rem);
    line-height: 1.1;
    max-width: 100%;
  }

  .article-content {
    font-size: 1rem;
    line-height: 1.82;
    margin-top: 2.5rem;
    max-width: none;
  }

  .article-content p {
    margin-bottom: 1.35rem;
  }

  .article-content h2 {
    margin-top: 2.75rem;
  }

  .article-content h3 {
    margin-top: 2.1rem;
  }
}
