/* embedded_system.css — M PRO9 Embedded Systems & IoT */

/* ══════════════════════════════════════════════
   FOUNDATION
══════════════════════════════════════════════ */
.es-page {
  background: #04090f;
  color: #cce4f0;
}

.es-section-label {
  display: block;
  font-family: 'Lato', sans-serif;
  font-size: 0.60rem;
  font-weight: 900;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(0, 200, 255, 0.65);
  margin-bottom: 10px;
}

/* Buttons */
.es-btn-primary {
  background: #00c8ff;
  color: #02060b;
  font-weight: 700;
  border: none;
  padding: 14px 32px;
  border-radius: 4px;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  transition: background 0.22s, transform 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px; /* WCAG 2.5.8 touch target */
}
.es-btn-primary:hover { background: #33d6ff; transform: translateY(-1px); color: #02060b; }

.es-btn-ghost {
  background: transparent;
  color: rgba(204, 228, 240, 0.80);
  border: 1px solid rgba(204, 228, 240, 0.20);
  padding: 13px 28px;
  border-radius: 4px;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  transition: border-color 0.22s, color 0.22s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px; /* WCAG 2.5.8 touch target */
}
.es-btn-ghost:hover { border-color: #00c8ff; color: #00c8ff; }

/* ══════════════════════════════════════════════
   HERO
══════════════════════════════════════════════ */
.es-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh; /* iOS 15.4+: excludes URL bar — prevents over-tall hero on Safari */
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #04090f;
}

#es-signal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* HUD corner brackets */
.es-hud-tl, .es-hud-tr, .es-hud-bl, .es-hud-br {
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 2;
}
.es-hud-tl { top: 22px; left: 22px; border-top: 1.5px solid rgba(0,200,255,0.30); border-left: 1.5px solid rgba(0,200,255,0.30); }
.es-hud-tr { top: 22px; right: 22px; border-top: 1.5px solid rgba(0,200,255,0.30); border-right: 1.5px solid rgba(0,200,255,0.30); }
.es-hud-bl { bottom: 22px; left: 22px; border-bottom: 1.5px solid rgba(0,200,255,0.30); border-left: 1.5px solid rgba(0,200,255,0.30); }
.es-hud-br { bottom: 22px; right: 22px; border-bottom: 1.5px solid rgba(0,200,255,0.30); border-right: 1.5px solid rgba(0,200,255,0.30); }

/* Channel labels overlay on right */
.es-ch-labels {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  z-index: 2;
  pointer-events: none;
}
.es-ch-labels span {
  font-family: 'Lato', sans-serif;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: rgba(0, 200, 255, 0.40);
  padding: 0 12px;
  height: 60px;
  display: flex;
  align-items: center;
}

/* IoT transparent GIF — hero right-side overlay */
.es-hero-iot-gif {
  position: absolute;
  right: 3%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(280px, 28vw, 440px);
  opacity: 0;
  pointer-events: none;
  filter: grayscale(1) sepia(1) hue-rotate(162deg) saturate(2.2) brightness(1.35);
  z-index: 1;
}

@media (max-width: 960px) {
  .es-hero { flex-direction: column; }

  /* Rejoin normal flow instead of absolutely overlaying the hero (which on
     a narrow viewport would sit on top of the text). It's a DOM sibling
     positioned before .es-hero-inner (desktop treats it as a decorative
     background layer) — order places it after the whole text/button block
     without needing to move it in the HTML. Same element, same GIF, same
     GSAP opacity reveal (es-gsap.js) — none of that is gated by width. */
  .es-hero-iot-gif {
    position: static;
    order: 2;
    display: block;
    width: min(78vw, 360px);
    max-width: 100%;
    height: auto;
    margin: 36px auto 0;
    transform: none;
  }

  .es-hero-inner { order: 1; }
}

.es-hero-inner {
  position: relative;
  z-index: 3;
  padding-top: 120px;
  padding-bottom: 100px;
  max-width: 860px;
}

.es-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(0, 200, 255, 0.60);
  margin-bottom: 30px;
}

.es-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00c8ff;
  box-shadow: 0 0 8px rgba(0,200,255,0.80);
  animation: es-dot-blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes es-dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.20; }
}

.es-hero-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(3.2rem, 8.5vw, 7.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #eef8ff;
  margin-bottom: 28px;
}

