/* ==========================================================================
   CUSTOM ENGINEERED SOLUTIONS — SPECIFIC STYLES
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables & Theme Overrides
   -------------------------------------------------------------------------- */
:root {
  --ces-dark: #0a0b0d;
  --ces-gray: #1f2226;
  --ces-white: #f5f6f8;
  --ces-blue: #1c2635;
  --ces-teal: #0eb3c4;
  --ces-amber: #e88d2d;
  
  --hud-grid: rgba(255, 255, 255, 0.03);
  --hud-border: rgba(255, 255, 255, 0.08);
  --hud-glow: rgba(14, 179, 196, 0.15);
}

/* Base Body Adjustment for darker theme feel if needed locally */
.ces-page {
  background-color: var(--ces-dark);
  color: var(--ces-white);
}

/* --------------------------------------------------------------------------
   CES Hero Section (Section 1)
   -------------------------------------------------------------------------- */
.ces-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  background-color: #050506;
  overflow: hidden;
}

.ces-hero__bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}

.ces-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.ces-hero__bg-grid {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: 
    linear-gradient(var(--hud-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hud-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}

.ces-hero__glow {
  position: absolute;
  top: 30%; right: -10%;
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--hud-glow) 0%, transparent 60%);
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
}

.ces-hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.ces-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ces-teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.ces-hero__badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background-color: var(--ces-teal);
  box-shadow: 0 0 8px var(--ces-teal);
}

.ces-hero__title {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: #fff;
}

.ces-hero__subtitle {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
  color: #b0b4ba;
  margin-bottom: 40px;
  max-width: 700px;
}

.ces-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 60px;
}

.ces-hero__micro-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--hud-border);
}

.ces-hero__micro-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ces-hero__micro-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.ces-hero__micro-label {
  font-size: 13px;
  color: #8c9096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Sticky Section Navigation (Section 2)
   -------------------------------------------------------------------------- */
.ces-section-nav {
  position: sticky;
  top: 72px; /* Header height */
  background: rgba(10, 11, 13, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hud-border);
  z-index: 90;
  overflow-x: auto;
  scrollbar-width: none;
}

.ces-section-nav::-webkit-scrollbar {
  display: none;
}

.ces-section-nav__inner {
  display: flex;
  align-items: center;
  padding: 0 20px;
  min-width: max-content;
  max-width: 1400px;
  margin: 0 auto;
}

.ces-section-nav__link {
  display: inline-flex;
  padding: 20px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #8c9096;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.ces-section-nav__link:hover {
  color: #fff;
}

.ces-section-nav__link.active {
  color: var(--ces-teal);
  border-bottom-color: var(--ces-teal);
}

/* --------------------------------------------------------------------------
   Constraint Map Infographic (Section 3)
   -------------------------------------------------------------------------- */
.ces-constraint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.ces-constraint-visual {
  position: relative;
  border: 1px solid var(--hud-border);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 40px;
  aspect-ratio: 1;
}

.ces-constraint-map {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ces-constraint-node {
  background: var(--ces-gray);
  border: 1px solid var(--hud-border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.3s ease;
}

.ces-constraint-node:hover {
  border-color: var(--ces-teal);
  background: var(--ces-blue);
  transform: translateY(-5px);
}

.ces-constraint-icon {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--ces-teal);
}

.ces-constraint-node h5 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}

.ces-constraint-node p {
  font-size: 13px;
  color: #b0b4ba;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Customization Matrix (Section 4)
   -------------------------------------------------------------------------- */
.ces-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.ces-matrix-card {
  background: var(--ces-gray);
  border: 1px solid var(--hud-border);
  padding: 32px 24px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.ces-matrix-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 40px; height: 3px;
  background: var(--ces-teal);
  transition: var(--transition);
}

.ces-matrix-card:hover::before {
  width: 100%;
}

.ces-matrix-icon {
  width: 48px;
  height: 48px;
  background: rgba(14, 179, 196, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--ces-teal);
  font-size: 24px;
}

.ces-matrix-card h4 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 12px;
}

.ces-matrix-card p {
  font-size: 14px;
  color: #b0b4ba;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Engineering Workflow (Section 5)
   -------------------------------------------------------------------------- */
.ces-workflow-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  margin-top: 60px;
}

.ces-workflow-track::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 50px;
  right: 50px;
  height: 2px;
  background: var(--hud-border);
  z-index: 1;
}

