@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;1,9..144,500&family=Source+Sans+3:wght@400;600&display=swap");

:root {
  --bg: #0f1115;
  --bg-elevated: #171a21;
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #3ecf8e;
  --accent-dim: rgba(62, 207, 142, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(62, 207, 142, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(120, 140, 255, 0.06), transparent);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: "Source Sans 3", sans-serif;
  font-weight: 400;
  display: block;
  margin-top: 0.25rem;
}

.transport-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.status strong {
  color: var(--text);
  font-weight: 600;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--accent);
}

.quote-inject {
  margin-top: 2rem;
  padding: 1.35rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.quote-inject-title {
  margin: 0 0 1rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
}

.quote-inject-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quote-inject-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.quote-inject-form textarea,
.quote-inject-form input[type="text"] {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  resize: vertical;
  min-height: 0;
}

.quote-inject-form textarea:focus,
.quote-inject-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(62, 207, 142, 0.45);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.quote-inject-form button[type="submit"] {
  align-self: flex-start;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 0.5rem;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.quote-inject-form button[type="submit"]:hover {
  filter: brightness(1.08);
}

.quote-inject-form button[type="submit"]:active {
  transform: scale(0.98);
}

.quote-inject-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.quote-inject-msg {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
  color: var(--accent);
  min-height: 1.25em;
}

.quote-stage {
  perspective: 800px;
}

.quote-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem 2rem 2.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quote-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 2;
  pointer-events: none;
}

.quote-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(
    90deg,
    var(--accent),
    rgba(62, 207, 142, 0.65)
  );
  box-shadow: 0 0 12px rgba(62, 207, 142, 0.35);
  will-change: transform;
}

.quote-text {
  margin: 0 0 1.25rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 500;
  line-height: 1.35;
  font-style: italic;
  letter-spacing: -0.01em;
}

.quote-text::before {
  content: "\201C";
  color: var(--accent);
  margin-right: 0.15em;
  font-style: normal;
}

.quote-author {
  display: block;
  font-style: normal;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  font-family: "Source Sans 3", sans-serif;
}

/* Enter animation — re-triggered via class toggle in JS */
.quote-card.quote-animate-in {
  animation: quoteReveal 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quote-text.quote-line-animate {
  animation: lineFade 0.65s ease-out both;
}

.quote-author.quote-line-animate {
  animation: lineFade 0.65s ease-out 0.08s both;
}

@keyframes quoteReveal {
  0% {
    opacity: 0;
    transform: translateY(18px) rotateX(6deg) scale(0.98);
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
  }
}

@keyframes lineFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Index grid */
.demo-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .demo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.demo-card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.demo-card:hover {
  border-color: rgba(62, 207, 142, 0.35);
  transform: translateY(-2px);
  text-decoration: none;
}

.demo-card h2 {
  margin: 0 0 0.35rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.demo-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.intro {
  color: var(--muted);
  max-width: 40rem;
  margin-top: 0.5rem;
}

code {
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, monospace;
}