.es-hw {
  display: inline-block;
  margin-right: 0.20em;
}
.es-hw-accent { color: #00c8ff; }

.es-hero-sub {
  font-size: clamp(0.95rem, 1.8vw, 1.08rem);
  line-height: 1.80;
  color: rgba(204, 228, 240, 0.52);
  max-width: 500px;
  margin-bottom: 42px;
}

.es-hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════
   PROTOCOL MARQUEE STRIP
══════════════════════════════════════════════ */
.es-proto-strip {
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid rgba(0, 200, 255, 0.07);
  border-bottom: 1px solid rgba(0, 200, 255, 0.07);
  background: rgba(0, 200, 255, 0.022);
}

.es-proto-track {
  display: flex;
  white-space: nowrap;
  animation: es-proto-scroll 38s linear infinite;
}

@keyframes es-proto-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.es-proto-item {
  font-family: 'Lato', sans-serif;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 200, 255, 0.40);
  padding: 0 14px;
}

.es-proto-sep {
  font-size: 0.58rem;
  color: rgba(0, 200, 255, 0.16);
  line-height: 1;
  align-self: center;
}

/* ══════════════════════════════════════════════
   ARCHITECTURE LAYERS
══════════════════════════════════════════════ */
.es-layers {
  padding: 100px 0;
}

.es-layers-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 80px;
  align-items: start;
}

.es-layers-hd {
  position: sticky;
  top: 100px;
}

.es-layers-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 3.8vw, 3rem);
  line-height: 1.15;
  color: #eef8ff;
  margin-bottom: 16px;
}

.es-layers-sub {
  font-size: 0.92rem;
  line-height: 1.80;
  color: rgba(204, 228, 240, 0.50);
}

/* Stack with left rail */
.es-layer-stack {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid rgba(0, 200, 255, 0.10);
}

/* Animated pulse traveling down the rail */
.es-layer-stack::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: 36px;
  background: linear-gradient(180deg, transparent, #00c8ff, transparent);
  box-shadow: 0 0 10px rgba(0,200,255,0.60);
  animation: es-rail-pulse 3.5s ease-in-out infinite;
}

@keyframes es-rail-pulse {
  0%   { top: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: calc(100% - 36px); opacity: 0; }
}

/* GSAP-controlled data-packet dot on the rail */
.es-flow-dot {
  position: absolute;
  left: -4px;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00c8ff;
  box-shadow: 0 0 14px #00c8ff, 0 0 28px rgba(0,200,255,0.50);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}

.es-layer {
  padding: 32px 0;
  border-top: 1px solid rgba(0, 200, 255, 0.07);
}
.es-layer-last { border-bottom: 1px solid rgba(0, 200, 255, 0.07); }

.es-layer-tag {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.es-layer-num {
  font-family: 'Lato', sans-serif;
  font-size: 0.60rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(0, 200, 255, 0.50);
}

.es-layer-name {
  font-family: 'Lato', sans-serif;
  font-size: 0.60rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(204, 228, 240, 0.28);
}

.es-layer-body {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 32px;
  align-items: center;
}

.es-layer-text h3 {
  font-family: 'Lato', sans-serif;
  font-weight: 800;
  font-size: 1.08rem;
  color: #eef8ff;
  margin-bottom: 10px;
}

.es-layer-text p {
  font-size: 0.90rem;
  line-height: 1.80;
  color: rgba(204, 228, 240, 0.52);
}

.es-layer-photo {
  margin: 0;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(0, 200, 255, 0.09);
  flex-shrink: 0;
}
.es-layer-photo img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  filter: brightness(0.55) saturate(0.40);
  transition: filter 0.40s;
}
.es-layer:hover .es-layer-photo img { filter: brightness(0.72) saturate(0.65); }

/* ══════════════════════════════════════════════
   IOT DEVICE SHOWCASE
══════════════════════════════════════════════ */
.es-device-showcase {
  border-top: 1px solid rgba(0, 200, 255, 0.07);
  overflow: hidden;
}

.es-device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 580px;
}

/* Canvas / HUD side */
.es-device-canvas-col {
  position: relative;
  background: #020608;
  border-right: 1px solid rgba(0, 200, 255, 0.07);
  overflow: hidden;
}

#iot-camera-canvas {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 480px;
}

