/* ==========================================================================
   Brain Careers — Main Stylesheet
   Global reset, typography, color system, interactive elements, and responsive
   ========================================================================== */

/* ==========================================================================
   Font-face declarations with font-display: swap for fallback behavior
   (Google Fonts are enqueued via functions.php with display=swap in the URL,
    but we declare local fallback references here for robustness)
   ========================================================================== */

@font-face {
  font-family: 'Orbitron';
  font-display: swap;
  src: local('Orbitron');
}

@font-face {
  font-family: 'Inter';
  font-display: swap;
  src: local('Inter');
}

/* ==========================================================================
   Base Reset / Normalize
   ========================================================================== */

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

html {
  background-color: var(--color-base);
  font-size: var(--font-size-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-base);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

ul,
ol {
  list-style: none;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ==========================================================================
   Typography — Orbitron for headlines, Inter for body
   Requirements: 1.4, 1.5
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

h4 {
  font-size: 20px;
}

h5 {
  font-size: 18px;
}

h6 {
  font-size: 16px;
}

p {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 1em;
}

small {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Interactive Elements — Electric Cyan as primary color
   Requirements: 1.2
   ========================================================================== */

a:not(.btn) {
  color: var(--color-accent-primary);
  transition: opacity 0.2s ease;
}

a:not(.btn):hover,
a:not(.btn):focus {
  opacity: 0.8;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 32px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Primary button — solid Electric Cyan */
.btn-primary {
  background-color: var(--color-accent-primary);
  color: var(--color-base);
}

.btn-primary:hover,
.btn-primary:focus {
  box-shadow: 0 0 12px var(--color-accent-primary);
  opacity: 0.9;
}

/* Secondary button — outlined */
.btn-secondary {
  background-color: transparent;
  color: var(--color-accent-primary);
  border: 2px solid var(--color-accent-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 12px var(--color-accent-primary);
}

/* ==========================================================================
   80/15/5 Color Usage Rule — Utility Classes
   Requirements: 1.3
   80% — base/surface (backgrounds, large areas)
   15% — accent-primary / cyan (CTAs, links, highlights, borders)
    5% — accent-secondary (violet) and accent-tertiary (green)
   ========================================================================== */

/* Backgrounds (80% — base) */
.bg-base {
  background-color: var(--color-base);
}

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

/* Accent backgrounds (15% — cyan) */
.bg-accent {
  background-color: var(--color-accent-primary);
}

/* Secondary accent backgrounds (5% — violet/green) */
.bg-violet {
  background-color: var(--color-accent-secondary);
}

.bg-green {
  background-color: var(--color-accent-tertiary);
}

/* Text colors */
.text-base {
  color: var(--color-text);
}

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

.text-cyan {
  color: var(--color-accent-primary);
}

.text-violet {
  color: var(--color-accent-secondary);
}

.text-green {
  color: var(--color-accent-tertiary);
}

/* Border colors */
.border-cyan {
  border-color: var(--color-accent-primary);
}

.border-violet {
  border-color: var(--color-accent-secondary);
}

.border-green {
  border-color: var(--color-accent-tertiary);
}

.border-default {
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--grid-gap);
  padding-right: var(--grid-gap);
}

.section {
  padding: 80px 0;
}

.grid {
  display: grid;
  gap: var(--grid-gap);
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   Card Component
   ========================================================================== */

.card {
  background-color: var(--color-surface);
  padding: var(--card-padding);
  border-radius: var(--card-radius);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 0 12px var(--color-accent-primary);
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--color-accent-primary);
  outline: none;
}

label {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

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

/* ==========================================================================
   Header / Navigation
   Requirements: 4.1, 4.2, 4.3, 11.3
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.site-header.scrolled {
  background-color: var(--color-base);
}

.site-nav {
  height: 100%;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo:hover {
  opacity: 0.85;
}

.nav-menu-container {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  display: block;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li a:focus,
.nav-menu li.current-menu-item a,
.nav-menu li.current_page_item a {
  color: var(--color-accent-primary);
}

/* Hamburger toggle — hidden on desktop */
.hamburger-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Offset body content below fixed nav */
body {
  padding-top: var(--nav-height);
}

/* ==========================================================================
   Responsive Breakpoints
   Requirements: 8.1, 8.2, 8.3
   ========================================================================== */

/* Mobile and Tablet nav: up to 768px */
@media (max-width: 768px) {
  .hamburger-toggle {
    display: flex;
  }

  .nav-menu-container {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background-color: var(--color-base);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .nav-menu-container.menu-open {
    transform: translateX(0);
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 0;
  }

  .nav-menu li a {
    padding: 14px 24px;
    font-size: 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* Hamburger open state */
  .hamburger-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Mobile: up to 480px */
@media (max-width: 480px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 20px;
  }

  body {
    font-size: 16px;
  }

  .section {
    padding: 40px 0;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  /* Ensure all multi-column grids collapse to single column on mobile */
  .service-features.grid {
    grid-template-columns: 1fr;
  }

  .compliance-grid {
    grid-template-columns: 1fr;
  }

  /* Page subtitle readable on mobile */
  .page-subtitle {
    font-size: 16px;
  }

  /* Mission text readable on mobile */
  .mission-text {
    font-size: 16px;
  }

  /* Ensure all CTA buttons meet 44x44px minimum on mobile */
  .btn,
  .page-cta-block .btn {
    min-width: 44px;
    min-height: 44px;
    padding: 14px 24px;
  }
}

/* Tablet: 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 22px;
  }

  body {
    font-size: 16px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  h1 {
    font-size: 42px;
  }

  body {
    font-size: 17px;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop and above: multi-column layouts (≥1024px) */
@media (min-width: 1024px) {
  .service-features.grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .values-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .leadership-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .compliance-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Wide: 1025px to 1440px */
@media (min-width: 1025px) and (max-width: 1440px) {
  body {
    font-size: 18px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Ultra-wide: above 1440px */
@media (min-width: 1441px) {
  body {
    font-size: 18px;
  }

  .container {
    max-width: var(--max-width);
  }
}

/* ==========================================================================
   Hero Section
   Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 8.4, 11.3
   ========================================================================== */

.hero-section {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#neural-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px var(--grid-gap);
}

.hero-headline {
  font-family: var(--font-headline);
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-cta {
  min-width: 44px;
  min-height: 44px;
  padding: 14px 32px;
}

/* Hero responsive adjustments */
@media (max-width: 480px) {
  .hero-section {
    min-height: 90vh;
  }

  .hero-headline {
    font-size: 28px;
  }

  .hero-ctas {
    flex-direction: column;
    gap: 12px;
  }

  .hero-cta {
    width: 100%;
    min-height: 44px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .hero-headline {
    font-size: 36px;
  }
}

/* ==========================================================================
   Services Grid
   Requirements: 3.1, 3.2, 3.3, 3.4, 3.5
   ========================================================================== */

.services-section {
  background-color: var(--color-base);
}

.services-heading {
  margin-bottom: 48px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--grid-gap);
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 32px;
  border-radius: 8px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
}

.service-card:hover,
.service-card:focus {
  box-shadow: 0 0 12px var(--color-accent-primary);
}

.service-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.service-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.service-title {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.service-summary {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Services grid responsive — single column on mobile */
@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Footer
   Requirements: 4.5, 11.3
   ========================================================================== */

.site-footer {
  background-color: var(--color-surface);
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--grid-gap);
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-copyright {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.footer-nav {
  flex-shrink: 0;
}

.footer-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu li a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-menu li a:hover,
.footer-menu li a:focus {
  color: var(--color-accent-primary);
}

/* Footer responsive — stack on mobile */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
}

/* ==========================================================================
   Page Templates — Shared Styles
   Requirements: 4.2, 11.3
   ========================================================================== */

.page-hero {
  padding-top: 40px;
}

.page-hero h1 {
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: 0;
}

.service-features.grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 40px;
}

.service-features .card h2 {
  font-size: var(--font-size-h3);
  margin-bottom: 12px;
}

.service-features .card p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.page-cta-block {
  margin-top: 48px;
  text-align: center;
}

/* ==========================================================================
   Government Contracting Page
   Requirements: 5.1, 5.2, 5.3, 5.4
   ========================================================================== */

/* SAM Registration ID */
.sam-id-display {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 24px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  margin-top: 24px;
}

.sam-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sam-value {
  font-family: var(--font-headline);
  font-size: var(--font-size-h3);
  color: var(--color-accent-primary);
  font-weight: 700;
}

/* NAICS Codes List */
.naics-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.naics-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 24px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
}

.naics-code {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent-primary);
  white-space: nowrap;
  min-width: 80px;
}

.naics-desc {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-text);
}

/* Compliance Badges Grid */
.compliance-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 24px;
}

.compliance-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.compliance-badge img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.compliance-badge h3 {
  font-size: 16px;
}

/* Gov Contracting responsive */
@media (max-width: 480px) {
  .sam-id-display {
    flex-direction: column;
    gap: 8px;
  }

  .sam-value {
    font-size: 20px;
  }

  .naics-item {
    flex-direction: column;
    gap: 4px;
  }

  .compliance-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .compliance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   About Page
   Requirements: 9.1, 9.2, 9.3, 9.4
   ========================================================================== */

/* Mission Statement */
.mission-text {
  font-size: 20px;
  line-height: 1.7;
  color: var(--color-text);
  max-width: 800px;
}

/* Brand Values Grid */
.values-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 32px;
}

.value-card {
  text-align: center;
}

.value-card h3 {
  color: var(--color-accent-primary);
  margin-bottom: 8px;
}

.value-card p {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 0;
}

/* Leadership Grid */
.leadership-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 32px;
}

.leader-card {
  text-align: center;
}

.leader-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 2px solid var(--color-border);
}

.leader-name {
  font-size: 20px;
  margin-bottom: 4px;
}

.leader-title {
  font-size: 14px;
  color: var(--color-accent-primary);
  margin-bottom: 8px;
}

.leader-credentials {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Partner Logos */
.partner-logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--grid-gap);
  margin-top: 32px;
}

.partner-logo {
  height: 60px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: grayscale(100%) brightness(1.5);
  opacity: 0.7;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.partner-logo:hover {
  filter: none;
  opacity: 1;
}

/* About page responsive */
@media (max-width: 480px) {
  .values-grid {
    grid-template-columns: 1fr;
  }

  .leadership-grid {
    grid-template-columns: 1fr;
  }

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

  .mission-text {
    font-size: 16px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .leadership-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mission-text {
    font-size: 18px;
  }
}

/* ==========================================================================
   Contact Page & Form
   Requirements: 6.1, 6.2, 6.3, 6.5, 8.4
   ========================================================================== */

.contact-form-wrapper {
  max-width: 640px;
  margin: 0 auto;
}

.contact-field {
  margin-bottom: 24px;
}

.contact-field .required {
  color: var(--color-accent-primary);
}

/* CF7 overrides — match dark theme */
.wpcf7 .wpcf7-form-control-wrap {
  display: block;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: var(--color-accent-primary);
  outline: none;
}

/* Submit button — Electric Cyan, 44x44 min touch target */
.contact-submit {
  margin-top: 32px;
}

.contact-submit-btn,
.wpcf7 input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 16px 40px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--color-accent-primary);
  color: var(--color-base);
  border: none;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.contact-submit-btn:hover,
.contact-submit-btn:focus,
.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus {
  box-shadow: 0 0 12px var(--color-accent-primary);
  opacity: 0.9;
}

/* On-page confirmation message */
.contact-confirmation {
  margin-top: 24px;
  padding: 20px 24px;
  background-color: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--color-accent-primary);
  border-radius: var(--card-radius);
}

.contact-confirmation p {
  color: var(--color-accent-primary);
  margin-bottom: 0;
}

/* CF7 response output — match dark theme */
.wpcf7-response-output {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: var(--card-radius);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
}

.wpcf7-mail-sent-ok,
.wpcf7 form.sent .wpcf7-response-output {
  background-color: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--color-accent-primary);
  color: var(--color-accent-primary);
}

/* ---------- Inline Form Validation ----------
   Requirements: 6.4
   CF7 validation classes + HTML5 fallback + JS-driven .field-error
   Error color: #FF4444 (red) on dark theme
   ========================================================================== */

/* 1. CF7 invalid inputs — red border */
.wpcf7 .wpcf7-not-valid {
  border-color: #FF4444;
}

/* 2. CF7 error tips — red text below invalid field */
.wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: #FF4444;
  line-height: 1.4;
}

/* 3. CF7 validation errors summary */
.wpcf7-validation-errors,
.wpcf7 form.invalid .wpcf7-response-output {
  background-color: rgba(255, 68, 68, 0.08);
  border: 1px solid #FF4444;
  color: #FF4444;
}

/* 4. CF7 server-side failure message */
.wpcf7-mail-sent-ng,
.wpcf7 form.failed .wpcf7-response-output {
  background-color: rgba(255, 68, 68, 0.08);
  border: 1px solid #FF4444;
  color: #FF4444;
}

/* 5. HTML5 fallback — :invalid styling after submission attempt
      The .submitted class is toggled by JS on form submit so
      :invalid styles only appear after the user tries to send. */
.contact-form.submitted input:invalid,
.contact-form.submitted select:invalid,
.contact-form.submitted textarea:invalid {
  border-color: #FF4444;
}

/* 6. JS-driven validation messages */
.field-error {
  display: block;
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: #FF4444;
  line-height: 1.4;
}

/* Server-side submission failure fallback */
.contact-form-error {
  margin-top: 24px;
  padding: 20px 24px;
  background-color: rgba(255, 68, 68, 0.08);
  border: 1px solid #FF4444;
  border-radius: var(--card-radius);
}

.contact-form-error p {
  color: #FF4444;
  margin-bottom: 0;
}

/* Contact form responsive */
@media (max-width: 480px) {
  .contact-form-wrapper {
    max-width: 100%;
  }

  .contact-submit-btn,
  .wpcf7 input[type="submit"] {
    width: 100%;
    min-height: 48px;
    padding: 16px 24px;
  }
}

/* ==========================================================================
   404 Error Page
   Requirements: 1.6, 4.2
   ========================================================================== */

.error-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-404-inner {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.error-code {
  font-family: var(--font-headline);
  font-size: 120px;
  font-weight: 700;
  color: var(--color-accent-primary);
  line-height: 1;
  margin-bottom: 16px;
  opacity: 0.15;
}

.error-title {
  margin-bottom: 16px;
}

.error-message {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 40px;
}

.error-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 480px) {
  .error-code {
    font-size: 80px;
  }

  .error-message {
    font-size: 16px;
  }

  .error-links {
    flex-direction: column;
  }

  .error-links .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Broken Image Handling — Unobtrusive on Dark Background
   Requirements: 10.1
   ========================================================================== */

img::after {
  content: attr(alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-surface);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
}

img[alt]::before {
  content: '';
  display: block;
}

/* Broken images — fallback styling using the object-fit trick.
   When an image fails to load, the element collapses; these rules
   ensure it remains visible with a subtle placeholder appearance. */
img {
  position: relative;
  min-height: 1px;
}

img:-moz-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  color: var(--color-text-muted);
  font-size: 13px;
  padding: 8px;
  min-height: 48px;
}