.ces-workflow-step {
  position: relative;
  z-index: 2;
  text-align: center;
}

.ces-workflow-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--ces-dark);
  border: 2px solid var(--ces-teal);
  color: var(--ces-teal);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 0 15px rgba(14, 179, 196, 0.2);
}

.ces-workflow-step h5 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 12px;
}

.ces-workflow-step p {
  color: #b0b4ba;
  font-size: 14px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Product Ecosystem (Section 6)
   -------------------------------------------------------------------------- */
.ces-ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}

.ces-ecosystem-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
  transition: all 0.3s ease;
}

.ces-ecosystem-card:hover {
  background: rgba(14, 179, 196, 0.05);
  border-color: rgba(14, 179, 196, 0.3);
}

.ces-ecosystem-img {
  height: 140px;
  margin-bottom: 24px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.ces-ecosystem-card:hover .ces-ecosystem-img {
  opacity: 1;
  transform: scale(1.05);
}

.ces-ecosystem-card h3 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}

.ces-ecosystem-card p {
  font-size: 14px;
  color: #8c9096;
}

.ces-ecosystem-connector {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 0;
  color: var(--ces-teal);
}

.ces-ecosystem-hybrid {
  grid-column: 1 / -1;
  background: var(--ces-blue);
  border: 1px solid var(--ces-teal);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Application Pathways (Section 7)
   -------------------------------------------------------------------------- */
.ces-pathway-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--hud-border);
  padding-bottom: 16px;
}

.ces-pathway-tab {
  background: none;
  border: none;
  color: #8c9096;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.ces-pathway-tab:hover {
  color: #fff;
}

.ces-pathway-tab.active {
  color: var(--ces-teal);
  background: rgba(14, 179, 196, 0.1);
  border-radius: 4px;
}

