/* ==========================================================================
   frostdevcloudgrid - Common Styles (Tesla-inspired Tech Aesthetic)
   ========================================================================== */

:root {
  --color-bg: #000000;
  --color-bg-1: #0a0a0a;
  --color-bg-2: #111111;
  --color-bg-3: #161616;
  --color-surface: #1a1a1a;
  --color-surface-2: #222222;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.15);
  --color-text: #ffffff;
  --color-text-2: #b8b8b8;
  --color-text-3: #7a7a7a;
  --color-accent: #e82127;
  --color-accent-2: #ff3b3f;
  --color-accent-glow: rgba(232, 33, 39, 0.55);
  --color-cyan: #00d4ff;
  --color-blue: #3b82f6;
  --color-purple: #a855f7;
  --color-success: #10b981;
  --gradient-primary: linear-gradient(135deg, #e82127 0%, #ff3b3f 50%, #ff6b6b 100%);
  --gradient-tech: linear-gradient(135deg, #00d4ff 0%, #3b82f6 50%, #a855f7 100%);
  --gradient-dark: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
  --shadow-glow: 0 0 40px rgba(232, 33, 39, 0.35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 20px 60px rgba(232, 33, 39, 0.25);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1440px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  animation: gridShift 30s linear infinite;
}

@keyframes gridShift {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Radial accent */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 100%;
  background: radial-gradient(circle, rgba(232, 33, 39, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

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

a:hover { color: var(--color-accent-2); }

img { max-width: 100%; display: block; }

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

ul, ol { list-style: none; }

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-1); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-accent), #8b0000);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent-2); }

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.75rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

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

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

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

.section-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #b8b8b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-2);
  max-width: 720px;
  line-height: 1.7;
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

section {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

.section-header .eyebrow { justify-content: center; }
.section-header .eyebrow::after {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--color-accent);
}
.section-header .section-subtitle { margin: 0 auto; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s;
}

.btn:hover::before { left: 100%; }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(232, 33, 39, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232, 33, 39, 0.6);
  color: #fff;
}

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

.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}

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

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

.btn .arrow {
  transition: transform var(--transition-fast);
}

.btn:hover .arrow { transform: translateX(4px); }

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.25rem 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: all var(--transition-base);
}

.nav.scrolled {
  padding: 0.75rem 0;
  background: rgba(0, 0, 0, 0.9);
  border-bottom-color: var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
}

.nav-logo svg { width: 36px; height: 36px; }

.nav-logo-text { display: flex; flex-direction: column; line-height: 1; }
.nav-logo-text .small { font-size: 0.625rem; color: var(--color-text-3); letter-spacing: 0.2em; margin-top: 2px; font-family: var(--font-mono); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-2);
  position: relative;
  padding: 0.5rem 0;
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: all var(--transition-base);
  border-radius: 2px;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--color-bg-1);
  border-top: 1px solid var(--color-border);
  padding: 5rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

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

.footer-brand .nav-logo { margin-bottom: 1.5rem; }

.footer-brand p {
  color: var(--color-text-2);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

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

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-2);
  transition: all var(--transition-base);
}

.footer-social a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-2);
  transform: translateY(-3px);
  background: rgba(232, 33, 39, 0.1);
}

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

.footer-col ul li { margin-bottom: 0.75rem; }

.footer-col ul li a {
  color: var(--color-text-2);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-col ul li a::before {
  content: '›';
  color: var(--color-accent);
  transition: transform var(--transition-fast);
}

.footer-col ul li a:hover {
  color: #fff;
  transform: translateX(4px);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--color-text-2);
  font-size: 0.9375rem;
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

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

.footer-bottom p {
  color: var(--color-text-3);
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

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

.footer-bottom-links a {
  color: var(--color-text-3);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

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

/* ==========================================================================
   Utility
   ========================================================================== */

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

.text-gradient-tech {
  background: var(--gradient-tech);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mono { font-family: var(--font-mono); }

.hidden { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
  }
  .footer-brand { grid-column: span 3; }
}

@media (max-width: 768px) {
  section { padding: 4rem 0; }
  .container { padding: 0 1.25rem; }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(0,0,0,0.98);
    backdrop-filter: blur(20px);
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-150%);
    transition: transform var(--transition-base);
    border-bottom: 1px solid var(--color-border);
  }

  .nav-menu.active { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .nav-cta .btn { display: none; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: span 2; }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}
