@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;600;700;800&display=swap');

/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
:root {
  --bg-deep: #07010f;
  --bg-dark: #0f031f;
  --bg-card: rgba(30, 6, 62, 0.35);
  --primary: #9240bf;
  --primary-glow: rgba(146, 64, 191, 0.4);
  --primary-dark: #630096;
  --accent: #67d9e1;
  --accent-glow: rgba(103, 217, 225, 0.3);
  --accent-hover: #aef4fa;
  --text-primary: #ffffff;
  --text-secondary: #d1a7ff;
  --text-muted: #8c7fa0;
  --border-glass: rgba(210, 175, 255, 0.1);
  --border-glass-hover: rgba(103, 217, 225, 0.3);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Montserrat', sans-serif;
  --header-height: 100px;
  --container-max-width: 1200px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: hidden;
}

body {
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(99, 0, 150, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(103, 217, 225, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

section {
  padding: 8rem 0;
  position: relative;
}

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

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 3.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
}

h2 span.gradient-purple-cyan {
  background: linear-gradient(in oklch 90deg, var(--primary) 0%, var(--accent) 50%, var(--text-primary) 50.1%, var(--text-primary) 100%);
  background-size: 200% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: default;
}

h2 span.gradient-purple-cyan:hover,
h2 span.gradient-purple-cyan.tapped {
  animation: gradientDrawIn 0.7s ease forwards;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 50px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(146, 64, 191, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-cyan {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-deep);
  font-weight: 700;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-cyan:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(103, 217, 225, 0.5);
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: var(--transition-smooth);
}

header.scrolled {
  background: rgba(15, 3, 31, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  height: 80px;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

header .logo {
  height: 94px;
  width: auto;
  transition: var(--transition-smooth);
  animation: logoSlideIn 1.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes logoSlideIn {
  from { opacity: 0; transform: translateX(calc(100vw - 4rem)); }
  to   { opacity: 1; transform: translateX(0); }
}

header.scrolled .logo {
  height: 78px;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  position: relative;
  padding: 0.5rem 0;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition-smooth);
}

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

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================
   HERO SECTION
   ========================================== */
#hero {
  min-height: 35vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 100%;
  padding-top: 20px;
}

.hero-title {
  margin-bottom: 1.5rem;
  font-size: 4rem;
  line-height: 1.1;
}

.glow-text {
  background: linear-gradient(in oklch 90deg, var(--primary) 0%, var(--accent) 50%, var(--text-primary) 50.1%, var(--text-primary) 100%);
  background-size: 200% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: default;
}

.glow-text:hover,
.glow-text.tapped {
  animation: gradientDrawIn 0.7s ease forwards;
}

@keyframes gradientDrawIn {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

.desc-partner {
  color: var(--accent);
  font-weight: 700;
  cursor: default;
}

.desc-partner.gradient-active {
  background: linear-gradient(in oklch 90deg, var(--primary) 0%, var(--accent) 50%, var(--text-primary) 50.1%, var(--text-primary) 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientDrawIn 0.7s ease forwards;
}

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-weight: 300;
  max-width: 66vw;
  line-height: 1.7;
}

/* ==========================================
   SERVICES SECTION
   ========================================== */
#services {
  padding-top: 0;
}

.services-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 3rem;
}

.service-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 1rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.service-tab:hover { color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }

.service-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.services-slider {
  position: relative;
  min-height: 280px;
}

.service-panel {
  display: none;
  animation: panelFadeIn 0.35s ease-out;
}

.service-panel.active { display: block; }

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.service-panel h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.service-panel p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 680px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.service-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  transition: var(--transition-smooth);
  position: relative;
  padding-bottom: 2px;
}

.service-learn-more::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition-smooth);
}

.service-learn-more:hover { color: var(--accent-hover); }
.service-learn-more:hover::after { width: 100%; }

.service-learn-more svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: var(--transition-smooth);
}

/* ==========================================
   BLOG SECTION
   ========================================== */
#blog {
  padding-top: 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px);
  gap: 2rem;
  margin-top: 3rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.blog-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(146, 64, 191, 0.12);
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.blog-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(103, 217, 225, 0.08);
  border: 1px solid rgba(103, 217, 225, 0.2);
  border-radius: 50px;
  padding: 0.25rem 0.75rem;
}

.blog-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-card h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.blog-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.blog-card p:last-child { margin-bottom: 0; }

/* ==========================================
   CONTACT SECTION
   ========================================== */
#contact {
  padding-top: calc(8rem - 400px);
}

.contact-layout--form-only {
  display: block;
  max-width: 600px;
}

.contact-form-container {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 3rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
}

.form-group {
  margin-bottom: 1.8rem;
  position: relative;
}

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

