/* ============================================
   Bishop Solutions — Design System & Shared Styles
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Backgrounds */
  --bg-ivory: #FAFAF7;
  --bg-ivory-warm: #F5F4F0;
  --bg-cream: #EDECE6;
  --bg-white: #FFFFFF;
  --bg-gold-subtle: rgba(200, 164, 85, 0.08);
  --bg-gold-light: rgba(200, 164, 85, 0.12);

  /* Text */
  --text-midnight: #1C1B18;
  --text-graphite: #3A3833;
  --text-stone: #6B6860;
  --text-muted: #8A8780;

  /* Accent — Gold */
  --gold: #C8A455;
  --gold-dark: #A6873E;
  --gold-light: #D4B76A;
  --gold-glow: rgba(200, 164, 85, 0.25);

  /* Accent — Navy */
  --navy: #1B2A4A;
  --navy-light: #243660;
  --navy-dark: #141F38;

  /* Borders & Lines */
  --border-cream: #D4D2C9;
  --border-light: #EDECE6;

  /* Spacing Scale */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2.5rem;
  --sp-2xl: 4rem;
  --sp-3xl: 6rem;
  --sp-4xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;
  --container-padding: 2.5rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(28, 27, 24, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 27, 24, 0.06);
  --shadow-lg: 0 8px 24px rgba(28, 27, 24, 0.08);
  --shadow-xl: 0 12px 36px rgba(28, 27, 24, 0.1);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.35s;
  --duration-fast: 0.2s;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-graphite);
  background-color: var(--bg-ivory);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--text-midnight);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  line-height: 1.7;
}

.text-gold { color: var(--gold); }
.text-gold-dark { color: var(--gold-dark); }
.text-stone { color: var(--text-stone); }
.text-muted { color: var(--text-muted); }

/* ---------- Section Label / Eyebrow ---------- */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--sp-lg);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background-color: var(--gold);
  flex-shrink: 0;
}

.section-label--light {
  color: var(--gold-light);
}

.section-label--light::before {
  background-color: var(--gold-light);
}

.section-label--center {
  justify-content: center;
}

.section-label--center::before {
  display: none;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding: var(--sp-3xl) 0;
}

.section--warm {
  background-color: var(--bg-ivory-warm);
}

.section--dark {
  background-color: var(--navy);
  color: rgba(255, 255, 255, 0.9);
}

.section--white {
  background-color: var(--bg-white);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}

.btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration) var(--ease-out);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  background-color: var(--text-midnight);
  color: var(--bg-white);
}

.btn--primary:hover {
  background-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--secondary {
  background-color: transparent;
  color: var(--text-graphite);
  border: 1px solid var(--border-cream);
}

.btn--secondary:hover {
  border-color: var(--gold);
  background-color: var(--bg-gold-subtle);
  color: var(--text-midnight);
}

.btn--gold {
  background-color: var(--gold);
  color: var(--text-midnight);
}

.btn--gold:hover {
  background-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

.btn-group {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

.btn-arrow {
  display: inline-block;
  transition: transform var(--duration) var(--ease-out);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  transition: all var(--duration) var(--ease-out);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform var(--duration) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  transform: scaleX(1);
}

/* ---------- Tags / Pills ---------- */
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-cream);
  display: inline-flex;
  align-items: center;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.tag:hover {
  border-color: var(--gold);
  background-color: var(--bg-gold-subtle);
}

.tag--gold {
  border-color: transparent;
  background-color: var(--bg-gold-subtle);
  color: var(--gold-dark);
}

.tag--gold:hover {
  background-color: var(--bg-gold-light);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  overflow: visible;
  transition: border-color var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  border-bottom-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: visible;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav__logo-mark {
  width: 32px;
  height: 32px;
  background: var(--text-midnight);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.nav__logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-midnight);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}

.nav__link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-graphite);
  position: relative;
  padding: 4px 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width var(--duration) var(--ease-out);
}

.nav__link:hover {
  color: var(--text-midnight);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__link.active {
  color: var(--text-midnight);
}

.nav__cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  background: var(--text-midnight);
  color: var(--bg-white);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease-out);
}

