:root {
  --bg-primary: #f8f6fc;
  --bg-secondary: #ffffff;
  --bg-form: #ffffff;
  --text-primary: #2d2640;
  --text-secondary: #6b5f7a;
  --text-muted: #8c92ac;
  --primary-color: #9966cc;
  --primary-hover: #8855bb;
  --accent-color: #856088;
  --border-color: rgba(153, 102, 204, 0.15);
  --shadow-sm: 0 2px 8px rgba(133, 96, 136, 0.08);
  --shadow-md: 0 8px 24px rgba(133, 96, 136, 0.12);
  --shadow-lg: 0 16px 48px rgba(133, 96, 136, 0.15);

  --border-radius: 16px;
  --border-radius-sm: 12px;
  --border-radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-serif: "Crimson Pro", Georgia, serif;
}

[data-theme="dark"] {
  --bg-primary: #1a1625;
  --bg-secondary: #251f34;
  --bg-form: #2d2640;
  --text-primary: #e8e4f0;
  --text-secondary: #c4b9d4;
  --text-muted: #8c92ac;
  --primary-color: #b892e6;
  --primary-hover: #c9a5ee;
  --accent-color: #a67fb8;
  --border-color: rgba(184, 146, 230, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

.container {
  margin: 0 auto;
  max-width: 680px;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  margin-bottom: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  position: relative;
}

.header-content {
  flex: 1;
}

h1 {
  font-weight: 700;
  font-size: 48px;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 400;
}

.theme-toggle {
  background: var(--bg-form);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.theme-toggle svg {
  color: var(--text-primary);
}

.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

[data-theme="dark"] .sun-icon {
  display: block;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

.form-container {
  background: var(--bg-form);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.form-container:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

form {
  display: flex;
  gap: 12px;
}

.instructions {
  flex: 1;
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 16px;
  border-radius: var(--border-radius-sm);
  line-height: 24px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: var(--transition);
}

.instructions:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(153, 102, 204, 0.1);
}

.instructions::placeholder {
  color: var(--text-muted);
}

.submit-button {
  background: var(--primary-color);
  color: white;
  border: none;
  min-width: 120px;
  border-radius: var(--border-radius-sm);
  padding: 16px 28px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.submit-button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.submit-button:active {
  transform: translateY(0);
}

.hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-left: 4px;
}
.poem {
  font-family: var(--font-serif);
  font-size: 18px;
  background: var(--bg-form);
  border: 1px solid var(--border-color);
  padding: 32px;
  line-height: 1.8;
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-height: 200px;
}

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

.hidden {
  display: none;
}

.generating {
  color: var(--primary-color);
  font-style: italic;
  text-align: center;
  font-family: var(--font-sans);
  animation: pulse 1.5s ease-in-out infinite;
}

.error {
  color: #e74c3c;
  text-align: center;
  font-family: var(--font-sans);
}

footer {
  margin-top: auto;
  padding-top: 64px;
  padding-bottom: 32px;
}

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

.footer-text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.footer-text a {
  font-weight: 500;
  color: var(--primary-color);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-form);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  transition: var(--transition);
}

.social-links a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.social-icon {
  width: 20px;
  height: 20px;
  filter: var(--icon-filter);
  transition: var(--transition);
}

:root {
  --icon-filter: brightness(0) saturate(100%) invert(24%) sepia(15%)
    saturate(1824%) hue-rotate(229deg) brightness(92%) contrast(91%);
}

[data-theme="dark"] {
  --icon-filter: brightness(0) saturate(100%) invert(95%) sepia(5%)
    saturate(464%) hue-rotate(207deg) brightness(102%) contrast(93%);
}

.social-links a:hover .social-icon {
  filter: brightness(0) saturate(100%) invert(100%);
}

.footer-links {
  font-size: 14px;
  color: var(--text-muted);
}

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

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

.separator {
  margin: 0 12px;
  color: var(--text-muted);
}

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

@media (max-width: 768px) {
  .container {
    padding: 24px 16px;
  }

  header {
    margin-bottom: 32px;
  }

  h1 {
    font-size: 36px;
  }

  .subtitle {
    font-size: 16px;
  }

  .form-container {
    padding: 20px;
  }

  form {
    flex-direction: column;
  }

  .instructions {
    width: 100%;
  }

  .submit-button {
    width: 100%;
    padding: 16px;
  }

  .poem {
    padding: 24px;
    font-size: 16px;
  }

  .social-links {
    gap: 12px;
  }

  .social-links a {
    width: 36px;
    height: 36px;
  }

  .social-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .form-container {
    padding: 16px;
  }

  .poem {
    padding: 20px;
    font-size: 15px;
  }

  .footer-text {
    font-size: 14px;
  }
}
