/* apv-base.css — reset + base typography */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--apv-font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--apv-fg-light-1);
  background: var(--apv-bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dark-top pages: body bg = dark so transparent nav shows correctly */
body.apv-page--dark-top {
  background: var(--apv-bg-dark);
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Typography scale */
h1 {
  font-family: var(--apv-font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--apv-font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h3 {
  font-family: var(--apv-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-family: var(--apv-font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

p {
  line-height: 1.7;
}

.apv-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apv-mono {
  font-family: var(--apv-font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--apv-blue);
  outline-offset: 2px;
}

/* Skip link */
.apv-skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--apv-blue);
  color: #fff;
  z-index: 10000;
  font-weight: 600;
}

.apv-skip-link:focus {
  top: 0;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--apv-ease), transform 0.5s var(--apv-ease);
  animation: apv-reveal 0s 0.8s forwards;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
  animation: none;
}

/* Failsafe: force visible after 0.8s via CSS animation — covers IntersectionObserver firing delay */
@keyframes apv-reveal {
  to { opacity: 1; transform: none; }
}
