/*
Theme Name: Prim Engineering
Theme URI: https://primengineering.com
Author: Prim Engineering Team
Author URI: https://primengineering.com
Description: A monochrome consulting engineering WordPress theme featuring ASCII moon hero canvas, 3D archive carousel, service domains grid, and contact form. Built for structural integrity firms.
Version: 1.0.0
License: GPL v2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: prim-engineering
*/

/* ============================================
   FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'Geist Pixel';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-pixel/GeistPixel-Line.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  background: #000;
  color: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

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

button {
  cursor: pointer;
  font-family: inherit;
}

/* ============================================
   NAVIGATION
   ============================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  transition: background 0.3s, border-color 0.3s;
}

.site-nav.scrolled {
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-nav .brand {
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-nav .nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.site-nav .nav-links a {
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.08em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
  padding-bottom: 2px;
}

.site-nav .nav-links a:hover {
  border-bottom-color: #fff;
}

.nav-separator {
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: #fff;
  transition: 0.3s;
}

/* ============================================
   HERO SECTION - FIXED TEXT OVERLAP
   ============================================ */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

.hero-left {
  position: relative;
  width: 40%;
  min-width: 380px;
  background: #000;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 140px 40px 40px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hero-left::-webkit-scrollbar {
  display: none;
}

.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 22px;
}

.hero-title {
  font-family: 'Geist Pixel', monospace;
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 400;
  line-height: 0.96;
  color: #fff;
  text-transform: uppercase;
  margin: 0 0 30px 0;
  letter-spacing: 0.015em;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}

.hero-lead {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.95;
  color: rgba(255, 255, 255, 0.56);
  max-width: 42ch;
}

.hero-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.95;
  color: rgba(255, 255, 255, 0.56);
  max-width: 38ch;
}

.hero-note.accent {
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  margin-top: 10px;
}

.hero-right {
  position: relative;
  width: 60%;
  background: #000;
  overflow: hidden;
}

#ascii-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================
   MANIFESTO SECTION
   ============================================ */
.manifesto-section {
  background: #ffffff;
  color: #000000;
  padding: 120px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.manifesto-inner {
  width: 100%;
  max-width: 1360px;
  display: grid;
  grid-template-columns: minmax(300px, 46%) minmax(300px, 1fr);
  gap: 64px;
  align-items: center;
}

.manifesto-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.manifesto-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.manifesto-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 25px;
  max-width: 680px;
  text-align: left;
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services-section {
  background: #ffffff;
  color: #000000;
  border-top: 1px solid #000;
}

.services-header {
  padding: 40px 40px 20px;
}

.services-header h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17.5px;
  font-weight: 400;
  line-height: 20px;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 40px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #000;
}

.service-card {
  border-right: 1px solid #000;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.service-card:last-child {
  border-right: none;
}

.service-card h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  text-transform: uppercase;
  margin: 0 0 4px 0;
  color: #000;
}

.service-card h2 a {
  color: #000;
  transition: opacity 0.2s;
}

.service-card h2 a:hover {
  opacity: 0.6;
}

.service-code {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 16px;
}

.analog-clock {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

.service-address {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 12px 0;
}

.service-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  color: #000;
  margin: 0 0 12px 0;
  font-style: italic;
}

.service-email,
.service-phone {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  color: #000;
  margin: 0 0 4px 0;
}

.service-cta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
  display: inline-block;
  margin: 16px 0 32px 0;
  transition: border-bottom-width 0.2s;
}

.service-cta:hover {
  border-bottom-width: 2px;
}

.service-image-wrap {
  margin-top: auto;
  overflow: hidden;
}

.service-image-wrap img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
  filter: grayscale(100%);
}

.service-image-wrap img:hover {
  opacity: 0.8;
}

/* ============================================
   OBSERVATION SECTION
   ============================================ */
.observation-section {
  background: #000;
  color: #fff;
  padding: 120px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.observation-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17.5px;
  font-weight: 400;
  line-height: 20px;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 48px 0;
  align-self: flex-start;
}

.observation-video-wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
}