/* HUD corners — same pattern as Robotics biped section */
.es-device-hud-tl, .es-device-hud-tr,
.es-device-hud-bl, .es-device-hud-br {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 2;
}
.es-device-hud-tl { top: 16px; left: 16px;  border-top: 1.5px solid rgba(0,200,255,0.40); border-left: 1.5px solid rgba(0,200,255,0.40); }
.es-device-hud-tr { top: 16px; right: 16px; border-top: 1.5px solid rgba(0,200,255,0.40); border-right: 1.5px solid rgba(0,200,255,0.40); }
.es-device-hud-bl { bottom: 40px; left: 16px;  border-bottom: 1.5px solid rgba(0,200,255,0.40); border-left: 1.5px solid rgba(0,200,255,0.40); }
.es-device-hud-br { bottom: 40px; right: 16px; border-bottom: 1.5px solid rgba(0,200,255,0.40); border-right: 1.5px solid rgba(0,200,255,0.40); }

/* Scan line */
.es-device-scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,200,255,0.55), transparent);
  pointer-events: none;
  z-index: 2;
  animation: es-dev-scan 4s ease-in-out infinite;
}

@keyframes es-dev-scan {
  0%   { top: 10%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}

/* Loading bar */
#iot-camera-load {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020608;
  z-index: 3;
}

.iot-load-track {
  width: 140px;
  height: 2px;
  background: rgba(0,200,255,0.12);
  border-radius: 2px;
  overflow: hidden;
}

#iot-camera-bar {
  height: 100%;
  width: 0%;
  background: #00c8ff;
  border-radius: 2px;
  transition: width 0.2s;
  box-shadow: 0 0 8px rgba(0,200,255,0.6);
}

/* Data strip at bottom of canvas */
.es-device-data-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 200, 255, 0.04);
  border-top: 1px solid rgba(0, 200, 255, 0.10);
  padding: 8px 16px;
  display: flex;
  gap: 24px;
  font-family: 'Lato', sans-serif;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: rgba(0, 200, 255, 0.45);
  z-index: 2;
}

.es-ds-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10d98c;
  box-shadow: 0 0 5px rgba(16, 217, 140, 0.7);
  margin-right: 5px;
  animation: es-ds-blink 2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes es-ds-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.20; }
}

/* Text side */
.es-device-text-col {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #04090f;
}

.es-device-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  line-height: 1.16;
  color: #eef8ff;
  margin-bottom: 16px;
}

.es-device-sub {
  font-size: 0.90rem;
  line-height: 1.80;
  color: rgba(204, 228, 240, 0.50);
  max-width: 420px;
  margin-bottom: 28px;
}

/* Spec grid — 2×2 */
.es-device-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border: 1px solid rgba(0, 200, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(0, 200, 255, 0.05);
  margin-bottom: 32px;
}

.es-ds-cell {
  background: #04090f;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.es-ds-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 200, 255, 0.40);
}

.es-ds-val {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #eef8ff;
}

/* ══════════════════════════════════════════════
   IOT NETWORK SECTION
══════════════════════════════════════════════ */
.es-network {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(0, 200, 255, 0.07);
}

.es-net-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.65) brightness(0.95);
  pointer-events: none;
}

.es-net-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(4,9,15,0.62) 30%, rgba(0,30,50,0.45) 100%);
  pointer-events: none;
}

.es-net-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 60px;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 80px;
}

.es-net-inner { max-width: 540px; }

.es-net-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.14;
  color: #eef8ff;
  margin-bottom: 16px;
}

.es-net-sub {
  font-size: 0.91rem;
  line-height: 1.80;
  color: rgba(204, 228, 240, 0.52);
  margin-bottom: 36px;
}

/* Three inline stats */
.es-net-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.es-net-stat { display: flex; flex-direction: column; gap: 5px; }

.es-net-stat-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 200, 255, 0.45);
}

.es-net-stat-val {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: #00c8ff;
  letter-spacing: -0.01em;
}

/* IoT network canvas column */
.es-net-canvas-col {
  position: relative;
  height: 420px;
  min-width: 0;
}

#iot-net-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ══════════════════════════════════════════════
   BOOT TERMINAL
══════════════════════════════════════════════ */
.es-terminal {
  border-top: 1px solid rgba(0, 200, 255, 0.07);
  border-bottom: 1px solid rgba(0, 200, 255, 0.07);
  overflow: hidden;
}

.es-term-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}

.es-term-text {
  padding: 80px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #04090f;
}

.es-term-text .es-section-label { margin-bottom: 12px; }

.es-term-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.18;
  color: #eef8ff;
  margin-bottom: 18px;
}

.es-term-sub {
  font-size: 0.90rem;
  line-height: 1.80;
  color: rgba(204, 228, 240, 0.50);
  max-width: 420px;
}

