:root {
  --ink: #10251f;
  --muted: #62706b;
  --paper: #f3f1e9;
  --panel: #fbfaf5;
  --line: #d9d8ce;
  --acid: #c9ff55;
  --acid-dark: #9dd126;
  --blue: #2f65ff;
  --orange: #ff6d3a;
  --radius: 6px;
  --shadow: 0 24px 70px rgba(16, 37, 31, 0.1);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 37, 31, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 37, 31, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

main { min-height: 100vh; }

.site-header {
  width: min(1180px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 37, 31, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.03em;
  font-size: 15px;
}

.brand b { font-weight: 850; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--acid);
  background: var(--ink);
  border-radius: 2px 14px 2px 2px;
  font-weight: 900;
}

.header-status {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(16, 37, 31, 0.15);
  background: rgba(251, 250, 245, 0.6);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-status i, .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid-dark);
  box-shadow: 0 0 0 4px rgba(157, 209, 38, 0.14);
}

.hero {
  width: min(1180px, calc(100% - 48px));
  margin: 74px auto 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  align-items: end;
  gap: 64px;
}

.kicker, .eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.kicker span {
  margin-right: 10px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--acid);
}

.hero h1 {
  max-width: 760px;
  margin: 24px 0 20px;
  font-size: clamp(54px, 7vw, 96px);
  font-weight: 850;
  line-height: 0.89;
  letter-spacing: -0.075em;
}

.hero h1 em {
  color: transparent;
  -webkit-text-stroke: 1.7px var(--ink);
  font-style: normal;
  font-weight: 650;
}

.hero-copy > p {
  max-width: 625px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.process-line {
  position: relative;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
}

.process-line::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: #c8c9c0;
}

.process-line li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.process-line li > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #7a837f;
  background: var(--paper);
  border: 1px solid #c8c9c0;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.process-line li.active > span { color: var(--ink); background: var(--acid); border-color: var(--ink); }
.process-line strong { margin-top: 5px; font-size: 12px; }
.process-line small { color: #8a918e; font-size: 10px; }

.workspace {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-card, .result-card, .empty-result { min-height: 590px; }

.upload-card {
  padding: 42px;
  border-right: 1px solid var(--ink);
}

.upload-card h2, .result-card h2, .empty-result h2 {
  margin: 12px 0 9px;
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.upload-card > p, .empty-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.dropzone {
  position: relative;
  margin-top: 34px;
  min-height: 325px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #91a09a;
  background:
    linear-gradient(135deg, rgba(201, 255, 85, 0.09), transparent 42%),
    #f6f6ef;
  transition: 180ms ease;
}

.dropzone::before, .dropzone::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--ink);
  border-style: solid;
}

.dropzone::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.dropzone::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
.dropzone.is-dragging { border-color: var(--blue); background: rgba(47, 101, 255, 0.08); transform: scale(1.01); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.upload-glyph {
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  font-size: 30px;
  line-height: 1;
}

.dropzone strong { font-size: 18px; letter-spacing: -0.02em; }
.dropzone > span { margin: 8px 0 22px; color: var(--muted); font-size: 12px; }

.primary-button {
  min-width: 145px;
  padding: 13px 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--paper);
  background: var(--ink);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--acid-dark);
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.primary-button:hover:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--acid-dark); }
.primary-button:disabled, .sample-row button:disabled { opacity: 0.55; cursor: wait; }

.sample-row {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.sample-row button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: none;
  font-weight: 750;
  cursor: pointer;
}

.error-message, .warning-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  background: rgba(255, 109, 58, 0.1);
  color: #7b2b10;
  font-size: 12px;
  line-height: 1.5;
}

