/* =========================================================
   DEVIGO — LAYOUT: header, nav, footer, buttons
   ========================================================= */

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.9rem 1.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background var(--dur-fast),
    border-color var(--dur-fast);
  clip-path: polygon(
    var(--chamfer-sm) 0,
    100% 0,
    100% calc(100% - var(--chamfer-sm)),
    calc(100% - var(--chamfer-sm)) 100%,
    0 100%,
    0 var(--chamfer-sm)
  );
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out);
}

.btn-primary {
  background: var(--blue-500);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 108, 254, 0.4),
    0 10px 30px -8px var(--blue-glow);
}
.btn-primary:hover {
  background: var(--blue-400);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(61, 139, 255, 0.6),
    0 16px 36px -8px var(--blue-glow);
}
.btn-primary:hover svg {
  transform: translateX(3px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--ice-100);
  box-shadow: inset 0 0 0 1px var(--navy-700);
}
.btn-outline:hover {
  box-shadow: inset 0 0 0 1px var(--blue-400);
  color: var(--blue-300);
  transform: translateY(-2px);
}
.btn-outline:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-400);
  padding: 0.7rem 1rem;
}
.btn-ghost:hover {
  color: var(--ice-100);
}

.btn-block {
  width: 100%;
}
.btn-lg {
  padding: 1.1rem 2rem;
  font-size: var(--fs-sm);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(3, 20, 43, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    background var(--dur-base),
    border-color var(--dur-base),
    height var(--dur-base);
}
.site-header.is-scrolled {
  background: rgba(3, 20, 43, 0.92);
  border-bottom-color: var(--navy-800);
}

.nav-wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--content-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  clip-path: polygon(
    9px 0,
    100% 0,
    100% calc(100% - 9px),
    calc(100% - 9px) 100%,
    0 100%,
    0 9px
  );
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--ice-100);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-7);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.nav-links a {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--slate-400);
  padding: var(--sp-2) 0;
  transition: color var(--dur-fast);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--blue-500);
  box-shadow: 0 0 8px var(--blue-glow);
  transition: width var(--dur-base) var(--ease-out);
}
.nav-links a:hover {
  color: var(--ice-100);
}
.nav-links a:hover::after {
  width: 100%;
}
.nav-links a[aria-current="page"] {
  color: var(--ice-100);
}
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-toggle span {
  position: relative;
  width: 20px;
  height: 2px;
  background: var(--ice-100);
  transition: background var(--dur-fast);
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ice-100);
  transition:
    transform var(--dur-base) var(--ease-out),
    top var(--dur-base) var(--ease-out);
}
.nav-toggle span::before {
  top: -6px;
}
.nav-toggle span::after {
  top: 6px;
}
.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    gap: var(--sp-4);
  }

  .mobile-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--navy-950);
    z-index: calc(var(--z-header) - 1);
    padding: var(--sp-7) var(--content-pad);
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity var(--dur-base) var(--ease-out),
      transform var(--dur-base) var(--ease-out);
    overflow-y: auto;
  }
  .mobile-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .mobile-nav a {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    color: var(--ice-100);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding-block: var(--sp-2);
    border-bottom: 1px solid var(--navy-800);
  }
  .mobile-nav .btn {
    margin-top: var(--sp-4);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  border-top: 1px solid var(--navy-800);
  padding-block: var(--sp-9) var(--sp-6);
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: var(--sp-7);
  padding-bottom: var(--sp-8);
}
.footer-brand p {
  margin-top: var(--sp-4);
  max-width: 320px;
  font-size: var(--fs-sm);
}
.footer-social {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.footer-social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy-700);
  color: var(--slate-400);
  clip-path: polygon(
    6px 0,
    100% 0,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    0 100%,
    0 6px
  );
  transition:
    color var(--dur-fast),
    border-color var(--dur-fast),
    transform var(--dur-fast);
}
.footer-social a:hover {
  color: var(--blue-400);
  border-color: var(--blue-500);
  transform: translateY(-3px);
}
.footer-social svg {
  width: 16px;
  height: 16px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: var(--sp-4);
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.footer-col a,
.footer-col address,
.footer-col p {
  font-size: var(--fs-sm);
  color: var(--slate-400);
  font-style: normal;
  transition: color var(--dur-fast);
}
.footer-col a:hover {
  color: var(--ice-100);
}
.footer-col .contact-line {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.footer-col .contact-line svg {
  width: 14px;
  height: 14px;
  color: var(--blue-400);
  flex-shrink: 0;
}

.footer-bottom {
  padding-top: var(--sp-6);
  border-top: 1px solid var(--navy-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--slate-500);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: var(--sp-7);
  }
}
@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-900);
  border: 1px solid var(--navy-700);
  color: var(--blue-400);
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity var(--dur-base),
    transform var(--dur-base),
    visibility var(--dur-base),
    border-color var(--dur-fast);
  z-index: 80;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--blue-500);
}
.back-to-top svg {
  width: 18px;
  height: 18px;
}
