:root {
  --bg-2: #ecebe7;
  --card: rgba(255, 255, 255, 0.62);
  --border: rgba(210, 201, 188, 0.62);
  --se-cta-grad: linear-gradient(135deg, #1e293b, #334155);
  --se-progress: 0%;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --surface: rgba(20, 30, 48, 0.78);
  --card: rgba(20, 30, 48, 0.82);
  --text: #e5e7eb;
  --muted: #b5becd;
  --line: rgba(104, 121, 147, 0.36);
  --border: rgba(104, 121, 147, 0.36);
  --ink: #f3f4f6;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --se-cta-grad: linear-gradient(135deg, #23334a, #334a68);
}

body {
  transition: background-color 0.28s ease, color 0.28s ease;
}

body::after {
  opacity: 0.04;
}

.site-header {
  transition: background-color 0.28s ease, border-color 0.28s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(11, 18, 32, 0.9);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(860px 560px at 12% 8%, rgba(58, 108, 170, 0.22), transparent 62%),
    radial-gradient(940px 600px at 86% 12%, rgba(54, 80, 132, 0.2), transparent 64%),
    radial-gradient(980px 620px at 56% 92%, rgba(38, 116, 94, 0.16), transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 56%, #131e33 100%);
}

.links a {
  position: relative;
}

.links {
  margin-left: auto;
}

.nav-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.links a.is-active {
  color: var(--ink);
}

.links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  background: var(--brand, #0e8f72);
  border-radius: 999px;
}

.btn,
.links .btn,
.btn-primary {
  background: var(--se-cta-grad) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 24px rgba(19, 29, 44, 0.2);
  transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease !important;
}

.btn:hover,
.links .btn:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(19, 29, 44, 0.24);
}

.btn-soft {
  transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

[data-theme="dark"] .btn-soft {
  background: rgba(31, 44, 66, 0.72);
  color: #e5e7eb;
  border-color: var(--line);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 143, 114, 0.45);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(24, 35, 54, 0.84);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.menu-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 143, 114, 0.45);
}

[data-theme="dark"] .menu-toggle {
  background: rgba(24, 35, 54, 0.84);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  backdrop-filter: blur(6px);
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.back-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 143, 114, 0.45);
}

.back-btn:focus-visible {
  outline: 2px solid var(--brand, #0e8f72);
  outline-offset: 2px;
}

.back-btn svg {
  width: 26px;
  height: 26px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .back-btn {
  color: #e8edf7;
  background: rgba(25, 36, 56, 0.68);
  border-color: rgba(104, 121, 147, 0.45);
}

.contact-email-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-email-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

[data-theme="dark"] .contact-email-link {
  color: #ff5c5c;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
  background: linear-gradient(to right, var(--brand, #0e8f72) var(--se-progress), transparent 0);
}

.floating-cta {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  background: var(--se-cta-grad);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(16, 24, 38, 0.26);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.floating-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.panel,
.card,
.block,
.about-card,
.service-card,
table,
tbody tr {
  transition: box-shadow 0.24s ease, transform 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}

[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .block,
[data-theme="dark"] .about-card,
[data-theme="dark"] .service-card,
[data-theme="dark"] table {
  background: var(--card);
  border-color: var(--border);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: var(--ink);
}

.cta h2 {
  margin: 0 0 10px;
  color: var(--ink);
}

.cta p {
  margin: 0 0 14px;
  color: var(--muted);
}

[data-theme="dark"] .cta {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.panel:hover,
.card:hover,
.block:hover,
.about-card:hover,
.service-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(18, 23, 33, 0.14);
}

tbody tr:hover {
  background: rgba(26, 56, 90, 0.06);
  transform: translateY(-2px) scale(1.01);
}

.enhance-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

[data-theme="dark"] th {
  background: rgba(30, 43, 64, 0.92);
  color: #e5e7eb;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(16, 26, 41, 0.9);
  border-color: rgba(111, 130, 159, 0.45);
  color: #e5e7eb;
}

@media (max-width: 980px) {
  .floating-cta {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-wrap: nowrap !important;
    position: relative;
  }

  .links {
    display: none !important;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(290px, calc(100vw - 24px));
    margin-left: 0;
    padding: 12px;
    border-radius: 12px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    background: var(--card, var(--surface));
    border: 1px solid var(--border, var(--line));
    box-shadow: 0 16px 34px rgba(18, 23, 33, 0.18);
    z-index: 45;
  }

  .links.open {
    display: flex !important;
  }

  .links a {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .links .btn {
    text-align: center;
  }

  .menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .theme-toggle svg,
  .menu-toggle svg {
    width: 24px;
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .enhance-reveal {
    opacity: 1;
    transform: none;
  }

  .floating-cta {
    transition: none;
  }
}
