/* ==========================================================================
   Pichvara prototype — shared base
   Reset + accessibility primitives only. No grid, type scale, colour or
   component styling lives here: each variant owns its own look.
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
summary { cursor: pointer; }
[hidden] { display: none !important; }

/* Grid/flex children must be allowed to shrink so Thai text and tags wrap */
:where(.grid, [class*="grid"], [class*="row"]) > * { min-width: 0; }

/* Focus: two-tone ring stays visible on light and dark grounds */
:focus-visible {
  outline: 3px solid var(--focus, #0b5cff);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-halo, rgb(255 255 255 / 0.9));
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 8px;
  background: #0a1133;
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Back-to-chooser pill (same position on every variant) */
.proto-back {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: #0a1133;
  color: #fff;
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.5);
  opacity: 0.92;
}
.proto-back:hover { opacity: 1; }
.proto-back .icon { width: 16px; height: 16px; }

/* Reveal on scroll (opt-in per variant) */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@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;
    transition-delay: 0ms !important;
    animation-delay: 0ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
