*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, "Times New Roman", Times, serif;
  background: #fff;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.content {
  width: 50vh;
  padding: 3rem 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, .subtitle {
  align-self: flex-start;
}

h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.subtitle {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #999;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.3rem;
}

.subtitle a { color: #999; text-decoration: none; }
.subtitle a:hover { color: #1a1a1a; }

.privacy {
  align-self: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #999;
  font-size: 0.7rem;
  margin-bottom: 2rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 1.5rem;
}

.step-btn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  width: 2.2em;
  height: 2.2em;
  border: none;
  background: #f5f5f5;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.step-btn:hover {
  background: #e8e8e8;
}

.step-btn:active {
  background: #ddd;
}

.controls input[type=number] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  width: 3em;
  padding: 0.3em 0.4em;
  border: none;
  background: #f5f5f5;
  color: #1a1a1a;
  text-align: center;
  -moz-appearance: textfield;
}

.controls input[type=number]::-webkit-inner-spin-button,
.controls input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.controls input[type=number]:focus {
  outline: 1px solid #1a1a1a;
}

#dropzone {
  width: 50vh;
  height: 50vh;
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  text-align: center;
  cursor: pointer;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dropzone.has-image {
  cursor: pointer;
  background-size: cover;
  background-position: center center;
}

#dropzone .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

#dropzone.initial .overlay {
  opacity: 1;
  transition: opacity 0.6s;
}

#dropzone:hover .overlay,
#dropzone.hover .overlay {
  opacity: 1;
}

#dropzone .overlay p {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

#dropzone .overlay p span {
  text-decoration: underline;
}

#dropzone p.hint {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #999;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#dropzone p.hint span {
  color: #1a1a1a;
  text-decoration: underline;
  font-weight: 500;
}

#fileInput { display: none; }

#result {
  width: 50vh;
  margin-top: 0.5rem;
  min-height: 420px;
}

.palette-group {
  width: 100%;
}

.palette-group + .palette-group {
  margin-top: 0.75rem;
}

.swatch-row {
  display: flex;
  width: 100%;
}

.swatch {
  flex: 1;
  height: 80px;
  cursor: pointer;
}

.detail-row {
  display: flex;
  width: 100%;
}

.color-card {
  flex: 1;
  background: #fff;
  padding: 0.5rem 0.5rem;
}

.color-pip {
  display: none;
}

.color-card .color-name {
  font-size: 0.65rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.6;
  margin-bottom: 0.1rem;
}

.color-card .code {
  font-size: 0.65rem;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Menlo, monospace;
  color: #666;
  line-height: 1.6;
  word-break: break-all;
}

.color-card .code strong {
  color: #1a1a1a;
  font-weight: 700;
}

@media (max-width: 768px) {
  .content {
    width: 94vw;
    padding: 1.2rem 0 1.5rem;
  }

  h1 {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0.2rem;
  }

  .subtitle {
    font-size: 0.6rem;
    text-align: center;
    margin-bottom: 0.2rem;
  }

  .privacy {
    font-size: 0.6rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  #dropzone {
    width: 94vw;
    height: 94vw;
  }

  #result {
    width: 94vw;
    min-height: auto;
  }

  .swatch-row {
    display: none;
  }

  .detail-row {
    flex-direction: column;
  }

  .color-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .color-pip {
    display: block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .color-card .color-name {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .color-card .code {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .color-card .code br {
    display: none;
  }

  .color-card .code strong::after {
    content: ' \00b7 ';
  }

  .controls {
    margin-top: 1rem;
  }

  #result {
    min-height: auto;
  }
}

/* ── Social media slide view ─────────────────────────────────────── */

.social-container {
  --social-aspect: 0.75;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
}

.social-slide {
  width: min(90vw, 600px);
  aspect-ratio: var(--social-aspect);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
}

/* Slide 1: image + palette card */
.social-slide1-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.pantone-card-slide1 {
  margin: auto auto 3.5% auto;
  position: relative;
  z-index: 1;
}

.social-watermark {
  position: absolute;
  top: 3.5%;
  left: 4%;
  font-family: "DM Mono", monospace;
  font-size: clamp(0.55rem, 1.5vmin, 0.75rem);
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  z-index: 2;
  pointer-events: none;
}

/* Slides 2-6: blurred bg + pantone card */
.social-slide-bg {
  position: absolute;
  inset: -10px;
  background-size: cover;
  background-position: center;
  filter: blur(3px);
  z-index: 0;
}

.social-slide-tint {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  mix-blend-mode: color;
}

.pantone-card {
  position: relative;
  z-index: 1;
  width: calc(75% * min(1, 0.7 / var(--social-aspect)));
  margin: auto;
  background: #fff;
  padding: 2.5%;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.pantone-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.pantone-info {
  padding-top: 5%;
  flex-shrink: 0;
}

.pantone-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.8rem, 2.2vmin, 1.3rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.3em;
}

.pantone-hex {
  font-family: "DM Mono", monospace;
  font-size: clamp(0.6rem, 1.5vmin, 0.85rem);
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 0.2em;
}

.pantone-codes {
  font-family: "DM Mono", monospace;
  font-size: clamp(0.6rem, 1.5vmin, 0.85rem);
  color: #999;
  line-height: 1.7;
}

.pantone-slide-num {
  position: absolute;
  bottom: 3.5%;
  right: 4%;
  font-family: "DM Mono", monospace;
  font-size: clamp(0.55rem, 1.5vmin, 0.75rem);
  color: rgba(255, 255, 255, 0.45);
  z-index: 2;
}

/* Palette strip card (slide 1) */
.pantone-card-last {
  aspect-ratio: auto;
  margin: auto auto 3.5% auto;
}
.pantone-last-palette {
  width: 100%;
  aspect-ratio: 5 / 1;
  display: flex;
}

.pantone-last-rect {
  flex: 1;
  height: 100%;
}
