/* ===== Yuanhook — Style Sheet ===== */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #070b17;
  --bg-secondary: #0c1225;
  --bg-card: rgba(15, 23, 42, 0.7);
  --bg-glass: rgba(7, 11, 23, 0.8);
  --border-glass: rgba(148, 163, 184, 0.12);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-1: #3b82f6;
  --accent-2: #06b6d4;
  --accent-3: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #06b6d4, #a78bfa);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(59, 130, 246, 0.3); color: #fff; }
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ---- Skip Link (a11y) ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  padding: 8px 16px;
  background: #3b82f6;
  color: #fff;
  border-radius: 8px;
  z-index: 200;
  font-weight: 600;
  font-size: 14px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
}

/* ---- Page Background ---- */
.page {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(59, 130, 246, 0.12), transparent 50%),
    radial-gradient(ellipse at 85% 15%, rgba(6, 182, 212, 0.08), transparent 45%),
    radial-gradient(ellipse at 50% 80%, rgba(167, 139, 250, 0.06), transparent 50%),
    var(--bg-primary);
}

/* ---- Animated Grid Background ---- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 70%);
}
.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.06), transparent 60%);
  animation: gridPulse 8s ease-in-out infinite;
}
@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ---- Floating Orbs ---- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}
.orb-1 {
  width: 400px; height: 400px;
  background: rgba(59, 130, 246, 0.08);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 300px; height: 300px;
  background: rgba(6, 182, 212, 0.06);
  bottom: -50px; right: -50px;
  animation-delay: -7s;
}
.orb-3 {
  width: 250px; height: 250px;
  background: rgba(167, 139, 250, 0.05);
  top: 50%; left: 50%;
  animation-delay: -14s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 40px) scale(0.95); }
  75% { transform: translate(30px, 20px) scale(1.02); }
}

/* ---- Navbar (Sticky Glass) ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 8%;
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(7, 11, 23, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  line-height: 0;
}
.logo-svg {
  display: block;
  height: 36px;
  width: auto;
  transition: var(--transition);
}
.logo:hover .logo-svg {
  opacity: 0.85;
}
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
  transition: var(--transition);
}
.nav-links a:hover {
  color: var(--text-primary);
}
.nav-links a:hover::after {
  width: 100%;
}

/* ---- Sections ---- */
section {
  position: relative;
  z-index: 1;
  padding: 100px 8%;
}
.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* ---- Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---- Hero ---- */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 60px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px;
  animation: fadeInUp 0.6s ease-out;
}
.hero-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hero h1 {
  font-size: clamp(36px, 5.5vw, 68px);
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}
.hero h1 .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 6s ease-in-out infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero p {
  max-width: 600px;
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 36px;
  line-height: 1.8;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.45);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}
.btn-primary:hover::before { opacity: 1; }
.btn-secondary {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-primary);
  transform: translateY(-2px);
}

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

/* ---- Hero Visual Panel ---- */
.hero-visual {
  position: relative;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}
.hero-panel {
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  padding: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.hero-panel::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  right: -100px;
  top: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 65%);
  pointer-events: none;
}
.window-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.window-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  transition: var(--transition);
}
.window-dots span:nth-child(1) { background: #ef4444; }
.window-dots span:nth-child(2) { background: #eab308; }
.window-dots span:nth-child(3) { background: #22c55e; }

/* ---- Code Block ---- */
.code-block {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.1);
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.code-block .code-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
}
.code-block:hover .code-toolbar {
  opacity: 1;
}
.code-toolbar button {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}
.code-toolbar button:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}
.code-toolbar button.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
  color: #34d399;
}
.code-line { white-space: nowrap; }
.code-line .kw { color: #60a5fa; }
.code-line .str { color: #34d399; }
.code-line .fn { color: #c084fc; }
.code-line .cm { color: #64748b; font-style: italic; }

/* ---- Hero Stats ---- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}
.hero-stat {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.08);
  text-align: center;
  transition: var(--transition);
}
.hero-stat:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}
.hero-stat strong {
  display: block;
  font-size: 22px;
  color: #60a5fa;
  margin-bottom: 2px;
}
.hero-stat span {
  color: var(--text-muted);
  font-size: 12px;
}

/* ---- Section Headers ---- */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}
.section-header .tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  margin-bottom: 16px;
  letter-spacing: -1px;
  line-height: 1.2;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

/* ---- Gradient Divider ---- */
.section-divider {
  width: 100%;
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.15) 25%,
    rgba(6, 182, 212, 0.15) 50%,
    rgba(167, 139, 250, 0.15) 75%,
    transparent 100%
  );
  margin: 0;
  position: relative;
  z-index: 1;
}

/* ---- Cards Grid ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-8px);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
              0 0 40px rgba(59, 130, 246, 0.05);
}
.card:hover::before {
  opacity: 1;
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.1);
  transition: var(--transition);
}
.card:hover .card-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.25));
  transform: scale(1.05);
}
.card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
}
.card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* ---- About Section ---- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
}
.about-card {
  padding: 40px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg,
    rgba(59, 130, 246, 0.08),
    rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(148, 163, 184, 0.1);
  position: relative;
  overflow: hidden;
}
.about-card::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  right: -60px;
  bottom: -60px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06), transparent 65%);
  pointer-events: none;
}
.about-card h2 {
  font-size: 32px;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.about-card p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
}
.about-card p:last-child {
  margin-bottom: 0;
}
.about-list {
  display: grid;
  gap: 16px;
}
.about-item {
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
  cursor: default;
}
.about-item:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(59, 130, 246, 0.15);
  transform: translateX(4px);
}
.about-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 15px;
}
.about-item span {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* ---- CTA ---- */
.cta-section {
  padding: 0 8% 80px;
  position: relative;
  z-index: 1;
}
.cta-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.cta-box {
  padding: 60px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #1e40af, #0f766e);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(30, 64, 175, 0.25);
}
.cta-box::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 65%);
}
.cta-box::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  left: -80px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(255,255,255,0.04), transparent 65%);
}
.cta-box h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.cta-box p {
  color: #dbeafe;
  max-width: 600px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

/* ---- Footer ---- */
footer {
  position: relative;
  z-index: 1;
  padding: 28px 8%;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-glass);
  background: rgba(2, 6, 23, 0.5);
}
footer a {
  color: var(--text-secondary);
  transition: var(--transition);
}
footer a:hover {
  color: var(--text-primary);
}

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: var(--transition);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero h1 { font-size: clamp(32px, 6vw, 48px); }
  .hero-visual { max-width: 500px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  section { padding: 60px 6%; }
  .navbar { padding: 0 6%; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 13px; }
  .cards-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stat { padding: 12px; }
  .hero-stat strong { font-size: 18px; }
  .cta-box { padding: 36px 24px; }
  .cta-section { padding: 0 6% 60px; }
  .about-list { gap: 12px; }
  .about-card { padding: 28px; }
  .about-item { padding: 16px 18px; }
}
@media (max-width: 480px) {
  .nav-links a { font-size: 12px; }
  .nav-links { gap: 14px; }
  .hero h1 { font-size: 28px; letter-spacing: -0.5px; }
  .code-block { font-size: 12px; padding: 14px; overflow-x: auto; }
  .code-line { white-space: pre; }
}
