/* Circumference site foundation
 * Shared base for the Circumference product sites (ARC, Full Circle, Connect): design
 * tokens, the fixed site header and navigation, page and section headings, feature
 * tiles, form status messages, the footer, and the back-to-top control. Each product
 * stylesheet loads after this file and refines it.
 * Copyright Circumference Tech, LLC.
 */

/* Design tokens */
:root {
  --default-font: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --heading-font: "Raleway", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --background-color: #ffffff;
  --surface-color: #ffffff;
  --default-color: #444444;
  --heading-color: #273d4e;
  --accent-color: #0076d4;
  --contrast-color: #ffffff;

  --nav-color: #e5eaee;
  --nav-hover-color: #0076d4;
  --nav-mobile-background-color: #ffffff;
  --nav-dropdown-color: #444444;
  --nav-dropdown-hover-color: #0076d4;

  --rule-color: color-mix(in srgb, var(--default-color), transparent 90%);
  scroll-behavior: smooth;
}

/* Surface themes: apply to any block to switch its tokens */
.light-background {
  --background-color: #f1f4fa;
  --surface-color: #ffffff;
}

.dark-background {
  --background-color: #000910;
  --surface-color: #28323a;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --contrast-color: #ffffff;
}

/* Base elements */
body {
  font-family: var(--default-font);
  color: var(--default-color);
  background-color: var(--background-color);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  color: var(--heading-color);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: color-mix(in srgb, var(--accent-color), transparent 25%);
}

@keyframes cx-spin {
  to { transform: rotate(360deg); }
}

/* Site header: transparent over the page title, tinted with a shadow once scrolled */
.header {
  --background-color: transparent;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  z-index: 997;
  padding: 20px 0;
  color: var(--default-color);
  background-color: var(--background-color);
  transition: background-color 0.5s, box-shadow 0.5s;
}

.scrolled .header {
  --background-color: rgba(21, 34, 43, 0.85);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.1);
}

.header .logo {
  line-height: 1;
}

.header .logo h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: var(--heading-color);
}

.header .cta-btn,
.header .cta-btn:focus {
  margin-left: 30px;
  padding: 7px 25px;
  border: 2px solid var(--contrast-color);
  border-radius: 4px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--contrast-color);
  transition: 0.3s;
}

.header .cta-btn:hover {
  color: var(--contrast-color);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

/* Navigation, wide screens: an inline row with an underline on the current link */
@media (min-width: 1200px) {
  .navmenu ul {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .navmenu li {
    position: relative;
    padding: 15px 14px;
    white-space: nowrap;
  }

  .navmenu li:last-child {
    padding-right: 0;
  }

  .navmenu a,
  .navmenu a:focus {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 2px;
    font-family: var(--nav-font);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--nav-color);
    transition: 0.3s;
  }

  .navmenu a::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background-color: var(--nav-hover-color);
    visibility: hidden;
    transition: all 0.3s ease-in-out;
  }

  .navmenu a:hover::before,
  .navmenu .active::before {
    width: 100%;
    visibility: visible;
  }

  .navmenu a:hover,
  .navmenu .active,
  .navmenu .active:focus {
    color: color-mix(in srgb, var(--nav-color) 90%, white 15%);
  }
}

/* Navigation, narrow screens: a toggle opens the links as a panel over a dimmed page */
@media (max-width: 1199.98px) {
  .header .logo { order: 1; }
  .header .cta-btn { order: 2; margin: 0 15px 0 0; padding: 6px 15px; }
  .header .navmenu { order: 3; }

  .mobile-nav-toggle {
    margin-right: 10px;
    font-size: 28px;
    line-height: 0;
    color: var(--nav-color);
    cursor: pointer;
    transition: color 0.3s;
  }

  .navmenu {
    z-index: 9997;
  }

  .navmenu ul {
    display: none;
    position: absolute;
    inset: 60px 20px 20px 20px;
    z-index: 9998;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    overflow-y: auto;
    border: 1px solid var(--rule-color);
    border-radius: 6px;
    background-color: var(--nav-mobile-background-color);
  }

  .navmenu a,
  .navmenu a:focus {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-family: var(--nav-font);
    font-size: 17px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--nav-dropdown-color);
    transition: 0.3s;
  }

  .navmenu a:hover,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-dropdown-hover-color);
  }

  .mobile-nav-active {
    overflow: hidden;
  }

  .mobile-nav-active .mobile-nav-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 9999;
    margin-right: 0;
    font-size: 32px;
    color: #ffffff;
  }

  .mobile-nav-active .navmenu {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: rgba(33, 37, 41, 0.8);
  }

  .mobile-nav-active .navmenu > ul {
    display: block;
  }
}

