:root {
  --bg: #ffffff;
  --ink: #0b1220;
  --muted: rgba(11, 18, 32, 0.58);
  --line: rgba(11, 18, 32, 0.08);
  --card: rgba(255, 255, 255, 0.45);
  --card-border: rgba(255, 255, 255, 0.8);
  --shadow-xl: 0 40px 100px rgba(13, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(13, 24, 40, 0.06);
  --shadow-tight: 0 12px 32px rgba(13, 24, 40, 0.04);
  --radius-xxl: 44px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --mx: 0;
  --my: 0;
  --sat: 1.25;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(88, 223, 194, 0.22);
}

/* Background & Blobs */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: #ffffff;
}

.blob {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(60px) saturate(var(--sat));
  opacity: 0.8;
  will-change: transform, opacity;
  mix-blend-mode: multiply;
}

/* More varied blobs for "small color blocks" - STRICTLY Blue, Yellow, Red */
.blob.b1 {
  background: #4facfe; /* Blue */
  left: 10%;
  top: 10%;
  animation: flow1 24s ease-in-out infinite;
}
.blob.b2 {
  background: #ff4e50; /* Red */
  right: 15%;
  top: 5%;
  width: 320px;
  height: 320px;
  animation: flow2 28s ease-in-out infinite;
}
.blob.b3 {
  background: #f9d423; /* Yellow */
  left: 20%;
  bottom: 15%;
  width: 260px;
  height: 260px;
  animation: flow3 32s ease-in-out infinite;
}
.blob.b4 {
  background: #4facfe; /* Blue */
  right: 10%;
  bottom: 20%;
  width: 300px;
  height: 300px;
  animation: flow4 26s ease-in-out infinite;
}
.blob.b5 {
  background: #ff4e50; /* Red */
  left: 45%;
  top: 40%;
  width: 240px;
  height: 240px;
  animation: flow5 30s ease-in-out infinite;
}
.blob.b6 {
  background: #f9d423; /* Yellow */
  right: 40%;
  bottom: 10%;
  width: 220px;
  height: 220px;
  animation: flow6 34s ease-in-out infinite;
}

/* Complex Flow Animations */
@keyframes flow1 {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 40px) scale(1.1); }
  66% { transform: translate(-20px, 80px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes flow2 {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, 60px) scale(0.9); }
  66% { transform: translate(40px, -20px) scale(1.1); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes flow3 {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(60px, -40px) rotate(20deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes flow4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -50px) scale(1.15); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes flow5 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  50% { transform: translate(40px, 40px) scale(0.8); opacity: 0.8; }
  100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
}
@keyframes flow6 {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
  100% { transform: translate(0, 0); }
}

/* Grain Overlay - Subtle */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  z-index: 0;
}

/* Layout */
.wrap {
  position: relative;
  min-height: 100%;
  padding: max(24px, env(safe-area-inset-top)) 24px
    max(100px, env(safe-area-inset-bottom));
  z-index: 1;
}

.wrap.center {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.container {
  width: min(1000px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Ultra Glass Card Style */
.card, .miniCard, .proj, .dock, .pill, .brand, .btn {
  background: var(--card);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Inner highlight for 3D feel */
.card::after, .miniCard::after, .proj::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9),
              inset 0 -1px 1px rgba(0, 0, 0, 0.02);
  pointer-events: none;
  z-index: 2;
}

.card {
  border-radius: var(--radius-xxl);
  box-shadow: var(--shadow-xl);
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cardInner {
  padding: 40px;
  position: relative;
  z-index: 1;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.brand {
  padding: 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a0c4ff, #ffc6ff);
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.logo-slot {
  display: flex;
  justify-content: center;
  margin: 6px 0 18px;
  width: 100%;
}

.logo-slot-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-tight);
  width: min(920px, 100%);
}

.logo-slot-img {
  display: block;
  width: min(620px, 100%);
  height: auto;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}

.hero.hero--noMedia {
  grid-template-columns: 1fr;
  justify-items: start;
}

@media (max-width: 680px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .hero.hero--noMedia {
    justify-items: center;
  }
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 36px;
  background: linear-gradient(135deg, #ffffff, #f0f4f8);
  box-shadow: var(--shadow-tight);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  color: #a0c4ff;
  position: relative;
}

.avatar::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 38px;
  padding: 2px;
  background: linear-gradient(135deg, #a0c4ff, #ffadd2);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
}

h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, #0b1220 0%, #4a5568 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo {
  width: 140px;
  height: auto;
  display: block;
  border-radius: 24px; /* Rounded rectangle */
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.sub {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 540px;
  text-align: justify;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: inherit;
}

.btn {
  border: none;
  padding: 14px 24px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}

.btn.primary {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 20px rgba(160, 196, 255, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(160, 196, 255, 0.35);
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.metaGrid {
  display: grid;
  gap: 24px;
}

.miniCard {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffadd2;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  transition: transform 0.2s;
}

.chip:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.8);
}

.big {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.proj {
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.proj:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.proj h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.proj p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.proj .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  display: grid;
  place-items: center;
  transition: transform 0.2s;
}

.proj:hover .arrow {
  transform: translateX(4px);
  background: #fff;
}

/* Dock */
.dockWrap {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}

.dock {
  pointer-events: auto;
  padding: 12px;
  border-radius: 32px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-xl);
  background: rgba(255, 255, 255, 0.65);
}

.app {
  width: 52px;
  height: 52px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1);
  transform-origin: bottom center;
}

.app:hover {
  background: #fff;
}

.app svg {
  width: 24px;
  height: 24px;
  opacity: 0.7;
}

/* 404 Page Specifics */
.code {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #a0c4ff, #ffadd2, #fdffb6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
  filter: drop-shadow(0 10px 30px rgba(160, 196, 255, 0.4));
}

.inner-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 40px;
}

.inner-404 h1 {
  font-size: 32px;
  margin-bottom: 16px;
}

.inner-404 p {
  font-size: 18px;
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto 32px;
}

/* Animation Utilities */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.on {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none !important; }
  .card, .proj, .app, .chip { transition: none !important; }
}

/* Page Header & Navigation */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 32px;
}

.logo-small {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(160, 196, 255, 0.2));
  transition: transform 0.3s ease;
}

.logo-small:hover {
  transform: scale(1.05);
}

.back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  transition: all 0.2s ease;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  transform: translateX(-2px);
}

/* Footer ICP */
.site-footer {
  text-align: center;
  padding: 18px 0 28px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.95;
}

.icp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.3s;
}

.icp:hover {
  opacity: 1;
  color: var(--ink);
}

/* Nav Grid on Index */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  text-align: center;
  transition: all 0.3s ease;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-4px);
  box-shadow: var(--shadow-tight);
}

.nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  color: #333333;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
