* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f4f2;
  color: #222;
}

body { display: flex; flex-direction: column; }

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 8px;
}
.heading { flex: 1; min-width: 0; }
.brand { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #888; }
h1 { margin: 4px 0 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
h1 .sep { color: #aaa; font-weight: 400; }
h1 .factory { letter-spacing: .04em; }
h1 .type { font-weight: 400; color: #555; }

.project-link {
  flex: none;
  padding: 10px 16px;
  border: 1px solid #222;
  border-radius: 20px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.project-link[hidden] { display: none; }

main { flex: 1; display: flex; flex-direction: column; padding: 0 12px 16px; }

model-viewer {
  flex: 1;
  width: 100%;
  min-height: 60vh;
  background: #fff;
  border-radius: 12px;
}

.ar-button {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 14px 26px;
  border: 0;
  border-radius: 28px;
  background: #222;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.progress { position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.progress-fill { height: 100%; width: 0; background: #222; transition: width .2s; }

.ar-scale {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.ar-scale.natural { background: rgba(20, 120, 70, .85); }

.hint { margin: 12px 8px 0; font-size: 14px; color: #666; text-align: center; }
.error { margin: 12px 8px 0; font-size: 15px; color: #b00020; text-align: center; }
