:root{
  --bg: #0b1020;
  --bg2: #0a0f1a;
  --text: #e9eefc;
  --muted: rgba(233,238,252,.72);
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.10);
  --border: rgba(255,255,255,.14);
  --shadow: 0 18px 50px rgba(0,0,0,.40);
  --accent: #7c5cff;
  --accent2: #28d7ff;
  --good: #49f2a1;
  --warn: #ffd166;
  --danger: #ff5c7a;
}

[data-theme="light"]{
  --bg: #f7f8ff;
  --bg2: #ffffff;
  --text: #111427;
  --muted: rgba(17,20,39,.70);
  --card: rgba(20,30,60,.05);
  --card2: rgba(20,30,60,.08);
  --border: rgba(20,30,60,.14);
  --shadow: 0 18px 50px rgba(30,35,60,.18);
  --accent: #5b4bff;
  --accent2: #00a8cc;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 900px at 20% 10%, rgba(124,92,255,.18), transparent 60%),
              radial-gradient(1000px 700px at 90% 30%, rgba(40,215,255,.12), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  overflow-x: hidden;
}

/* Background layer */
.bg{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.grid{
  position:absolute;
  inset:-2px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .25;
  mask-image: radial-gradient(500px 300px at 20% 20%, black, transparent 70%);
}
.blob{
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .55;
  transform: translate3d(0,0,0);
  animation: floaty 12s ease-in-out infinite;
}
.blob--1{
  left: -140px;
  top: -160px;
  background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.85), rgba(124,92,255,.15));
}
.blob--2{
  right: -220px;
  top: 100px;
  background: radial-gradient(circle at 30% 30%, rgba(40,215,255,.8), rgba(40,215,255,.12));
  animation-duration: 15s;
}
.blob--3{
  left: 25%;
  bottom: -260px;
  background: radial-gradient(circle at 30% 30%, rgba(73,242,161,.55), rgba(73,242,161,.10));
  animation-duration: 18s;
}
@keyframes floaty{
  0%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(20px,-18px) scale(1.03); }
  100%{ transform: translate(0,0) scale(1); }
}

