:root {
  --c1: #3ABEF9;
  --c2: #2ECC71;
  --c3: #EC6F2D;
  --font-sans: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --container-width: 1100px;
  --header-h: 70px;
  --wrap-pad: 12px;
  --wrap-radius: 24px;
  --halo-overlap: 1px;
  --ring-size: 14px;
  --focus-ring: 0 0 0 3px rgba(58, 190, 249, 0.35);
}

:root[data-theme="dark"] {
  --bg-deep1: #0b1220;
  --bg-deep2: #071726;
  --bg-deep3: #05111d;
  --txt: #ffffff;
  --txt-dim: #f5f5f5;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.18);
  --input-bg: rgba(255, 255, 255, 0.12);
  --input-border: rgba(255, 255, 255, 0.25);
  --placeholder: rgba(255, 255, 255, 0.7);
  --table-line: rgba(255, 255, 255, 0.25);
  --table-zebra: rgba(255, 255, 255, 0.05);
  --gear-opacity: 0.05;
  --gear-filter: brightness(0.95);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.04);
  --bg: #0b1220;
  --fg: #ffffff;
  --muted: #f5f5f5;
  --card: var(--card-bg);
  --border: var(--card-border);
  --accent: var(--c3);
}

:root[data-theme="light"] {
  --bg-deep1: #f7f9fc;
  --bg-deep2: #eaf1ff;
  --bg-deep3: #e6eefb;
  --txt: #0b1220;
  --txt-dim: #27364d;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(0, 0, 0, 0.06);
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.12);
  --placeholder: rgba(0, 0, 0, 0.45);
  --table-line: rgba(11, 18, 32, 0.18);
  --table-zebra: rgba(11, 18, 32, 0.04);
  --gear-opacity: 0.22;
  --gear-filter: brightness(1.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 0 10px rgba(0, 0, 0, 0.03);
  --bg: #f7f9fc;
  --fg: #0b1220;
  --muted: #27364d;
  --card: var(--card-bg);
  --border: var(--card-border);
  --accent: var(--c3);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--txt);
  line-height: 1.6;
  background: linear-gradient(120deg, var(--bg-deep1), var(--bg-deep2) 70%, var(--bg-deep3));
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(11, 18, 32, 0.82);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: rgba(247, 249, 252, 0.9);
}

.site-header__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px 0 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand__name {
  font-size: 1.05rem;
}

.header-actions{
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-nav__link {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--txt-dim);
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav__link:hover {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .site-nav__link:hover {
  background: rgba(11, 18, 32, 0.08);
}

.nav-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid var(--card-border);
  background:transparent;
  color:var(--txt);
  cursor:pointer;
}
.nav-toggle__icon{
  position:relative;
  width:18px;
  height:2px;
  border-radius:999px;
  background:currentColor;
}
.nav-toggle__icon::before,
.nav-toggle__icon::after{
  content:"";
  position:absolute;
  left:0;
  width:18px;
  height:2px;
  border-radius:999px;
  background:currentColor;
}
.nav-toggle__icon::before{ top:-6px; }
.nav-toggle__icon::after{ top:6px; }
.nav-toggle:focus-visible{
  outline:none;
  box-shadow: var(--focus-ring);
}

@media (max-width: 980px){
  .nav-toggle{ display:inline-flex; }
  .site-nav{
    display:none !important;
    position:absolute;
    top: calc(100% + 10px);
    right:0;
    left:auto;
    min-width: 220px;
    max-width: 90vw;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    padding:10px;
    border-radius:16px;
    background: rgba(11, 18, 32, 0.92);
    border:1px solid var(--card-border);
    backdrop-filter: blur(12px);
  }
  :root[data-theme="light"] .site-nav{
    background: rgba(247, 249, 252, 0.95);
  }
  .site-nav__link{
    padding:12px 14px;
    border-radius:12px;
  }
  .site-header.is-open .site-nav{ display:flex !important; }
}

.site-page {
  position: relative;
  z-index: 2;
  flex: 1;
}

.site-page--center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 56px;
}

.theme-switch {
  position: relative;
  width: 70px;
  height: 34px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  margin-left: 12px;
  flex-shrink: 0;
}

.theme-switch span {
  pointer-events: none;
}

.theme-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c3);
  transition: transform 0.3s ease;
}

:root[data-theme="light"] .theme-switch::after {
  transform: translateX(36px);
}

.theme-ripple {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --rx: 0px;
  --ry: 0px;
  clip-path: circle(0 at var(--rx) var(--ry));
  transition: clip-path 600ms ease-out;
}

:root[data-theme="dark"] .theme-ripple.to-light {
  background: linear-gradient(120deg, #f7f9fc, #eaf1ff 70%, #e6eefb);
}

:root[data-theme="light"] .theme-ripple.to-dark {
  background: linear-gradient(120deg, #0b1220, #071726 70%, #05111d);
}

.theme-ripple.is-active {
  clip-path: circle(150% at var(--rx) var(--ry));
}

.gear-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.bg-gear {
  position: absolute;
  opacity: var(--gear-opacity);
  filter: var(--gear-filter);
  animation: spin 60s linear infinite;
}

.gear-1 {
  top: -100px;
  left: -100px;
  width: 420px;
  height: auto;
  fill: var(--c1);
}

.gear-2 {
  bottom: -120px;
  right: -120px;
  width: 520px;
  height: auto;
  fill: var(--c2);
  animation-direction: reverse;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--accent,
.btn.primary {
  --pulse-rgb: 236, 111, 45;
  background: var(--c3);
  color: #fff;
  box-shadow: 0 8px 22px rgba(236, 111, 45, 0.45);
}

.btn--accent:hover,
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(236, 111, 45, 0.55);
}

.btn--info {
  --pulse-rgb: 58, 190, 249;
  background: var(--c1);
  color: #fff;
  box-shadow: 0 8px 22px rgba(58, 190, 249, 0.45);
}

.btn--info:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(58, 190, 249, 0.55);
}

.btn--ghost,
.btn.ghost {
  background: transparent;
  border-color: var(--card-border);
  color: var(--txt);
}

.btn--ghost:hover,
.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .btn--ghost:hover,
:root[data-theme="light"] .btn.ghost:hover {
  background: rgba(11, 18, 32, 0.08);
}

.btn--sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn--pulse {
  animation: btnPulse 2.2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--pulse-rgb), 0.6), 0 8px 22px rgba(var(--pulse-rgb), 0.45);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(var(--pulse-rgb), 0), 0 8px 22px rgba(var(--pulse-rgb), 0.45);
  }
}

.btn--fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .btn--fab {
    padding: 12px;
    bottom: 14px;
  }

  .btn--fab span:not(.icon) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-gear {
    animation: none;
  }

  .theme-ripple {
    transition: none;
  }

  .btn--pulse {
    animation: none;
  }
}
