/* =========================================================
   base.css
   变量 · 重置 · 排版 · 背景层 · 玻璃通用类
   ========================================================= */

/* =========================================================
   Tenkawa Mika — Personal Site
   Glassmorphism · 单文件样式
   ========================================================= */

/* ---------- 变量 ---------- */
:root {
  --bg:            #08090f;
  --bg-2:          #0e0b18;

  --text:          #f4f5fa;
  --text-2:        rgba(238, 240, 250, 0.72);
  --text-3:        rgba(238, 240, 250, 0.48);

  --violet:        #a78bfa;
  --blue:          #60a5fa;
  --cyan:          #22d3ee;

  /* 玻璃 */
  --glass-bg:      rgba(255, 255, 255, 0.06);
  --glass-bg-2:    rgba(255, 255, 255, 0.095);
  --glass-border:  rgba(255, 255, 255, 0.16);
  --glass-blur:    blur(26px) saturate(135%) brightness(1.08);
  --glass-shadow:  0 8px 32px rgba(0, 0, 0, 0.38),
                   inset 0 1px 0 rgba(255, 255, 255, 0.16);

  --radius-lg:     32px;

  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --maxw:          1120px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
          Consolas, monospace;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* hidden 属性优先，避免被组件的 display 规则覆盖 */
[hidden] { display: none !important; }

/* 中文断行优化：避免行尾孤字 */
p, li, h1, h2, h3 { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

::selection {
  background: rgba(167, 139, 250, 0.35);
  color: #fff;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; }

/* =========================================================
   背景层
   ========================================================= */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(124, 58, 237, 0.20), transparent 60%),
    radial-gradient(900px 600px at 90% 5%,   rgba(14, 165, 233, 0.16), transparent 60%),
    radial-gradient(1000px 800px at 50% 110%, rgba(167, 139, 250, 0.12), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.blob-1 {
  width: 46vw; height: 46vw;
  min-width: 320px; min-height: 320px;
  top: -12vw; left: -8vw;
  background: radial-gradient(circle at 30% 30%, #7c3aed, #4338ca 55%, transparent 72%);
  animation: drift-1 26s var(--ease) infinite alternate;
}

.blob-2 {
  width: 40vw; height: 40vw;
  min-width: 280px; min-height: 280px;
  top: 22vh; right: -12vw;
  background: radial-gradient(circle at 60% 40%, #0891b2, #1d4ed8 55%, transparent 72%);
  animation: drift-2 32s var(--ease) infinite alternate;
}

.blob-3 {
  width: 36vw; height: 36vw;
  min-width: 260px; min-height: 260px;
  bottom: -14vw; left: 32vw;
  background: radial-gradient(circle at 50% 50%, #db2777, #7c3aed 55%, transparent 75%);
  opacity: 0.34;
  animation: drift-3 38s var(--ease) infinite alternate;
}

@keyframes drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 8vh, 0) scale(1.14); }
}
@keyframes drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(-7vw, 10vh, 0) scale(0.92); }
}
@keyframes drift-3 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(8vw, -9vh, 0) scale(1.18); }
}

/* 颗粒噪点，让玻璃更有质感 */
.bg-grain {
  position: absolute;
  inset: -50%;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* 鼠标跟随光晕 */
.cursor-glow {
  position: absolute;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.14), transparent 62%);
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}
body.has-pointer .cursor-glow { opacity: 1; }

/* =========================================================
   玻璃通用类
   ========================================================= */
.glass {
  background-color: var(--glass-bg);
  background-image: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.02) 48%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

