:root {
  --bg: #0b1220;
  --bg-alt: #111a2e;
  --surface: #162033;
  --surface-hover: #1c2840;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --text-muted: #9aa8c7;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --header-h: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1140px, calc(100% - 40px));
  margin-inline: auto;
}

/* Logo */
.logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: white;
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #4f46e5);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Auth overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.12), transparent 35%),
    var(--bg);
}

.auth-overlay[aria-hidden="true"] {
  display: none;
}

.auth-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand .logo-mark {
  margin: 0 auto 16px;
  width: 56px;
  height: 56px;
}

.auth-brand h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.auth-tab {
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active {
  display: flex;
}

.auth-form label,
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label span,
.contact-form label span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.auth-form input,
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.form-success {
  margin: 0;
  color: var(--success);
  font-size: 0.9rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-shell {
  position: relative;
}

.nav-toggle {
  display: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-greeting {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 0 20px 16px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Hero */
.hero {
  padding: 72px 0 88px;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(59, 130, 246, 0.15), transparent 55%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-content h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-lead {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-card {
  background: linear-gradient(145deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat span {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Sections */
.section {
  padding: 80px 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.section.alt,
.service-section.alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 620px;
  margin-bottom: 40px;
}

.section-head h3 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-head p:last-child {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.subpage-section {
  min-height: calc(100vh - var(--header-h) - 120px);
  padding-top: 48px;
}

.subpage-back {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.15s;
}

.subpage-back:hover {
  color: var(--accent);
}

.subpage-content {
  min-height: 240px;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
}

.card h4 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature {
  display: flex;
  gap: 16px;
  height: 148px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.45s ease,
    border-color 0.45s ease;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  align-self: start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.feature:hover:not(.hover-suppressed),
.feature.is-open {
  height: 200px;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.feature:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feature-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature:hover:not(.hover-suppressed) .feature-icon,
.feature.is-open .feature-icon {
  transform: scale(1.08);
}

.feature-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.feature h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.feature-body {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: overflow 0.3s ease;
}

.feature:hover:not(.hover-suppressed) .feature-body,
.feature.is-open .feature-body {
  overflow-y: auto;
}

.feature-summary,
.feature-details {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.feature-summary {
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition:
    max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s ease 0.08s,
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

.feature:hover:not(.hover-suppressed) .feature-summary,
.feature.is-open .feature-summary {
  opacity: 0;
  transform: translateY(-4px);
  position: absolute;
  pointer-events: none;
}

.feature:hover:not(.hover-suppressed) .feature-details,
.feature.is-open .feature-details {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
}

.contact-info a {
  color: var(--accent);
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 960px) {
  .nav {
    display: none;
  }

  .burger {
    display: flex;
  }

  .nav-toggle:checked ~ .mobile-nav {
    display: flex;
  }

  .mobile-nav.open {
    display: flex;
  }

  .nav-toggle:checked ~ .header-inner .burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked ~ .header-inner .burger span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .header-inner .burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero-grid,
  .contact-grid,
  .cards,
  .feature-list {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }
}

@media (hover: none) {
  .feature:hover:not(.is-open) {
    height: 148px;
    border-color: var(--border);
    box-shadow: none;
  }

  .feature:hover:not(.is-open) .feature-icon {
    transform: none;
  }

  .feature:hover:not(.is-open) .feature-summary {
    opacity: 1;
    transform: none;
    position: static;
    pointer-events: auto;
  }

  .feature:hover:not(.is-open) .feature-details {
    max-height: 0;
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 520px) {
  .container {
    width: calc(100% - 24px);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 16px;
  }
}
