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

:root {
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --cyan: #8da4bd;
  --cyan-dim: #7a92ab;
  --cyan-light: #a8bcd0;
  --cyan-glow: rgba(141, 164, 189, 0.15);
  --green: #a8c4b8;
  --white: #e2e8f0;
  --gray: #94a3b8;
  --gray-dark: #6b7a8d;
  --border: rgba(141, 164, 189, 0.12);
  --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--green); }

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -60px;
  left: 0;
  padding: 12px 24px;
  background: var(--cyan);
  color: var(--bg);
  font-weight: 600;
  z-index: 200;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ===== SCREEN READER ONLY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== ANIMATED GRID BACKGROUND ===== */
.grid-bg {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.grid-bg::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  right: 0;
  bottom: 0;
  width: calc(100% + 120px);
  height: calc(100% + 120px);
  background-image:
    linear-gradient(rgba(141, 164, 189, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 164, 189, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridScroll 20s linear infinite;
  will-change: transform;
}

@keyframes gridScroll {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* Scanline overlay */
.scanline {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(141, 164, 189, 0.008) 2px,
    rgba(141, 164, 189, 0.008) 4px
  );
}

/* Floating particles */
.particles {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: var(--size, 2px);
  height: var(--size, 2px);
  left: var(--left, 0);
  background: var(--cyan);
  border-radius: 50%;
  opacity: 0;
  animation: float var(--duration, 12s) var(--delay, 0s) linear infinite;
}

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

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section {
  padding: 100px 0;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo-icon {
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--cyan);
}

.nav-logo-text span {
  color: var(--white);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--cyan); }

.lang-toggle {
  background: none;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.lang-toggle:hover {
  background: var(--cyan-glow);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cyan);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== FOCUS VISIBLE ===== */
a:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible,
.lang-toggle:focus-visible,
.nav-toggle:focus-visible,
.nav-logo-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
}

.hero-content {
  max-width: 720px;
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  letter-spacing: 2px;
  animation: fadeInUp 0.6s ease-out;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 .accent {
  color: var(--cyan);
  text-shadow: 0 0 40px var(--cyan-glow);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--gray);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, transform 0.25s, box-shadow 0.25s;
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--cyan-light);
  color: var(--bg);
  box-shadow: 0 0 30px rgba(141, 164, 189, 0.3);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.btn-outline:hover {
  background: var(--cyan-glow);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* Terminal decoration */
.hero-terminal {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray-dark);
}

.terminal-body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--gray);
}

.terminal-body .prompt { color: var(--cyan); }
.terminal-body .cmd { color: var(--white); }
.terminal-body .output { color: var(--green); }
.terminal-body .comment { color: var(--gray-dark); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--cyan);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== SERVICES ===== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(141, 164, 189, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(141, 164, 189, 0.08);
}

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

.service-icon {
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.service-icon svg {
  width: 32px;
  height: 32px;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.7;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.service-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan-dim);
  background: rgba(141, 164, 189, 0.06);
  border: 1px solid rgba(141, 164, 189, 0.1);
  padding: 3px 10px;
  border-radius: 3px;
}

/* ===== METHODOLOGY ===== */
.method-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  counter-reset: step;
}

.method-step {
  position: relative;
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  counter-increment: step;
  transition: transform 0.3s, border-color 0.3s;
}

.method-step:hover {
  border-color: rgba(141, 164, 189, 0.3);
  transform: translateY(-2px);
}

.method-step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(141, 164, 189, 0.1);
  position: absolute;
  top: 12px;
  right: 16px;
  line-height: 1;
}

.method-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--cyan);
}

.method-step p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-text p {
  color: var(--gray);
  margin-bottom: 20px;
  line-height: 1.7;
}

.about-text strong {
  color: var(--white);
}

.cert-list {
  list-style: none;
  margin-top: 24px;
}

.cert-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--gray);
}

.cert-list li::before {
  content: '>';
  font-family: var(--font-mono);
  color: var(--cyan);
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: rgba(141, 164, 189, 0.3);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== CONTACT ===== */
#contact {
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.75rem;
  color: var(--gray-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.contact-value {
  font-size: 1rem;
  color: var(--white);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

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

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--gray-dark);
  margin-bottom: 16px;
}

.footer-legal {
  font-size: 0.75rem;
  color: var(--gray-dark);
  font-family: var(--font-mono);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-card: #f8f9fa;
  --bg-card-hover: #f0f2f5;
  --cyan: #5a7a94;
  --cyan-dim: #4a6578;
  --cyan-light: #4a6578;
  --cyan-glow: rgba(90, 122, 148, 0.12);
  --white: #1a2332;
  --gray: #64748b;
  --gray-dark: #5c6370;
  --border: rgba(90, 122, 148, 0.12);
}

[data-theme="light"] nav {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .hero-terminal {
  background: #1a2332;
}

[data-theme="light"] .terminal-bar {
  background: #111827;
}

[data-theme="light"] .terminal-body {
  color: #94a3b8;
}

[data-theme="light"] .terminal-body .prompt { color: #8da4bd; }
[data-theme="light"] .terminal-body .cmd { color: #e2e8f0; }
[data-theme="light"] .terminal-body .output { color: #a8c4b8; }
[data-theme="light"] .terminal-body .comment { color: #6b7a8d; }

[data-theme="light"] .btn-primary {
  color: #ffffff;
}

[data-theme="light"] .btn-primary:hover {
  background: var(--cyan-light);
  color: #ffffff;
}

[data-theme="light"] .grid-bg::before {
  background-image:
    linear-gradient(rgba(90, 122, 148, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 122, 148, 0.05) 1px, transparent 1px);
}

[data-theme="light"] .scanline {
  background: none;
}

[data-theme="light"] .service-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .service-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--gray);
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ===== LAYOUT HELPERS ===== */
.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.section-methodology {
  background: linear-gradient(180deg, transparent 0%, rgba(141, 164, 189, 0.02) 50%, transparent 100%);
}

.btn-form-submit {
  align-self: flex-start;
}

.btn-disabled {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

.footer-logo-icon {
  vertical-align: middle;
  margin-right: 8px;
}

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

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .grid-bg::before { animation: none; }
  .particle { display: none; }
  .cursor { animation: none; opacity: 1; }
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 900px) {
  .hero-terminal { display: none; }
  .hero-content { max-width: 100%; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }
  [data-theme="light"] .nav-links.open {
    background: rgba(255, 255, 255, 0.97);
  }
  .nav-toggle { display: block; }

  section { padding: 60px 0; }

  .hero { min-height: auto; padding-top: 100px; padding-bottom: 60px; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; justify-content: center; }

  .services-grid { grid-template-columns: 1fr; }
  .service-card { padding: 24px; }

  .method-steps { grid-template-columns: 1fr 1fr; gap: 16px; }
  .method-step { padding: 20px 16px; }
  .method-step::before { font-size: 2rem; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-number { font-size: 1.8rem; }

  .section-header { margin-bottom: 40px; }
  .section-title { font-size: 1.6rem; }

  .contact-form { gap: 12px; }
  .btn-form-submit { width: 100%; justify-content: center; }
}

/* Small phones */
@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.7rem; }
  .method-steps { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .nav-inner { padding: 0 16px; }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .nav-links a { padding: 8px 4px; }
  .lang-toggle, .theme-toggle { min-height: 40px; min-width: 40px; }
  .form-group input, .form-group textarea { padding: 14px 16px; font-size: 16px; }
}
