/* 사진이 되기까지 — ModelGarden (모형정원) demo styles
   Light warm background · charcoal text · lime accent. No framework. */

:root {
  --bg: #f7f3ea;
  --card: #fffdf8;
  --ink: #2b2a25;
  --ink-soft: #6b675b;
  --accent: #65a30d;
  --accent-deep: #4d7c0f;
  --accent-soft: #f0f6de;
  --accent-line: #dbe8c0;
  --line: #e7e0cf;
  --stage-bg: #191813;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", "Pretendard", -apple-system,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header / footer ---------- */

.site {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 16px 0;
}

.brand {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand span { color: var(--ink-soft); font-weight: 500; }

.site-foot {
  margin-top: 26px;
  padding-bottom: 34px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.site-foot p { margin: 0; }
.site-foot a { color: var(--accent-deep); }
.foot-brand { font-weight: 600; }
.foot-brand span { font-weight: 500; }

/* ---------- title ---------- */

h1 {
  margin: 26px 0 8px;
  font-size: clamp(28px, 5.4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.desc {
  margin: 0 0 18px;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- stage ---------- */

.stage-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(60, 50, 20, 0.05), 0 10px 28px rgba(60, 50, 20, 0.07);
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4; /* overridden at runtime from the data */
  overflow: hidden;
  border-radius: 10px;
  background: var(--stage-bg);
}

.stage svg,
.stage .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.photo {
  opacity: 0;
  transition: opacity 120ms linear;
  pointer-events: none;
}

/* Real-download mode: the crossfade is its own CSS transition that starts
   only after all bytes arrived and the image decoded — independent of the
   byte-based progress bar (which is already at 100% by then). */
.photo.photo-show {
  opacity: 1;
  transition: opacity 600ms ease;
}

.stage-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px 2px;
  font-size: 14px;
}

.stage-label { font-weight: 600; }
.tri-count { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- progress ---------- */

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e9e2d1;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
}

.pct {
  min-width: 44px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

/* ---------- controls ---------- */

.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: 14px;
  align-items: end;
}

.slider-ctl {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.control-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.btn {
  min-height: 44px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn:hover { background: var(--accent-deep); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.selects {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
}
.selects .control { flex: 1; }

select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* ---------- note / footer ---------- */

.note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: #3f6212;
  font-size: 13px;
}

/* ---------- focus & motion ---------- */

:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  .controls { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .slider-ctl { grid-column: 1; }
  .selects { flex-direction: column; }
  .stage-meta { font-size: 13px; }
}
