/* ==========================================================================
   Black Forge Technology — Professional theme
   ========================================================================== */

:root {
  /* Palette: deep navy + light blue accent (from reference site) */
  --bg: #0e111a;
  --bg-elevated: #151922;
  --bg-muted: #1a1f2e;
  --fg: #ffffff;
  --fg-muted: #b4bcc9;
  --fg-dim: #7c8694;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --accent: #007bff;
  --accent-hover: #3395ff;
  --accent-muted: rgba(0, 123, 255, 0.15);
  /* Typography */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --text-base: 1.125rem;
  --text-sm: 1.0625rem;
  --text-xs: 1rem;
  --leading: 1.65;
  --leading-tight: 1.35;
  /* Layout */
  --wrap: 90rem;
  --space: 1.5rem;
  --space-header: 2rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --transition: 0.2s ease;
  /* Header height for hero padding (logo 7rem + padding 2.5rem*2) */
  --header-height: 12rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Prevent accidental text cursor/caret in chrome; only main content and inputs are selectable */
.site-header,
.site-footer,
.cta-fixed,
.nav,
.nav-dropdown,
.image-modal,
.page-hero,
.featured-service,
.section-three-col,
.prose-section {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
/* Restore pointer on interactive elements inside those areas */
.site-header a,
.site-header button,
.site-footer a,
.nav a,
.nav-dropdown a,
.nav-dropdown-trigger,
.page-hero-cta,
.featured-service a,
.section-three-col a {
  cursor: pointer;
  user-select: auto;
  -webkit-user-select: auto;
}

.wrap {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space);
  padding-right: var(--space);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  overflow: visible;
  background: rgba(14, 17, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding-left: var(--space-header);
  padding-right: var(--space-header);
}

.logo {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--fg);
  text-decoration: none;
  transition: opacity var(--transition);
}

.logo:hover {
  opacity: 0.9;
}

.logo-img {
  display: block;
  height: 7rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.nav-drawer {
  display: flex;
  align-items: center;
  gap: 5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav {
  display: flex;
  gap: 0.125rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--fg-muted);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}

.nav a:hover {
  color: var(--fg);
  background: var(--accent-muted);
}

.nav a.active {
  color: var(--fg);
  background: var(--bg-muted);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}

.nav-dropdown-trigger::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.25rem;
  margin-top: -0.2rem;
  opacity: 0.9;
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger,
.nav-dropdown--active .nav-dropdown-trigger {
  color: var(--fg);
  background: var(--accent-muted);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0.25rem 0 0;
  padding: 0.35rem 0;
  min-width: 16rem;
  white-space: nowrap;
  list-style: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: 0;
  transition: color var(--transition), background var(--transition);
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  color: var(--fg);
  background: var(--accent-muted);
}

.cta {
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-base);
  transition: background var(--transition), transform var(--transition);
}

.cta:hover {
  background: var(--accent-hover);
}

.cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cta-fixed {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  min-height: 3rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--fg);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.nav-toggle::after {
  content: "";
  display: none;
  position: absolute;
  inset: 0;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.site-header.nav-open .nav-toggle::after {
  content: "×";
  display: flex;
}

.nav-toggle:hover {
  background: var(--bg-elevated);
}

.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  transition: opacity var(--transition);
}

.site-header.nav-open .nav-toggle-bar {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Main content
   ========================================================================== */

.main {
  flex: 1;
  padding-top: 0;
  padding-bottom: var(--space-xl);
  font-size: 1.25em; /* ~25% larger than body; header/footer unchanged */
}

.main:not(:has(.page-hero)):not(:has(.home-hero)) {
  padding-top: var(--space-xl);
}

/* ==========================================================================
   Page hero (background image + overlay)
   ========================================================================== */

.page-hero {
  position: relative;
  min-height: 28rem;
  padding-top: 5rem;
  padding-bottom: 5rem;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 17, 26, 0.65);
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-xl) var(--space);
  max-width: 42rem;
  background: rgba(14, 17, 26, 0.75);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.page-hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.page-hero-subtitle {
  margin: 0 0 1.5rem;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading);
}

.page-hero-cta {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: background var(--transition);
}

.page-hero-cta:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   Home layout (index): hero + feature cards
   ========================================================================== */

