/* Terminal-inspired dark theme overrides */
:root {
  --bg: #0b0d0f;
  --panel: #0f1216;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --accent: #38bdf8; /* cyan accent */
}

html, body {
  background: var(--bg);
  color: var(--text);
}

/* Typography */
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.hero h1 span { display: inline-block; }

/* Navbar */
.navbar {
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
}
.nav-container { padding: 0 28px; }
.nav-logo .brand { color: var(--text); letter-spacing: 0.5px; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.nav-menu a { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
.nav-menu a:hover { color: var(--text); }

/* Mobile menu */
@media (max-width: 768px) {
  .nav-menu { background: var(--panel); }
  .nav-menu a { color: var(--text); font-size: 1rem; }
}

/* Hero */
.hero {
  background: radial-gradient(1200px 600px at 20% 10%, rgba(56, 189, 248, 0.12), transparent 40%),
              radial-gradient(800px 400px at 80% 10%, rgba(99, 102, 241, 0.14), transparent 40%),
              var(--bg);
}
.hero-content h1 {
  font-size: clamp(2.8rem, 6vw, 6rem);
  line-height: 0.95;
}
.hero-content p { color: var(--muted); max-width: 46ch; }
.btn-primary { background: #ffffff; color: #0b0d0f; }
.btn-primary:hover { background: #fff; box-shadow: 0 12px 30px rgba(255,255,255,0.08); }
.btn-secondary { border-color: #334155; color: #e5e7eb; }
.btn-secondary:hover { background: #111418; }

/* Hero refinements */
.hero-content p { margin-top: 14px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.pill { background: rgba(148, 163, 184, 0.12); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; font-size: 12px; letter-spacing: 0.04em; }
.hero-metrics { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.metric { display: inline-flex; flex-direction: column; gap: 2px; font-family: 'IBM Plex Mono', monospace; min-width: 128px; min-height: 32px; }
.metric strong { font-size: 0.95rem; color: var(--text); }
.metric em { font-style: normal; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; }

.hero-panel { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.panel-row { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 12px 10px; border-radius: 10px; }
.panel-row i { color: var(--text); opacity: 0.85; }
.panel-row + .panel-row { border-top: 1px dashed var(--border); }

@media (max-width: 900px) {
  .hero-panel { display: none; }
}

/* Cards / Panels */
.service-card, .contact-form, .contact-item {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: none;
}
.service-icon { background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(99,102,241,0.15)); color: var(--text); }
.service-card h3 { color: var(--text); }
.service-card p { color: var(--muted); }

/* Sections */
.services { background: #0c0f13; }
.about { background: var(--bg); }
.contact { background: #0c0f13; }

/* Stats */
.stat { background: transparent; border: 1px solid var(--border); }
.stat h3 { color: var(--text); }
.stat p { color: var(--muted); }

/* Footer */
.footer { background: #0a0c0f; border-top: 1px solid var(--border); }
.footer-section p, .footer-section ul li a, .footer-bottom { color: var(--muted); }
.footer-section h3, .footer-section h4 { color: var(--text); }

/* Scroll cue */
.scroll-cue { display: flex; align-items: center; gap: 12px; margin-top: 28px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.14em; font-size: 0.75rem; }
.scroll-cue .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{ opacity: 0.4; } 50%{ opacity: 1; } }

/* Section index rail */
.section-index { position: fixed; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; z-index: 999; }
.section-index a { width: 44px; height: 44px; border: 1px solid var(--border); color: var(--muted); display: grid; place-items: center; text-decoration: none; border-radius: 999px; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; transition: all .25s ease; background: rgba(255,255,255,0.01); }
.section-index a:hover { color: var(--text); border-color: var(--text); }
.section-index a.active { color: #0b0d0f; background: var(--text); border-color: var(--text); }

@media (max-width: 1024px) { .section-index { display: none; } }

/* Inputs */
.form-group input, .form-group textarea { background: #0b0e12; color: var(--text); border-color: var(--border); }
.form-group input::placeholder, .form-group textarea::placeholder { color: #6b7280; }

/* Subtle borders for containers */
.container { border-left: 1px solid transparent; border-right: 1px solid transparent; }

/* Language switch */
.lang-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-btn { background: rgba(148,163,184,0.12); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.lang-btn.active { background: var(--text); color: #0b0d0f; border-color: var(--text); }

/* Flag buttons */
.lang-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 28px; padding: 0; }
.lang-btn .flag { display: inline-flex; align-items: center; justify-content: center; }
.lang-btn .flag-svg { width: 24px; height: 16px; display: block; pointer-events: none; }
.lang-btn[aria-pressed="true"], .lang-btn.active { background: var(--text); color: #0b0d0f; border-color: var(--text); }

@media (max-width: 768px) {
  .lang-switch { position: absolute; right: 64px; top: 14px; }
}

/* Improve best practices and contrast */
:root { color-scheme: dark; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.btn-primary { background: #ffffff; color: #0b0d0f; }
.btn-secondary { border-color: #334155; color: #e5e7eb; }
.btn-secondary:hover { background: #111418; }

a { color: #38bdf8; }
a:focus { outline: 2px solid #38bdf8; outline-offset: 2px; border-radius: 4px; }

/* Ensure navbar text remains readable when backdrop applies */
.navbar { border-bottom: 1px solid rgba(255,255,255,0.08); transition: background .25s ease, backdrop-filter .25s ease, border-color .25s ease; }
.navbar.nav-scrolled { background: rgba(0, 0, 0, 0.6); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06); backdrop-filter: saturate(180%) blur(12px); border-bottom-color: rgba(255,255,255,0.06); }

/* Tap feedback and focus clarity */
.btn, .nav-menu a, .lang-btn { -webkit-tap-highlight-color: rgba(56,189,248,0.2); }
.btn:focus-visible, .nav-menu a:focus-visible, .lang-btn:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; border-radius: 6px; }

/* Smoother animations for hero graphic and cards */
.hero-graphic, .service-card { will-change: transform, opacity; }

/* Language dropdown */
.lang-select { background: rgba(148,163,184,0.12); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.lang-select:focus { outline: 2px solid #38bdf8; outline-offset: 2px; }

/* Custom flag-only dropdown */
.lang-dropdown { display: inline-flex; align-items: center; position: relative; }
.lang-toggle { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 4px 6px; }
.lang-toggle .flag { display: inline-flex; align-items: center; justify-content: center; }
.lang-toggle .flag .flag-svg { width: 24px; height: 16px; display: block; }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px; display: grid; gap: 6px; }
.lang-option { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; }
.lang-option:hover, .lang-option[aria-selected="true"] { background: rgba(148,163,184,0.12); }
.lang-option .flag-svg { width: 24px; height: 16px; display: block; }

/* Ensure dropdown list hides when [hidden] is set */
.lang-list[hidden] { display: none !important; }

/* Mobile navigation layout and behavior */
@media (max-width: 900px) {
	.nav-container { align-items: center; gap: 8px; }
	.nav-logo { display: flex; align-items: center; }
	.nav-menu { 
		display: none;
		position: fixed;
		top: 64px;
		left: 0;
		right: 0;
		background: var(--panel);
		border-top: 1px solid var(--border);
		flex-direction: column;
		padding: 16px 20px;
		gap: 12px;
		z-index: 999;
	}
	.nav-menu.active { display: flex; }
	.lang-switch { margin-left: auto; display: flex; align-items: center; }
	.hamburger { margin-left: 16px; }
}

/* Hamburger animation */
.hamburger { position: relative; width: 28px; height: 22px; padding: 0; margin-left: 12px; }
.hamburger span { position: absolute; left: 0; width: 100%; height: 2px; background: #e5e7eb; transition: transform .25s ease, opacity .2s ease, top .25s ease; }
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 10px; }
.hamburger span:nth-child(3) { top: 20px; }
.hamburger.active span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* Nudge flag for baseline alignment */
.lang-toggle .flag .flag-svg { transform: translateY(1px); }

/* Navbar base layout (desktop) */
.navbar { min-height: 64px; }
.nav-container { display: flex; align-items: center; justify-content: flex-start; gap: 16px; }
.nav-logo { display: flex; align-items: center; }
.nav-logo h2 { line-height: 1; margin: 0; }
.nav-menu { display: flex; align-items: center; gap: 24px; margin-left: 24px; }
.lang-switch { display: flex; align-items: center; gap: 12px; margin-left: 0; }
.hamburger { display: none; position: relative; width: 28px; height: 22px; padding: 0; margin-left: auto; }
.hamburger span { position: absolute; left: 0; width: 100%; height: 2px; background: #e5e7eb; transition: transform .25s ease, opacity .2s ease, top .25s ease; }
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 10px; }
.hamburger span:nth-child(3) { top: 20px; }
.hamburger.active span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* Flag dropdown alignment */
.lang-dropdown { display: inline-flex; align-items: center; position: relative; }
.lang-toggle { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 4px 6px; background: rgba(148,163,184,0.12); border: 1px solid var(--border); border-radius: 8px; }
.lang-toggle .flag { display: inline-flex; align-items: center; justify-content: center; }
.lang-toggle .flag .flag-svg { width: 24px; height: 16px; display: block; transform: translateY(1px); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px; display: grid; gap: 6px; z-index: 1001; }
.lang-list[hidden] { display: none !important; }
.lang-option { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; }
.lang-option:hover, .lang-option[aria-selected="true"] { background: rgba(148,163,184,0.12); }
.lang-option .flag-svg { width: 24px; height: 16px; display: block; }

/* Mobile navigation */
@media (max-width: 900px) {
	.nav-container { align-items: center; gap: 8px; }
	.nav-menu { 
		display: none;
		position: fixed;
		top: 64px;
		left: 0;
		right: 0;
		background: var(--panel);
		border-top: 1px solid var(--border);
		flex-direction: column;
		padding: 16px 20px;
		gap: 12px;
		z-index: 999;
	}
	.nav-menu.active { display: flex; }
	.lang-switch { gap: 12px; }
	.hamburger { display: block; margin-left: auto; }
}

/* Center navbar contents on desktop */
@media (min-width: 901px) {
	.nav-container { justify-content: center; }
}

/* Cases Section */
.cases { padding: 5rem 0; background: #0c0f13; }
.cases h2 { text-align: center; font-size: 2.2rem; margin-bottom: 2rem; color: #e5e7eb; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.case-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; }
.case-card h3 { color: #e5e7eb; margin-bottom: 6px; font-size: 1.2rem; }
.case-desc { color: #94a3b8; margin-bottom: 14px; }
.case-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: stretch; }
.kpi { background: #111418; border: 1px solid #2b3442; border-radius: 12px; padding: 12px; text-align: center; }
.kpi-value { font-size: 1.4rem; font-weight: 700; color: #e5e7eb; }
.kpi-key { font-size: 0.85rem; color: #cbd5e1; }
@media (max-width: 600px) { .case-stats { grid-template-columns: repeat(2, 1fr); } }

/* Why us cards */
.why-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.why-card { display: flex; align-items: center; gap: 10px; background: #0f1216; border: 1px solid #1f2937; border-radius: 12px; padding: 14px; }
.why-icon { color: #38bdf8; }
.why-card h3 { margin: 0; color: #e5e7eb; font-size: 1rem; }

/* Logos Marquee */
.logos-marquee { background: #0a0c0f; padding: 1.5rem 0; border-top: 1px solid #1f2937; border-bottom: 1px solid #1f2937; }
.marquee { overflow: hidden; position: relative; }
.marquee-track { display: inline-flex; gap: 24px; align-items: center; white-space: nowrap; animation: scroll-left 30s linear infinite; }
.logo-item { display: inline-flex; align-items: center; justify-content: center; opacity: 0.9; }
.logo-item:hover { opacity: 1; }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* Logos images */
.logo-item img { height: 32px; width: auto; opacity: 0.9; filter: drop-shadow(0 0 0 transparent); }
.logo-item img.invert { filter: invert(1) brightness(1.2); }
.logo-item img:hover { opacity: 1; }
