/* ===========================================================
   LitArbi — landing page styles
   Design tokens live on :root; never hardcode hex in rules.
   =========================================================== */

:root {
  --radius: 0.875rem;
  --background: #F5F5F7;
  --surface: #FFFFFF;
  --foreground: #1D1D1F;
  --primary: #0066FF;
  --primary-foreground: #FFFFFF;
  --secondary: #F2F2F5;
  --muted: #F2F2F5;
  --muted-foreground: #6E6E73;
  --border: rgba(0, 0, 0, 0.08);
  --ring: rgba(0, 102, 255, 0.25);
  --destructive: #D7263D;

  /* primary at low alpha for tints */
  --primary-tint: rgba(0, 102, 255, 0.10);

  --shadow-app:
    0 30px 60px -20px rgba(0, 0, 0, 0.18),
    0 12px 24px -12px rgba(0, 0, 0, 0.12);
  --shadow-cta: 0 10px 24px -8px rgba(0, 80, 255, 0.4);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);

  --nav-offset: 5rem;
}

.dark {
  --background: #0A0A0C;
  --surface: #161618;
  --foreground: #F5F5F7;
  --primary: #2D8CFF;
  --primary-foreground: #FFFFFF;
  --secondary: #1F1F22;
  --muted: #1F1F22;
  --muted-foreground: #9A9AA0;
  --border: rgba(255, 255, 255, 0.1);
  --ring: rgba(45, 140, 255, 0.35);
  --primary-tint: rgba(45, 140, 255, 0.15);

  --shadow-app:
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 12px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-cta: 0 10px 24px -8px rgba(45, 140, 255, 0.45);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0A0A0C;
    --surface: #161618;
    --foreground: #F5F5F7;
    --primary: #2D8CFF;
    --primary-foreground: #FFFFFF;
    --secondary: #1F1F22;
    --muted: #1F1F22;
    --muted-foreground: #9A9AA0;
    --border: rgba(255, 255, 255, 0.1);
    --ring: rgba(45, 140, 255, 0.35);
    --primary-tint: rgba(45, 140, 255, 0.15);

    --shadow-app:
      0 30px 60px -20px rgba(0, 0, 0, 0.6),
      0 12px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-cta: 0 10px 24px -8px rgba(45, 140, 255, 0.45);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

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

h1, h2, h3 {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  top: 0.5rem;
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 100;
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateX(-50%) translateY(0);
}

/* ---------- Layout ---------- */
.container {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
  width: 100%;
}

.container--narrow {
  max-width: 48rem;
}

.container--prose {
  max-width: 48rem;
}

.section {
  padding-block: 6rem;
}

/* ---------- Logo mark ---------- */
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
  flex: none;
  object-fit: cover;
}

/* ---------- Buttons / pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 0.8rem 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-cta);
}

.btn--primary:hover {
  opacity: 0.94;
}

.btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.pill:active {
  transform: translateY(1px);
}

.pill--dark {
  background: var(--foreground);
  color: var(--background);
}

.pill--dark:hover {
  opacity: 0.88;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--background) 75%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
}

.nav__brand-name {
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.nav__center {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.9375rem;
}

.nav__center a {
  color: var(--muted-foreground);
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav__center a:hover {
  color: var(--foreground);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

/* ---------- Language switcher ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.lang-switch__link {
  color: var(--muted-foreground);
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lang-switch__link:hover {
  color: var(--foreground);
}

.lang-switch__link[aria-current="true"] {
  color: var(--primary);
  background: var(--primary-tint);
}

.lang-switch__sep {
  color: var(--border);
  user-select: none;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 0.875rem;
}

.eyebrow--center {
  text-align: center;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-tint);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  margin: 0 0 1.75rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  position: relative;
  flex: none;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding-top: 5rem;
  padding-bottom: 3.5rem;
}

.hero__title {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 auto 1.25rem;
  max-width: 18ch;
}

.hero__sub {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--muted-foreground);
  font-size: clamp(1.0625rem, 2.5vw, 1.25rem);
}

/* ---------- Beta form ---------- */
.beta {
  max-width: 28rem;
  margin: 2.5rem auto 0;
}

.beta-form__row {
  display: flex;
  gap: 0.625rem;
}

.beta-form__input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.beta-form__input::placeholder {
  color: var(--muted-foreground);
}

.beta-form__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.beta-form__input[aria-invalid="true"] {
  border-color: var(--destructive);
}

.beta-form__submit {
  flex: none;
}

.beta-form__helper {
  margin: 0.875rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-align: center;
}

.beta-form__error {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--destructive);
  font-weight: 500;
  text-align: center;
}

/* ---------- Beta success card ---------- */
.beta-success {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.beta-success__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.beta-success__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.375rem;
}

.beta-success__copy {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

/* ---------- App window (faux macOS frame) ---------- */
.app-window {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-app);
  overflow: hidden;
  background: var(--surface);
}

.app-window__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 28px;
  padding-inline: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--foreground) 4%, var(--surface)),
    var(--surface)
  );
}

.app-window__dots {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
}

.app-window__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}