.home-hero {
  position: relative;
  min-height: min(100vh, 32rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--header-height) var(--space) 4rem;
  overflow: hidden;
  box-sizing: border-box;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 123, 255, 0.12) 0%, transparent 50%),
    linear-gradient(220deg, rgba(14, 17, 26, 0.97) 0%, rgba(21, 25, 34, 0.92) 50%, #0e111a 100%),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 123, 255, 0.2) 0%, transparent 50%);
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 42rem;
}

.home-hero-title {
  margin: 0 0 0.5rem;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--fg);
}

.home-hero-tagline {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.home-hero-desc {
  margin: 0 0 2rem;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading);
}

.home-hero-cta {
  display: inline-block;
  padding: 1rem 2.25rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.0625rem;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 4px 20px rgba(0, 123, 255, 0.35);
}

.home-hero-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.home-hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.home-hero-scroll:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}

.home-hero-scroll-icon {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-25%);
  animation: home-scroll-bounce 2s ease-in-out infinite;
}

@keyframes home-scroll-bounce {
  0%, 100% { transform: rotate(45deg) translateY(-25%); opacity: 1; }
  50% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
}

/* Feature cards */
.home-features {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  scroll-margin-top: var(--header-height);
}

.home-features-heading {
  margin: 0 0 var(--space-lg);
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  text-align: center;
}

.home-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin: 0;
}

.home-feature-card {
  position: relative;
  display: block;
  min-height: 22rem;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  transition: transform var(--transition);
}

.home-feature-card:hover {
  transform: translateY(-6px);
}

.home-feature-card-bg {
  position: absolute;
  inset: 0;
  background-image: var(--feature-image);
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.home-feature-card:hover .home-feature-card-bg {
  transform: scale(1.06);
}

.home-feature-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 17, 26, 0.95) 0%, rgba(14, 17, 26, 0.6) 40%, rgba(14, 17, 26, 0.35) 100%);
  transition: background 0.35s ease;
}

.home-feature-card:hover .home-feature-card-overlay {
  background: linear-gradient(to top, rgba(14, 17, 26, 0.92) 0%, rgba(14, 17, 26, 0.5) 50%, rgba(0, 123, 255, 0.15) 100%);
}

.home-feature-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-lg);
  justify-content: flex-end;
}

.home-feature-card-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.home-feature-card-title {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.home-feature-card-desc {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading);
  margin-bottom: 1rem;
}

.home-feature-card-cta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  transition: color var(--transition);
}

.home-feature-card:hover .home-feature-card-cta {
  color: var(--accent-hover);
}

/* Home about section: reset prose so h2 aren’t styled like old featured heading */
.home-about.prose > h2:first-of-type {
  margin-top: 0;
  font-size: 1.625rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
}

.home-about.prose > h2:nth-of-type(2) {
  margin-top: var(--space-xl);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--fg);
}

/* Contact form */
.contact-form {
  margin-top: var(--space);
  margin-bottom: var(--space-xl);
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-muted);
}

.contact-form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.contact-form-input::placeholder {
  color: var(--fg-dim);
}

/* Override browser autofill background so it stays dark */
.contact-form-input:-webkit-autofill,
.contact-form-input:-webkit-autofill:hover,
.contact-form-input:-webkit-autofill:focus,
.contact-form-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-elevated) inset;
  box-shadow: 0 0 0 1000px var(--bg-elevated) inset;
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
}

/* Invalid state only after user has interacted (avoids showing red on load) */
.contact-form-input:user-invalid {
  border-color: rgba(200, 60, 60, 0.6);
}
.contact-form-input:user-invalid:focus {
  box-shadow: 0 0 0 3px rgba(200, 60, 60, 0.2);
}

.contact-form-textarea {
  min-height: 8rem;
  resize: vertical;
}

.contact-form-submit {
  align-self: start;
  margin-top: 0.25rem;
  padding: 0.75rem 1.75rem;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.contact-form-submit:hover {
  background: var(--accent-hover);
}

.contact-form-section-title {
  margin-top: var(--space-xl);
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--fg);
}

