/* =========================================================
   Atlantic Distributed Systems
   Palette: Maroon, Navy, White, Gray
   Type:    Lora (serif headings) + Nunito (rounded sans body)
   ========================================================= */

:root {
  --navy:        #0f1e3d;
  --navy-deep:   #0a1530;
  --navy-soft:   #1c2c54;
  --maroon:      #7a1c2f;
  --maroon-dark: #5e1424;
  --gray-900:    #1f2530;
  --gray-700:    #4a5566;
  --gray-500:    #7a8497;
  --gray-300:    #c9cfdb;
  --gray-100:    #eef1f6;
  --gray-50:     #f7f9fc;
  --white:       #ffffff;

  --shadow-sm: 0 1px 2px rgba(15, 30, 61, 0.06), 0 1px 3px rgba(15, 30, 61, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 30, 61, 0.08), 0 2px 4px rgba(15, 30, 61, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 30, 61, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --container: 1160px;
  --pad-x: clamp(1.25rem, 4vw, 2.5rem);

  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans:  "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.2rem; }

p  { margin: 0 0 1em; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--gray-100);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 44px; width: auto; }

.site-nav { display: flex; align-items: center; }
.nav-list {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.nav-list a {
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 0;
  background: var(--maroon);
  transition: width 0.2s ease;
}
.nav-list a:hover::after,
.nav-list a:focus-visible::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px; height: 44px;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-list {
    position: absolute;
    top: 100%; right: 0; left: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--pad-x) 1rem;
    border-bottom: 1px solid var(--gray-100);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-list.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-list li { border-top: 1px solid var(--gray-100); }
  .nav-list a { display: block; padding: 0.9rem 0; }
  .nav-list a::after { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.05s ease, box-shadow 0.18s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--maroon);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--maroon-dark);
  color: var(--white);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}
.btn-primary:active { transform: translateY(1px); }

/* ---------- Sections ---------- */
.section {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}
.section-light { background: var(--gray-50); }
.section-dark {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--gray-100);
}
.section-dark h2,
.section-dark h3 { color: var(--white); }
.section-dark p  { color: var(--gray-300); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--maroon);
  margin: 0 0 1rem;
}
.eyebrow-light { color: #e8b8c0; }

.lead { font-size: 1.1rem; color: var(--gray-700); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: var(--white);
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 7rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(122, 28, 47, 0.35), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(28, 44, 84, 0.6), transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 820px; }
.hero .eyebrow { color: #e8b8c0; }
.hero h1 { color: var(--white); }
.hero-sub {
  font-size: 1.15rem;
  color: var(--gray-300);
  margin-bottom: 2rem;
  max-width: 640px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }
.value-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1rem;
}
.value-list li {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 3px solid var(--maroon);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.value-list strong { color: var(--navy); }

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}
.card h3 { margin-bottom: 0.4rem; }
.card p  { margin: 0; color: var(--gray-700); }

/* ---------- Category carousel ---------- */
.category-carousel {
  margin-top: 2.5rem;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.carousel-viewport {
  overflow: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--radius-md);
}
.carousel-viewport::-webkit-scrollbar { display: none; }
.carousel-viewport:focus-visible {
  outline: 2px solid #e8b8c0;
  outline-offset: 4px;
}
.carousel-viewport.is-dragging { scroll-behavior: auto; cursor: grabbing; }

.category-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  /* Show 4 tiles per page on wide screens; gap is part of each slot */
  grid-auto-columns: calc((100% - (var(--carousel-visible, 4) - 1) * var(--carousel-gap, 1rem)) / var(--carousel-visible, 4));
  gap: var(--carousel-gap, 1rem);
}

.category-tile {
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  min-width: 0;
}
.category-tile:hover {
  background: rgba(122, 28, 47, 0.18);
  border-color: rgba(232, 184, 192, 0.5);
  transform: translateY(-3px);
}

.category-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 184, 192, 0.12);
  color: #f3c8cf;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.category-icon svg { width: 24px; height: 24px; }
.category-tile h3 { margin: 0; color: var(--white); }
.category-tile p  { margin: 0; color: var(--gray-300); font-size: 0.95rem; }

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.05s ease, opacity 0.18s ease;
  flex-shrink: 0;
}
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-btn:hover,
.carousel-btn:focus-visible {
  background: rgba(232, 184, 192, 0.18);
  border-color: rgba(232, 184, 192, 0.5);
  outline: none;
}
.carousel-btn:active { transform: scale(0.95); }
.carousel-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.carousel-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-dot:hover { background: rgba(255, 255, 255, 0.45); }
.carousel-dot.is-active {
  background: #e8b8c0;
  transform: scale(1.25);
}

@media (max-width: 900px) {
  .category-carousel { --carousel-visible: 2; }
}
@media (max-width: 560px) {
  .category-carousel { --carousel-visible: 1; }
  .carousel-btn { width: 40px; height: 40px; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-direct { font-weight: 600; }

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  background: var(--white);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .contact-form { grid-template-columns: 1fr; } .form-row-full { grid-column: 1; } }

.contact-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}
.req { color: var(--maroon); }

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  color: var(--gray-900);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 30, 61, 0.12);
}
.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown) {
  border-color: var(--maroon);
}

.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-status { margin: 0; font-size: 0.95rem; color: var(--gray-700); }
.form-status.is-success { color: #1c6b3a; font-weight: 600; }
.form-status.is-error   { color: var(--maroon-dark); font-weight: 600; }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: var(--gray-300);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-logo {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.footer-meta { text-align: right; }
.footer-meta p { margin: 0.15rem 0; }
.footer-meta a { color: #e8b8c0; }
.copyright { font-size: 0.85rem; color: var(--gray-500); }

@media (max-width: 560px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
