/* ============================================================
   JPert INC — Brand CSS Foundation
   Typography-driven, warm, boutique consultancy aesthetic
   ============================================================ */

/* ---------- Custom Properties (Tokens) ---------- */
:root {
  /* Brand Colors */
  --orange: #F58220;
  --deep-blue: #0F2853;
  --blue: #2B6CDE;
  --teal: #00897B;
  --purple: #5E35B1;

  /* Semantic Aliases */
  --warm-bg: #F8F7F4;
  --text: #1A1714;
  --text-secondary: #3D3A36;
  --text-muted: #9B9690;
  --text-dark: #1A1714;
  --text-body: #3D3A36;
  --warm-bg-alt: #FDFCFA;
  --rule: rgba(0, 0, 0, 0.08);
  --section-label: #F58220;

  /* Neutrals */
  --warm-white: #FDFCFA;
  --warm-cream: #F8F7F4;
  --warm-gray: #E8E6E3;
  --mid-gray: #9B9690;
  --dark-gray: #3D3A36;
  --near-black: #1A1714;

  /* Typography */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Font Sizes — fluid scale */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.3vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  --text-lg: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
  --text-2xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2vw, 3rem);
  --text-4xl: clamp(2.4rem, 1.8rem + 2.5vw, 3.8rem);
  --text-5xl: clamp(2.8rem, 2rem + 3vw, 4.5rem);

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

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --nav-height: 72px;
  --border-radius: 4px;
  --border-radius-lg: 8px;

  /* Borders */
  --border-subtle: 1px solid rgba(0, 0, 0, 0.06);
  --border-light: 1px solid rgba(0, 0, 0, 0.1);
  --border-medium: 1px solid rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}


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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--dark-gray);
  background-color: var(--warm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--deep-blue);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p + p {
  margin-top: var(--space-md);
}


/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: var(--border-subtle);
  transition: box-shadow var(--transition-base);
}

.site-nav.scrolled {
  box-shadow: 0 1px 12px rgba(15, 40, 83, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.nav-wordmark {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--deep-blue);
  letter-spacing: -0.02em;
}

.nav-wordmark .p-accent {
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--dark-gray);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--deep-blue);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--orange);
  transition: width var(--transition-base);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-phone {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mid-gray);
  letter-spacing: 0.02em;
}

.nav-cta {
  margin-left: var(--space-md);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--deep-blue);
  transition: transform var(--transition-base), opacity var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav panel */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: var(--space-2xl) var(--space-xl);
  flex-direction: column;
  gap: var(--space-lg);
  overflow-y: auto;
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--deep-blue);
}


/* ---------- Page Hero ---------- */
.page-hero {
  padding-top: calc(var(--nav-height) + var(--space-3xl));
  padding-bottom: var(--space-3xl);
  background: var(--warm-white);
}

.page-hero .section-inner {
  max-width: var(--max-width-narrow);
}

.page-hero h1 {
  margin-bottom: var(--space-lg);
}

.page-hero .hero-subtitle {
  font-size: var(--text-lg);
  color: var(--mid-gray);
  max-width: 560px;
  line-height: 1.8;
}

/* Homepage hero — split layout */
.home-hero {
  padding-top: calc(var(--nav-height) + var(--space-2xl));
  padding-bottom: var(--space-3xl);
  background: var(--warm-cream);
}

.home-hero .section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.home-hero-content h1 {
  margin-bottom: var(--space-lg);
}

.home-hero-content p {
  font-size: var(--text-lg);
  color: var(--mid-gray);
  margin-bottom: var(--space-xl);
  max-width: 480px;
}

.home-hero-image {
  position: relative;
}

.home-hero-image img {
  border-radius: var(--border-radius-lg);
}


/* ---------- Section Utilities ---------- */
.section {
  padding: var(--space-3xl) 0;
}

.section--cream {
  background: var(--warm-cream);
}

.section--white {
  background: white;
}

.section-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section-inner--narrow {
  max-width: var(--max-width-narrow);
}

.section-header {
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--mid-gray);
  max-width: 560px;
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  margin-bottom: var(--space-sm);
}


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.75em 1.6em;
  border-radius: var(--border-radius);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  color: white;
}

.btn-primary:hover {
  background: #e0740f;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--deep-blue);
  border: 1.5px solid var(--deep-blue);
}

.btn-secondary:hover {
  background: var(--deep-blue);
  color: white;
}

.btn-text {
  background: none;
  color: var(--deep-blue);
  padding: 0;
  font-weight: 600;
  border-bottom: 1.5px solid var(--orange);
  border-radius: 0;
  padding-bottom: 2px;
}

.btn-text:hover {
  color: var(--orange);
}


/* ---------- Footer ---------- */
.site-footer {
  background: var(--deep-blue);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand .nav-wordmark {
  color: white;
  margin-bottom: var(--space-md);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: 1.8;
  max-width: 280px;
}

.footer-col h6 {
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
}

.footer-col a {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
}


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

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

/* Staggered children */
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.5s; }


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


/* ---------- Responsive ---------- */

/* Tablet */
@media (max-width: 1024px) {
  .home-hero .section-inner {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .home-hero-image {
    order: -1;
    max-width: 500px;
  }

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

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav-links,
  .nav-phone,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .page-hero {
    padding-top: calc(var(--nav-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
  }

  .home-hero {
    padding-top: calc(var(--nav-height) + var(--space-xl));
    padding-bottom: var(--space-2xl);
  }

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

  .section-inner {
    padding: 0 var(--space-lg);
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .nav-inner {
    padding: 0 var(--space-lg);
  }

  .section-inner {
    padding: 0 var(--space-md);
  }

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