.contact-form-feedback {
  margin-bottom: var(--space);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.contact-form-feedback--success {
  background: rgba(0, 123, 255, 0.15);
  color: var(--fg);
  border: 1px solid var(--accent);
}

.contact-form-feedback--error {
  background: rgba(200, 60, 60, 0.15);
  color: var(--fg);
  border: 1px solid rgba(200, 60, 60, 0.5);
}

@media (max-width: 56rem) {
  .home-features-grid {
    grid-template-columns: 1fr;
  }

  .home-feature-card {
    min-height: 18rem;
  }
}

@media (max-width: 40rem) {
  .home-hero {
    min-height: 85vh;
    padding: 5rem var(--space) 4rem;
  }
}

/* ==========================================================================
   Page layout
   ========================================================================== */

.page .wrap {
  padding-top: 0.5rem;
}

/* Hide first image in content when page uses hero (avoid duplicate) */
.has-hero .page-content.prose > p:first-of-type:has(> img:only-child) {
  display: none;
}

.has-hero .page-content.prose > h1:first-of-type,
.has-hero .page-content.prose > h2:first-of-type {
  margin-top: 2rem;
}

/* Homepage only: hero-style first headings */
.page-index .page-content.prose > h1:first-of-type,
.page-index .page-content.prose > h1:nth-of-type(2),
.page-index .page-content.prose > h1:nth-of-type(3) {
  text-align: center;
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: var(--leading-tight);
}

.page-index .page-content.prose > h1:first-of-type {
  margin-top: 0;
  color: var(--fg);
}

.page-index .page-content.prose > h1:nth-of-type(2) {
  color: var(--accent);
  margin-bottom: 0;
}

.page-index .page-content.prose > h1:nth-of-type(3) {
  font-size: 0;
  margin: 0;
  overflow: hidden;
  height: 0.5rem;
}

/* Homepage only: "Featured Products" section title */
.page-index .page-content.prose > h2:first-of-type {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-lg);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

/* Homepage only: product blocks (image + h4 + p) */
.page-index .page-content.prose > h4 {
  margin-top: var(--space-lg);
  margin-bottom: 0.5rem;
  padding-top: var(--space);
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}

.page-index .page-content.prose > h4:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.page-content.prose > p:has(img) {
  margin-bottom: 0.5rem;
}

.page-content.prose > p:has(img) img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Homepage only: "About our company" section */
.page-index .page-content.prose > h1:nth-of-type(4) {
  margin-top: var(--space-xl);
  margin-bottom: 1rem;
  font-size: 1.625rem;
  font-weight: 700;
  text-align: left;
  color: var(--fg);
}

/* Homepage only: "Contact Us" section */
.page-index .page-content.prose > h2:nth-of-type(2) {
  margin-top: var(--space-xl);
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
}

/* ==========================================================================
   Prose (shared content typography)
   ========================================================================== */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--accent);
}

.prose h1 {
  font-size: 2rem;
  margin-top: 4rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prose h1:first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 1.625rem;
  margin-top: 4rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.prose h3,
.prose h4 {
  font-size: 1.375rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.prose p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--fg-muted);
}

.prose ul,
.prose ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--fg-muted);
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

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

.prose a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  display: block;
}

/* Standalone figures: block in flow (no float/grid). Use .prose-section for side-by-side. */
.prose-figure {
  margin: 1.5rem 0;
}

.prose-figure img {
  width: 100%;
  margin: 0;
  cursor: pointer;
  border-radius: var(--radius);
  transition: box-shadow var(--transition);
}

.prose-figure img:hover {
  box-shadow: var(--shadow);
}

.prose-figure-caption {
  margin: 0.5rem 0 0;
  font-size: var(--text-xs);
  color: var(--fg-dim);
  line-height: 1.4;
}

/* Optional: wrap a block in .prose-section for explicit text + image layout (no gaps).
   Use in markdown with raw HTML, e.g.:
   <div class="prose-section prose-section--image-right">
     <div class="prose-section__body">...text and HTML...</div>
     <figure class="prose-figure">...</figure>
   </div>
   Modifiers: --image-right (text left, image right), --image-left (image left, text right). */
.prose-section {
  margin: 2rem 0;
}
.prose-section--image-right {
  display: grid;
  grid-template-columns: 1fr min(33%, 18rem);
  gap: 1.5rem 2rem;
  align-items: start;
}
.prose-section--image-right .prose-section__body {
  min-width: 0;
}
.prose-section--image-right .prose-section__figure {
  margin: 0;
}
.prose-section--image-left {
  display: grid;
  grid-template-columns: min(33%, 18rem) 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
}
.prose-section--image-left .prose-section__body {
  min-width: 0;
  order: 2;
}
.prose-section--image-left .prose-section__figure {
  margin: 0;
  order: 1;
}
@media (max-width: 52rem) {
  .prose-section--image-right,
  .prose-section--image-left {
    grid-template-columns: 1fr;
  }
  .prose-section--image-left .prose-section__body {
    order: 1;
  }
  .prose-section--image-left .prose-section__figure {
    order: 2;
  }
}

