:root {
  --ink: #4a3b2a;
  --ink-soft: #7a6a55;
  --sky: #a9c7e8;
  --fan-blue: #9fb8d9;
  --sun: #fbd653;
  --card: #ffffff;
  --line: #e8e2d8;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Nunito", sans-serif;
  background: #ffffff;
  color: var(--ink);
  overflow-x: hidden;
}

h1, h2 { font-family: "Shantell Sans", cursive; }

h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
}

section { padding: 56px 20px; max-width: 980px; margin: 0 auto; position: relative; }

/* ---------- doodles ---------- */
.doodle { position: absolute; z-index: 0; pointer-events: none; }
.doodle-sun { top: 24px; left: 4vw; width: 84px; animation: sunspin 40s linear infinite; }
.doodle-cloud { top: 60px; right: 5vw; width: 130px; }
.doodle-cloud2 { top: 620px; left: -30px; width: 150px; opacity: .8; }

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

@media (prefers-reduced-motion: reduce) {
  .doodle-sun { animation: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 90px 20px 30px;
  max-width: 980px;
  margin: 0 auto;
}

.hero-banner {
  width: 100%;
  max-width: 760px;
  border-radius: 18px;
  display: block;
  margin: 0 auto 18px;
}

.site-title {
  font-size: clamp(1.9rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 20px;
}

.ca-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  border: 2px dashed var(--fan-blue);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  max-width: 100%;
  transition: transform .15s ease;
}
.ca-box:active { transform: scale(.98); }
.ca-label { font-weight: 800; color: var(--fan-blue); }
.ca-text {
  font-size: .82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 52vw;
}
.ca-copy { font-size: .78rem; font-weight: 800; color: var(--ink-soft); }

.socials {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}
.socials a {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 2px solid var(--line);
  transition: transform .15s ease, border-color .15s ease;
  color: #000;
}
.socials a:hover { transform: translateY(-3px); border-color: var(--fan-blue); }
.socials img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.socials .x-link svg { width: 24px; height: 24px; }

/* ---------- lore ---------- */
.lore { text-align: center; padding-top: 40px; }
.lore p {
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  font-weight: 700;
  line-height: 1.65;
  max-width: 640px;
  margin: 0 auto 16px;
}

/* ---------- generator ---------- */
.generator { text-align: center; }

.tabs {
  display: inline-flex;
  background: #f4f2ee;
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 26px;
}
.tab {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: .95rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab.active { background: var(--fan-blue); color: #fff; }

.panel { max-width: 440px; margin: 0 auto; }
.panel-hint { font-weight: 700; color: var(--ink-soft); margin-bottom: 18px; }

.dropzone {
  border: 3px dashed var(--fan-blue);
  border-radius: 22px;
  background: #fbfcfe;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  padding: 18px;
  margin-bottom: 18px;
  transition: background .15s ease;
}
.dropzone.over { background: #eef4fb; }
.dropzone span { font-weight: 800; color: var(--fan-blue); }
.dropzone img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 14px;
}

.btn {
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: var(--fan-blue);
  border: none;
  border-radius: 999px;
  padding: 13px 34px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  background: #fff;
  color: var(--fan-blue);
  border: 2px solid var(--fan-blue);
  margin-top: 14px;
}

.result { margin-top: 24px; }
.result img {
  width: 100%;
  max-width: 380px;
  border-radius: 22px;
  border: 3px solid var(--line);
  display: block;
  margin: 0 auto;
}

.status { margin-top: 14px; font-weight: 700; color: var(--ink-soft); min-height: 1.2em; }

/* ---------- tweets ---------- */
.tweets { text-align: center; }
.tweet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}
.tweet-card {
  flex: 1 1 320px;
  max-width: 440px;
  display: flex;
  justify-content: center;
}
.tweet-card .twitter-tweet { margin: 0 auto !important; }

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.art {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .15s ease;
}
.art:hover { transform: translateY(-4px) rotate(-.5deg); }
.art img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.art figcaption {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 10px 14px 14px;
  text-align: center;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 20px 46px;
  font-family: "Shantell Sans", cursive;
  font-weight: 700;
}
.footer img { width: 40px; height: 40px; border-radius: 12px; }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  section { padding: 44px 16px; }
  .hero { padding-top: 72px; }
  .doodle-sun { width: 58px; }
  .doodle-cloud { width: 92px; top: 40px; }
  .doodle-cloud2 { display: none; }
  .ca-text { max-width: 44vw; }
}

/* ---------- background options ---------- */
.bg-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.bg-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f4f2ee;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .88rem;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.bg-opt:has(input:checked) {
  border-color: var(--fan-blue);
  color: var(--ink);
  background: #eef4fb;
}
.bg-opt input { accent-color: var(--fan-blue); margin: 0; }

.scene-input {
  width: 100%;
  font-family: "Nunito", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color .15s ease;
}
.scene-input:focus { border-color: var(--fan-blue); }
.scene-input::placeholder { color: #b3a897; font-weight: 600; }
