/* ============================================
   nsometech.work - Design System & Styles
   ============================================ */

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

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Light Theme */
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f5;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888aa;
  --accent-primary: #0066ff;
  --accent-secondary: #00d4ff;
  --accent-gradient: linear-gradient(135deg, #0066ff 0%, #00d4ff 100%);
  --border-color: rgba(26, 26, 46, 0.08);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.3);
  --hero-bg: linear-gradient(135deg, #e8eaf6 0%, #e3f2fd 50%, #e0f7fa 100%);
  --nav-bg: rgba(250, 250, 250, 0.85);
  --input-bg: #ffffff;
  --input-border: #d0d0e0;
  --input-focus: #0066ff;
  --footer-bg: #1a1a2e;
  --footer-text: #b0b0cc;
  --success-color: #10b981;
  --error-color: #ef4444;
  --particle-color: rgba(0, 102, 255, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0a0e27;
  --bg-secondary: #111538;
  --bg-card: rgba(17, 21, 56, 0.6);
  --bg-card-hover: rgba(17, 21, 56, 0.85);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8a;
  --accent-primary: #00d4ff;
  --accent-secondary: #0066ff;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
  --border-color: rgba(255, 255, 255, 0.06);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(17, 21, 56, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --hero-bg: linear-gradient(135deg, #0a0e27 0%, #0d1137 50%, #0a1628 100%);
  --nav-bg: rgba(10, 14, 39, 0.85);
  --input-bg: rgba(17, 21, 56, 0.6);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus: #00d4ff;
  --footer-bg: #060820;
  --footer-text: #6a6a8a;
  --success-color: #34d399;
  --error-color: #f87171;
  --particle-color: rgba(0, 212, 255, 0.08);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  position: relative;
}

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

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--glass-bg);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

/* Mobile Nav Toggle */
.nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav__mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav__mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hero-bg);
  overflow: hidden;
  padding-top: 64px;
}

.hero__particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__particle {
  position: absolute;
  border-radius: 50%;
  background: var(--particle-color);
  animation: float linear infinite;
}

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

/* Gradient orbs */
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbPulse 8s ease-in-out infinite alternate;
}

.hero__orb--1 {
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  top: 10%;
  right: -10%;
  animation-delay: 0s;
}

.hero__orb--2 {
  width: 300px;
  height: 300px;
  background: var(--accent-secondary);
  bottom: 10%;
  left: -5%;
  animation-delay: 4s;
}

.hero__orb--3 {
  width: 200px;
  height: 200px;
  background: #7c3aed;
  top: 50%;
  left: 40%;
  animation-delay: 2s;
}

@keyframes orbPulse {
  0% {
    transform: scale(1) translate(0, 0);
    opacity: 0.2;
  }
  100% {
    transform: scale(1.3) translate(30px, -20px);
    opacity: 0.4;
  }
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem 1.5rem;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  animation: fadeInDown 0.8s ease forwards;
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

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

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease 0.6s forwards;
  opacity: 0;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.hero__cta::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.5s ease;
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 102, 255, 0.3);
  color: #ffffff;
}

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

.hero__cta-arrow {
  transition: transform 0.3s ease;
}

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

/* ============================================
   Section Common
   ============================================ */
.section {
  padding: 6rem 1.5rem;
}

.section__container {
  max-width: 1100px;
  margin: 0 auto;
}

.section__header {
  text-align: center;
  margin-bottom: 4rem;
}

.section__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section__description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ============================================
   Products Section
   ============================================ */
.products {
  background: var(--bg-secondary);
  transition: background 0.4s ease;
}

.products__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.product-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: transparent;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.product-card__icon--web {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.1), rgba(0, 212, 255, 0.1));
  color: var(--accent-primary);
}

.product-card__icon--mobile {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
  color: #7c3aed;
}

.product-card__category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}

.product-card__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.product-card__description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.product-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.product-card__tag {
  padding: 0.25rem 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.product-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

.product-card__link-arrow {
  transition: transform 0.3s ease;
}

.product-card__link:hover .product-card__link-arrow {
  transform: translateX(4px);
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
  background: var(--bg-primary);
  transition: background 0.4s ease;
}

.contact__form-wrapper {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--card-shadow);
  transition: all 0.4s ease;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group__label span {
  color: var(--error-color);
  margin-left: 0.25rem;
}

.form-group__input,
.form-group__textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.925rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
}

.form-group__input::placeholder,
.form-group__textarea::placeholder {
  color: var(--text-muted);
}

.form-group__input:focus,
.form-group__textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

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

.form-group__error {
  font-size: 0.78rem;
  color: var(--error-color);
  display: none;
}

.form-group--error .form-group__input,
.form-group--error .form-group__textarea {
  border-color: var(--error-color);
}

.form-group--error .form-group__error {
  display: block;
}

.contact__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.contact__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 102, 255, 0.3);
}

.contact__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.contact__submit-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.contact__submit--loading .contact__submit-spinner {
  display: block;
}

.contact__submit--loading .contact__submit-text {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form result messages */
.contact__result {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.contact__result--success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success-color);
}

.contact__result--error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error-color);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--footer-bg);
  padding: 3rem 1.5rem;
  transition: background 0.4s ease;
}

.footer__container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

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

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--footer-text);
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.footer__social-link:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.footer__divider {
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.footer__copyright {
  font-size: 0.8rem;
  color: var(--footer-text);
  text-align: center;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  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; }

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

/* Tablet */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav__links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__mobile-toggle {
    display: flex;
  }

  .hero__title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .products__grid {
    grid-template-columns: 1fr;
  }

  .contact__form-wrapper {
    padding: 2rem 1.5rem;
  }

  .section {
    padding: 4rem 1.5rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero__content {
    padding: 2rem 1rem;
  }

  .hero__cta {
    padding: 0.875rem 2rem;
    font-size: 0.9rem;
  }

  .product-card {
    padding: 2rem 1.5rem;
  }

  .contact__form-wrapper {
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
  }
}

/* Large screens */
@media (min-width: 1440px) {
  .hero__content {
    max-width: 900px;
  }

  .section__container {
    max-width: 1200px;
  }
}
