﻿:root {
  color-scheme: light;
  --ink: #14201c;
  --muted: #64706b;
  --line: #d9e2dd;
  --surface: #ffffff;
  --soft: #eef4f0;
  --accent: #1fbf8f;
  --accent-strong: #0d8f69;
  --amber: #f3b33d;
  --blue: #385dd8;
  --shadow: 0 18px 50px rgba(20, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f7faf8;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 250, 248, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand,
.nav a,
.button {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 14px;
}

.nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.hero {
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  padding: clamp(36px, 7vw, 86px) clamp(16px, 5vw, 72px) clamp(26px, 5vw, 64px);
}

.hero-copy {
  max-width: 720px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

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

.button,
button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
}

.primary {
  background: var(--ink);
  color: white;
}

.ghost {
  background: white;
  border: 1px solid var(--line);
}

.full {
  width: 100%;
}

.hero-visual {
  display: grid;
  min-height: 520px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(31, 191, 143, 0.22), transparent 48%),
    linear-gradient(35deg, rgba(56, 93, 216, 0.2), transparent 52%),
    #e8f0ec;
  box-shadow: var(--shadow);
}

.printer {
  position: relative;
  width: min(80%, 560px);
  aspect-ratio: 1.14;
  border: 14px solid #22312c;
  border-bottom-width: 24px;
  border-radius: 8px;
  transform: perspective(900px) rotateX(58deg) rotateZ(-34deg);
  transform-style: preserve-3d;
}

.printer span {
  position: absolute;
  display: block;
}

.rail.top {
  top: 18%;
  left: 10%;
  width: 80%;
  height: 12px;
  background: var(--blue);
}

.rail.side {
  top: 18%;
  left: 48%;
  width: 12px;
  height: 46%;
  background: var(--blue);
}

.nozzle {
  top: 17%;
  left: 43%;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--amber);
  transform: translateZ(58px);
}

.print-bed {
  left: 16%;
  bottom: 14%;
  width: 68%;
  height: 30%;
  border-radius: 8px;
  background: #cad8d1;
  box-shadow: inset 0 0 0 4px #98aaa1;
}

.printed-part {
  left: 36%;
  bottom: 24%;
  width: 28%;
  height: 18%;
  border-radius: 8px 8px 4px 4px;
  background: var(--accent);
  transform: translateZ(42px);
  box-shadow: 18px 18px 0 rgba(13, 143, 105, 0.36);
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(420px, 1fr) 330px;
  gap: 16px;
  padding: 18px clamp(16px, 3vw, 36px) 36px;
}

.panel,
.stage-wrap,
.materials article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(20, 32, 28, 0.06);
}

.panel {
  padding: 18px;
}

.panel-header {
  margin-bottom: 18px;
}

.field,
form label,
.control-grid label,
.upload-box label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field,
form label {
  margin-bottom: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.mode-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
}

.mode-tabs button.active {
  background: var(--ink);
  color: white;
}

.upload-box {
  margin-bottom: 14px;
  border: 1px dashed #aebdb5;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.upload-box p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 11px;
}

input[type="color"] {
  padding: 4px;
}

textarea {
  min-height: 106px;
  resize: vertical;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.toolbar button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
}

.stage-wrap {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background:
    linear-gradient(#e5ece8 1px, transparent 1px),
    linear-gradient(90deg, #e5ece8 1px, transparent 1px),
    #f9fbfa;
  background-size: 36px 36px;
}

#viewer {
  position: absolute;
  inset: 0;
}

.viewer-note {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
}

.stats {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.stats strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.summary {
  display: none;
  margin-top: 14px;
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.summary.active {
  display: block;
}

.materials {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  gap: 16px;
  padding: 26px clamp(16px, 3vw, 36px) 54px;
  align-items: stretch;
}

.materials article,
.materials > div {
  padding: 20px;
}

.materials article p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .order-panel {
    grid-column: 1 / -1;
  }

  .materials {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .workspace,
  .materials {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

  .stage-wrap {
    min-height: 520px;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
