/* ===== RiceVault — Custom Stylesheet ===== */

/* ---------- Custom Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Root Variables ---------- */
:root {
  --bg-deep: #0b0f14;
  --bg-card: rgba(15, 23, 42, 0.55);
  --primary: #3b82f6;
  --accent: #22d3ee;
  --success: #22c55e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --glow-primary: 0 0 20px rgba(59, 130, 246, 0.35);
  --glow-accent: 0 0 20px rgba(34, 211, 238, 0.35);
  --glow-success: 0 0 15px rgba(34, 197, 94, 0.3);
  --border-glass: 1px solid rgba(148, 163, 184, 0.12);
  --border-glow: 1px solid rgba(34, 211, 238, 0.4);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0b0f14;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ---------- Terminal Intro Overlay ---------- */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.5s ease-in-out;
}

#intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Hero Entrance Animation ---------- */
#hero .hero-content-wrapper {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1.2s ease-out 0.3s, transform 1.2s ease-out 0.3s;
}

#hero .hero-content-wrapper.hero-visible {
  opacity: 1;
  transform: scale(1);
}

.terminal-window {
  width: min(680px, 90vw);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(59, 130, 246, 0.08),
    0 25px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #eab308; }
.terminal-dot.green { background: #22c55e; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 28px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  min-height: 220px;
}

.terminal-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.terminal-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.terminal-prompt {
  color: var(--accent);
}

.terminal-command {
  color: var(--text);
}

.terminal-output {
  color: var(--text-muted);
}

.terminal-success {
  color: var(--success);
}

.terminal-cursor {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}

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

/* ---------- Hero Background Animation ---------- */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 600px 600px at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 20%, rgba(34, 211, 238, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  animation: hero-drift 20s ease-in-out infinite;
}

@keyframes hero-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -3%) rotate(1deg); }
  66% { transform: translate(-2%, 2%) rotate(-1deg); }
}

/* Grid pattern overlay */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 30%, transparent 70%);
}

/* Floating particles */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(1);
  }
}

/* ---------- Hero Title ---------- */
.hero-title {
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.25));
}

.hero-subtitle {
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* ---------- Glow Buttons ---------- */
.btn-glow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.btn-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  box-shadow: var(--glow-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary::before {
  opacity: 0.3;
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.8);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
}

.btn-secondary:hover::before {
  opacity: 0.7;
}

/* ---------- Glass Card (TRUE Glassmorphism) ---------- */
.glass-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.06) 0%, rgba(59, 130, 246, 0.04) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow:
    0 0 20px rgba(34, 211, 238, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

/* ---------- 3D Tilt Bento Cards ---------- */
.bento-card {
  transform-style: preserve-3d;
  perspective: 800px;
  will-change: transform;
}

.bento-card-inner {
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

.bento-card .card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.bento-card .card-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.bento-card:hover .card-icon {
  transform: translateZ(30px) scale(1.1);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.4));
}

.card-title {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Screenshot Frame ---------- */
.screenshot-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.4);
  box-shadow:
    0 0 80px rgba(59, 130, 246, 0.08),
    0 25px 60px rgba(0, 0, 0, 0.4);
}

.screenshot-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ---------- Demo Terminal ---------- */
#demo-terminal {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(34, 211, 238, 0.04) 0%, transparent 50%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- Code Block ---------- */
.code-block {
  position: relative;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.code-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.copy-btn.copied {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

pre.code-body {
  padding: 20px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 2;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
  word-wrap: normal;
  tab-size: 2;
}

pre.code-body code {
  display: block;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
  margin: 0;
}

.code-body .comment {
  color: #64748b;
}

.code-body .command {
  color: var(--accent);
}

.code-body .flag {
  color: var(--primary);
}

.code-body .path {
  color: var(--success);
}

.code-body .prompt {
  color: var(--text-muted);
  user-select: none;
}

/* ---------- Support Card (Glassmorphism) ---------- */
.support-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.support-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.support-card .support-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  color: #ff6b35;
  margin-bottom: 1.5rem;
}

.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff6b35, #ff4500);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.25);
}

.support-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(255, 107, 53, 0.4);
}

/* ---------- Footer ---------- */
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  position: relative;
}

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

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

/* ---------- Scroll Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 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; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---------- Section Badge ---------- */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  background: rgba(34, 211, 238, 0.06);
  color: var(--accent);
}

/* ---------- Section Title ---------- */
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

/* ---------- Divider Line ---------- */
.glow-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.3;
}

/* ---------- Utility: Neon Text Shadow ---------- */
.neon-text {
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.15);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .terminal-body {
    padding: 20px 16px;
    font-size: 0.8rem;
  }

  .bento-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-glow {
    justify-content: center;
  }
}
