:root {
  --primary: #0a0a0a;
  --primary-active: #1f1f1f;
  --primary-disabled: #e5e5e5;
  --ink: #0a0a0a;
  --body: #3a3a3a;
  --body-strong: #1a1a1a;
  --muted: #6a6a6a;
  --muted-soft: #9a9a9a;
  --hairline: #e5e5e5;
  --hairline-soft: #f0f0f0;
  --canvas: #fffaf0;
  --surface-soft: #faf5e8;
  --surface-card: #f5f0e0;
  --surface-strong: #ebe6d6;
  --surface-dark: #0a1a1a;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --brand-pink: #ff4d8b;
  --brand-teal: #1a3a3a;
  --brand-lavender: #b8a4ed;
  --brand-peach: #ffb084;
  --brand-ochre: #e8b94a;
  --brand-mint: #a4d4c5;
  --brand-coral: #ff6b5a;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  --rounded-xs: 6px;
  --rounded-sm: 8px;
  --rounded-md: 12px;
  --rounded-lg: 16px;
  --rounded-xl: 24px;
  --rounded-pill: 9999px;

  --xxs: 4px;
  --xs: 8px;
  --sm: 12px;
  --md: 16px;
  --lg: 24px;
  --xl: 32px;
  --xxl: 48px;
  --section: 96px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--canvas);
  color: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--lg);
}

.display-xl {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 88px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -3px;
  color: var(--ink);
}

.display-lg {
  font-size: 56px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--ink);
}

.display-md {
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--ink);
}

.display-sm {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--canvas);
  height: 64px;
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--lg);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sm);
}

.logo-text {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #000000, #000000);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: var(--lg);
  margin-left: auto;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--xs);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 20px;
  border-radius: var(--rounded-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background: var(--primary-active);
}

.btn-primary:disabled {
  background: var(--primary-disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn-secondary:hover {
  background: var(--surface-card);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.hero-band {
  padding: var(--section) 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--xxl);
  align-items: center;
}

.hero-text {
  max-width: 560px;
}

.hero-desc {
  font-size: 18px;
  color: var(--muted);
  margin-top: var(--lg);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--md);
  margin-top: var(--xl);
}

.hero-illustration {
  display: flex;
  justify-content: center;
}

.hero-card {
  background: var(--surface-soft);
  border-radius: var(--rounded-xl);
  padding: var(--lg);
  width: 100%;
  max-width: 480px;
}

.hero-card-header {
  display: flex;
  gap: 6px;
  margin-bottom: var(--md);
}

.hero-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hero-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--md);
}

.hero-mock-img,
.hero-mock-result {
  border-radius: var(--rounded-md);
  overflow: hidden;
  display: flex;
}

.hero-mock-img svg,
.hero-mock-result svg {
  width: 100%;
  height: auto;
}

.hero-mock-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.features-section {
  padding: var(--section) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--xxl);
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--md);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--lg);
}

.feature-card {
  border-radius: var(--rounded-xl);
  padding: var(--xl);
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-card-icon {
  margin-bottom: var(--lg);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--sm);
}

.feature-card p {
  font-size: 14px;
  line-height: 1.55;
}

.feature-card-pink {
  background: var(--brand-pink);
  color: var(--on-primary);
}

.feature-card-pink p {
  color: rgba(255, 255, 255, 0.85);
}

.feature-card-lavender {
  background: var(--brand-lavender);
  color: var(--ink);
}

.feature-card-peach {
  background: var(--brand-peach);
  color: var(--ink);
}

.feature-card-teal {
  background: var(--brand-teal);
  color: var(--on-dark);
}

.feature-card-teal p {
  color: rgba(255, 255, 255, 0.8);
}

.workspace-section {
  padding: var(--section) 0;
}

.workspace {
  background: var(--surface-soft);
  border-radius: var(--rounded-xl);
  overflow: hidden;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--md) var(--lg);
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  gap: var(--md);
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--sm);
}

.toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: var(--xs);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.tool-btn:hover {
  color: var(--ink);
  background: var(--surface-card);
}

.tool-btn.active {
  color: var(--ink);
  background: var(--surface-card);
  border-color: var(--ink);
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: var(--sm);
}

.brush-size-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.brush-size-slider {
  width: 100px;
  accent-color: var(--ink);
}

.brush-size-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  min-width: 32px;
}

.workspace-canvas-area {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.upload-zone {
  padding: var(--xxl);
  cursor: pointer;
}

.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--md);
}

.upload-icon {
  opacity: 0.7;
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.upload-hint {
  font-size: 14px;
  color: var(--muted);
}

.upload-zone.drag-over .upload-zone-inner {
  transform: scale(1.02);
}

.canvas-container {
  position: relative;
  display: inline-block;
  cursor: none;
}

.canvas-container canvas {
  display: block;
}

#maskCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.brush-cursor {
  position: fixed;
  border: 2px solid var(--brand-pink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  display: none;
  transform: translate(-50%, -50%);
}

.workspace-result {
  padding: var(--lg);
  border-top: 1px solid var(--hairline);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--md);
}

.result-actions {
  display: flex;
  gap: var(--sm);
}

.result-canvas-wrap {
  display: flex;
  justify-content: center;
  background: var(--canvas);
  border-radius: var(--rounded-lg);
  padding: var(--md);
}

