:root {
  --bg: #030712;
  --surface: #0f172a;
  --accent: #00f0ff;
  --accent-dim: rgba(0, 240, 255, 0.15);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --terminal-green: #22c55e;
  --glitch-speed: 3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Hacker Scanline Effect */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  z-index: 9999;
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
}

/* Mono Font Utility */
.mono {
  font-family: 'Fira Code', monospace;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 10%;
  position: relative;
}

.hero-content {
  z-index: 10;
  max-width: 1000px;
}

.sys-status {
  color: var(--terminal-green);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--terminal-green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }

  70% {
    transform: scale(1.2);
    opacity: 0.5;
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

h1 {
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 1;
  margin-bottom: 1.5rem;
  font-weight: 900;
  background: linear-gradient(to right, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.type-wrap {
  font-family: 'Fira Code';
  color: var(--accent);
  font-size: 1.5rem;
}

/* Grid Layout for Portfolio */
.grid-container {
  padding: 100px 5%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  position: relative;
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 10px 30px -10px var(--accent-dim);
}

.card::before {
  content: "SECURED_MODULE";
  position: absolute;
  top: 5px;
  right: 10px;
  font-family: 'Fira Code';
  font-size: 0.6rem;
  color: var(--accent-dim);
}

.card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-img img {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Cyber Buttons */
.btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.4rem 0.75rem;
  font-family: 'Fira Code';
  font-size: 0.75rem;
  text-decoration: none;
  display: inline-block;
  transition: 0.3s;
  position: relative;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px var(--accent);
}

/* Matrix Background */
#canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0.15;
}

/* 深入阅读按钮容器 */
.hero-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  /* 标题顶部留出间距 */
  .hero {
    padding-top: 15vh;
    align-items: flex-start;
  }

  /* 华为浏览器兼容：用 color 兜底避免黑色渐变 */
  h1 {
    color: #fff;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* 副标题字号缩小2号（约1.1rem ≈ 17.6px） */
  .type-wrap {
    font-size: 1.1rem;
  }

  /* 移动端隐藏"深入阅读"按钮 */
  .hero-actions {
    display: none;
  }
}
