:root {
  --ink900: #0B0B1E;
  --ink800: #12122B;
  --ink700: #1A1A3A;
  --ink500: #2c2c4e;
  --gold: #E8B84B;
  --goldBright: #FFD879;
  --parchment: #F4ECDB;
  --mist: #A8A8CF;
  --faint: #62628F;
  --correct: #5BD9A4;
  --wrong: #F4506B;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink900);
  color: var(--parchment);
  font-family: 'Nunito', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #ffffff55, transparent),
    radial-gradient(1px 1px at 70% 60%, #ffffff44, transparent),
    radial-gradient(1px 1px at 40% 80%, #ffffff33, transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, var(--gold), transparent),
    radial-gradient(1px 1px at 55% 15%, #ffffff33, transparent);
  background-size: 100% 100%;
  opacity: 0.5;
  animation: twinkle 7s ease-in-out infinite;
}

/* ── motion: matches the app's "Rise" entrance (gentle fade + lift, staggered) ── */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 0.42; } 50% { opacity: 0.62; } }
@keyframes shimmer { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }

.hero { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero h1 { animation: rise 0.6s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero .sub { animation: rise 0.6s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both; }
main .card { animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
main .card:nth-of-type(1) { animation-delay: 0.12s; }
main .card:nth-of-type(2) { animation-delay: 0.20s; }
main .card:nth-of-type(3) { animation-delay: 0.28s; }
.publish { animation: rise 0.55s 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
footer { animation: fadein 0.9s 0.5s both; }
.preview:not(.hidden) { animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* gold shimmer sweep on the brand word, like the app's featured cards */
.logo .brand {
  background: linear-gradient(100deg, var(--gold) 35%, var(--goldBright) 50%, var(--gold) 65%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 5.5s ease-in-out 1.2s infinite;
}
.logo .dot { color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  *, .stars, .logo .brand { animation: none !important; }
}

header, main, footer { position: relative; z-index: 1; }

.hero {
  max-width: 720px; margin: 0 auto; padding: 54px 22px 12px; text-align: center;
}
.logo {
  font-family: 'Fraunces', serif; font-weight: 900; font-size: 22px;
  color: var(--gold); letter-spacing: 0.5px;
}
.logo .dot { color: var(--faint); margin: 0 6px; }
.logo em { font-style: normal; color: var(--parchment); font-weight: 600; }
.hero h1 {
  font-family: 'Fraunces', serif; font-weight: 900; font-size: 34px;
  line-height: 1.1; margin: 18px 0 10px;
}
.hero .sub { color: var(--mist); font-size: 16px; line-height: 1.55; margin: 0 auto; max-width: 560px; }

main { max-width: 720px; margin: 0 auto; padding: 18px 22px 80px; }

.card {
  background: var(--ink800);
  border: 1px solid #2a2a4a;
  border-radius: 18px;
  padding: 22px;
  margin-top: 18px;
}
.card h2 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px;
  margin: 0 0 16px; color: var(--parchment);
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; font-size: 13px; color: var(--mist); font-weight: 700; }
label .muted { color: var(--faint); font-weight: 500; }
.muted { color: var(--faint); }

input[type=text], select, textarea {
  width: 100%; margin-top: 7px;
  background: var(--ink900);
  border: 1px solid var(--ink500);
  border-radius: 11px;
  color: var(--parchment);
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700;
  padding: 11px 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { font-family: ui-monospace, monospace; font-weight: 500; font-size: 13px; resize: vertical; }

code {
  background: var(--ink700); color: var(--goldBright);
  padding: 1px 6px; border-radius: 6px; font-size: 12.5px;
}
a { color: var(--gold); }

.drop {
  position: relative; margin-top: 6px;
  border: 1.5px dashed var(--ink500); border-radius: 14px;
  padding: 26px; text-align: center; color: var(--mist);
  transition: border-color 0.15s, background 0.15s;
}
.drop.over { border-color: var(--gold); background: #e8b84b14; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.paste { margin-top: 14px; }
.paste summary { color: var(--mist); cursor: pointer; font-size: 13px; }
.paste textarea { margin-top: 10px; }

.preview { margin-top: 16px; border-radius: 12px; overflow: hidden; border: 1px solid var(--ink500); }
.preview.hidden { display: none; }
.preview .bar { padding: 10px 14px; font-weight: 800; font-size: 13.5px; }
.preview .bar.ok { background: #5bd9a41f; color: var(--correct); }
.preview .bar.warn { background: #f4734d1f; color: #F4734D; }
.preview .bar.err { background: #f4506b1f; color: var(--wrong); }
.preview ul { margin: 0; padding: 8px 14px 14px; list-style: none; max-height: 220px; overflow-y: auto; }
.preview li { font-size: 13px; padding: 5px 0; border-top: 1px solid #ffffff10; color: var(--parchment); }
.preview li .q { font-weight: 700; }
.preview li .a { color: var(--correct); }
.preview li.bad { color: var(--wrong); }

.terms-card { border-color: #e8b84b44; }
.terms p { color: var(--mist); font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
.terms strong { color: var(--parchment); }
.agree { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; font-weight: 700; color: var(--parchment); font-size: 14px; }
.agree input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--gold); flex: none; }

.publish {
  display: block; width: 100%; margin-top: 22px;
  background: var(--gold); color: var(--ink900);
  border: none; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 17px;
  padding: 16px; cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.publish:hover:not(:disabled) { background: var(--goldBright); }
.publish:active:not(:disabled) { transform: scale(0.99); }
.publish:disabled { opacity: 0.45; cursor: not-allowed; }

.ghost {
  margin-top: 10px; background: transparent; color: var(--gold);
  border: 1px solid #e8b84b66; border-radius: 11px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
  padding: 9px 16px; cursor: pointer;
}

.status { text-align: center; margin-top: 16px; font-weight: 700; font-size: 14px; min-height: 20px; }
.status.ok { color: var(--correct); }
.status.err { color: var(--wrong); }

footer { text-align: center; color: var(--faint); font-size: 12px; padding: 0 22px 40px; max-width: 620px; margin: 0 auto; line-height: 1.5; }