.app-window__dot--red { background: #ff5f57; }
.app-window__dot--amber { background: #febc2e; }
.app-window__dot--green { background: #28c840; }

.app-window__body {
  display: block;
}

.app-window__img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2200 / 1309;
  object-fit: cover;
  /* graceful fallback while the PNG loads */
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--primary) 12%, var(--surface)) 0%,
      var(--surface) 55%,
      color-mix(in srgb, var(--foreground) 6%, var(--surface)) 100%);
}

/* ---------- App preview (hero) ---------- */
.app-preview {
  padding-bottom: 1rem;
}

.app-preview .app-window {
  max-width: 72rem;
  margin-inline: auto;
}

/* ---------- Screenshots gallery ---------- */
.shots__head {
  margin-bottom: 3rem;
}

.shots__head .section__title {
  max-width: 26ch;
}

.shots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.shot figcaption {
  margin: 1rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 46ch;
}

.shot__label {
  display: block;
  font-weight: 600;
  color: var(--foreground);
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

/* Workflow inline screenshot */
.workflow__shot {
  margin-top: 3.5rem;
}

.workflow__shot .app-window {
  max-width: 60rem;
  margin-inline: auto;
}

.workflow__shot figcaption {
  margin: 1rem auto 0;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  max-width: 50ch;
}

/* ---------- Section titles ---------- */
.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 22ch;
  margin: 0;
}

.section__title--center {
  margin-inline: auto;
  text-align: center;
}

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-app);
}

.feature-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--primary-tint);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.125rem;
}

.feature-card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.feature-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.feature-card__body {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ---------- Workflow ---------- */
.workflow {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.workflow-step__num {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: 0.875rem;
}

.workflow-step__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.workflow-step__body {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ---------- FAQ ---------- */
.faq-list {
  margin-top: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item {
  border-top: 1px solid var(--border);
}

.faq-item:first-child {
  border-top: none;
}

.faq-item__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.faq-item__summary::-webkit-details-marker {
  display: none;
}

.faq-item__summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.faq-item__icon {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--muted);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-item__icon {
  transform: rotate(45deg);
}

.faq-item__body {
  padding: 0 1.5rem 1.375rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 60ch;
}

/* ---------- CTA ---------- */
.cta__block {
  max-width: 56rem;
  margin-inline: auto;
  background: var(--foreground);
  color: var(--background);
  border-radius: 1.5rem;
  padding: 4rem 3rem;
  text-align: center;
}

.cta__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 auto 1rem;
  max-width: 20ch;
}

.cta__sub {
  margin: 0 auto 2rem;
  max-width: 38rem;
  opacity: 0.7;
  font-size: 1.0625rem;
}

.cta__btn {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-cta);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
}

.cta__btn:hover {
  opacity: 0.94;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 3.5rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
}

.footer__tagline {
  margin: 1rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  max-width: 22rem;
  line-height: 1.6;
}

.footer__heading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin: 0 0 1rem;
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer__col a {
  font-size: 0.9375rem;
  color: var(--foreground);
  transition: color 0.15s ease;
}

.footer__col a:hover {
  color: var(--primary);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted-foreground);
}

/* ===========================================================
   Demo — animated "how it works in Word" section
   Pure CSS/JS, no libraries. Tokens only.
   =========================================================== */
.demo {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.demo__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.demo__intro {
  margin: 1rem 0 0;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 52ch;
}

.demo__live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-top: 0.25rem;
}

.demo__live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28c840;
  position: relative;
  flex: none;
}

.demo__live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #28c840;
  animation: demo-live-pulse 2s ease-out infinite;
}

@keyframes demo-live-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ---- two-panel stage ---- */
.demo-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 2.75rem;
  align-items: start;
}

.demo-panel {
  min-width: 0;
}

.demo-panel__caption {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* ---- LitArbi panel: screenshot + interactive overlays ---- */
.demo-litarbi {
  position: relative;
}

.demo-litarbi__stage {
  position: relative;
  aspect-ratio: 2200 / 1309;
}

.demo-litarbi__img {
  width: 100%;
  height: auto;
  display: block;
}

/* highlight ring drawn over the exhibit-list rows (mid-left) */
.demo-ring {
  position: absolute;
  left: 17%;
  top: 15.5%;
  width: 15%;
  height: 9.5%;
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 0 0 4px var(--ring);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.35s ease, transform 0.35s ease, top 0.45s ease;
  pointer-events: none;
  will-change: opacity, transform, top;
}

.demo-ring.is-on {
  opacity: 1;
  transform: scale(1);
}

/* the Cite ribbon button sits ~57% across / ~6% down inside the panel */
.demo-cite-target {
  position: absolute;
  left: 54.5%;
  top: 3%;
  width: 6%;
  height: 8.5%;
  border-radius: 7px;
  background: var(--primary-tint);
  outline: 2px solid var(--primary);
  outline-offset: 0;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  will-change: opacity, transform;
}

.demo-cite-target.is-on {
  opacity: 1;
  transform: scale(1);
}

/* click pulse emitted at the cursor tip */
.demo-click {
  position: absolute;
  width: 6%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--primary);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  pointer-events: none;
}