#resultCanvas {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--rounded-sm);
}

.workspace-bottom {
  display: flex;
  justify-content: center;
  gap: var(--md);
  padding: var(--lg);
  border-top: 1px solid var(--hairline);
}

.how-section {
  padding: var(--section) 0;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lg);
}

.how-card {
  border-radius: var(--rounded-xl);
  padding: var(--xl);
}

.how-step {
  display: inline-block;
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -2px;
  opacity: 0.2;
  margin-bottom: var(--md);
  line-height: 1;
}

.how-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--sm);
}

.how-card p {
  font-size: 14px;
  line-height: 1.55;
}

.how-card-teal {
  background: var(--brand-teal);
  color: var(--on-dark);
}

.how-card-teal .how-step {
  opacity: 0.3;
}

.how-card-teal p {
  color: rgba(255, 255, 255, 0.8);
}

.how-card-ochre {
  background: var(--brand-ochre);
  color: var(--ink);
}

.how-card-ochre .how-step {
  opacity: 0.3;
}

.how-card-cream {
  background: var(--surface-card);
  color: var(--ink);
}

.how-card-cream .how-step {
  opacity: 0.3;
}

.site-footer {
  background: var(--surface-soft);
  padding: var(--xxl) 0;
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sm);
  margin-bottom: var(--md);
}

.footer-brand span {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.footer-copy {
  font-size: 14px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto var(--sm);
}

.footer-note {
  font-size: 13px;
  color: var(--muted-soft);
}

.compare-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.7);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--lg);
}

.compare-modal.active {
  display: flex;
}

.compare-modal-inner {
  background: var(--canvas);
  border-radius: var(--rounded-xl);
  padding: var(--lg);
  max-width: 900px;
  width: 100%;
  position: relative;
}

.compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--md);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.compare-slider-track {
  flex: 1;
  height: 6px;
  background: var(--hairline);
  border-radius: var(--rounded-pill);
  margin: 0 var(--md);
  position: relative;
  cursor: pointer;
}

.compare-slider-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.compare-body {
  position: relative;
  border-radius: var(--rounded-lg);
  overflow: hidden;
}

.compare-body canvas {
  display: block;
  width: 100%;
}

.compare-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.compare-overlay canvas {
  display: block;
}

.compare-close {
  position: absolute;
  top: var(--md);
  right: var(--md);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-card);
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.compare-close:hover {
  background: var(--surface-strong);
}

.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.processing-overlay.active {
  display: flex;
}

.processing-card {
  background: var(--canvas);
  border-radius: var(--rounded-xl);
  padding: var(--xxl);
  text-align: center;
}

.processing-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--hairline);
  border-top-color: var(--brand-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--lg);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.processing-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--xs);
}

.processing-hint {
  font-size: 14px;
  color: var(--muted);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--hairline);
  margin: 0 var(--xs);
}

.btn-ai {
  background: linear-gradient(135deg, #7c3aed, #e11d48);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  position: relative;
  overflow: hidden;
  font-weight: 600;
}

.btn-ai::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  animation: aiShimmer 3s infinite;
}

@keyframes aiShimmer {
  0% { left: -60%; }
  100% { left: 130%; }
}

.btn-ai:hover {
  background: linear-gradient(135deg, #6d28d9, #be123c);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.btn-ai:disabled {
  background: var(--primary-disabled);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ai:disabled::after {
  display: none;
}

.btn-ai-auto {
  background: linear-gradient(135deg, #d35207, #ffc815);
  color: #fff;
  border: none;
  box-shadow: 0 2px 12px rgba(255, 234, 42, 0.4);
  position: relative;
  overflow: hidden;
  font-weight: 600;
}

.btn-ai-auto::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  animation: aiShimmer 3s infinite;
}

@keyframes aiShimmer {
  0% { left: -60%; }
  100% { left: 130%; }
}

.btn-ai-auto:hover {
  background: linear-gradient(135deg, #d35207, #ffc815);
  box-shadow: 0 4px 18px rgba(255, 234, 42, 0.7);
  transform: translateY(-1px);
}

.btn-ai-auto:disabled {
  background: var(--primary-disabled);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.ai-status {
  font-size: 12px;
  color: var(--muted-soft);
  white-space: nowrap;
}

.ai-status.success {
  color: var(--success);
}

.ai-status.error {
  color: var(--error);
}

.processing-text-ai {
  font-size: 14px;
  color: var(--muted);
  margin-top: var(--xs);
}

@media (max-width: 1024px) {
  .display-xl {
    font-size: 56px;
    letter-spacing: -2px;
  }

  .display-md {
    font-size: 32px;
    letter-spacing: -0.5px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--xl);
  }

  .feature-grid,
  .how-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    justify-content: center;
  }

  .toolbar-center {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .display-xl {
    font-size: 40px;
    letter-spacing: -1px;
  }

  .display-md {
    font-size: 28px;
    letter-spacing: -0.5px;
  }

  .hero-band {
    padding: var(--xxl) 0;
  }

  .features-section,
  .workspace-section,
  .how-section {
    padding: var(--xxl) 0;
  }

  .nav-links {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-card {
    padding: var(--md);
  }

  .workspace-toolbar {
    padding: var(--sm) var(--md);
  }

  .tool-btn span {
    display: none;
  }

  .feature-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }
}
