:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --surface: #141420;
  --surface-2: #0f0f1a;
  --text: #e5f0ff;
  --muted: #a0a0b8;
  --cyan: #00e5ff;
  --cyan-2: #7b61ff;
  --pink: #ff61dc;
  --line: rgba(255, 255, 255, .06);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-2: #eaf6fb;
  --text: #102033;
  --muted: #526278;
  --line: rgba(15, 23, 42, .14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-loading {
  overflow: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #67e8f9; }
.text-secondary { color: var(--muted) !important; }
.form-control, .form-select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background: var(--surface-2);
  border-color: var(--cyan);
  box-shadow: 0 0 0 .2rem rgba(34, 211, 238, .15);
  color: var(--text);
}
.form-control::placeholder { color: var(--muted); }
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  border: 0;
  color: #04111f;
  font-weight: 700;
}
.btn-cyan:hover { color: #04111f; transform: translateY(-1px); }

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(0, 229, 255, .16), transparent 32rem),
    #03070d;
  transition: opacity .55s ease, visibility .55s ease;
}
.site-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-shader {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 120deg, rgba(0, 229, 255, .03), rgba(124, 58, 237, .22), rgba(42, 125, 255, .12), rgba(0, 229, 255, .03)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(0, 229, 255, .08) 19px 20px);
  filter: blur(18px);
  animation: shaderSweep 4s linear infinite;
}
.loader-content {
  position: relative;
  width: min(420px, calc(100vw - 3rem));
  text-align: center;
}
.loader-mark {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin-bottom: 1.4rem;
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 800;
  line-height: .9;
}
.loader-mark span {
  display: inline-block;
  text-shadow: 0 0 28px rgba(0, 229, 255, .55);
}
.loader-content p {
  color: var(--muted);
  margin-bottom: 1rem;
}
.loader-bar {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}
.loader-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #2a7dff, #7c3cff);
  box-shadow: 0 0 24px rgba(0, 229, 255, .8);
}
.loader-percent {
  display: block;
  margin-top: 1rem;
  font-size: 1.35rem;
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #7c3cff);
  box-shadow: 0 0 18px rgba(34, 211, 238, .8);
}
.cursor,
.mouse-trail {
  display: none;
}

@keyframes shaderSweep {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.08); }
}

@keyframes caretPulse {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.site-nav, .admin-nav {
  background: rgba(10, 10, 15, .74);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 70px rgba(0, 0, 0, .18);
  backdrop-filter: blur(18px);
}
[data-theme="light"] .site-nav,
[data-theme="light"] .admin-nav { background: rgba(255, 255, 255, .9); }
.navbar-brand, .nav-link, .navbar-text { color: var(--text) !important; }
.nav-link:hover { color: var(--cyan) !important; }
.site-nav .nav-link {
  position: relative;
}
.site-nav .nav-link::after {
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: .18rem;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--cyan), var(--cyan-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .24s cubic-bezier(.19, 1, .22, 1);
}
.site-nav .nav-link:hover::after {
  transform: scaleX(1);
}
.language-switch {
  display: inline-flex;
  gap: .25rem;
  padding: .18rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}
.language-switch button {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: .32rem .58rem;
  font-size: .76rem;
  font-weight: 800;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.language-switch button.active {
  color: #041014;
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(34, 211, 238, .34);
}

.hero-section {
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 8rem 0 5rem;
  background:
    radial-gradient(circle at 18% 22%, rgba(34, 211, 238, .24), transparent 30rem),
    radial-gradient(circle at 80% 18%, rgba(124, 58, 237, .2), transparent 28rem),
    linear-gradient(135deg, rgba(8, 145, 178, .18), transparent 45%),
    var(--bg);
  isolation: isolate;
}
.hero-section .container {
  position: relative;
  z-index: 2;
}
.lottie-core {
  position: absolute;
  top: clamp(5rem, 11vw, 8rem);
  right: clamp(1rem, 7vw, 8rem);
  width: clamp(120px, 16vw, 220px);
  height: clamp(120px, 16vw, 220px);
  opacity: .5;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: drop-shadow(0 0 28px rgba(34, 211, 238, .38));
}
.hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: .92;
}
.hero-glow {
  position: absolute;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .24;
  pointer-events: none;
}
.hero-glow-one {
  right: 8%;
  top: 18%;
  background: #00e5ff;
}
.hero-glow-two {
  right: 22%;
  bottom: -18%;
  background: #7c3aed;
}
.hero-section h1 {
  max-width: 920px;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: .95;
  letter-spacing: 0;
  margin-bottom: 1.5rem;
}
.hero-section .lead { max-width: 760px; color: var(--muted); font-size: 1.35rem; }
.typewriter-line {
  min-height: 2.4rem;
  margin: 0 0 1rem;
  color: var(--cyan);
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  font-weight: 800;
}
.typewriter-caret {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  margin-left: .35rem;
  vertical-align: -.2em;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 229, 255, .75);
  animation: caretPulse .86s steps(2, start) infinite;
}
.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.5rem 0 2rem;
}
.hero-roles span {
  border: 1px solid rgba(34, 211, 238, .35);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(34, 211, 238, .08);
  padding: .5rem .85rem;
  font-weight: 700;
}
.eyebrow {
  color: var(--cyan);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .82rem;
}
.section { padding: 5.5rem 0; }
.section-muted { background: rgba(13, 27, 46, .58); }
[data-theme="light"] .section-muted { background: #edf7fb; }
.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-heading span {
  color: var(--cyan);
  font-weight: 800;
}
.section-heading h2 { margin: 0; font-size: 2.1rem; }
.wide-text {
  max-width: 900px;
  color: var(--muted);
  font-size: 1.14rem;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-top: 2rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .85rem;
  margin-top: 2rem;
}
.profile-grid div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}
.profile-grid span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: .35rem;
}
.profile-grid strong { color: var(--text); }
.interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.interest-grid span,
.skill-grid span, .tags span {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  padding: .7rem .9rem;
}

