/* CutPico — editor, steps and footer (loaded after styles.css). */

/* Editor */

.workspace {
  display: grid;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px 48px;
}

.workspace:focus-visible {
  outline-offset: 8px;
}

.stage-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background-color: #fff;
  background-image:
    conic-gradient(var(--checker) 25%, transparent 25% 50%, var(--checker) 50% 75%, transparent 75%);
  background-size: 20px 20px;
  box-shadow: var(--shadow-sm);
}

.stage-frame.is-solid {
  background-image: none;
}

.preview {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 8px;
}

.progress-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(420px, 100%);
  padding: 26px 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.status {
  margin: 0;
  font-weight: 650;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  transition: transform 0.2s ease;
}

.progress-note {
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.85rem;
}

/* Result panel */

.panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--surface);
}

.seg-btn {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.field {
  margin: 0;
  padding: 0;
  border: 0;
}

.field legend {
  padding: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 650;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.swatch.is-on {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.swatch-transparent {
  background-color: #fff;
  background-image:
    conic-gradient(var(--checker) 25%, transparent 25% 50%, var(--checker) 50% 75%, transparent 75%);
  background-size: 12px 12px;
}

.swatch-white {
  background: #fff;
}

.swatch-black {
  background: #111827;
}

.swatch-custom {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.swatch-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.downloads {
  display: grid;
  gap: 10px;
}

.meta {
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.86rem;
}

.panel-note {
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.82rem;
}

/* Steps */

.steps {
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px 20px 56px;
  border-top: 1px solid var(--line-soft);
}

.steps h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.step h3 {
  font-size: 1.06rem;
}

.step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--blue-strong);
  font-weight: 700;
}

.steps-link {
  margin: 24px 0 0;
  font-weight: 600;
}

/* Footer */

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-mute);
  font-size: 0.92rem;
}

.footer-brand {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 650;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 10px;
}

.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-note,
.noscript-note {
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.88rem;
}

.noscript-note {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 32px;
}

/* Wide screens: sample on the left, upload card on the right. */

@media (min-width: 920px) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.85fr);
    align-items: center;
    gap: 44px;
    padding-top: 18px;
  }

  .demo {
    order: -1;
  }

  .workspace {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    align-items: start;
    gap: 28px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .demo-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .demo-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
  }

  .demo-frame {
    aspect-ratio: 4 / 3;
  }

  .demo-label {
    margin: 0;
  }

  .stage-frame {
    min-height: 240px;
    padding: 10px;
  }

  .preview {
    max-height: 48vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