.observation-video-wrap video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.observation-status {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.observation-coords {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 10px;
}

/* ============================================
   ARCHIVES / PROJECTS SECTION
   ============================================ */
.archives-section {
  background: #000;
  color: #fff;
  min-height: 200vh;
  position: relative;
}

.archives-header {
  padding: 80px 40px 40px;
  position: relative;
  z-index: 10;
}

.archives-header h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17.5px;
  font-weight: 400;
  line-height: 20px;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 24px 0;
}

.scene {
  perspective: 900px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.vault-btn {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 26px;
  padding: 10px 28px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.vault-btn:hover {
  background: #fff;
  color: #000;
}

.carousel {
  width: 400px;
  height: 500px;
  position: absolute;
  transform-style: preserve-3d;
  will-change: transform;
  transform: translateZ(-550px) rotateY(0deg);
}

.carousel-cell {
  position: absolute;
  width: 350px;
  height: 420px;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
}

.carousel-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
}

.carousel-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  padding: 0 15vw;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-content: center;
  justify-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  transition: opacity 0.3s;
}

.preview-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-close {
  position: absolute;
  top: 32px;
  right: 40px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 26px;
  padding: 8px 20px;
  cursor: pointer;
  letter-spacing: 0.08em;
  z-index: 110;
  transition: background 0.2s, color 0.2s;
}

.preview-close:hover {
  background: #fff;
  color: #000;
}

.preview-item {
  will-change: transform;
  position: relative;
  visibility: hidden;
}

.preview-item img {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  filter: grayscale(100%);
}

.preview-item p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
  letter-spacing: 0.05em;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
  background: #ffffff;
  color: #000000;
  padding: 120px 40px;
  border-top: 1px solid #000;
}

.contact-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.contact-header h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17.5px;
  font-weight: 400;
  line-height: 20px;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 32px 0;
}

.contact-header p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 25px;
  color: #000;
  margin-bottom: 40px;
  max-width: 480px;
}

.contact-info-block {
  margin-bottom: 32px;
}

.contact-info-block h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: #000;
  letter-spacing: 0.08em;
  margin: 0 0 12px 0;
}

.contact-info-block p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: #000;
  margin: 0;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  color: #000;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group textarea,
.form-group select {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  padding: 14px 16px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  outline: none;
  transition: background 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  background: #fafafa;
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.submit-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: #000;
  border: 1px solid #000;
  padding: 16px 40px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  align-self: flex-start;
}

.submit-btn:hover {
  background: #fff;
  color: #000;
}

.form-message {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  padding: 12px 16px;
  margin-top: 16px;
}

.form-message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #2e7d32;
}

.form-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #c62828;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: #ffffff;
  color: #000000;
  border-top: 1px solid #000;
  padding: 32px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .hero-left {
    width: 50%;
    min-width: 300px;
  }
  .hero-right {
    width: 50%;
  }
  .manifesto-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .service-card:nth-child(2) {
    border-right: none;
  }
  .service-card:nth-child(1),
  .service-card:nth-child(2) {
    border-bottom: 1px solid #000;
  }
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 60px;
  }
}

@media (max-width: 768px) {
  .site-nav {
    padding: 16px 24px;
  }
  .nav-links {
    display: none !important;
  }
  .nav-links.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    padding: 24px;
    gap: 16px !important;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-separator {
    display: none;
  }
  .hero-section {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  .hero-left {
    width: 100%;
    min-width: auto;
    padding: 100px 24px 40px;
  }
  .hero-right {
    width: 100%;
    height: 50vh;
    min-height: 300px;
  }
  .hero-title {
    font-size: clamp(32px, 8vw, 48px);
  }
  .manifesto-section {
    padding: 80px 24px;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .service-card {
    border-right: none;
    border-bottom: 1px solid #000;
  }
  .service-card:last-child {
    border-bottom: none;
  }
  .observation-section {
    padding: 80px 24px;
  }
  .archives-header {
    padding: 60px 24px 30px;
  }
  .scene {
    height: 70vh;
  }
  .carousel {
    width: 280px;
    height: 360px;
  }
  .carousel-cell {
    width: 240px;
    height: 300px;
  }
  .preview-overlay {
    padding: 0 5vw;
    grid-template-columns: 1fr;
  }
  .contact-section {
    padding: 80px 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .site-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px;
  }
}
