:root {
  --bg-color: #FDFCF8;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --purple-500: #a855f7;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--stone-900);
  background: var(--bg-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #e0e7ff;
  color: #312e81;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1152px;
}

/* Typography Helpers */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.color-stone-500 {
  color: var(--stone-500);
}

.font-medium {
  font-weight: 500;
}

.text-sm {
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  max-width: 896px;
  margin: 0 auto;
  padding: 80px 24px 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preview-wrapper {
  position: relative;
  margin-bottom: 48px;
  cursor: pointer;
}

.preview-wrapper:hover .glow {
  opacity: 0.3;
}

.glow {
  position: absolute;
  inset: 0;
  background: var(--indigo-500);
  filter: blur(48px);
  opacity: 0.2;
  transition: opacity 0.3s;
  border-radius: 50%;
  z-index: 0;
}

.main-avatar {
  position: relative;
  z-index: 1;
  border-radius: 50%;
  border: 4px solid white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
  opacity: 1;
}

.main-avatar.morphing {
  transform: scale(0.8);
  opacity: 0;
}

.shadow {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.icon-btn {
  position: absolute;
  bottom: -8px;
  right: -8px;
  z-index: 2;
  background: white;
  border: 1px solid var(--stone-100);
  padding: 16px;
  border-radius: 50%;
  color: var(--indigo-600);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  transform: scale(1.1);
}

.icon-btn:active {
  transform: scale(0.95);
}

.title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .title {
    font-size: 4.5rem;
  }
}

.gradient-text {
  background: linear-gradient(to right, var(--indigo-500), var(--purple-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--stone-500);
  max-width: 42rem;
  margin-bottom: 48px;
  font-weight: 400;
}

.subtitle strong {
  color: var(--stone-700);
}

/* Input Area */
.input-wrapper {
  width: 100%;
  max-width: 32rem;
  background: white;
  padding: 8px;
  border-radius: 16px;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid var(--stone-200);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.input-wrapper:focus-within {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  border-color: #a5b4fc;
}

.seed-label {
  padding-left: 16px;
  color: var(--stone-400);
  font-family: monospace;
  font-size: 0.875rem;
}

#seed-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--stone-700);
  padding: 12px 0;
  width: 100%;
}

.copy-btn {
  background: var(--stone-900);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.copy-btn:hover {
  background: var(--stone-800);
}

.download-btn {
  background: var(--indigo-600);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.download-btn:hover {
  background: var(--indigo-500);
}

/* Controls Row */
.controls-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  justify-content: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--stone-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select-input {
  background: white;
  border: 1px solid var(--stone-200);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--stone-700);
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.2s;
}

.select-input:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Sections */
.seo-section {
  border-top: 1px solid var(--stone-200);
  background: var(--stone-50);
  padding: 96px 0;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.section-desc {
  font-size: 1.125rem;
  color: var(--stone-600);
  margin: 0 auto 48px;
  max-width: 42rem;
}

.features-grid {
  display: grid;
  gap: 32px;
  text-align: left;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature h3 {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--stone-900);
}

.feature p {
  color: var(--stone-600);
  font-size: 0.875rem;
}

.grid-section {
  border-top: 1px solid var(--stone-200);
  background: white;
  padding: 96px 0;
  flex: 1;
}

.grid-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.grid-header h2 {
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  .grid-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.secondary-btn {
  background: var(--stone-100);
  color: var(--stone-600);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.secondary-btn:hover {
  background: var(--stone-200);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 24px;
}

@media (min-width: 640px) {
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  .avatar-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1024px) {
  .avatar-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.grid-item:hover {
  transform: translateY(-4px);
}

.grid-item-avatar {
  border-radius: 50%;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid var(--stone-100);
}

.grid-item-seed {
  font-size: 0.75rem;
  color: var(--stone-400);
  font-family: monospace;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

/* Footer */
.footer {
  background: var(--stone-900);
  color: var(--stone-400);
  padding: 48px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.grayscale {
  filter: grayscale(100%);
  opacity: 0.5;
  transition: all 0.3s;
}

.grayscale:hover {
  filter: grayscale(0%);
  opacity: 1;
}