* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

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

.ros-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0.7rem;
}

.nav-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-btn,
.primary-btn,
.ghost-btn,
.motion-btn {
  border: 0;
  border-radius: 0.85rem;
  padding: 0.78rem 1rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.nav-btn,
.ghost-btn {
  color: #0f172a;
  background: #e2e8f0;
}

.primary-btn,
.motion-btn.is-active {
  color: #ffffff;
  background: #059669;
  box-shadow: 0 18px 34px -24px rgba(5, 150, 105, 0.9);
}

.nav-btn:hover,
.primary-btn:hover,
.ghost-btn:hover,
.motion-btn:hover {
  transform: translateY(-2px);
}

.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 4vw, 3rem) 3rem;
  background:
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.16), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(14, 165, 233, 0.12), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 58%, #eef2ff 100%);
}

.hero-inner,
.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 1rem;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.45rem, 6vw, 5.8rem);
  font-weight: 1000;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 1000;
}

h3 {
  font-size: 1.25rem;
  font-weight: 1000;
}

.lead {
  max-width: 680px;
  margin: 1.2rem 0 0;
  color: #475569;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.7rem;
}

.image-stack {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 0.9rem;
  align-items: stretch;
}

.image-card {
  overflow: hidden;
  min-height: 210px;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #ffffff;
  box-shadow: 0 24px 54px -42px rgba(15, 23, 42, 0.9);
}

.image-card:first-child {
  grid-row: span 2;
}

.image-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: contain;
  padding: 0.8rem;
}

.section {
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem);
}

.motion-panel {
  display: grid;
  grid-template-columns: minmax(330px, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  align-items: stretch;
  margin-top: 1.4rem;
}

.robot-stage,
.info-panel,
.card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 26px 58px -46px rgba(15, 23, 42, 0.95);
}

.robot-stage {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff, #eef2f7);
  background-size: 42px 42px, 42px 42px, 100% 100%;
}

.robot-svg {
  width: 100%;
  height: 100%;
  min-height: 430px;
}

#shoulderGroup,
#elbowGroup {
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-box: view-box;
}

#shoulderGroup {
  transform-origin: 220px 300px;
}

#elbowGroup {
  transform-origin: 335px 220px;
}

.rail {
  fill: none;
  stroke: rgba(15, 23, 42, 0.16);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 12 16;
}

.weld-path {
  fill: none;
  stroke: #059669;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 8 14;
  animation: pathFlow 1.5s linear infinite;
}

.arm {
  stroke: #0f172a;
  stroke-width: 18;
  stroke-linecap: round;
}

.arm.secondary {
  stroke: #334155;
  stroke-width: 14;
}

.joint {
  fill: #059669;
  stroke: #ffffff;
  stroke-width: 5;
}

.tool {
  fill: #f97316;
}

.workpiece {
  fill: #cbd5e1;
  stroke: #64748b;
  stroke-width: 3;
}

.spark {
  fill: #facc15;
  opacity: 0;
  animation: sparkPulse 1.15s ease-in-out infinite;
}

.code-tcp {
  transition: transform 0.78s cubic-bezier(0.22, 0.86, 0.24, 1);
  filter: drop-shadow(0 10px 16px rgba(249, 115, 22, 0.35));
}

.code-tcp circle {
  fill: #f97316;
  stroke: #ffffff;
  stroke-width: 5;
}

.code-tcp path {
  stroke: #0f172a;
  stroke-width: 4;
  stroke-linecap: round;
}

.code-tcp text {
  fill: #0f172a;
  font-size: 18px;
  font-weight: 1000;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
}

.motion-readout {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.readout-box {
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.86);
  color: #ffffff;
}

.readout-box span {
  display: block;
  color: #86efac;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.readout-box strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.88rem;
}

.info-panel {
  padding: 1.4rem;
}

.motion-controls {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 1.1rem 0;
}

.step-list,
.feature-grid {
  display: grid;
  gap: 0.9rem;
}

.step {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem;
  border-radius: 0.95rem;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.step-number {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  color: #ffffff;
  background: #0f172a;
  font-weight: 1000;
}

.step p,
.card p,
.info-panel p {
  margin: 0.35rem 0 0;
  color: #475569;
  line-height: 1.7;
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.4rem;
}

.card {
  padding: 1.25rem;
}

.card ul {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  color: #475569;
  line-height: 1.8;
}

.compare-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-top: 1.3rem;
}

.metric {
  padding: 1rem;
  border-radius: 0.95rem;
  color: #ffffff;
  background: #0f172a;
}

.metric span {
  display: block;
  color: #86efac;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
}

.code-simulator,
.real-workflow {
  margin-top: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1.1rem;
  background: #ffffff;
  box-shadow: 0 26px 58px -46px rgba(15, 23, 42, 0.95);
}

.code-simulator {
  padding: 1.25rem;
}

.code-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.code-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.code-input {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.95rem;
  padding: 1rem;
  color: #d1fae5;
  background: #0f172a;
  font: 800 0.95rem/1.65 Consolas, "Courier New", monospace;
  outline: none;
}

.code-input:focus {
  border-color: rgba(5, 150, 105, 0.7);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.14);
}

.code-output {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  color: #064e3b;
  background: #d1fae5;
  font-weight: 850;
}

.code-output.is-error {
  color: #7f1d1d;
  background: #fee2e2;
}