.es-term-display {
  background: #010508;
  border-left: 1px solid rgba(0, 200, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
}

.es-term-wrap {
  width: 100%;
  max-width: 520px;
  border: 1px solid rgba(0, 200, 255, 0.12);
  border-radius: 6px;
  overflow: hidden;
}

.es-term-bar {
  background: rgba(0, 200, 255, 0.05);
  border-bottom: 1px solid rgba(0, 200, 255, 0.09);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.es-term-dots { display: flex; gap: 6px; }
.es-td-red   { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; flex-shrink: 0; }
.es-td-amber { width: 10px; height: 10px; border-radius: 50%; background: #febc2e; flex-shrink: 0; }
.es-td-green { width: 10px; height: 10px; border-radius: 50%; background: #28c840; flex-shrink: 0; }

.es-term-bar-label {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.65rem;
  color: rgba(0, 200, 255, 0.35);
  letter-spacing: 0.04em;
}

.es-term-body {
  padding: 20px 22px;
  min-height: 340px;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.70rem;
  line-height: 1.95;
  color: rgba(0, 200, 255, 0.65);
  background: #010406;
  white-space: nowrap;   /* preserve terminal line-per-line aesthetic */
  overflow-x: auto;      /* long lines scroll inside the terminal box */
}

/* Terminal line variants */
.es-tl-ok { color: #10d98c; }
.es-tl-warn { color: rgba(0, 200, 255, 0.38); }
.es-tl-nominal { color: #10d98c; font-weight: 700; letter-spacing: 0.03em; }
.es-tl-cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: #00c8ff;
  vertical-align: text-bottom;
  animation: es-cursor-blink 1s step-end infinite;
}

@keyframes es-cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ══════════════════════════════════════════════
   APPLICATION ROWS
══════════════════════════════════════════════ */
.es-apps {
  padding: 100px 0;
}

.es-apps-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  align-items: start;
}

.es-apps-hd {
  position: sticky;
  top: 100px;
}

.es-apps-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 4.5vw, 3.5rem);
  line-height: 1.12;
  color: #eef8ff;
  margin-top: 6px;
}

.es-app-list { display: flex; flex-direction: column; }

.es-app-row {
  display: grid;
  grid-template-columns: 44px 1fr 150px;
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid rgba(0, 200, 255, 0.07);
  align-items: center;
  transition: border-color 0.25s;
}
.es-app-row:hover { border-top-color: rgba(0, 200, 255, 0.20); }
.es-app-row-last  { border-bottom: 1px solid rgba(0, 200, 255, 0.07); }

.es-app-ch {
  font-family: 'Lato', sans-serif;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: rgba(0, 200, 255, 0.40);
  padding-top: 2px;
  align-self: start;
}

.es-app-text h3 {
  font-family: 'Lato', sans-serif;
  font-weight: 800;
  font-size: 1.0rem;
  color: #eef8ff;
  margin-bottom: 8px;
}
.es-app-text p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(204, 228, 240, 0.50);
}

.es-app-img {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 200, 255, 0.08);
  flex-shrink: 0;
}
.es-app-img img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  display: block;
  filter: brightness(0.50) saturate(0.38);
  transition: filter 0.38s;
}
.es-app-row:hover .es-app-img img { filter: brightness(0.68) saturate(0.60); }

/* ══════════════════════════════════════════════
   DEVELOPMENT PROCESS
══════════════════════════════════════════════ */
.es-process {
  padding: 100px 0;
  border-top: 1px solid rgba(0, 200, 255, 0.07);
  background: rgba(0, 200, 255, 0.018);
}

.es-process-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}

.es-process-hd {
  position: sticky;
  top: 100px;
}

.es-process-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  line-height: 1.18;
  color: #eef8ff;
  margin-top: 6px;
}

/* Desktop only (matches the 1080px breakpoint where .es-process-hd is a
   fixed 280px column): global-overrides.css's overflow-wrap:anywhere
   was splitting "Requirements" mid-word since it didn't fit that width.
   Keep it whole here; mobile's single-column layout already has room
   and is left untouched. */
@media (min-width: 1081px) {
  .es-proc-nowrap { white-space: nowrap; }
}

/* 2×2 grid with gap-as-border trick */
.es-proc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border: 1px solid rgba(0, 200, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 200, 255, 0.06);
}

.es-proc-cell {
  background: #04090f;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.es-proc-num {
  font-family: 'Lato', sans-serif;
  font-size: 0.60rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: rgba(0, 200, 255, 0.42);
}

