:root {
  color-scheme: dark;
  --background: 224 48% 6%;
  --background-secondary: 224 42% 8%;
  --background-tertiary: 222 35% 12%;
  --foreground: 210 40% 96%;
  --card: 222 37% 10%;
  --card-secondary: 222 34% 14%;
  --card-foreground: 210 40% 96%;
  --card-border: 220 28% 23%;
  --glass: 224 48% 7% / 0.86;
  --glass-border: 217 80% 65% / 0.2;
  --popover: 222 35% 12%;
  --popover-foreground: 210 40% 96%;
  --primary: 221 83% 60%;
  --primary-glow: 213 94% 68%;
  --primary-dark: 224 76% 48%;
  --primary-foreground: 0 0% 100%;
  --secondary: 222 30% 18%;
  --secondary-glow: 221 32% 26%;
  --secondary-foreground: 210 40% 96%;
  --muted: 222 29% 18%;
  --muted-foreground: 215 18% 70%;
  --light: 210 40% 98%;
  --accent: 221 54% 21%;
  --accent-foreground: 210 40% 96%;
  --accent-glow: 213 94% 76%;
  --border: 221 28% 22%;
  --border-bright: 220 28% 35%;
  --input: 222 34% 12%;
  --input-border: 220 26% 26%;
  --ring: 213 94% 68%;
  --gradient-primary: linear-gradient(135deg, hsl(217 91% 63%), hsl(224 76% 48%));
  --gradient-secondary: linear-gradient(135deg, hsl(222 35% 17%), hsl(221 45% 25%));
  --gradient-background: linear-gradient(135deg, hsl(224 48% 6%), hsl(224 42% 8%));
  --gradient-hero: linear-gradient(135deg, hsl(224 48% 6%), hsl(224 42% 8%), hsl(222 35% 12%));
  --gradient-card: linear-gradient(145deg, hsl(222 37% 10%), hsl(222 34% 15%));
  --grd1: linear-gradient(120deg, #3b82f6, #1d4ed8);
  --shadow-primary: 0 10px 36px hsl(221 83% 60% / 0.26);
  --shadow-secondary: 0 10px 36px hsl(217 91% 60% / 0.16);
  --shadow-elegant: 0 24px 60px hsl(224 60% 3% / 0.72);
  --shadow-glow: 0 0 34px hsl(217 91% 60% / 0.22);
  --sidebar-background: 224 48% 6%;
  --sidebar-foreground: 210 40% 94%;
  --sidebar-primary: 221 83% 60%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 222 35% 14%;
  --sidebar-accent-foreground: 210 40% 96%;
  --sidebar-border: 220 28% 22%;
  --sidebar-ring: 213 94% 68%;
}

section.min-h-screen h1 {
  max-width: 500px;
}

section.min-h-screen h1 > span:first-child {
  display: block;
}

section.min-h-screen p.text-xl {
  max-width: 540px;
}

nav.fixed > div.max-w-7xl > div.h-16 > a:first-child {
  position: relative;
  display: block;
  width: 112px;
  height: 48px;
  flex: 0 0 auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

nav.fixed > div.max-w-7xl > div.h-16 > a:first-child > * {
  display: none !important;
}

nav.fixed > div.max-w-7xl > div.h-16 > a:first-child::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 112px;
  background: url("/images/primetechpos-logo-white.png") center / contain no-repeat;
}

footer img[src="/images/primetechpos-logo-white.png"] {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

footer .grid > div:first-child > p.text-muted-foreground.leading-relaxed {
  display: none !important;
}

/* Let the hero video show through the header; use a glass surface after scrolling. */
nav.fixed {
  background: transparent !important;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

nav.fixed[class*="bg-background/80"] {
  background: rgba(7, 11, 24, 0.86) !important;
  border-bottom-color: rgba(96, 165, 250, 0.16);
  box-shadow: 0 8px 30px rgba(3, 8, 12, 0.24);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

nav.fixed:not([class*="bg-background/80"]) a:not(:first-child),
nav.fixed:not([class*="bg-background/80"]) button {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.78);
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas {
  max-width: 100%;
}

img {
  height: auto;
  transition: transform 350ms ease, filter 350ms ease;
}

video {
  background-color: #070b18;
}

/* Fill the hero behind the transparent header and keep the intro clear of the nav. */
section.min-h-screen > .absolute.inset-0.z-0 {
  top: 0;
  bottom: 0;
  overflow: hidden;
}

section.min-h-screen > .relative.z-10 {
  transform: none !important;
  padding-top: clamp(1.25rem, 3vh, 2.5rem);
}

section.min-h-screen h1 {
  text-wrap: balance;
}

section.min-h-screen video {
  object-position: center 45%;
}

section {
  scroll-margin-top: 84px;
}

button,
[role="button"] {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid hsl(var(--primary-glow));
  outline-offset: 3px;
}

nav.fixed > div.max-w-7xl > div.h-16 > a:first-child::before {
  animation: ptp-logo-in 500ms ease-out both;
}

section.min-h-screen > .relative.z-10 > div > div {
  animation: ptp-hero-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

main button,
main [role="button"],
footer a,
nav a {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

main button:hover,
main [role="button"]:hover {
  transform: translateY(-2px);
}

.group:hover img {
  transform: scale(1.025);
  filter: saturate(1.06);
}

.ptp-site-toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(8, 13, 27, 0.97);
  color: #fff;
  box-shadow: 0 12px 34px rgba(3, 5, 25, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.ptp-site-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes ptp-logo-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ptp-hero-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* At tablet widths, use the same uncluttered menu as mobile. */
@media (min-width: 768px) and (max-width: 1100px) {
  nav .hidden.md\:flex {
    display: none !important;
  }

  nav .md\:hidden {
    display: block !important;
  }

  nav .absolute.top-16 {
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(11, 18, 38, 0.98);
    box-shadow: 0 18px 44px rgba(3, 8, 12, 0.42);
  }
}

@media (max-width: 767px) {
  nav.fixed > div.max-w-7xl {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  nav.fixed > div.max-w-7xl > div.h-16 > a:first-child {
    width: 112px;
    height: 48px;
  }

  section.min-h-screen > .absolute.inset-0.z-0 {
    top: 0;
  }

  section {
    scroll-margin-top: 72px;
  }

  nav .absolute.top-16 {
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    max-height: calc(100dvh - 82px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(11, 18, 38, 0.98);
    box-shadow: 0 18px 44px rgba(3, 8, 12, 0.42);
  }

  nav button,
  nav a {
    -webkit-tap-highlight-color: transparent;
  }

  nav button {
    min-width: 44px;
    min-height: 44px;
  }

  section.min-h-screen {
    min-height: 100svh;
    padding-top: calc(5rem + env(safe-area-inset-top));
    padding-bottom: 2.5rem;
  }

  section.min-h-screen > .relative.z-10 {
    transform: none;
    padding-top: 0.5rem;
  }

  section.min-h-screen h1 {
    max-width: 100%;
    font-size: clamp(2rem, 8.6vw, 3rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  section.min-h-screen p.text-xl {
    max-width: 38rem;
    font-size: clamp(1rem, 4.5vw, 1.15rem);
    line-height: 1.6;
  }

  section.min-h-screen .flex.flex-col.sm\:flex-row.gap-4 > button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  section.min-h-screen .grid.grid-cols-2.md\:grid-cols-4 {
    gap: 12px;
    padding-top: 1.25rem;
  }

  section.min-h-screen .text-xl.font-bold {
    font-size: clamp(1rem, 4.5vw, 1.25rem);
  }

  section.min-h-screen .text-sm {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  section h2.text-4xl,
  section h2.text-4xl.lg\:text-5xl,
  section h2.text-3xl.lg\:text-4xl {
    font-size: clamp(1.8rem, 8vw, 2.45rem);
    line-height: 1.15;
  }

  section .text-xl {
    line-height: 1.55;
  }

  section .grid {
    min-width: 0;
  }

  section .grid > * {
    min-width: 0;
  }

  section .rounded-2xl {
    overflow-wrap: anywhere;
  }

  section img,
  section video {
    object-fit: cover;
  }

  footer .py-16 {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }

  footer .grid {
    gap: 2.25rem;
  }

  footer .py-6 > div {
    text-align: center;
  }

  [class~="fixed"][class~="inset-0"] {
    align-items: flex-start;
    overflow-y: auto;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  [class~="fixed"][class~="inset-0"] > .relative {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    margin-top: auto;
    margin-bottom: auto;
  }
}

@media (max-width: 380px) {
  nav.fixed > div.max-w-7xl {
    padding-left: 10px;
    padding-right: 10px;
  }

  nav.fixed > div.max-w-7xl > div.h-16 > a:first-child {
    width: 108px;
  }

  section.min-h-screen .text-sm {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Deep navy and electric-blue theme based on the supplied site reference. */
html {
  background: #070b18;
}

body {
  color: hsl(var(--foreground));
  background:
    radial-gradient(ellipse at 8% 4%, rgba(37, 99, 235, 0.13), transparent 31rem),
    radial-gradient(ellipse at 95% 34%, rgba(59, 130, 246, 0.1), transparent 35rem),
    #080d1b;
  background-attachment: fixed;
}

.text-light {
  color: hsl(var(--light));
}

/* Keep primary calls to action and highlighted headings in the reference blue. */
.bg-grd1 {
  background-image: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border-color: rgba(96, 165, 250, 0.5);
}

.gradient-text {
  background-image: linear-gradient(90deg, #93c5fd 0%, #60a5fa 48%, #818cf8 100%) !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  text-shadow: 0 0 22px rgba(59, 130, 246, 0.2);
}

[class~="from-[#142966]"] {
  --tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[class~="to-[#0F1D4D]"] {
  --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);
}

[class~="bg-primary"] {
  background-image: var(--gradient-primary);
}

/* Unify blue-family highlights while preserving meaningful non-blue status colors. */
[class*="text-blue-"],
[class*="text-indigo-"],
[class*="text-sky-"],
[class*="text-cyan-"] {
  color: #60a5fa !important;
}

[class*="ring-blue-"],
[class*="ring-indigo-"],
[class*="ring-sky-"],
[class*="ring-cyan-"] {
  --tw-ring-color: #60a5fa !important;
}

[class~="from-blue-500"],
[class~="from-cyan-500"],
[class~="from-purple-500"],
[class~="from-pink-500"] {
  --tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[class~="to-blue-500"],
[class~="to-cyan-500"],
[class~="to-purple-500"],
[class~="to-pink-500"] {
  --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);
}

nav.fixed a:hover,
nav.fixed a:focus-visible {
  color: hsl(var(--primary-glow));
}

nav .absolute.top-16 {
  border-color: rgba(96, 165, 250, 0.2);
}

main a:not([class*="bg-"]):hover {
  color: hsl(var(--primary-glow));
}

input,
textarea,
select {
  color: hsl(var(--foreground));
  background-color: hsl(var(--input));
  border-color: hsl(var(--input-border));
}

input::placeholder,
textarea::placeholder {
  color: hsl(var(--muted-foreground) / 0.78);
}

hr {
  border-color: hsl(var(--border));
}
