/* Base Styles */
:root {
  --bg: #0a0b10;
  --fg: #e6e9ef;
  --muted: #9aa3b2;
  --brand: #7c4dff;
  --brand-2: #00e5ff;
  --accent: #ff7a18;
  --accent-2: #00ffb3;
  --danger: #ff5252;
  --ok: #69f0ae;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --blur: saturate(120%) blur(6px);
  --radius: 14px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  background: radial-gradient(1200px 1200px at 80% -10%, rgba(124,77,255,0.35), transparent 50%),
              radial-gradient(900px 900px at -10% 110%, rgba(0,229,255,0.25), transparent 50%),
              #0a0b10;
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  overflow-x: hidden;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px 56px;
}

/* Header */
.site-header {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15,16,25,0.5);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--fg);
  text-transform: uppercase;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 18px rgba(124,77,255,.8), 0 0 24px rgba(0,229,255,.5) inset;
}
.site-nav { display: flex; gap: 14px; align-items: center; }
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  font-size: 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,77,255,.25), rgba(0,229,255,.25));
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }

/* Page dots */
.page-dots {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 40;
}
.page-dots a {
  width: 10px; height: 10px; border-radius: 50%; display: block;
  background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,0.35);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.page-dots a.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); transform: scale(1.1); }
.page-dots a:hover { transform: scale(1.15); }

/* Footer */
.site-footer {
  position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 30; color: var(--muted); font-size: 12px;
  background: rgba(15,16,25,0.5); backdrop-filter: var(--blur);
  padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }

/* Footer records (avoid HTML encoding issues) */
.site-footer span { position: relative; font-size: 0; }
.site-footer span::before { font-size: 12px; color: var(--muted); }
.site-footer span:nth-child(1)::before { content: '\8D63ICP\5907 2023001432\53F7-2'; }
.site-footer span:nth-child(2)::before { content: '\00B7'; }
.site-footer span:nth-child(3)::before { content: '\7CA4\516C\7F51\5B89\5907 44195202000125\53F7'; }

/* Transition overlay */
.transition-overlay {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: conic-gradient(from 120deg at 50% 50%, rgba(124,77,255,.75), rgba(0,229,255,.75), rgba(255,122,24,.7), rgba(124,77,255,.75));
  transform: scaleX(0);
  transform-origin: left center; opacity: .9;
}
.transition-overlay.active { pointer-events: auto; animation: wipe-in .6s var(--ease) forwards; }
.transition-overlay.exit  { animation: wipe-out .6s var(--ease) forwards; }

@keyframes wipe-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wipe-out { from { transform: scaleX(1); transform-origin: right; } to { transform: scaleX(0); transform-origin: right; } }

/* Page enter animations */
/* Stable reveal: elements start hidden, show with class */
.reveal-up { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(4px); }
.reveal-up.show { animation: up .8s var(--ease) .15s forwards; }
[data-reveal] { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(4px); }
[data-reveal].show { animation: up .8s var(--ease) .15s forwards; }
@keyframes up { to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

.title {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.1; margin: 0 0 12px 0;
  letter-spacing: -.02em; font-weight: 800;
}
.subtitle { color: var(--muted); margin: 0 0 26px 0; }

/* Hero specific */
.hero {
  min-height: 100vh; display: grid; place-items: center; position: relative;
}
.hero-inner { text-align: center; padding-top: 40px; }
.hero .name {
  font-size: clamp(48px, 10vw, 120px);
  background: linear-gradient(135deg, #fff, #b8c1ff 30%, #00f0ff 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 40px rgba(124,77,255,.25);
}
.tagline { color: var(--muted); font-size: clamp(14px, 2.5vw, 18px); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 18px; transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-4px) rotate3d(.2,.6,0,6deg); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px 0; }
.muted { color: var(--muted); }

/* Carousel */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 90%; gap: 4%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.carousel > * { scroll-snap-align: center; }

/* Timeline */
.timeline { position: relative; margin: 30px 0; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.15); }
.tl-item { position: relative; width: 48%; padding: 12px 18px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.tl-item.left { margin-right: auto; transform: translateX(-2%); }
.tl-item.right { margin-left: auto; transform: translateX(2%); }

/* Skills bars */
.bar { width: 100%; height: 10px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; transition: width 1s var(--ease); }

/* Gooey */
.goo {
  position: relative; height: 380px; filter: url(#gooey);
}
.blob {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(124,77,255,.8));
  mix-blend-mode: screen; opacity: .9; animation: float 8s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0,0); }
  25% { transform: translate(40px,-30px); }
  50% { transform: translate(80px,10px); }
  75% { transform: translate(-20px,30px); }
}

/* Quotes typing */
.typing { font-size: clamp(20px, 3.5vw, 36px); min-height: 2.8em; border-right: 2px solid rgba(255,255,255,.6); white-space: pre; overflow: hidden; }

/* Orbs */
.orbs { position: relative; height: 380px; }
.orb { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(0,229,255,.9), rgba(124,77,255,.7)); filter: blur(6px); mix-blend-mode: screen; animation: drift 18s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px, -40px) scale(1.05); } }

/* Waves */
.waves {
  --c1: #5b7cfa; --c2: #00e5ff; --c3: #9b5de5; --c4: #00ffb3;
  background: radial-gradient(1000px 800px at 20% -10%, color-mix(in oklab, var(--c1) 40%, transparent), transparent),
              radial-gradient(800px 900px at 120% 120%, color-mix(in oklab, var(--c2) 45%, transparent), transparent),
              #0a0b10;
}
.waves::before {
  content:""; position: fixed; inset: -10%; z-index: -1;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c1));
  filter: blur(120px) saturate(120%) opacity(.45);
  animation: hue 16s linear infinite;
}
@keyframes hue { to { filter: blur(120px) saturate(120%) opacity(.45) hue-rotate(360deg); } }

/* Typing hero (home overlay) */
.typing-hero {
  margin-top: 8px;
  font-size: clamp(18px, 3.5vw, 28px);
  color: var(--fg);
  border-right: 2px solid rgba(255,255,255,.6);
  white-space: pre;
  overflow: hidden;
  text-shadow: 0 0 18px rgba(124,77,255,.25);
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .site-header { gap: 10px; }
  .page-dots { right: 10px; }
  .timeline::before { left: 12px; }
  .tl-item { width: auto; margin-left: 28px; margin-right: 0; }
  .tl-item.left, .tl-item.right { transform: none; }
}