.nav__cta:hover {
  background: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ---------- Nav Dropdown ---------- */
.nav__dropdown {
  position: relative;
}

.nav__link--dropdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: inherit;
  letter-spacing: inherit;
  color: var(--text-graphite);
  padding: 4px 0;
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav__link--dropdown::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width var(--duration) var(--ease-out);
}

.nav__link--dropdown:hover,
.nav__link--dropdown.active {
  color: var(--text-midnight);
}

.nav__link--dropdown:hover::after,
.nav__link--dropdown.active::after {
  width: 100%;
}

.nav__dropdown-chevron {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.nav__dropdown:hover .nav__dropdown-chevron,
.nav__dropdown.open .nav__dropdown-chevron {
  transform: rotate(180deg);
}

.nav__dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px;
  background: rgba(250, 250, 247, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-sm) 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              visibility var(--duration-fast) var(--ease-out);
  z-index: 1001;
}

.nav__dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav__dropdown:hover .nav__dropdown-menu,
.nav__dropdown.open .nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.nav__dropdown-item {
  display: block;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-graphite);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.nav__dropdown-item:hover {
  color: var(--text-midnight);
  background: var(--bg-gold-subtle);
}

.nav__dropdown-item.active {
  color: var(--gold-dark);
}

/* ---------- Mobile Services Sub-menu ---------- */
.nav__mobile-group {
  border-bottom: 1px solid var(--border-light);
}

.nav__mobile-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-graphite);
  background: none;
  border: none;
  cursor: pointer;
}

.nav__mobile-sublinks {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration) var(--ease-out);
}

.nav__mobile-group.open .nav__mobile-sublinks {
  max-height: 300px;
}

.nav__mobile-group.open .nav__dropdown-chevron {
  transform: rotate(180deg);
}

.nav__link--sub {
  padding-left: 20px !important;
  font-size: 0.9rem !important;
  color: var(--text-stone);
  border-bottom: none !important;
}

.nav__link--sub:last-child {
  margin-bottom: 8px;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 1001;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-midnight);
  border-radius: 2px;
  transition: all var(--duration) var(--ease-out);
  transform-origin: center;
}

.nav__hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.nav__mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(250, 250, 247, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--sp-lg) var(--container-padding) var(--sp-xl);
  flex-direction: column;
  gap: var(--sp-sm);
  transform: translateY(-10px);
  opacity: 0;
  transition: all var(--duration) var(--ease-out);
  pointer-events: none;
}

.nav__mobile.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.nav__mobile .nav__link {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.nav__mobile .nav__cta {
  display: inline-block;
  text-align: center;
  margin-top: var(--sp-sm);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-light);
  padding: var(--sp-3xl) 0 var(--sp-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--sp-2xl);
  margin-bottom: var(--sp-2xl);
}

.footer__brand-desc {
  font-size: 0.875rem;
  color: var(--text-stone);
  line-height: 1.7;
  margin-top: var(--sp-md);
  max-width: 280px;
}

.footer__heading {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: var(--sp-lg);
}

.footer__link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-stone);
  padding: 6px 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer__link:hover {
  color: var(--text-midnight);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border-light);
}

.footer__copyright {
  font-size: 0.8125rem;
  color: var(--text-stone);
}

.footer__socials {
  display: flex;
  gap: 12px;
}

.footer__social {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  color: var(--text-stone);
}

.footer__social:hover {
  border-color: var(--gold);
  background: var(--bg-gold-subtle);
  color: var(--gold-dark);
}

.footer__social svg {
  width: 16px;
  height: 16px;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }
.mb-2xl { margin-bottom: var(--sp-2xl); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }

/* Page body offset for fixed nav */
.page-body {
  padding-top: var(--nav-height);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root {
    --container-padding: 1.5rem;
  }

  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__mobile {
    display: flex;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
  }

  .section {
    padding: var(--sp-2xl) 0;
  }
}

@media (max-width: 600px) {
  :root {
    --container-padding: 1rem;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-xl);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--sp-md);
    text-align: center;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    justify-content: center;
  }
}