.result-card { padding: 30px; background: #e9ece5; }

.result-heading {
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-heading h2 { max-width: 390px; margin-top: 8px; font-size: 20px; overflow-wrap: anywhere; }

.success-badge {
  padding: 7px 9px;
  color: #365f0b;
  border: 1px solid rgba(54, 95, 11, 0.25);
  background: rgba(201, 255, 85, 0.55);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cad-stage {
  position: relative;
  height: 300px;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid #172c26;
  background-color: #142822;
  background-image:
    linear-gradient(rgba(201, 255, 85, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 255, 85, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.cad-toolbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  color: #a9b9b3;
  background: rgba(8, 24, 20, 0.76);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cad-toolbar span { display: flex; align-items: center; gap: 8px; }
.cad-toolbar .live-dot { display: inline-block; }

.cad-svg { position: absolute; inset: 35px 35px 24px; width: calc(100% - 70px); height: calc(100% - 59px); }
.cad-svg line, .cad-svg circle, .cad-svg path, .cad-svg polyline { stroke: var(--acid); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.dimension {
  position: absolute;
  color: #8ca099;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.dimension-x { left: 20%; right: 20%; bottom: 7px; border-top: 1px solid #587069; text-align: center; }
.dimension-x span { position: relative; top: -6px; padding: 0 7px; background: #142822; }
.dimension-y { top: 31%; right: 6px; bottom: 23%; border-left: 1px solid #587069; }
.dimension-y span { position: absolute; top: 45%; left: -18px; padding: 2px 5px; background: #142822; transform: rotate(-90deg); white-space: nowrap; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: solid #c7cbc4;
  border-width: 0 1px 1px 0;
  background: var(--panel);
}

.metrics > div {
  padding: 16px 13px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  border: solid #c7cbc4;
  border-width: 1px 0 0 1px;
}

.metrics small { grid-column: 1 / -1; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.metrics strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: -0.06em; }
.metrics span { margin-left: 4px; color: var(--muted); font-size: 9px; }
.metrics .metric-warning { background: rgba(255, 109, 58, 0.1); }

.analysis-footer {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 20px;
}

.analysis-footer h3 { margin: 0 0 8px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.entity-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.entity-tags span { padding: 6px 8px; border: 1px solid #bdc3bc; background: rgba(255,255,255,0.52); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.entity-tags b { margin-left: 5px; color: var(--blue); }
.file-facts { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.file-facts span { display: flex; justify-content: space-between; border-bottom: 1px dotted #b6bcb5; }
.file-facts b { color: var(--ink); }
.warning-box b { display: block; margin-bottom: 3px; }

.empty-result {
  position: relative;
  padding: 55px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #172c26;
  color: #edf3ed;
}

.empty-result::before {
  content: "DXF";
  position: absolute;
  right: -18px;
  bottom: -28px;
  color: rgba(255,255,255,0.025);
  font-size: 210px;
  font-weight: 900;
  letter-spacing: -0.1em;
}

.empty-result .eyebrow { color: var(--acid); }
.empty-result h2 { max-width: 430px; font-size: 36px; }
.empty-result p { max-width: 430px; color: #a4b2ad; }

.blueprint-shape {
  position: relative;
  width: min(100%, 390px);
  height: 245px;
  align-self: center;
  border: 1px solid rgba(201,255,85,0.55);
  border-radius: 6px;
  transform: rotate(-4deg);
  box-shadow: 18px 18px 0 rgba(201,255,85,0.045);
}

.blueprint-shape::before, .blueprint-shape::after, .blueprint-shape span {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(201,255,85,0.65);
  border-radius: 50%;
}

.blueprint-shape::before { left: 20px; top: 20px; }
.blueprint-shape::after { right: 20px; top: 20px; }
.blueprint-shape span:nth-child(1) { left: 20px; bottom: 20px; }
.blueprint-shape span:nth-child(2) { right: 20px; bottom: 20px; }
.blueprint-shape span:nth-child(3) { width: 60px; height: 60px; left: calc(50% - 30px); top: calc(50% - 30px); }
.blueprint-shape span:nth-child(4) { width: 1px; height: 160%; left: 50%; top: -30%; border: 0; border-left: 1px dashed rgba(201,255,85,0.22); border-radius: 0; transform: rotate(32deg); }

.trust-strip {
  width: min(1180px, calc(100% - 48px));
  margin: 34px auto 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: solid rgba(16,37,31,0.2);
  border-width: 1px 0;
}

.trust-strip > div {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 13px;
  border-right: 1px solid rgba(16,37,31,0.15);
}

.trust-strip > div:last-child { border-right: 0; }
.trust-strip span { grid-row: 1 / 3; color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.trust-strip b { font-size: 12px; }
.trust-strip small { margin-top: 3px; color: var(--muted); font-size: 10px; }

footer {
  padding: 24px max(24px, calc((100% - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  color: #a9b6b1;
  background: var(--ink);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 38px; margin-top: 52px; }
  .process-line { max-width: 520px; }
  .workspace { grid-template-columns: 1fr; }
  .upload-card { min-height: auto; border-right: 0; border-bottom: 1px solid var(--ink); }
  .result-card, .empty-result { min-height: 560px; }
}

@media (max-width: 620px) {
  .site-header, .hero, .workspace, .trust-strip { width: min(100% - 28px, 1180px); }
  .site-header { height: 72px; }
  .header-status { padding: 7px; font-size: 8px; }
  .hero { margin: 40px auto 34px; }
  .hero h1 { font-size: 53px; }
  .hero-copy > p { font-size: 15px; }
  .process-line strong { font-size: 10px; }
  .upload-card, .result-card, .empty-result { padding: 25px; }
  .dropzone { min-height: 290px; padding: 22px; }
  .sample-row { align-items: flex-start; flex-direction: column; }
  .cad-stage { height: 260px; }
  .cad-svg { left: 22px; right: 22px; width: calc(100% - 44px); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .analysis-footer { grid-template-columns: 1fr; }
  .empty-result { min-height: 510px; }
  .empty-result h2 { font-size: 30px; }
  .blueprint-shape { height: 210px; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip > div { border-right: 0; border-bottom: 1px solid rgba(16,37,31,0.15); }
  .trust-strip > div:last-child { border-bottom: 0; }
  footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