.form-input {
  width: 100%;
  background: rgba(15, 3, 31, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(103, 217, 225, 0.15);
  background: rgba(15, 3, 31, 0.9);
}

.form-input.error {
  border-color: #ff4a7d;
  box-shadow: 0 0 10px rgba(255, 74, 125, 0.15);
}

.form-input.success { border-color: #34d399; }

.error-message {
  position: absolute;
  bottom: -1.2rem;
  left: 0.5rem;
  font-size: 0.75rem;
  color: #ff4a7d;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-5px);
  transition: var(--transition-smooth);
}

.form-input.error ~ .error-message {
  opacity: 1;
  transform: translateY(0);
}

#recaptcha-group .g-recaptcha {
  border-radius: 4px;
  transition: var(--transition-smooth);
}

#recaptcha-group.recaptcha-error .g-recaptcha {
  outline: 1px solid #ff4a7d;
  box-shadow: 0 0 10px rgba(255, 74, 125, 0.2);
}

#recaptcha-group.recaptcha-error #recaptcha-error {
  opacity: 1;
  transform: translateY(0);
}

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

.submit-btn-wrap { display: flex; justify-content: flex-end; }
.submit-btn { width: 100%; }

/* Toast styling */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-dark);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(103, 217, 225, 0.2);
  z-index: 2000;
  transform: translateY(100px) scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show { transform: translateY(0) scale(1); opacity: 1; }
.toast-icon { color: var(--accent); display: flex; align-items: center; }
.toast-message { font-size: 0.95rem; color: var(--text-primary); font-weight: 500; }

/* ==========================================
   FOOTER
   ========================================== */
footer {
  border-top: 1px solid var(--border-glass);
  background: #090112;
  padding: 5rem 0 2rem 0;
  position: relative;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-links { display: flex; gap: 1rem; }

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(210, 175, 255, 0.05);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background: var(--primary-dark);
  color: var(--text-primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--primary-glow);
}

.social-icon svg { width: 20px; height: 20px; fill: currentColor; }

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 2px;
}

.contact-email-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition-smooth);
}

.contact-email-link:hover { color: var(--accent-hover); text-shadow: 0 0 12px var(--accent-glow); }
.contact-email-link:hover::after { width: 100%; }

.contact-email-link svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.contact-email-link:hover svg {
  color: var(--accent-hover);
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.footer-email-link { font-size: 1.1rem; margin-bottom: 1.5rem; }
.contact-email-link.footer-email-link svg { width: 40px; height: 40px; }

.footer-bottom {
  border-top: 1px solid rgba(210, 175, 255, 0.05);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.footer-bottom p { color: var(--text-muted); font-size: 0.85rem; }

/* ==========================================
   SCROLL REVEAL ANIMATIONS
   ========================================== */
.reveal {
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active { opacity: 1; transform: translate(0); }

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }

/* ==========================================
   404 PAGE SPECIFIC STYLES
   ========================================== */
.error-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background-image: radial-gradient(circle at center, rgba(146, 64, 191, 0.1) 0%, transparent 60%);
}

.error-container {
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 4rem 3rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(7, 1, 15, 0.5);
}

.error-code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(in oklch 90deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 15px rgba(103, 217, 225, 0.3));
}


.error-title { font-size: 1.8rem; color: var(--text-primary); margin-bottom: 2.5rem; }

/* ==========================================
   RESPONSIVE MEDIA QUERIES
   ========================================== */
@media (max-width: 1024px) {
  h1 { font-size: 3rem; }
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  :root { --header-height: 170px; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; text-align: center; width: 100%; }
  section { padding: 5rem 0; }

  .hero-content { align-items: stretch; }
  .hero-title { width: 100%; }
  .hero-desc { max-width: 100%; }

  .mobile-nav-toggle { display: none; }

  header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 2rem;
    gap: 0.5rem;
  }

  header .logo-link { margin: 0 auto; }

  header .logo { height: 90px; }
  header.scrolled .logo { height: 70px; }

  nav {
    position: static;
    width: 100%;
    height: auto;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 0 0 50px 0;
    transition: opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease;
  }

  nav .nav-link { font-size: 1.2rem; }

  header.nav-hidden nav {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    padding-bottom: 0;
  }

  .services-tabs { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .services-tabs::-webkit-scrollbar { display: none; }
  .service-tab { flex: 0 0 auto; white-space: nowrap; }

  .contact-form-container { padding: 1.5rem; }
  .contact-layout--form-only { max-width: 100%; }
  #recaptcha-group { overflow: hidden; }
  .g-recaptcha { transform: scale(0.85); transform-origin: left top; height: 66px; }

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

@media (max-width: 480px) {
  h1 { font-size: 2.2rem; }
}
