:root {
  color-scheme: light;
  --ink: #12171b;
  --muted: #66727d;
  --line: #dce4e8;
  --surface: #ffffff;
  --surface-soft: #f4f7f8;
  --panel: #edf3f2;
  --brand: #0e6f68;
  --brand-dark: #094842;
  --accent: #d68a32;
  --steel: #5c6770;
  --pipe: #87949d;
  --shadow: 0 18px 60px rgba(23, 37, 42, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select,
input {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(220, 228, 232, 0.86);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.top-nav a:hover {
  color: var(--brand);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: clamp(46px, 7vw, 94px) clamp(18px, 5vw, 70px) clamp(32px, 5vw, 58px);
  background:
    linear-gradient(135deg, rgba(14, 111, 104, 0.11), transparent 46%),
    linear-gradient(180deg, #ffffff 0%, #f2f6f7 100%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(38px, 6vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 690px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.button.secondary {
  background: #ffffff;
  color: var(--brand-dark);
}

.hero-visual {
  min-height: 520px;
  display: grid;
  place-items: center;
}

.model-stage,
.design-canvas {
  position: relative;
  overflow: hidden;
  width: min(100%, 720px);
  aspect-ratio: 1.16;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(30deg, rgba(14, 111, 104, 0.08) 12%, transparent 12% 88%, rgba(214, 138, 50, 0.12) 88%),
    linear-gradient(180deg, #ffffff, #e9f0f1);
  box-shadow: var(--shadow);
}

.model-stage::before,
.design-canvas::before {
  content: "";
  position: absolute;
  inset: 12%;
  transform: skewY(-18deg) rotate(10deg);
  border: 1px solid rgba(92, 103, 112, 0.16);
  background-image:
    linear-gradient(rgba(92, 103, 112, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 103, 112, 0.13) 1px, transparent 1px);
  background-size: 34px 34px;
}

.pipe,
.canvas-pipe {
  position: absolute;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #aab4ba, #59646d);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.22), 0 18px 24px rgba(23, 37, 42, 0.16);
}

.pipe-a {
  left: 18%;
  top: 48%;
  width: 56%;
  transform: rotate(-16deg);
}

.pipe-b {
  left: 56%;
  top: 34%;
  width: 30%;
  transform: rotate(33deg);
}

.pipe-c {
  left: 34%;
  top: 64%;
  width: 32%;
  transform: rotate(90deg);
}

.pump,
.canvas-pump {
  position: absolute;
  display: grid;
  place-items: center;
  width: 116px;
  height: 72px;
  border: 8px solid var(--brand);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  font-weight: 900;
  box-shadow: 0 18px 28px rgba(23, 37, 42, 0.16);
}

.pump {
  left: 14%;
  top: 42%;
}

.valve,
.canvas-valve,
.canvas-check {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 16px 24px rgba(88, 61, 31, 0.2);
}

.valve-a {
  left: 58%;
  top: 43%;
  transform: rotate(-16deg);
}

.flange,
.canvas-flange,
.node {
  position: absolute;
  border-radius: 999px;
  background: #ffffff;
  border: 7px solid var(--steel);
  box-shadow: 0 14px 20px rgba(23, 37, 42, 0.15);
}

.flange {
  width: 52px;
  height: 52px;
}

.flange-a {
  left: 37%;
  top: 43%;
}

.flange-b {
  left: 74%;
  top: 43%;
}

.node {
  width: 28px;
  height: 28px;
  border-width: 5px;
}

.node-a {
  left: 31%;
  top: 65%;
}

.node-b {
  left: 51%;
  top: 64%;
}

.node-c {
  left: 78%;
  top: 31%;
}

.elbow {
  position: absolute;
  width: 82px;
  height: 82px;
  border: 22px solid var(--pipe);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.elbow-a {
  left: 66%;
  top: 29%;
  transform: rotate(15deg);
}

.workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 280px;
  gap: 16px;
  scroll-margin-top: 78px;
  padding: 22px clamp(14px, 3vw, 34px);
  background: #dfe8ea;
}

.tool-panel,
.property-panel,
.canvas-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 37, 42, 0.08);
}

.tool-panel,
.property-panel {
  padding: 16px;
}

.panel-title {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.panel-title span,
.label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-title strong {
  font-size: 20px;
}

.tool {
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.tool.is-active {
  border-color: rgba(14, 111, 104, 0.28);
  background: var(--panel);
  color: var(--brand-dark);
}

.canvas-shell {
  overflow: hidden;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.canvas-toolbar strong {
  display: block;
  margin-top: 3px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
  padding: 0 12px;
}

.design-canvas {
  width: calc(100% - 28px);
  margin: 14px;
  box-shadow: none;
}

.design-canvas.is-top-view {
  transform: none;
}

.main-line {
  left: 18%;
  top: 48%;
  width: 58%;
  transform: rotate(-12deg);
}

.branch-line {
  left: 53%;
  top: 35%;
  width: 26%;
  transform: rotate(37deg);
}

.riser-line {
  left: 36%;
  top: 58%;
  width: 28%;
  transform: rotate(88deg);
}

.canvas-pump {
  left: 12%;
  top: 41%;
}

.canvas-valve {
  left: 57%;
  top: 42%;
  transform: rotate(-12deg);
}

.canvas-check {
  left: 42%;
  top: 61%;
  background: var(--brand);
}

.canvas-flange {
  width: 48px;
  height: 48px;
}

.f1 {
  left: 34%;
  top: 43%;
}

.f2 {
  left: 73%;
  top: 42%;
}

.canvas-elbow {
  position: absolute;
  left: 64%;
  top: 31%;
  width: 78px;
  height: 78px;
  border: 21px solid var(--pipe);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(20deg);
}

.canvas-tag {
  position: absolute;
  min-height: 32px;
  border: 1px solid rgba(14, 111, 104, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.tag-a {
  left: 24%;
  top: 27%;
}

.tag-b {
  left: 61%;
  top: 58%;
}

.property-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.property-panel select,
.property-panel input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
}

.metrics {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
}

.metrics div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metrics dd {
  margin: 0;
  font-weight: 900;
}

.modules,
.roadmap {
  scroll-margin-top: 78px;
  padding: clamp(56px, 8vw, 96px) clamp(18px, 5vw, 70px);
  background: #ffffff;
}

.roadmap {
  background: var(--surface-soft);
}

.section-heading h2 {
  font-size: clamp(32px, 5vw, 60px);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.module-grid article {
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.module-grid span {
  color: var(--accent);
  font-weight: 900;
}

.module-grid h3 {
  margin: 52px 0 12px;
  font-size: 22px;
}

.module-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.roadmap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.roadmap-list span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(14, 111, 104, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  font-weight: 900;
  padding: 0 14px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 70px);
  border-top: 1px solid var(--line);
  background: var(--brand-dark);
  color: #ffffff;
}

.footer span {
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1080px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

  .tool-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .tool-panel .panel-title {
    grid-column: 1 / -1;
  }

  .tool {
    margin-bottom: 0;
  }
}

@media (max-width: 760px) {
  .app-header,
  .footer,
  .canvas-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: auto;
  }

  .hero h1,
  .section-heading h2 {
    font-size: 40px;
    line-height: 1.02;
  }

  .model-stage,
  .design-canvas {
    aspect-ratio: 0.92;
  }

  .tool-panel,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-grid article {
    min-height: auto;
  }

  .module-grid h3 {
    margin-top: 28px;
  }
}