.es-proc-cell h3 {
  font-family: 'Lato', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #eef8ff;
}
.es-proc-cell p {
  font-size: 0.87rem;
  line-height: 1.75;
  color: rgba(204, 228, 240, 0.50);
}

/* ══════════════════════════════════════════════
   CTA
══════════════════════════════════════════════ */
.es-cta {
  padding: 120px 0;
  border-top: 1px solid rgba(0, 200, 255, 0.07);
  text-align: center;
  background: linear-gradient(180deg, #04090f 0%, #020508 100%);
}

.es-cta-inner { max-width: 540px; margin: 0 auto; }

.es-cta-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.60rem;
  font-weight: 900;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(0, 200, 255, 0.55);
  margin-bottom: 14px;
  display: block;
}

.es-cta-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.12;
  color: #eef8ff;
  margin-bottom: 16px;
}

.es-cta-sub {
  font-size: 0.97rem;
  line-height: 1.72;
  color: rgba(204, 228, 240, 0.50);
  margin-bottom: 38px;
}

.es-cta-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .es-layers-inner  { grid-template-columns: 1fr; gap: 36px; }
  .es-layers-hd     { position: static; }
  .es-apps-inner    { grid-template-columns: 1fr; gap: 28px; }
  .es-apps-hd       { position: static; }
  .es-process-inner { grid-template-columns: 1fr; gap: 32px; }
  .es-process-hd    { position: static; }

  /* Contain GSAP x:28 / x:-24 initial states so they can't cause page-level
     horizontal scroll before their ScrollTrigger fires */
  .es-layers { overflow-x: clip; }

  .es-term-split   { grid-template-columns: 1fr; }
  .es-term-text    { padding: 60px 24px 40px; }
  .es-term-display { padding: 40px 24px; border-left: none; border-top: 1px solid rgba(0, 200, 255, 0.07); }

  .es-device-grid      { grid-template-columns: 1fr; }
  .es-device-canvas-col { min-height: 380px; border-right: none; border-bottom: 1px solid rgba(0, 200, 255, 0.07); }
  .es-device-text-col  { padding: 48px 32px; }

  .es-net-content { grid-template-columns: 1fr; gap: 32px; }
  .es-net-canvas-col { height: 300px; }
}

@media (max-width: 1024px) {
  /* Intermediate tablet — single-column already active from 1080px break above */
  .es-layers, .es-apps, .es-process { padding: 80px 0; }
  .es-cta { padding: 96px 0; }
  .es-net-content { padding-top: 64px; padding-bottom: 64px; }
}

@media (max-width: 768px) {
  /* Hero title — tighter clamp so 360 px phones don't clip */
  .es-hero-title { font-size: clamp(2.2rem, 8.5vw, 4rem); }
  /* Reduce hero vertical breathing room on phones */
  .es-hero-inner { padding-top: 80px; padding-bottom: 60px; }
  .es-ch-labels  { display: none; }

  .es-layer-body  { grid-template-columns: 1fr; gap: 16px; }
  .es-layer-photo { display: none; }

  .es-app-row { grid-template-columns: 36px 1fr; gap: 14px; }

  /* Image becomes a full-width row beneath the text instead of the 150px
     desktop thumbnail column — same DOM order (ch, text, img) already reads
     correctly stacked, no reordering needed. */
  .es-app-img {
    grid-column: 1 / -1;
    margin-top: 16px;
  }
  .es-app-img img {
    height: auto;
    aspect-ratio: 16 / 9;
    /* Hover never fires on touch, so the dim-until-hover desktop state would
       otherwise be permanently unreachable here — show the brightened
       (hover-equivalent) look by default instead. */
    filter: brightness(0.68) saturate(0.60);
  }

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

  .es-layers, .es-apps, .es-process { padding: 64px 0; }
  .es-cta { padding: 72px 0; }

  .es-term-text .es-term-sub { max-width: 100%; }
  /* Prevent terminal long lines from forcing page-level horizontal scroll */
  .es-term-body { overflow-x: auto; }

  .es-device-specs    { grid-template-columns: 1fr 1fr; }
  .es-device-text-col { padding: 40px 24px; }
  /* Data strip: wrap to two rows on narrow canvases */
  .es-device-data-strip { flex-wrap: wrap; gap: 6px 14px; }

  .es-net-content { padding-top: 56px; padding-bottom: 56px; }
  .es-net-stats   { gap: 24px; }
}