/* Page title band under the fixed header */
.page-title {
  position: relative;
  padding: 50px 0;
  text-align: center;
  color: var(--default-color);
  background-color: var(--background-color);
}

.page-title::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--background-color), transparent 30%);
}

/* Sections and their headings */
section,
.section {
  padding: 60px 0;
  scroll-margin-top: 90px;
  overflow: clip;
  color: var(--default-color);
  background-color: var(--background-color);
}

@media (max-width: 1199.98px) {
  section,
  .section {
    scroll-margin-top: 76px;
  }
}

.section-title {
  position: relative;
  padding-bottom: 60px;
}

.section-title h2 {
  position: relative;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 50%);
}

.section-title h2::after {
  content: "";
  display: inline-block;
  width: 120px;
  height: 1px;
  margin: 4px 10px;
  background: var(--accent-color);
}

.section-title p {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--heading-color);
}

@media (max-width: 768px) {
  .section-title p {
    font-size: 24px;
  }
}

/* Feature tiles: an icon beside a title and a short description */
.cx-feature {
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
  background-color: var(--surface-color);
  transition: border-color 0.3s;
}

.cx-feature .icon {
  margin-right: 30px;
  font-size: 36px;
  line-height: 0;
  color: var(--accent-color);
}

.cx-feature .title {
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 700;
}

.cx-feature .title a {
  color: var(--heading-color);
}

.cx-feature .description {
  margin: 0;
  font-size: 14px;
  line-height: 24px;
}

.cx-feature:hover {
  border-color: var(--accent-color);
}

.cx-feature:hover .title a {
  color: var(--accent-color);
}

/* Form status messages: hidden until the form script shows one */
.cx-form .loading,
.cx-form .error-message,
.cx-form .sent-message {
  display: none;
  margin-bottom: 24px;
  padding: 15px;
}

.cx-form .loading {
  text-align: center;
}

.cx-form .loading::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  margin: 0 10px -6px 0;
  border: 3px solid var(--accent-color);
  border-top-color: var(--surface-color);
  border-radius: 50%;
  animation: cx-spin 1s linear infinite;
}

.cx-form .error-message {
  font-weight: 600;
  text-align: left;
  color: #ffffff;
  background: #df1529;
}

.cx-form .sent-message {
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  background: #059652;
}

/* Site footer */
.footer {
  position: relative;
  font-size: 14px;
  color: var(--default-color);
  background-color: var(--background-color);
}

.footer .footer-top {
  padding-top: 50px;
  border-top: 1px solid var(--rule-color);
}

.footer .footer-about .logo {
  margin-bottom: 25px;
  line-height: 1;
}

.footer .footer-about .logo span {
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--heading-color);
}

.footer .footer-about p {
  font-family: var(--heading-font);
  font-size: 14px;
}

.footer .footer-contact p {
  margin-bottom: 5px;
}

.footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 50%);
  border-radius: 50%;
  font-size: 16px;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
  transition: 0.3s;
}

.footer .social-links a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.footer h4 {
  position: relative;
  padding-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}

.footer .footer-links {
  margin-bottom: 30px;
}

.footer .footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer .footer-links li {
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.footer .footer-links li:first-child {
  padding-top: 0;
}

.footer .footer-links i {
  padding-right: 3px;
  font-size: 13px;
  line-height: 0;
  color: var(--accent-color);
}

.footer .footer-links a {
  display: inline-block;
  line-height: 1;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}

.footer .footer-links a:hover {
  color: var(--accent-color);
}

.footer .copyright {
  padding: 25px 0;
  border-top: 1px solid var(--rule-color);
}

.footer .copyright p {
  margin-bottom: 0;
}

/* Phones: keep the last footer line clear of the back-to-top control */
@media (max-width: 767.98px) {
  .footer .copyright {
    padding-bottom: 70px;
  }
}

/* Page loading cover, removed by main.js once the page has loaded */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background: var(--background-color);
}

#preloader::before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  width: 60px;
  height: 60px;
  border: 6px solid;
  border-color: var(--accent-color) transparent;
  border-radius: 50%;
  animation: cx-spin 1.5s linear infinite;
}

/* Back-to-top control, shown after the visitor scrolls */
.scroll-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background-color: var(--accent-color);
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s;
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
}

.scroll-top:hover {
  color: var(--contrast-color);
  background-color: color-mix(in srgb, var(--accent-color), transparent 20%);
}

.scroll-top i {
  font-size: 24px;
  line-height: 0;
  color: var(--contrast-color);
}

/* Visitors who prefer reduced motion get instant scrolling */
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
}

/* Scroll animations start at once on phones */
@media (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0s !important;
  }
}