/* Why Choose Us: balanced two-column layout, image more prominent */
.why-choose-section {
  display: grid;
  grid-template-columns: 1fr min(48%, 26rem);
  gap: 2rem;
  align-items: center;
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.why-choose-section__body {
  min-width: 0;
}
.why-choose-section__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: inherit;
  line-height: var(--leading);
  color: var(--fg-muted);
}
.why-choose-section__list li {
  margin-bottom: 0.5rem;
}
.why-choose-section__list li:last-child {
  margin-bottom: 0;
}
.why-choose-section__list strong {
  color: var(--fg);
}
.why-choose-section__figure {
  margin: 0;
  min-width: 0;
}
.why-choose-section__figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}
.why-choose-section__figure .prose-figure-caption {
  margin-top: 0.5rem;
  font-size: var(--text-xs);
  color: var(--fg-dim);
}
@media (max-width: 52rem) {
  .why-choose-section {
    grid-template-columns: 1fr;
    padding: var(--space);
  }
  .why-choose-section__figure {
    order: -1;
  }
}

/* Featured service highlight card: elevated card with accent border, label, and prominent CTA */
.featured-service {
  margin: var(--space-xl) 0;
  /* Use em so text scales with .main font-size (25% larger) */
  font-size: 1em;
}
.featured-service__inner {
  display: grid;
  grid-template-columns: 1fr min(42%, 22rem);
  gap: var(--space-xl);
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}
.featured-service__content {
  min-width: 0;
}
.featured-service__label {
  margin: 0 0 0.5rem;
  font-size: 1em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.featured-service__title {
  margin: 0 0 0.75rem;
  font-size: 1.22em;
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--fg);
}
.featured-service__desc {
  margin: 0 0 var(--space);
  font-size: 0.95em;
  color: var(--fg-muted);
  line-height: var(--leading);
}
.featured-service__cta {
  display: inline-block;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.featured-service__cta:hover {
  color: var(--accent-hover);
}
.featured-service__cta::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.25em;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 0.15em;
}
.featured-service__media {
  min-width: 0;
}
.featured-service__link {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.featured-service__link:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.featured-service__link img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
@media (max-width: 52rem) {
  .featured-service__inner {
    grid-template-columns: 1fr;
    padding: var(--space);
  }
  .featured-service__media {
    order: -1;
  }
}

/* Three-column section: heading + description + image per column (e.g. Why Work With Us).
   Reuse by wrapping in <section class="section-three-col"> with __title and __grid of __item (__item-title, __item-desc, __item-figure). */
.section-three-col {
  margin: var(--space-xl) 0;
}
.section-three-col__title {
  margin: 0 0 var(--space-lg);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}
.section-three-col__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl) var(--space-lg);
  align-items: stretch;
}
.section-three-col__item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}
.section-three-col__item-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
}
.section-three-col__item-desc {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading);
  flex: 1 1 auto;
}
.section-three-col__item-figure {
  margin: 0;
  margin-top: auto;
}
.section-three-col__item-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
@media (max-width: 52rem) {
  .section-three-col__grid {
    grid-template-columns: 1fr;
  }
}

/* Image modal (full-width preview) */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.image-modal[hidden] {
  display: none;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.image-modal-inner {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-img {
  max-width: 100%;
  max-height: calc(100vh - 4rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--fg);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.image-modal-close:hover {
  background: var(--accent);
  color: #fff;
}

.prose strong {
  color: var(--fg);
  font-weight: 600;
}

/* ==========================================================================
   Carousel (How it Works gallery)
   ========================================================================== */

.carousel {
  position: relative;
  clear: both;
  margin: 3rem 0;
  max-width: 100%;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  margin: 0;
  padding: var(--space);
  box-sizing: border-box;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.carousel-slide figcaption {
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg);
  text-align: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--fg);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  z-index: 2;
}

.carousel-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.carousel-prev {
  left: -0.5rem;
}

.carousel-next {
  right: -0.5rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--fg-dim);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.carousel-dot:hover,
.carousel-dot.is-active {
  background: var(--accent);
}

.carousel-dot.is-active {
  transform: scale(1.25);
}

/* ==========================================================================
   Post (blog article)
   ========================================================================== */

.post .wrap {
  max-width: 52rem;
}

.post-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space);
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  color: var(--fg);
}

