/* ===========================================================================
   ServicesActiveLabo — Base tokens, typography helpers, term popovers, focus rings,
   hotspots, and motion engineering.
   =========================================================================== */

:root {
  --al-navy: #102A43;
  --al-blue: #1B6FB3;
  --al-blue-dark: #165F9C;
  --al-blue-pale: #8FC9F5;
  --al-amber: #F2B705;
  --al-amber-dark: #8A6300;
  --al-ink: #102A43;
  --al-muted: #5A6B7C;
  --al-line: #DCE4EC;
  --al-line-strong: #C6D3E0;
  --al-surface: #F7F9FB;
  --al-surface-tint: #F4F7FA;
  --al-white: #FFFFFF;
}

/* Breadcrumb contrast fix */
.bcrumb,
.bcrumb a {
  color: var(--al-muted);
}
.bcrumb a:hover {
  color: var(--al-blue);
}

.al-p {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 1.95;
  color: var(--al-muted);
  text-wrap: pretty;
}
.al-p + .al-p { margin-top: 16px; }

.al-h2 {
  margin-bottom: 16px;
}

.al-h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--al-navy);
}

.al-note {
  margin: 12px 0 0;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  line-height: 1.8;
  color: var(--al-muted);
}

.al-nb { display: inline-block; }
.al-nw { white-space: nowrap; }

.al-sub {
  margin: 20px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--al-navy);
}
.al-sub::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--al-blue);
  flex: none;
}

/* Amber hotspot */
.al-hot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--al-amber);
  vertical-align: middle;
}
.al-hot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--al-amber);
  opacity: 0;
}
.is-in .al-hot::after {
  animation: al-ring 1.4s .3s 3 both;
}

.al-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--al-muted);
}

@keyframes al-ring {
  0% { opacity: .85; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes al-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes al-pop {
  0% { opacity: 0; transform: scale(.6); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes al-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Hard words: term popover */
.al-term {
  position: relative;
  display: inline;
}

.al-term__btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 700;
  color: var(--al-blue-dark);
  text-decoration: underline dotted var(--al-blue-dark);
  text-underline-offset: 4px;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 6px;
  margin: -4px 0;
  border-radius: 4px;
  vertical-align: baseline;
  box-sizing: border-box;
}

.al-term__btn:hover {
  color: var(--al-blue);
  text-decoration-color: var(--al-blue);
}

.al-term__btn:focus-visible {
  outline: 3px solid var(--al-blue);
  outline-offset: 2px;
}

.al-term__q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--al-amber);
  color: var(--al-navy);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  flex: none;
}

/* Without JS: inline explanation */
.al-term__pop {
  font-size: 13px;
  line-height: 1.8;
  color: var(--al-muted);
  font-weight: 400;
}
.al-term__pop::before { content: "（"; }
.al-term__pop::after { content: "）"; }

/* With JS (.al-terms-live) */
.al-terms-live .al-term {
  position: relative;
  display: inline;
}

.al-terms-live .al-term__pop {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 80;
  width: max-content;
  max-width: min(320px, 86vw);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--al-navy);
  color: var(--al-white);
  box-shadow: 0 10px 28px rgba(16, 42, 67, 0.24);
  font-size: 14px;
  line-height: 1.7;
  font-weight: 400;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  pointer-events: none;
}
.al-terms-live .al-term__pop::before { content: none; }
.al-terms-live .al-term__pop::after { content: none; }

.al-terms-live .al-term.is-open .al-term__pop {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 600px) {
  .al-terms-live .al-term__pop {
    max-width: min(290px, 84vw);
  }
}

.is-on {
  /* active state marker */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
