/* ==========================================================================
   Base: reset, typography, layout primitives and shared utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 32px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-m);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition:
    opacity 700ms var(--ease-out),
    background-color var(--dur-2) ease,
    color var(--dur-2) ease;
}

/* Content is injected from JSON: fade the page in once it is ready. */
html.is-loading body {
  opacity: 0;
}

img,
svg,
canvas,
video,
iframe {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: var(--brand-soft);
}

:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 3px;
  border-radius: 6px;
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* Section header, as in Nuxt UI's PageSection: a large bold title, then an optional description. */
.section-head {
  margin-bottom: 32px;
}

.section-head__title {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.4rem + 1.9vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.section-intro {
  max-width: 60ch;
  margin: -16px 0 32px;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

/* VitePress's VPButton: brand (filled) and alt (soft gray), medium or big. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 0.25s,
    background-color 0.25s;
}

.btn--big {
  height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  font-size: 16px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--brand {
  background: var(--brand-3);
  color: #fff;
}

.btn--brand:hover {
  background: var(--brand-2);
}

.btn--alt {
  background: var(--button-alt-bg);
  color: var(--text);
}

.btn--alt:hover {
  background: var(--button-alt-hover);
}

/* -------------------------------------------------------------------------- */
/* Icons (inline SVG injected by assets/js/icons.js)                          */
/* -------------------------------------------------------------------------- */

[data-icon] {
  display: inline-flex;
  flex: none;
}

[data-icon] svg,
svg.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* -------------------------------------------------------------------------- */
/* Skeleton placeholders (shown while a piece of content is not written yet)  */
/* -------------------------------------------------------------------------- */

.skeleton {
  display: block;
  width: 100%;
}

.skeleton__line {
  display: block;
  width: var(--w, 100%);
  max-width: 100%;
  height: var(--sk-h, 0.62em);
  margin-block: var(--sk-gap, 0.26em);
  border-radius: 0.22em;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: shimmer 2.6s linear infinite;
}

/* Inline skeleton (inside a line of text). */
span[data-pending] {
  display: inline-block;
  width: var(--w, 6em);
  vertical-align: middle;
}

[data-pending] {
  user-select: none;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* -------------------------------------------------------------------------- */
/* Scroll reveal                                                              */
/* -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out),
    filter var(--dur-4) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* -------------------------------------------------------------------------- */
/* Misc                                                                       */
/* -------------------------------------------------------------------------- */

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-s);
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-s);
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
}

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

.noscript {
  padding: 120px var(--gutter);
  text-align: center;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Reduced motion: keep everything static                                     */
/* -------------------------------------------------------------------------- */

@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;
    transition-delay: 0s !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