.post-meta {
  color: var(--fg-dim);
  font-size: var(--text-sm);
  margin: 0;
}

.post-meta time {
  font-variant-numeric: tabular-nums;
}

.post-content {
  margin-top: var(--space);
}

/* ==========================================================================
   Blog listing
   ========================================================================== */

.post-list {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0 0;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.post-list li:hover {
  background: var(--accent-muted);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}

.post-list a {
  color: var(--fg);
  text-decoration: none;
  flex: 1;
  font-weight: 500;
  transition: color var(--transition);
}

.post-list a:hover {
  color: var(--accent);
}

.post-list time {
  color: var(--fg-dim);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 8rem 0 3rem;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5rem;
  margin-bottom: 5rem;
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4rem;
}

.footer-logo-img {
  display: block;
  height: 13rem;
  width: auto;
  object-fit: contain;
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4rem;
  text-align: right;
}

.footer-block {
  margin: 0;
}

.footer-detail {
  margin: 0.5rem 0 0;
}

@media (max-width: 52rem) {
  .site-footer {
    padding: 2.5rem 0 2rem;
    font-size: var(--text-base);
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .footer-logos {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
  }

  .footer-logo-img {
    height: 4rem;
  }

  .footer-info {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    text-align: center;
  }

  .footer-label {
    font-size: var(--text-base);
    margin-bottom: 0.5rem;
  }

  .footer-block p {
    margin-bottom: 0.5rem;
  }

  .footer-block a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0;
    min-height: 2.75rem;
    line-height: 1.5;
  }

  .footer-copy {
    padding-top: 1.5rem;
    font-size: var(--text-sm);
  }
}

.footer-label {
  font-weight: 600;
  color: var(--fg);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
}

.footer-block p {
  margin: 0 0 0.5rem;
}

.site-footer a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

.footer-copy {
  margin: 0;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--fg-dim);
  text-align: center;
}

/* ==========================================================================
   Utility: focus visible
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Responsive: narrow nav
   ========================================================================== */

@media (max-width: 64rem) {
  :root {
    --header-height: 7.5rem; /* 1.5rem + 4.5rem + 1.5rem */
  }

  .site-header {
    padding: 1.5rem 0;
  }

  .header-inner {
    gap: var(--space);
  }

  .logo-img {
    height: 4.5rem;
  }

  .nav-drawer {
    gap: var(--space);
  }

  .nav a,
  .nav-dropdown-trigger {
    padding: 0.6rem 0.75rem;
    font-size: var(--text-sm);
  }
}

/* Tablet / iPad: center footer for balanced layout */
@media (max-width: 64rem) and (min-width: 52.01rem) {
  .site-footer {
    padding: 4rem 0 2rem;
  }

  .footer-logo-img {
    height: 8rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
  }

  .footer-logos {
    justify-content: center;
  }

  .footer-info {
    justify-content: center;
    text-align: center;
  }
}

/* Mobile: hamburger menu */
@media (max-width: 52rem) {
  :root {
    --header-height: 5rem; /* 1rem + 3rem + 1rem */
  }

  .site-header {
    padding: 1rem 0;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0;
    padding-left: var(--space);
    padding-right: 2rem;
  }

  .logo-img {
    height: 3rem;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
    margin-right: 0.25rem;
  }

  .nav-drawer {
    flex-basis: 100%;
    order: 3;
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 0;
    transition: max-height 0.3s ease;
  }

  .site-header.nav-open .nav-drawer {
    max-height: 85vh;
    overflow: auto;
    padding: 1rem var(--space) 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav a,
  .nav-dropdown-trigger {
    padding: 1rem var(--space);
    font-size: var(--text-base);
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0;
    padding: 0;
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg-muted);
  }

  .nav-dropdown-menu a {
    padding: 0.875rem var(--space) 0.875rem 2.5rem;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border);
  }

  .nav-dropdown-trigger::after {
    display: none;
  }
}

@media (max-width: 40rem) {
  :root {
    --space: 1.25rem;
    --space-lg: 1.75rem;
    --space-xl: 2.5rem;
  }

  .main {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .page-content.prose > h1:first-of-type,
  .page-content.prose > h1:nth-of-type(2) {
    font-size: 1.625rem;
  }
}