/* ══════════════════════════════════════════════
   430px — Mobile phones (iPhone 14 / Plus size)
══════════════════════════════════════════════ */
@media (max-width: 430px) {

  /* ── Hero ── */
  .es-hero-inner {
    padding-top: 72px;
    padding-bottom: 48px;
  }
  /* clamp floor shrinks to ~31px at 360 px, ~36px at 430 px — still bold */
  .es-hero-title {
    font-size: clamp(1.95rem, 7.5vw, 2.6rem);
  }
  .es-hero-sub {
    font-size: 0.93rem;
    margin-bottom: 32px;
  }
  /* Stack CTA buttons vertically — full-width for reliable touch targets */
  .es-hero-btns {
    flex-direction: column;
    gap: 10px;
  }
  .es-hero-btns .btn {
    width: 100%;
    box-sizing: border-box;
  }

  /* ── Section spacing ── */
  .es-layers, .es-apps, .es-process { padding: 56px 0; }
  .es-cta { padding: 60px 0; }

  /* ── Architecture layers ── */
  .es-layers-sub { font-size: 0.88rem; }

  /* ── Device showcase ── */
  .es-device-canvas-col { min-height: 300px; }
  #iot-camera-canvas    { min-height: 300px; }
  .es-device-text-col   { padding: 32px 20px; }
  .es-device-data-strip { font-size: 0.50rem; gap: 4px 10px; }
  /* Spec grid stays 2-col but tighter padding */
  .es-ds-cell { padding: 12px 14px; }

  /* ── IoT network ── */
  .es-net-content    { padding-top: 48px; padding-bottom: 48px; }
  /* Collapse decorative network canvas to save space */
  .es-net-canvas-col { height: 180px; }
  .es-net-stat-val   { font-size: 1.25rem; }

  /* ── Boot terminal ── */
  .es-term-text    { padding: 48px 20px 32px; }
  .es-term-display { padding: 24px 14px; border-top: 1px solid rgba(0,200,255,0.07); }
  /* Slightly smaller font; long lines scroll within the terminal box */
  .es-term-body {
    font-size: 0.66rem;
    min-height: 250px;
    padding: 14px 16px;
  }

  /* ── Process grid ── */
  .es-proc-cell { padding: 28px 20px; }

  /* ── CTA ── */
  .es-cta-btns {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .es-cta-btns .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* ══════════════════════════════════════════════
   360px — Smallest supported phones
══════════════════════════════════════════════ */
@media (max-width: 360px) {

  /* Hero: hard floor at 1.9rem so "Firmware" never clips viewport */
  .es-hero-title { font-size: 1.9rem; }
  .es-hero-inner { padding-top: 64px; padding-bottom: 40px; }
  .es-hero-sub   { font-size: 0.90rem; }

  /* Collapse spec grid to single column — 360 px is too tight for two cells */
  .es-device-specs { grid-template-columns: 1fr; }

  /* Tighten process cells further */
  .es-proc-cell { padding: 22px 16px; }

  /* Terminal bar label: shorten visual footprint, prevent overflow */
  .es-term-bar-label {
    font-size: 0.52rem;
    letter-spacing: 0.02em;
  }
  .es-term-body {
    font-size: 0.62rem;
    padding: 12px 14px;
    min-height: 220px;
  }

  /* Reduce decorative canvas size */
  .es-device-canvas-col { min-height: 260px; }
  #iot-camera-canvas    { min-height: 260px; }
  .es-net-canvas-col    { height: 140px; }
}

/* ══════════════════════════════════════════════
   Reduced-motion: ensure all content is visible
   (GSAP early-returns; these are CSS-level guards
    for any CSS-only animations/transitions)
══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .es-proto-track,
  .es-layer-stack::before,
  .es-eyebrow-dot,
  .es-device-scan,
  .es-ds-dot,
  .es-tl-cursor {
    animation: none !important;
  }
  /* Keep all section content visible regardless */
  .es-layer,
  .es-app-row,
  .es-proc-cell,
  .es-layers-hd,
  .es-apps-hd,
  .es-process-hd,
  .es-device-canvas-col,
  .es-device-text-col,
  .es-net-title,
  .es-net-sub,
  .es-net-stat,
  .es-term-title,
  .es-term-sub,
  .es-term-wrap,
  .es-cta-label,
  .es-cta-title,
  .es-cta-sub,
  .es-cta-btns {
    opacity: 1 !important;
    transform: none !important;
  }
}
