/* ============================================
   gzyuans.com - Main Stylesheet
   Tesla-style Design System
   ============================================ */

/* ===== CSS Variables / Design Tokens ===== */
:root {
  /* Brand Colors */
  --color-bg: #0a0a0a;
  --color-bg-alt: #111111;
  --color-bg-elev: #161616;
  --color-bg-light: #f5f5f7;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.18);

  --color-text: #f5f5f7;
  --color-text-dim: #a1a1a6;
  --color-text-muted: #6e6e73;
  --color-text-dark: #1d1d1f;

  --color-accent: #00d4ff;
  --color-accent-2: #7b61ff;
  --color-accent-3: #00ffa3;
  --color-glow: rgba(0, 212, 255, 0.45);
  --color-warn: #ff5a3c;
  --color-success: #00ffa3;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00d4ff 0%, #7b61ff 100%);
  --grad-secondary: linear-gradient(135deg, #00ffa3 0%, #00d4ff 100%);
  --grad-dark: linear-gradient(180deg, #0a0a0a 0%, #161616 100%);
  --grad-glow: radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.15), transparent 60%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;
  --space-20: 12rem;

  /* Layout */
  --max-width: 1320px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 60px rgba(0, 212, 255, 0.25);

  /* Animation */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 0.2s;
  --duration: 0.4s;
  --duration-slow: 0.8s;
  --duration-slower: 1.2s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0, 212, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(123, 97, 255, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 6vw, 5.5rem); font-weight: 700; letter-spacing: -0.04em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.75rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  color: var(--color-text-dim);
  line-height: 1.7;
  font-size: 1rem;
}

.mono { font-family: var(--font-mono); }
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--color-accent);
  display: inline-block;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container { padding: 0 2.5rem; }
}

section {
  position: relative;
  padding: var(--space-16) 0;
}

@media (max-width: 768px) {
  section { padding: var(--space-12) 0; }
}

.section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto var(--space-12);
}

.section-header p {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--color-text-dim);
}

/* ===== Header / Navigation ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--duration) var(--ease);
}

.site-header.scrolled {
  background: rgba(10, 10, 10, 0.85);
  border-bottom-color: var(--color-border-strong);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
  transition: opacity var(--duration) var(--ease);
}

.nav-logo:hover { opacity: 0.85; }

.nav-logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--grad-primary);
  position: relative;
  overflow: hidden;
}

.nav-logo-mark::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: var(--color-bg);
}

.nav-logo-mark svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-dim);
  border-radius: 8px;
  position: relative;
  transition: all var(--duration) var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.3rem;
  height: 1px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) var(--ease);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--color-text);
  color: var(--color-text-dark);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
}

.nav-cta:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  position: relative;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  margin: 4px auto;
  transition: all var(--duration) var(--ease);
}

.nav-toggle.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-list {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 360px;
    flex-direction: column;
    align-items: stretch;
    padding: 6rem 2rem 2rem;
    background: var(--color-bg-alt);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform var(--duration-slow) var(--ease);
    gap: 0.5rem;
  }
  .nav-list.open { transform: translateX(0); }
  .nav-link { padding: 1rem; font-size: 1.125rem; }
  .nav-cta { margin-top: 1rem; justify-content: center; }
  .nav-toggle { display: block; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-text-dark);
}

.btn-primary:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-text);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  padding: 0.625rem 1rem;
}

.btn-ghost:hover { color: var(--color-accent); }

.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
  transition: gap var(--duration) var(--ease);
}

.btn-arrow:hover { gap: 0.875rem; color: var(--color-accent); }
.btn-arrow svg { transition: transform var(--duration) var(--ease); }
.btn-arrow:hover svg { transform: translateX(4px); }

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 600ms var(--ease) forwards;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(2.4); opacity: 0; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0 var(--space-6);
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 4rem;
}

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}

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

.footer-brand {
  max-width: 360px;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--color-text-dim);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: all var(--duration) var(--ease);
}

.footer-social a:hover {
  border-color: var(--color-accent);
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.footer-social svg { width: 18px; height: 18px; }

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-col a {
  color: var(--color-text-dim);
  font-size: 0.9375rem;
  transition: color var(--duration) var(--ease);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bottom-links a:hover { color: var(--color-text); }

/* ===== Cards ===== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-slow) var(--ease);
}

.card:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
  transform: translateY(-4px);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease);
  pointer-events: none;
}

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

.card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  transition: all var(--duration) var(--ease);
}

.card:hover .card-icon {
  border-color: var(--color-accent);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.3);
}

.card-icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 0.75rem; font-size: 1.375rem; }

.card p { font-size: 0.9375rem; }

/* ===== Grids ===== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Form Elements ===== */
.form-group { margin-bottom: 1.5rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1.125rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all var(--duration) var(--ease);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface-hover);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12);
}

.form-textarea { min-height: 140px; resize: vertical; }

.form-select { appearance: none; cursor: pointer; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.hidden { display: none; }

.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-dim);
  font-family: var(--font-mono);
}

.badge-accent {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--color-accent);
}

.badge-success {
  background: rgba(0, 255, 163, 0.1);
  border-color: rgba(0, 255, 163, 0.3);
  color: var(--color-success);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.4;
  z-index: -1;
}

/* ===== Page Transitions ===== */
.page-wrap {
  padding-top: 72px;
  min-height: 100vh;
  position: relative;
}

main { display: block; }
