/* Intro modal (js/shared/introModal.js). Shared by index.html and
   mobile.html, so colors carry literal fallbacks: mobile.css doesn't
   define the desktop tokens. */

body.intro-modal-open {
  overflow: hidden;
}

.intro-modal,
.intro-modal * {
  box-sizing: border-box;
}

.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.intro-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.intro-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  padding: 2rem 2.25rem 1.5rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(59, 91, 219, 0.08), rgba(59, 91, 219, 0) 140px),
    var(--bg, #ffffff);
  color: var(--text, #0f172a);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  text-align: center;
}

.intro-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.intro-close:hover {
  background: rgba(100, 116, 139, 0.12);
}

.intro-header {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.intro-mark svg {
  display: block;
  width: 48px;
  height: auto;
}

.intro-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text, #0f172a);
}

.intro-title span {
  color: #3b5bdb;
}

.intro-lede {
  margin: 0.9rem auto 1.1rem;
  max-width: 30rem;
  font-size: 1.1rem;
  line-height: 1.5;
  font-weight: 500;
}

/* Same highlighter treatment as .app-tagline-lead em in style.css,
   which mobile.html doesn't load. */
.intro-lede em {
  font-style: normal;
  font-weight: 750;
  color: #3b5bdb;
  background: linear-gradient(180deg, transparent 62%, rgba(59, 91, 219, 0.16) 62%, rgba(43, 138, 110, 0.16) 94%, transparent 94%);
  padding: 0 0.15em;
  border-radius: 3px;
}

[data-theme="dark"] .intro-lede em {
  color: #93b4ff;
  background: linear-gradient(180deg, transparent 62%, rgba(99, 102, 241, 0.28) 62%, rgba(43, 138, 110, 0.25) 94%, transparent 94%);
}

.intro-visual {
  margin: 0 0 1.1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.intro-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.intro-points {
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
  text-align: left;
  display: grid;
  gap: 0.6rem;
}

.intro-points li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.intro-points li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.45em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 3px;
  background: linear-gradient(135deg, #3b5bdb, #2b8a6e);
}

.intro-start {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b5bdb, #4c6ef5);
  color: #ffffff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(59, 91, 219, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.intro-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(59, 91, 219, 0.45);
}

.intro-start:focus-visible {
  outline: 3px solid rgba(59, 91, 219, 0.45);
  outline-offset: 3px;
}

.intro-book {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
}

.intro-book a {
  font-weight: 600;
  color: var(--accent, #3b5bdb);
  text-decoration: none;
}

.intro-book a:hover {
  text-decoration: underline;
}

.intro-disclaimer {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}

[data-theme="dark"] .intro-dialog {
  background:
    linear-gradient(180deg, rgba(76, 110, 245, 0.16), rgba(76, 110, 245, 0) 140px),
    var(--bg, #0d1117);
  color: var(--text, #e6edf3);
}

[data-theme="dark"] .intro-title {
  color: var(--text, #e6edf3);
}

[data-theme="dark"] .intro-title span {
  color: #748ffc;
}

/* Phones: smaller type and spacing so the whole intro fits on one screen. */
@media (max-width: 640px) {
  .intro-modal {
    padding: 0.75rem;
  }

  .intro-dialog {
    padding: 1.25rem 1.1rem 1rem;
    border-radius: 14px;
    max-height: calc(100dvh - 1.5rem);
  }

  .intro-mark svg {
    width: 34px;
  }

  .intro-title {
    font-size: 1.45rem;
  }

  .intro-lede {
    margin: 0.6rem auto 0.75rem;
    font-size: 0.9rem;
  }

  .intro-visual {
    margin-bottom: 0.75rem;
    border-radius: 9px;
  }

  .intro-points {
    gap: 0.4rem;
    margin-bottom: 0.9rem;
  }

  .intro-points li {
    font-size: 0.8rem;
    padding-left: 1.25rem;
  }

  .intro-points li::before {
    width: 0.5rem;
    height: 0.5rem;
  }

  .intro-start {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .intro-disclaimer {
    margin-top: 0.6rem;
    font-size: 0.8rem;
  }
}
