/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@300;400;500;700&family=ZCOOL+XiaoWei&display=swap');

/* ===== CSS Variables ===== */
:root {
  --bg: #0a0c0f;
  --bg-surface: #0e1117;
  --bg-raised: #141820;
  --bg-card: #111620;
  --bg-card-hover: #161c2a;
  --text: #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --accent: #f5a623;
  --accent-dim: rgba(245, 166, 35, 0.12);
  --accent-glow: rgba(245, 166, 35, 0.35);
  --teal: #00d9b4;
  --teal-dim: rgba(0, 217, 180, 0.1);
  --red: #ff4d4d;
  --red-dim: rgba(255, 77, 77, 0.1);
  --blue: #4d9fff;
  --blue-dim: rgba(77, 159, 255, 0.1);
  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.1);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.1);
  --pink: #f472b6;
  --pink-dim: rgba(244, 114, 182, 0.1);
  --orange: #fb923c;
  --orange-dim: rgba(251, 146, 60, 0.1);
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(245, 166, 35, 0.4);
  --radius: 6px;
  --radius-sm: 4px;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-body: 'ZCOOL XiaoWei', 'Noto Serif SC', Georgia, serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
}

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

/* ===== Noise & Grid Background ===== */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Grid lines */
.bg-decoration::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 166, 35, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 166, 35, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 70%);
}

/* Ambient glow orbs */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.bg-blob-1 {
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(245, 166, 35, 0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation: drift1 25s ease-in-out infinite;
}

.bg-blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(0, 217, 180, 0.06) 0%, transparent 70%);
  bottom: 10%;
  left: -80px;
  animation: drift2 30s ease-in-out infinite;
}

.bg-blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(77, 159, 255, 0.05) 0%, transparent 70%);
  top: 40%;
  right: 15%;
  animation: drift1 20s ease-in-out infinite reverse;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(40px, -30px); }
  66% { transform: translate(-20px, 25px); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(-30px, -40px); }
  70% { transform: translate(20px, 15px); }
}

/* ===== Header ===== */
.site-header {
  position: relative;
  z-index: 1;
  padding: 72px 32px 64px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* Scanline effect */
.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  opacity: 0.6;
}

.header-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

/* Eyebrow label */
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  padding: 6px 14px;
  border-radius: 2px;
  background: var(--accent-dim);
  animation: fadeInDown 0.5s ease both;
}

.header-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-header h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400; /* Bebas Neue only has one weight */
  line-height: 0.95;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s 0.1s ease both;
  text-transform: uppercase;
}

/* Highlight "dev-page" */
.site-header h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.site-header h1 em::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 2px;
}

.site-header .subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  animation: fadeInUp 0.6s 0.2s ease both;
}

.site-header .subtitle code {
  color: var(--teal);
  background: var(--teal-dim);
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
}

/* Decorative line */
.header-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-bottom: 28px;
  border-radius: 2px;
  animation: fadeInUp 0.6s 0.15s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Main container ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}

/* ===== Section ===== */
.section {
  margin-bottom: 64px;
  opacity: 0;
  animation: slideIn 0.5s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.25s; }
.section:nth-child(2) { animation-delay: 0.38s; }
.section:nth-child(3) { animation-delay: 0.51s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* Numbered prefix + accent bar */
.section-icon-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Section number badge */
.section-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  padding: 2px 6px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.section-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Divider line after header */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--border-accent), transparent 50%);
  margin-bottom: 20px;
  opacity: 0.5;
}

/* ===== Card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

/* ===== Card ===== */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

/* Glowing left accent bar */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 0 0 0 0;
}

/* Subtle inner highlight on hover */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,166,35,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(245, 166, 35, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 166, 35, 0.1);
  text-decoration: none;
  color: inherit;
}

.card:hover::before {
  opacity: 1;
}

.card:hover::after {
  opacity: 1;
}

/* ===== Card inner ===== */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.card:hover .card-title {
  color: var(--accent);
}

.card-title .arrow {
  margin-left: auto;
  font-size: 14px;
  color: var(--accent);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.2s, transform 0.2s;
}

.card:hover .card-title .arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 48px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-left: 48px;
}

/* Tags: monospace, compact, colored border style */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
}

.tag-blue   { background: var(--blue-dim);   color: var(--blue);   border-color: rgba(77, 159, 255, 0.3); }
.tag-purple { background: var(--violet-dim); color: var(--violet); border-color: rgba(167, 139, 250, 0.3); }
.tag-green  { background: var(--green-dim);  color: var(--green);  border-color: rgba(74, 222, 128, 0.3); }
.tag-orange { background: var(--orange-dim); color: var(--orange); border-color: rgba(251, 146, 60, 0.3); }
.tag-cyan   { background: var(--teal-dim);   color: var(--teal);   border-color: rgba(0, 217, 180, 0.3); }
.tag-pink   { background: var(--pink-dim);   color: var(--pink);   border-color: rgba(244, 114, 182, 0.3); }
.tag-red    { background: var(--red-dim);    color: var(--red);    border-color: rgba(255, 77, 77, 0.3); }

.card-path {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 300;
  color: var(--text-muted);
  padding-left: 48px;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.card:hover .card-path {
  color: var(--text-secondary);
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-icon {
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-link:hover .footer-icon {
  opacity: 1;
}

.footer-separator {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header {
    padding: 48px 20px 48px;
  }

  .site-header h1 {
    font-size: 36px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 40px 20px 60px;
  }

  .card-desc,
  .card-tags,
  .card-path {
    padding-left: 0;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .site-header h1 {
    font-size: 28px;
  }

  .header-badge {
    font-size: 10px;
    padding: 5px 10px;
  }

  .card {
    padding: 16px;
  }

  .card-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* ===== Print ===== */
@media print {
  .bg-decoration { display: none; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #333; }
  .card:hover { transform: none; }
}
