/* ==========================================================================
 * AUTOMATIONPRO — NON-DESTRUCTIVE HOMEPAGE VISUAL HARMONY LAYER
 * Preserves 100% of Hello WebGL, Stickers, Warp Tunnel, cnt.gltf & React Hydration
 * ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root, :host {
  --font-sans: "Plus Jakarta Sans", "Inter", "tiktok", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  /* Replace legacy acid-lime selection accent with AutomationPro Electric Azure */
  --selection-bg: #0077e6 !important;
  --color-selection: #0077e6 !important;
  --background-deep: 244, 247, 251;
  --background-elevated: #e8f0fa;
  --label: 11, 21, 40;
  --label-d: 51, 65, 85;
  --label-1: rgba(var(--label), 1);
  --label-2: rgba(var(--label-d), 0.78);
  --label-3: rgba(var(--label-d), 0.48);
  --label-4: rgba(var(--label-d), 0.22);
  --line: rgba(var(--label-d), 0.12);
}

html, body {
  font-family: var(--font-sans) !important;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  letter-spacing: -0.025em;
}

.dark {
  --background-deep: 7, 13, 25;
  --background-elevated: #0e192d;
  --label: 248, 250, 252;
  --label-d: 203, 213, 225;
  --label-1: rgba(var(--label), 1);
  --label-2: rgba(var(--label-d), 0.78);
  --label-3: rgba(var(--label-d), 0.48);
  --label-4: rgba(var(--label-d), 0.2);
  --line: rgba(148, 180, 255, 0.14);
  --selection-bg: #38bdf8 !important;
  --color-selection: #38bdf8 !important;
}

/* Override Selected Work corner badges & animated signature stroke without mutating React DOM */
.bg-selection,
#selected-work span.bg-selection {
  background-color: #0066cc !important;
  color: #ffffff !important;
  border-radius: 6px;
  padding: 0.18rem 0.52rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.28);
}

.dark .bg-selection,
.dark #selected-work span.bg-selection {
  background-color: #38bdf8 !important;
  color: #071226 !important;
}

.svg-sign__path {
  stroke: #74e000 !important;
  filter: drop-shadow(0 1px 2.5px rgba(7, 13, 25, 0.5));
}

.dark .svg-sign__path {
  stroke: #84ff14 !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

/* Accessible focus outlines across homepage controls */
header a:focus-visible,
header button:focus-visible,
header [role="button"]:focus-visible,
main a:focus-visible,
footer a:focus-visible,
button:focus-visible {
  outline: 2px solid #0077e6;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Sleek frosted squircle menu button ONLY for top-right header mobile trigger (excludes bottom clock/globe) */
@media (max-width: 1023px) {
  header > div:first-child .lg\:hidden {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 11px !important;
    background: rgba(var(--background-deep), 0.94) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line) !important;
    box-shadow: 0 4px 14px rgba(7, 13, 25, 0.14) !important;
    transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease;
  }
  header > div:first-child .lg\:hidden:active {
    transform: scale(0.95);
  }
  header > div:first-child .lg\:hidden > div.relative {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    flex: none !important;
  }
  header > div:first-child .lg\:hidden > div.relative > div {
    background-color: var(--label-1) !important;
  }
  .dark header > div:first-child .lg\:hidden {
    background: rgba(13, 23, 41, 0.90) !important;
    border-color: rgba(148, 180, 255, 0.24) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  }
  div.h-dvh > div.font-mono > span:last-child {
    max-width: calc(100% - 5.25rem) !important;
    padding-bottom: 1.25rem !important;
  }
}

/* Clean visual elevation and caption readability on #selected-work project tiles */
#selected-work article,
#selected-work a[href^="/services"],
#selected-work a[href^="/products"] {
  border-radius: 12px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Solid, spacious normal-document-flow footer placed cleanly AFTER #contact (cnt.gltf stage) */
footer#contact > div.grid {
  column-gap: clamp(1rem, 2.6vw, 2.5rem) !important;
  font-size: clamp(1.8rem, 5svw, 4.6vw) !important;
}

#ap-site-footer.ap-static-footer {
  position: relative;
  z-index: 30;
  width: 100%;
  background: rgb(var(--background-deep));
  color: var(--label-1);
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 5vw, 4.5rem) clamp(1.25rem, 5vw, 4rem) 10.5rem;
  pointer-events: auto;
  box-shadow: 0 -24px 60px -28px rgba(7, 13, 25, 0.18);
}

.dark #ap-site-footer.ap-static-footer {
  background: #070d19;
  border-top-color: rgba(148, 180, 255, 0.16);
}

.ap-sf-inner {
  max-width: 1320px;
  margin: 0 auto;
}

.ap-sf-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(3, minmax(150px, 1fr));
  gap: clamp(1.75rem, 3.5vw, 3rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.ap-sf-brand-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label-1);
  text-decoration: none;
  margin-bottom: 0.85rem;
}

.ap-sf-brand-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--label-2);
  max-width: 34ch;
  margin-bottom: 1.15rem;
}

.ap-sf-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.ap-sf-col h4 {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-3);
  margin-bottom: 0.9rem;
}

.ap-sf-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ap-sf-links a,
.ap-sf-contact-list a {
  color: var(--label-2);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.ap-sf-links a:hover,
.ap-sf-contact-list a:hover {
  color: #0066cc;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.dark .ap-sf-links a:hover,
.dark .ap-sf-contact-list a:hover {
  color: #38bdf8;
}

.ap-sf-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--label-3);
}

.ap-sf-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.ap-sf-socials a {
  color: var(--label-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ap-sf-socials a:hover {
  color: #0066cc;
}

.dark .ap-sf-socials a:hover {
  color: #38bdf8;
}

@media (min-width: 1024px) {
  .ap-sf-bottom {
    padding-right: 11.5rem;
  }
}

@media (max-width: 1023px) {
  header > div:first-child a[href="/"] {
    background: rgba(var(--background-deep), 0.90) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.35rem 0.72rem !important;
    border-radius: 999px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(7, 13, 25, 0.14);
  }
  .ap-sf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  #ap-site-footer.ap-static-footer {
    padding: 3.75rem 1.15rem 10.5rem;
  }
  .ap-sf-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .ap-sf-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 0;
  }
}

/* Modernize inquiry/navigation modals rendered by automationpro-client.js */
.ap-modal-card {
  background: rgb(var(--background-deep)) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 60px -16px rgba(7, 13, 25, 0.45) !important;
}

.ap-input,
.ap-select {
  border-radius: 8px !important;
  border-color: var(--label-3) !important;
}

.ap-btn-primary {
  border-radius: 8px !important;
  background: #0077e6 !important;
  color: #ffffff !important;
}

.dark .ap-btn-primary {
  background: #38bdf8 !important;
  color: #071226 !important;
}

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