.portfolio-card, .panel, .metric, .login-panel, .github-band, .github-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015)), var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .24);
  backdrop-filter: blur(14px);
}
.portfolio-card {
  height: 100%;
  overflow: hidden;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}
.portfolio-card:hover {
  border-color: rgba(34, 211, 238, .42);
  box-shadow: 0 28px 70px rgba(34, 211, 238, .12);
  transform: translateY(-6px);
}

.section,
.portfolio-card,
.metric,
.timeline div,
.github-band {
  will-change: transform, opacity, filter;
}
.reveal-ready {
  opacity: 0;
  transform: translateY(34px) scale(.985);
  filter: blur(12px);
}
.reveal-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: opacity .85s cubic-bezier(.19, 1, .22, 1), transform .85s cubic-bezier(.19, 1, .22, 1), filter .85s cubic-bezier(.19, 1, .22, 1);
}
.portfolio-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-2);
}
.portfolio-card > div, .certificate-card { padding: 1.3rem; }
.portfolio-card h3 { font-size: 1.25rem; margin-bottom: .75rem; }
.portfolio-card p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span { font-size: .82rem; padding: .4rem .6rem; }

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.timeline div {
  border-left: 3px solid var(--cyan);
  background: var(--surface);
  padding: 1.2rem;
  border-radius: 0 8px 8px 0;
}
.timeline p { color: var(--muted); margin-bottom: 0; }
.github-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
}
.github-band span { color: var(--cyan); font-weight: 800; }
.github-band p { color: var(--muted); margin: .6rem 0 0; }
.github-live-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.4fr) minmax(240px, .8fr);
  gap: 1rem;
  margin-top: 1rem;
}
.github-panel {
  min-height: 100%;
  padding: 1.25rem;
}
.github-panel h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}
.github-status {
  display: inline-block;
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: .6rem;
}
.github-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.github-stats span,
.repo-card span {
  color: var(--muted);
  font-size: .86rem;
}
.github-repos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .75rem;
}
.repo-card {
  display: block;
  min-height: 126px;
  padding: .95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.repo-card:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, .46);
  background: rgba(34, 211, 238, .075);
  transform: translateY(-3px);
}
.repo-card p {
  color: var(--muted);
  margin: .45rem 0 .7rem;
}
.language-bars {
  display: grid;
  gap: .8rem;
}
.language-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  overflow: hidden;
  padding-bottom: .55rem;
}
.language-bar span,
.language-bar strong {
  position: relative;
  z-index: 1;
  font-size: .88rem;
}
.language-bar i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-2));
  box-shadow: 0 0 18px rgba(34, 211, 238, .5);
}
.skeleton-card {
  min-height: 52px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(34,211,238,.1), rgba(255,255,255,.04));
  background-size: 240% 100%;
  animation: skeletonMove 1.35s ease-in-out infinite;
}
@keyframes skeletonMove {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
.contact-form { max-width: 820px; }
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0;
  color: var(--muted);
}

.admin-body { background: var(--bg); }
.panel { padding: 1.25rem; }
.panel h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.metric { padding: 1rem; }
.metric span { display: block; color: var(--muted); font-size: .86rem; }
.metric strong { display: block; font-size: 2rem; }
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: .85rem 0;
}
.list-row span { color: var(--muted); }
.table { --bs-table-bg: transparent; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at 50% 0, rgba(34, 211, 238, .2), transparent 28rem), var(--bg);
}
.login-panel {
  width: min(100%, 420px);
  padding: 2rem;
}
.login-panel h1 { font-size: 1.8rem; }
.login-panel p { color: var(--muted); }
.brand-dot {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .hero-section { min-height: auto; padding-top: 7rem; }
  .hero-scene { opacity: .5; }
  .github-band, .list-row { display: block; }
  .github-live-grid { grid-template-columns: 1fr; }
  .language-switch { margin: .65rem 0; }
  .lottie-core { opacity: .32; right: 1rem; top: 5.4rem; }
  .section { padding: 4rem 0; }
}

@media (hover: hover) and (pointer: fine) {
  body:not(.admin-body) {
    cursor: none;
  }
  body:not(.admin-body) a,
  body:not(.admin-body) button,
  body:not(.admin-body) input,
  body:not(.admin-body) textarea {
    cursor: none;
  }
  .cursor {
    position: fixed;
    z-index: 10000;
    display: block;
    pointer-events: none;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
  }
  .cursor-dot {
    width: 8px;
    height: 8px;
    background: #fff;
  }
  .cursor-ring {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .78);
    transition: width .28s cubic-bezier(.19, 1, .22, 1), height .28s cubic-bezier(.19, 1, .22, 1), border-color .28s;
  }
  .cursor-ring.is-active {
    width: 72px;
    height: 72px;
    border-color: var(--cyan);
  }
  .mouse-trail {
    position: fixed;
    z-index: 9999;
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
    border-radius: 999px;
    opacity: .38;
    background: radial-gradient(circle, rgba(0, 229, 255, .85), transparent 68%);
    filter: blur(6px);
    transform: translate(-50%, -50%);
  }
  .magnetic {
    transition: transform .22s cubic-bezier(.19, 1, .22, 1), box-shadow .22s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-shader,
  .hero-scene,
  .mouse-trail,
  .cursor {
    animation: none !important;
  }
  .reveal-ready,
  .reveal-in,
  .magnetic,
  .portfolio-card {
    transition: none !important;
  }
}