/* Top bar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  backdrop-filter: blur(12px);
  background: rgba(10, 12, 20, .42);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .topbar{
  background: rgba(255,255,255,.62);
}
.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .2px;
}
.brand__dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(45deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}
.nav{
  display: flex;
  gap: 14px;
}
.nav a{
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  transition: background .2s ease, color .2s ease;
}
.nav a:hover{
  color: var(--text);
  background: var(--card);
}

/* Layout */
.section{
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 18px;
}
.section--tight{
  padding-top: 56px;
  padding-bottom: 72px;
}
.section__head{
  margin-bottom: 22px;
  max-width: 760px;
}
h1, h2, h3{
  margin: 0 0 10px 0;
}
h1{
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2{
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: -0.01em;
}
h3{
  font-size: 18px;
}
p{ margin: 0 0 12px 0; }
.muted{ color: var(--muted); }
.lead{
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

/* Hero */
.hero{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 920px){
  .hero{ grid-template-columns: 1fr; }
}
.chip{
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(90deg, rgba(124,92,255,.18), rgba(40,215,255,.14));
  border: 1px solid var(--border);
}
.hero__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.hero__mini{
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.miniCard{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
}
.miniCard__icon{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(45deg, rgba(124,92,255,.22), rgba(40,215,255,.18));
  border: 1px solid var(--border);
}
.miniCard__title{
  font-weight: 800;
  font-size: 13px;
}
.miniCard__text{
  font-size: 13px;
  color: var(--muted);
}

/* Buttons + ripple */
.btn{
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
  user-select: none;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0px) scale(.99); }

.btn--primary{
  border-color: rgba(124,92,255,.45);
  background: linear-gradient(90deg, rgba(124,92,255,.85), rgba(40,215,255,.70));
  color: #070a12;
}
.btn--soft{
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
}
.btn--ghost{
  background: transparent;
}

.ripple{
  position: absolute;
  border-radius: 999px;
  transform: scale(0);
  animation: ripple 550ms ease-out;
  background: rgba(255,255,255,.35);
  pointer-events: none;
}
@keyframes ripple{
  to{
    transform: scale(4);
    opacity: 0;
  }
}

/* Glass preview card */
.hero__visual{
  display: flex;
  justify-content: center;
}
.glassCard{
  width: min(420px, 100%);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(-1.2deg);
  animation: hoverTilt 6.5s ease-in-out infinite;
}
@keyframes hoverTilt{
  0%{ transform: rotate(-1.2deg) translateY(0px); }
  50%{ transform: rotate(1.0deg) translateY(-6px); }
  100%{ transform: rotate(-1.2deg) translateY(0px); }
}
.glassCard__top{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.10);
}
.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.dot--red{ background: var(--danger); }
.dot--yellow{ background: var(--warn); }
.dot--green{ background: var(--good); }
.glassCard__title{
  margin-left: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.glassCard__body{
  padding: 16px;
}
.skeletonLine{
  height: 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: linear-gradient(90deg,
    rgba(255,255,255,.08),
    rgba(255,255,255,.18),
    rgba(255,255,255,.08)
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer{
  0%{ background-position: 0% 0; }
  100%{ background-position: 200% 0; }
}
.w-90{ width: 90%; }
.w-70{ width: 70%; }
.w-80{ width: 80%; }

.avatarRow{
  display:flex;
  gap: 10px;
  margin-top: 14px;
}
.avatar{
  width: 38px;
  height: 38px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 30%, rgba(124,92,255,.45), transparent 60%),
    radial-gradient(circle at 80% 40%, rgba(40,215,255,.35), transparent 55%),
    rgba(255,255,255,.06);
  animation: bob 2.8s ease-in-out infinite;
}
.avatar:nth-child(2){ animation-delay: .2s; }
.avatar:nth-child(3){ animation-delay: .4s; }
@keyframes bob{
  0%,100%{ transform: translateY(0px); }
  50%{ transform: translateY(-6px); }
}
.pulseBar{
  margin-top: 16px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  position: relative;
  overflow:hidden;
}
.pulseBar::after{
  content:"";
  position:absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(90deg, rgba(124,92,255,.0), rgba(124,92,255,.55), rgba(40,215,255,.0));
  animation: sweep 1.7s ease-in-out infinite;
}
@keyframes sweep{
  0%{ transform: translateX(-120%); }
  100%{ transform: translateX(260%); }
}

/* Cards */
.cards{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px){
  .cards{ grid-template-columns: 1fr; }
}
.card{
  padding: 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  transition: transform .15s ease, background .2s ease;
}
.card:hover{
  transform: translateY(-3px);
  background: var(--card2);
}
.link{
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.link:hover{ text-decoration: underline; }

/* Work grid */
.workGrid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px){
  .workGrid{ grid-template-columns: 1fr; }
}
.workItem{
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
}
.workThumb{
  height: 150px;
  background-size: 200% 200%;
  animation: gradientPan 9s ease-in-out infinite;
}
.workThumb--a{ background-image: linear-gradient(135deg, rgba(124,92,255,.8), rgba(40,215,255,.7), rgba(73,242,161,.55)); }
.workThumb--b{ background-image: linear-gradient(135deg, rgba(255,92,122,.75), rgba(255,209,102,.7), rgba(40,215,255,.55)); }
.workThumb--c{ background-image: linear-gradient(135deg, rgba(73,242,161,.65), rgba(124,92,255,.75), rgba(255,209,102,.55)); }
@keyframes gradientPan{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}
.workMeta{
  padding: 14px 16px 16px;
}
.workTitle{
  font-weight: 900;
  margin-bottom: 6px;
}

/* Stats */
.stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px){
  .stats{ grid-template-columns: 1fr; }
}
.stat{
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
}
.stat__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 800;
}
.bar{
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.bar__fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124,92,255,.9), rgba(40,215,255,.75));
  transition: width 900ms cubic-bezier(.2,.8,.2,1);
}

/* Contact */
.contact{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 920px){
  .contact{ grid-template-columns: 1fr; }
}
.form{
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
}
label{
  display:block;
  margin-bottom: 12px;
}
label span{
  display:block;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
}
input, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline: none;
}
input:focus, textarea:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}
.formNote{
  margin-top: 10px;
  color: var(--muted);
  min-height: 20px;
}

/* Footer */
.footer{
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 18px 40px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* Reveal animation */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}