@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&display=swap');

:root {
  --ghibli-bg: #f7f2e7;
  --ghibli-text: #3a5743;
  --ghibli-sub: #9bb5a0;
  --ghibli-accent: #c25b56;
  --ghibli-btn-bg: rgba(255,252,245,0.7);
  --ghibli-btn-border: #c2b8a3;
  --ghibli-btn-text: #3a5743;
  --ghibli-link: #c25b56;
  --ghibli-link-hover: #3a5743;
  --heading-font: 'Quicksand', sans-serif;
  --body-font: 'Nunito', sans-serif;
}

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

body {
  margin: 0;
  background: var(--ghibli-bg);
  font-family: var(--body-font);
  color: var(--ghibli-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Soft watercolor wash background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(155, 181, 160, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(194, 91, 86, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(58, 87, 67, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 70%, rgba(194, 184, 163, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ── Canvas ── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Layout ── */
main {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 6rem 2rem 3rem;
}

/* ── Hero ── */
.hero {
  margin-bottom: 4rem;
}

.hero h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--ghibli-text);
  margin: 0 0 0.25rem;
  line-height: 1.1;
  transition: color 0.4s ease;
}

.title {
  font-family: var(--heading-font);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500;
  color: var(--ghibli-sub);
  margin: 0 0 1.2rem;
  transition: color 0.4s ease;
}

.bio {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ghibli-text);
  margin: 0 0 1.5rem;
  transition: color 0.4s ease;
}

.bio a {
  color: var(--ghibli-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.bio a:hover {
  color: var(--ghibli-link-hover);
  border-bottom-color: var(--ghibli-link-hover);
}

/* ── Social Links ── */
.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ghibli-btn-bg);
  border: 1px solid var(--ghibli-btn-border);
  transition: transform 0.2s ease, background 0.4s ease, border-color 0.4s ease;
}

.social-links a:hover {
  transform: translateY(-2px);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: var(--ghibli-text);
  transition: fill 0.4s ease;
}

/* ── Projects ── */
.projects {
  margin-bottom: 4rem;
}

.projects h2 {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ghibli-sub);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
  transition: color 0.4s ease;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(155, 181, 160, 0.2);
  transition: padding-left 0.2s ease;
}

.project-item a:hover {
  padding-left: 0.5rem;
}

.project-item.featured a {
  border-left: 3px solid var(--ghibli-accent);
  padding-left: 1rem;
  transition: padding-left 0.2s ease, border-color 0.4s ease;
}

.project-item.featured a:hover {
  padding-left: 1.5rem;
}

.project-name {
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ghibli-text);
  white-space: nowrap;
  transition: color 0.4s ease;
}

.project-desc {
  color: var(--ghibli-sub);
  font-size: 0.9rem;
  flex: 1;
  transition: color 0.4s ease;
}

.project-arrow {
  color: var(--ghibli-sub);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.4s ease;
}

.project-item a:hover .project-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Theme Generator ── */
.theme-generator {
  margin-bottom: 4rem;
}

.theme-generator h2 {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ghibli-sub);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem;
  transition: color 0.4s ease;
}

.theme-hint {
  font-size: 0.9rem;
  color: var(--ghibli-sub);
  margin: 0 0 1rem;
  transition: color 0.4s ease;
}

.theme-controls {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.theme-controls select,
.theme-controls input,
.theme-controls button {
  font-family: var(--body-font);
  font-size: 0.9rem;
  border: 1px solid var(--ghibli-btn-border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.theme-controls select {
  background: var(--ghibli-btn-bg);
  color: var(--ghibli-btn-text);
  cursor: pointer;
  min-width: 120px;
}

.theme-controls input {
  flex: 1;
  background: rgba(255, 252, 245, 0.5);
  color: var(--ghibli-text);
  min-width: 0;
}

.theme-controls input::placeholder {
  color: var(--ghibli-sub);
}

.theme-controls button {
  background: var(--ghibli-accent);
  color: #fff;
  border-color: var(--ghibli-accent);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.4s ease, border-color 0.4s ease;
}

.theme-controls button:hover {
  transform: translateY(-1px);
}

.theme-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.theme-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--ghibli-sub);
  transition: color 0.4s ease;
}

.theme-status.error {
  color: var(--ghibli-accent);
}

.reset-btn {
  margin-top: 0.75rem;
  font-family: var(--body-font);
  font-size: 0.85rem;
  color: var(--ghibli-sub);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.reset-btn:hover {
  color: var(--ghibli-text);
}

/* Loading spinner for generate button */
.theme-controls button.loading {
  position: relative;
  color: transparent;
}

.theme-controls button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Footer ── */
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
  font-family: var(--body-font);
  color: var(--ghibli-sub);
  font-size: 0.9rem;
  margin-top: 2rem;
  transition: color 0.4s ease;
}

/* ── Entrance animations ── */
.hero,
.projects,
.theme-generator {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease forwards;
}

.projects {
  animation-delay: 0.1s;
}

.theme-generator {
  animation-delay: 0.2s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  main {
    padding: 4rem 1.25rem 2rem;
  }

  .theme-controls {
    flex-direction: column;
  }

  .theme-controls select {
    min-width: unset;
  }

  .project-desc {
    display: none;
  }
}