.code-help {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.code-help span {
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: #f8fafc;
  color: #475569;
  line-height: 1.5;
}

.real-workflow {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  overflow: hidden;
}

.workflow-card {
  min-height: 270px;
  padding: 1rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.workflow-card > span {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  font-weight: 1000;
}

.workflow-card p {
  margin: 0.45rem 0 0;
  color: #475569;
  line-height: 1.55;
}

.workflow-screen,
.controller-box,
.cell-motion {
  position: relative;
  height: 112px;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 0.85rem;
  background: #0f172a;
}

.screen-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(134, 239, 172, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(134, 239, 172, 0.14) 1px, transparent 1px);
  background-size: 20px 20px;
}

.mini-robot {
  position: absolute;
  left: 34px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-left: 10px solid #ef4444;
  border-top: 10px solid #ef4444;
  transform-origin: left bottom;
  animation: miniRobotMove 2.6s ease-in-out infinite;
}

.fanuc-mini {
  border-color: #facc15;
}

.mini-robot::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 38px;
  width: 30px;
  height: 8px;
  border-radius: 999px;
  background: #38bdf8;
}

.mini-path {
  position: absolute;
  right: 24px;
  bottom: 34px;
  width: 96px;
  height: 42px;
  border-bottom: 5px dashed #86efac;
  border-radius: 50%;
  animation: pathGlow 1.4s linear infinite;
}

.controller-box {
  display: grid;
  align-content: center;
  gap: 0.7rem;
  padding: 1rem;
}

.controller-box div {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #86efac, #38bdf8, #86efac);
  background-size: 220% 100%;
  animation: controllerLoad 1.65s linear infinite;
}

.controller-box div:nth-child(2) {
  width: 78%;
  animation-delay: 0.2s;
}

.controller-box div:nth-child(3) {
  width: 58%;
  animation-delay: 0.4s;
}

.fanuc-controller div {
  background: linear-gradient(90deg, #facc15, #ef4444, #facc15);
  background-size: 220% 100%;
}

.cell-motion {
  background:
    linear-gradient(180deg, transparent 64%, rgba(148, 163, 184, 0.35) 64%),
    #e2e8f0;
}

.cell-arm {
  position: absolute;
  left: 48px;
  bottom: 34px;
  width: 95px;
  height: 14px;
  border-radius: 999px;
  background: #ef4444;
  transform-origin: left center;
  animation: realArmMove 2.4s ease-in-out infinite;
}

.fanuc-cell .cell-arm {
  background: #facc15;
}

.cell-arm::before {
  content: "";
  position: absolute;
  left: -18px;
  top: -13px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1e293b;
}

.cell-arm::after {
  content: "";
  position: absolute;
  right: -48px;
  top: 0;
  width: 58px;
  height: 12px;
  border-radius: 999px;
  background: #334155;
}

.cell-torch {
  position: absolute;
  left: 186px;
  bottom: 42px;
  width: 32px;
  height: 10px;
  background: #f97316;
  transform: rotate(22deg);
  animation: torchFollow 2.4s ease-in-out infinite;
}

.cell-weld {
  position: absolute;
  right: 24px;
  bottom: 27px;
  width: 100px;
  height: 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #059669 0 10px, #86efac 10px 18px);
  animation: pathGlow 1s linear infinite;
}

.data-flow {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #059669, transparent);
  background-size: 220% 100%;
  animation: dataMove 1.2s linear infinite;
}

.footer {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  color: #94a3b8;
  background: #0f172a;
  text-align: center;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

@keyframes pathFlow {
  to {
    stroke-dashoffset: -44;
  }
}

@keyframes sparkPulse {
  35% {
    opacity: 1;
    transform: scale(1.25);
  }
  100% {
    opacity: 0;
  }
}

@keyframes miniRobotMove {
  0%, 100% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(26deg);
  }
}

@keyframes pathGlow {
  to {
    filter: hue-rotate(45deg);
    opacity: 0.72;
  }
}

@keyframes controllerLoad {
  to {
    background-position: -220% 0;
  }
}

@keyframes realArmMove {
  0%, 100% {
    transform: rotate(-20deg);
  }
  50% {
    transform: rotate(22deg);
  }
}

@keyframes torchFollow {
  0%, 100% {
    transform: translate(0, 0) rotate(22deg);
  }
  50% {
    transform: translate(44px, -18px) rotate(5deg);
  }
}

@keyframes dataMove {
  to {
    background-position: -220% 0;
  }
}

.section.muted {
  background: #f8fafc;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px;
  align-items: start;
}

.split p {
  color: #475569;
  font-size: 1rem;
  line-height: 1.8;
}

.stats-grid {
  display: grid;
  gap: 14px;
}

.stats-grid div {
  border: 1px solid #dbe5e1;
  border-radius: 16px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.stats-grid strong {
  display: block;
  color: #047857;
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 8px;
}

.stats-grid span {
  color: #334155;
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero-grid,
  .motion-panel,
  .feature-grid,
  .compare-strip,
  .code-help,
  .real-workflow,
  .split {
    grid-template-columns: 1fr;
  }

  .data-flow {
    width: 6px;
    height: 42px;
    justify-self: center;
    background: linear-gradient(180deg, transparent, #059669, transparent);
    background-size: 100% 220%;
  }

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

  .image-card:first-child {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .ros-nav {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .robot-stage,
  .robot-svg {
    min-height: 520px;
  }
}
