/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-text-muted: #57534e;
  --color-accent: #7c3aed;
  --color-accent-hover: #6d28d9;
  --color-border: #e7e5e4;
  --color-success: #059669;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --max-width: 1100px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

ul {
  list-style: none;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

.logo:hover {
  color: var(--color-text);
  text-decoration: none;
}

.logo svg {
  flex-shrink: 0;
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-nav a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}

/* ===== Hero ===== */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto 2rem;
}

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  background: var(--color-surface);
  max-width: 600px;
  margin: 0 auto;
}

.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--color-accent);
  background-color: #f5f3ff;
  box-shadow: var(--shadow-md);
}

.upload-zone.drag-over {
  border-color: var(--color-accent);
  background-color: #ede9fe;
  box-shadow: var(--shadow-lg);
}

.upload-icon {
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.browse-link {
  color: var(--color-accent);
  font-weight: 600;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===== Preview Section ===== */
.preview-section {
  padding: 2rem 0 3rem;
}

.preview-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.image-preview h2,
.palette-result h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.image-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  max-height: 100%;
  object-fit: contain;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  background: #f5f5f4;
  border-color: #d6d3d1;
}

/* ===== Palette Swatches ===== */
.palette-swatches {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.swatch-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}

.swatch-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.swatch-color {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.08);
}

.swatch-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.swatch-hex {
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.swatch-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.copy-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}

.swatch-row:hover .copy-hint {
  opacity: 1;
}

.palette-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

.copy-feedback {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-success);
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-feedback.visible {
  opacity: 1;
}

/* ===== How It Works ===== */
.how-it-works {
  padding: 3rem 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.step-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===== Use Cases ===== */
.use-cases {
  padding: 3rem 0;
}

.use-cases h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.case-card {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.case-card:hover {
  box-shadow: var(--shadow-md);
}

.case-icon {
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.case-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.case-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===== FAQ ===== */
.faq {
  padding: 3rem 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.faq h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item dt {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.faq-item dd {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-left: 0;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===== About Page ===== */
.about-page {
  padding: 3rem 0;
}

.about-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.about-content {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* ===== Legal Pages ===== */
.legal-page {
  padding: 3rem 0;
  max-width: 720px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.legal-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .preview-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .upload-zone {
    padding: 2rem 1rem;
  }

  .steps-grid,
  .cases-grid {
    grid-template-columns: 1fr;
  }

  .site-nav ul {
    gap: 1rem;
  }

  .logo span {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .swatch-row {
    padding: 0.6rem 0.75rem;
    gap: 0.75rem;
  }

  .swatch-color {
    width: 36px;
    height: 36px;
  }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
