/* ==========================================================================
   platform/styles/base.css — structural baseline shared by every site

   Design belongs to each site's styles.css (tokens, type, color, layout).
   This file carries only the reset and behavior-coupled structural rules
   that platform/core JS depends on.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
}

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

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

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

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Skip link (first element in <body>)
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 300;
  padding: 0.75em 1.5em;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.skip-link:focus {
  top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Scroll reveal (driven by core/reveal.js)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.9s cubic-bezier(0.2, 0.65, 0.2, 1),
    transform 0.9s cubic-bezier(0.2, 0.65, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Mobile menu open state (driven by core/nav.js)
   -------------------------------------------------------------------------- */
body.nav-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Honeypot form field (spam heuristic — see infra/README.md)
   Visually removed but present in the DOM so naive bots fill it. Never
   display:none — some bots skip hidden inputs.
   -------------------------------------------------------------------------- */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   View transition cross-fade (Turbo Drive + View Transitions API)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.25s;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
