@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
  --bg-deep: #0a0b0d;
  --bg-card: #111318;
  --bg-elevated: #181b22;
  --bg-glass: rgba(18, 21, 28, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(74, 222, 155, 0.15);
  --text-primary: #e8e6e1;
  --text-secondary: #8a8880;
  --text-muted: #555249;
  --accent-emerald: #4ade9b;
  --accent-emerald-dim: rgba(74, 222, 155, 0.08);
  --accent-gold: #d4a853;
  --accent-gold-dim: rgba(212, 168, 83, 0.1);
  --accent-amber: #c9944a;
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 60px rgba(74, 222, 155, 0.06);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* === Atmospheric Background === */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(74, 222, 155, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(212, 168, 83, 0.025) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(10, 11, 13, 1) 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle scale-like pattern overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.015;
  background-image:
    radial-gradient(circle at 50% 50%, var(--text-primary) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* === Layout === */
.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* === Header === */
.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeUp 0.8s ease-out;
}

.header__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 3.4rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.1;
}

.header__title span {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.04em;
}

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

.header__subtitle a:hover {
  color: var(--accent-gold);
}

/* === Image Showcase === */
.showcase {
  position: relative;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.8s ease-out 0.1s both;
}

.showcase__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* === Model Card === */
.model-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-deep), var(--shadow-glow);
  position: relative;
}

.model-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(74, 222, 155, 0.12) 0%, transparent 40%, transparent 60%, rgba(212, 168, 83, 0.08) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.model-card__label {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

.model-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-card);
}

.model-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease;
}

.model-card--loading .model-card__image {
  opacity: 0.4;
}

.model-card--done .model-card__image {
  opacity: 1;
}

.model-card__footer {
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  min-height: 2rem;
}

.model-card__progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.model-card__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-emerald), #3cc88a);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.model-card__status {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 3.5rem;
  text-align: right;
  letter-spacing: 0.02em;
}

.model-card--loading .model-card__status {
  animation: pulse 2s ease-in-out infinite;
}

/* === Input Area === */
.controls {
  margin-bottom: 2rem;
  animation: fadeUp 0.8s ease-out 0.2s both;
}

.controls__form {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.controls__input {
  flex: 1;
  padding: 0.9rem 1.2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  letter-spacing: 0.01em;
}

.controls__input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.controls__input:focus {
  border-color: rgba(74, 222, 155, 0.3);
  box-shadow: 0 0 0 3px rgba(74, 222, 155, 0.06);
  background: var(--bg-elevated);
}

.controls__submit {
  padding: 0.9rem 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent-emerald) 0%, #3cc88a 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.3s, opacity 0.2s;
  white-space: nowrap;
}

.controls__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(74, 222, 155, 0.2);
}

.controls__submit:active {
  transform: translateY(0);
}

/* === Morphs Section === */
.morphs {
  animation: fadeUp 0.8s ease-out 0.3s both;
}

.morphs__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  display: block;
}

.morphs__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.morph-chip {
  padding: 0.35rem 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.morph-chip:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-glow);
  box-shadow: 0 0 12px rgba(74, 222, 155, 0.06);
  transform: translateY(-1px);
}

.morph-chip:active {
  transform: translateY(0);
  background: var(--accent-emerald-dim);
}

.morph-chip--super {
  color: var(--accent-amber);
  border-color: rgba(212, 168, 83, 0.12);
}

.morph-chip--super:hover {
  border-color: rgba(212, 168, 83, 0.25);
  box-shadow: 0 0 12px rgba(212, 168, 83, 0.06);
}

/* === Info Section === */
.info {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  animation: fadeUp 0.8s ease-out 0.4s both;
}

.info__heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.info__text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
  max-width: 600px;
}

.info__text + .info__heading {
  margin-top: 1.5rem;
}

/* === Animations === */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* === Responsive === */
@media (max-width: 640px) {
  .app {
    padding: 2rem 1rem 3rem;
  }

  .header__title {
    font-size: 2.4rem;
  }

  .showcase__grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .controls__form {
    flex-direction: column;
  }

  .controls__submit {
    padding: 0.85rem;
    text-align: center;
  }

  .morph-chip {
    font-size: 0.74rem;
    padding: 0.3rem 0.6rem;
  }

  .morphs__grid {
    gap: 0.35rem;
  }
}

@media (max-width: 380px) {
  .header__title {
    font-size: 2rem;
  }
}