.demo-click.is-firing {
  animation: demo-click-ring 0.55s ease-out;
}

@keyframes demo-click-ring {
  0% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}

/* animated cursor — reuses assets/cursor.svg */
.demo-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 3.4%;
  height: auto;
  /* park near the exhibit rows to start */
  transform: translate(620%, 470%);
  transition: transform 0.7s cubic-bezier(0.45, 0.05, 0.2, 1);
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  will-change: transform;
}

.demo-cursor.is-pressing {
  transform: var(--cursor-pos, translate(620%, 470%)) scale(0.86);
  transition: transform 0.12s ease;
}

/* ---- Word panel ---- */
.demo-word {
  background: #fbfbfd;
  color: #1d1d1f;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dark .demo-word,
.demo-word.is-dark {
  background: var(--surface);
  color: var(--foreground);
}

.demo-word__toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--foreground) 4%, var(--surface));
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.demo-word__doc-title {
  font-weight: 600;
  color: var(--foreground);
}

.demo-word__app {
  margin-left: auto;
  letter-spacing: 0.02em;
}

.demo-word__page {
  position: relative;
  padding: 1.6rem 1.75rem 2rem;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--foreground);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 19rem;
}

.demo-word__heading {
  font-weight: 700;
  font-size: 1.0625rem;
  text-align: center;
  margin: 0 0 1.4rem;
  letter-spacing: 0.01em;
}

.demo-doc {
  display: flex;
  flex-direction: column;
}

.demo-para {
  margin: 0 0 0.95rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease, margin 0.4s ease;
  /* collapse fully when hidden so there's no reserved gap / layout jump */
  max-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  will-change: opacity, transform;
}

.demo-para.is-visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 12rem;
  margin-bottom: 0.95rem;
}

/* brief emphasis when a citation number cascades */
.demo-cite {
  transition: color 0.25s ease, background 0.25s ease;
  border-radius: 3px;
  padding: 0 1px;
}

.demo-cite.is-bumped {
  background: var(--primary-tint);
  color: var(--primary);
}

/* superscript footnote marker (EN) */
.demo-sup {
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  color: var(--primary);
  font-weight: 600;
  font-family: "Inter", sans-serif;
}

.demo-sup.is-bumped {
  background: var(--primary-tint);
  border-radius: 3px;
}

/* inline parenthetical citation (DE/FR) */
.demo-inline-cite {
  font-family: "Inter", sans-serif;
  font-size: 0.82em;
  color: var(--primary);
  font-weight: 600;
}

/* footnotes area (EN only) */
.demo-foot {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.demo-foot__item {
  display: flex;
  gap: 0.45rem;
  margin: 0 0 0.3rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(4px);
  transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.4s ease, margin 0.4s ease;
}

.demo-foot__item.is-visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 4rem;
  margin-bottom: 0.3rem;
}

.demo-foot__num {
  color: var(--primary);
  font-weight: 700;
  flex: none;
}

/* citations are hyperlinks in the real document — render them Word-link blue */
.demo-cite-link {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* toast — "Exhibits renumbered" */
.demo-toast {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translate(-50%, 140%);
  background: var(--foreground);
  color: var(--background);
  font-family: "Inter", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-app);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
  z-index: 4;
}

.demo-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.demo-toast__check {
  color: #28c840;
  font-weight: 800;
}

/* "Update Exhibits" pulse on the LitArbi side */
.demo-litarbi.is-updating .demo-cite-target {
  animation: demo-update-pulse 0.7s ease-out 2;
}

@keyframes demo-update-pulse {
  0% { box-shadow: 0 0 0 0 var(--ring); }
  100% { box-shadow: 0 0 0 14px rgba(0, 102, 255, 0); }
}

@media (max-width: 860px) {
  .demo-stage {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  /* Screenshots: large lead shot, then two side-by-side */
  .shots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
  }
  .shot--lead {
    grid-column: 1 / -1;
  }
  .shot--lead figcaption {
    max-width: 60ch;
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .workflow-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Below 768px: hide nav center links, keep lang switcher reachable */
@media (max-width: 767px) {
  .nav__center {
    display: none;
  }
}

/* Very small screens: keep the nav from overflowing */
@media (max-width: 400px) {
  .nav__right .pill--dark {
    display: none;
  }
}

/* Mobile <= 640: scale down hero, tighter CTA, stack form */
@media (max-width: 640px) {
  .section {
    padding-block: 4rem;
  }
  .hero {
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
  }
  .beta-form__row {
    flex-direction: column;
  }
  .beta-form__submit {
    width: 100%;
  }
  .cta__block {
    padding: 2.5rem 1.5rem;
  }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===========================================================
   Reduced motion
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Gated download (licence-email check) ── */
.dl-gate__form { display: flex; gap: 0.5rem; margin-top: 0.6rem; justify-content: center; }
.beta-form__input--sm { height: 2.5rem; font-size: 0.9rem; max-width: 16rem; padding: 0 0.8rem; }
.btn--sm { height: 2.5rem; padding: 0 1rem; font-size: 0.9rem; white-space: nowrap; }