.ces-pathway-content {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.ces-pathway-content.active {
  display: grid;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ces-pathway-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 30px;
}

.ces-pathway-metric {
  background: var(--ces-gray);
  padding: 20px;
  border-radius: 8px;
  border-left: 3px solid var(--ces-teal);
}

.ces-pathway-metric h6 {
  color: #fff;
  margin-bottom: 4px;
}

.ces-pathway-metric p {
  font-size: 13px;
  color: #b0b4ba;
}

.ces-pathway-visual {
  background: var(--ces-gray);
  border-radius: 12px;
  height: 400px;
  border: 1px solid var(--hud-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #8c9096;
  position: relative;
  overflow: hidden;
}

.ces-pathway-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Trade-off Matrix (Section 8)
   -------------------------------------------------------------------------- */
.ces-tradeoff-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
  align-items: center;
}

.ces-tradeoff-chart {
  background: var(--ces-gray);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  padding: 40px;
  position: relative;
}

.ces-tradeoff-axis {
  position: relative;
  height: 300px;
  border-left: 2px solid var(--hud-border);
  border-bottom: 2px solid var(--hud-border);
  margin: 20px 0 0 20px;
}

.ces-tradeoff-label-y {
  position: absolute;
  top: 50%;
  left: -80px;
  transform: translateY(-50%) rotate(-90deg);
  color: #8c9096;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ces-tradeoff-label-x {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: #8c9096;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ces-tradeoff-zone {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.ces-tradeoff-zone--1 {
  bottom: 20px; left: 20px; width: 40%; height: 40%;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  color: #b0b4ba;
}
.ces-tradeoff-zone--2 {
  top: 20px; right: 20px; width: 50%; height: 50%;
  background: rgba(14, 179, 196, 0.1);
  border: 1px solid var(--ces-teal);
  color: var(--ces-teal);
  box-shadow: 0 0 20px rgba(14, 179, 196, 0.1);
}

/* --------------------------------------------------------------------------
   Comparison Table (Section 10)
   -------------------------------------------------------------------------- */
.ces-compare__table-wrap {
  overflow-x: auto;
  margin-top: 40px;
  border-radius: 12px;
  border: 1px solid var(--hud-border);
  background: var(--ces-gray);
}

.ces-compare__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.ces-compare__table th,
.ces-compare__table td {
  padding: 20px 24px;
  text-align: left;
  border-bottom: 1px solid var(--hud-border);
}

.ces-compare__table th {
  font-size: 14px;
  color: #8c9096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: rgba(255,255,255,0.02);
}

.ces-compare__table td {
  font-size: 15px;
  color: #b0b4ba;
  vertical-align: top;
}

.ces-compare__table tr:last-child td {
  border-bottom: none;
}

.ces-compare__col--highlight {
  background: rgba(14, 179, 196, 0.05);
  color: #fff;
}

.ces-compare__table td.ces-compare__col--highlight {
  border-left: 1px solid var(--ces-teal);
  border-right: 1px solid var(--ces-teal);
  background: rgba(14, 179, 196, 0.03);
  color: var(--ces-teal);
  font-weight: 500;
}

.ces-compare__table th.ces-compare__col--highlight {
  border-top: 2px solid var(--ces-teal);
  border-left: 1px solid var(--ces-teal);
  border-right: 1px solid var(--ces-teal);
  color: var(--ces-teal);
}

/* --------------------------------------------------------------------------
   Material Science Bridge (Section 11)
   -------------------------------------------------------------------------- */
.ces-bridge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.ces-bridge-flow {
  display: flex;
  align-items: stretch;
  background: var(--ces-gray);
  border-radius: 12px;
  border: 1px solid var(--hud-border);
  overflow: hidden;
}

.ces-bridge-source {
  flex: 1;
  padding: 40px;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--hud-border);
}

.ces-bridge-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  color: var(--ces-teal);
  font-size: 24px;
}

.ces-bridge-outcome {
  flex: 1.5;
  padding: 40px;
}

.ces-bridge-source h5 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 8px;
}

.ces-bridge-source p {
  color: #b0b4ba;
  font-size: 14px;
}

.ces-bridge-outcome h5 {
  color: var(--ces-teal);
  font-size: 18px;
  margin-bottom: 12px;
}

.ces-bridge-outcome p {
  color: #fff;
  font-size: 15px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Resource Hub (Section 13)
   -------------------------------------------------------------------------- */
.ces-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.ces-resource-card {
  background: var(--ces-gray);
  border: 1px solid var(--hud-border);
  border-radius: 8px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.ces-resource-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}

.ces-resource-icon {
  font-size: 32px;
  margin-bottom: 20px;
  opacity: 0.8;
}

.ces-resource-card h4 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 12px;
}

.ces-resource-card p {
  color: #8c9096;
  font-size: 14px;
  margin-bottom: 30px;
  flex: 1;
}

.ces-resource-link {
  color: var(--ces-teal);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Responsive Layout Additions
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .ces-constraint-grid,
  .ces-tradeoff-grid,
  .ces-pathway-content {
    grid-template-columns: 1fr;
  }
  .ces-matrix-grid,
  .ces-workflow-track,
  .ces-resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ces-ecosystem-grid {
    grid-template-columns: 1fr;
  }
  .ces-workflow-track::before {
    display: none;
  }
  .ces-bridge-flow {
    flex-direction: column;
  }
  .ces-bridge-source {
    border-right: none;
    border-bottom: 1px solid var(--hud-border);
  }
  .ces-bridge-arrow {
    transform: rotate(90deg);
    padding: 20px 0;
  }
}

@media (max-width: 768px) {
  .ces-matrix-grid,
  .ces-workflow-track,
  .ces-resource-grid {
    grid-template-columns: 1fr;
  }
  .ces-pathway-metrics {
    grid-template-columns: 1fr;
  }
}
