/* ── RESET & BASE ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #06050f;
  --surface: #0d0b1a;
  --surface-2: #141228;
  --border: #221e3a;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-dim: rgba(139, 92, 246, 0.1);
  --accent-glow: rgba(139, 92, 246, 0.2);
  --text: #ece8f8;
  --muted: #7060a0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
}

/* ── PAGE WRAPPER ── */
.page-wrapper {
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

/* ── BACK LINK ── */
.back-link {
  align-self: flex-start;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-2);
}

/* ── HEADER ── */
.page-header {
  text-align: center;
  margin-bottom: 36px;
}

.header-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-dim);
  border: 1px solid rgba(139, 92, 246, 0.28);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.page-header h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.header-sub {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── QUOTE CARD ── */
.quote-card,
#container {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow:
    0 0 0 1px var(--border),
    0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  margin-bottom: 28px;
  transition: box-shadow 0.3s ease;
}

#container:hover {
  box-shadow:
    0 0 0 1px var(--accent),
    0 20px 60px var(--accent-glow);
}

/* Quote open mark */
#container::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 26px;
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.25;
}

#container p {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-style: italic;
  font-weight: 500;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 20px;
}

#container h3 {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-2);
  letter-spacing: 0.03em;
}

/* ── LOADER ── */
.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── ERROR MESSAGE ── */
.message {
  font-size: 0.95rem;
  color: #e85050;
  font-weight: 500;
}

/* ── BUTTONS ── */
.btn-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

button {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s;
}

button:hover {
  transform: translateY(-2px);
}

/* New Quote */
#btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

#btn:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Copy */
#copyBtn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

#copyBtn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

/* Twitter/X Share */
#twitterBtn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

#twitterBtn:hover {
  border-color: #29b6f6;
  color: #29b6f6;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding-top: 32px;
  }
  #container {
    padding: 36px 24px;
  }
  button {
    flex: 1;
    min-width: 0;
  }
}
