/* —— Design tokens (mirrors dev/seedance-nsfw "Venice" dark palette) —— */
:root {
  --ink-950: #070708;
  --ink-900: #0c0c0e;
  --ink-850: #111114;
  --ink-800: #16161a;
  --ink-700: #24242b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --cream: #f4f1ea;
  --cream-dim: #b9b5ab;
  --cream-faint: #7d7a72;
  --accent: #e8a44c;
  --accent-hover: #f1b262;
  --violet-glow: #7c6cff;
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background-color: var(--ink-950);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* subtle grain, matching the app's ink-black base */
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.028) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
}

::selection { background: rgba(232, 164, 76, 0.3); color: var(--cream); }

a { text-decoration: none; color: inherit; }

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* hero glow layers */
.glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.8;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(124, 108, 255, 0.18) 0%, rgba(124, 108, 255, 0) 70%),
    radial-gradient(40% 50% at 80% 20%, rgba(232, 164, 76, 0.16) 0%, rgba(232, 164, 76, 0) 70%);
}
.fade-bottom {
  pointer-events: none;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 20rem;
  background: linear-gradient(to top, var(--ink-950), transparent);
}

/* —— Header —— */
header {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.625rem; }
.brand img {
  width: 28px; height: 28px;
  border-radius: 8px;
  object-fit: contain;
}
.brand span {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* landing header: no brand, nav pinned right */
.header-home { max-width: 72rem; padding: 1.25rem 1.5rem; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* legal page header: single close button, pinned right */
.header-legal { max-width: 42rem; justify-content: flex-end; }
.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--cream-dim);
  transition: all 0.15s ease;
}
.btn-close:hover {
  border-color: var(--line-strong);
  color: var(--cream);
  background: var(--ink-850);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink-950);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 1px rgba(232, 164, 76, 0.35), 0 8px 30px -8px rgba(232, 164, 76, 0.4);
}
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--cream-dim);
}
.btn-ghost:hover {
  border-color: var(--line-strong);
  color: var(--cream);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

/* —— Main / Hero (index page) —— */
main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: rgba(17, 17, 20, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  color: var(--cream-dim);
}
.badge .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse-soft 1.8s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .badge .dot { animation: none; }
}

h1 {
  margin-top: 2rem;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 24ch;
}
h1 .grad {
  background: linear-gradient(to right, var(--accent), #fcd34d, var(--violet-glow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 1.5rem auto 0;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--cream-dim);
  text-wrap: balance;
}

.cta {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.cta .btn-primary { font-weight: 600; box-shadow: 0 0 0 1px rgba(232, 164, 76, 0.35), 0 8px 30px -8px rgba(232, 164, 76, 0.4); }
.cta .hint { font-size: 0.8125rem; color: var(--cream-faint); }
.cta .hint code { color: var(--cream-dim); }

/* —— Legal pages (privacy / terms) —— */
.legal {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 5rem;
}
.legal h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  max-width: none;
  text-align: left;
}
.legal .updated {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--cream-faint);
}
.legal h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.legal p {
  margin-top: 0.75rem;
  line-height: 1.7;
  color: var(--cream-dim);
}
.legal ul {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  color: var(--cream-dim);
  line-height: 1.7;
}
.legal li { margin-top: 0.35rem; }
.legal a.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal strong { color: var(--cream); }

/* —— Footer —— */
footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--line);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--cream-faint);
}
footer .footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}
footer .footer-links a {
  color: var(--cream-dim);
  transition: color 0.15s ease;
}
footer .footer-links a:hover { color: var(--cream); }
footer .footer-links .dot { color: var(--line-strong); }

@media (max-width: 640px) {
  main { padding-top: 2.5rem; }
  .subtitle { font-size: 1rem; }
  .cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 20rem; }
  .header-home { padding: 1rem; }
}
