/* ==========================================================================
   PenbunWeb — 02-base.css
   Reset + typography + a11y floor.
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--pb-canvas);
  color: var(--pb-text);
  font-family: var(--pb-font-ui);
  font-size: var(--pb-fs-base);
  line-height: var(--pb-lh-base);
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--pb-dur) var(--pb-ease), color var(--pb-dur) var(--pb-ease);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: var(--pb-lh-tight);
  letter-spacing: -0.011em;
}

h1 { font-size: var(--pb-fs-2xl); }
h2 { font-size: var(--pb-fs-xl); }
h3 { font-size: var(--pb-fs-lg); }
h4 { font-size: var(--pb-fs-md); }

p { margin: 0 0 var(--pb-3); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--pb-brand);
  text-decoration: none;
  transition: color var(--pb-dur-fast) var(--pb-ease);
}
a:hover { color: var(--pb-brand-hover); }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

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

hr {
  border: 0;
  border-top: 1px solid var(--pb-divider);
  margin: var(--pb-5) 0;
}

code, kbd, pre { font-family: var(--pb-font-mono); font-size: 0.9em; }

/* Numeric alignment for every figure in the product. Money never dances. */
.pb-num,
td.pb-num,
.pb-stat__value,
.pb-table td[data-num] {
  font-family: var(--pb-font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: -0.01em;
}

/* Focus: always visible, never removed. */
:focus-visible {
  outline: 2px solid var(--pb-brand);
  outline-offset: 2px;
  border-radius: var(--pb-r-xs);
}

::selection {
  background: var(--pb-brand-soft-2);
  color: var(--pb-text);
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--pb-border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--pb-border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--pb-r-pill);
}

/* Utilities */
.pb-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.pb-skip-link {
  position: absolute;
  left: var(--pb-4);
  top: -60px;
  z-index: var(--pb-z-toast);
  padding: var(--pb-2) var(--pb-4);
  background: var(--pb-brand);
  color: var(--pb-text-on-brand);
  border-radius: var(--pb-r-sm);
  font-weight: 600;
  transition: top var(--pb-dur) var(--pb-ease);
}
.pb-skip-link:focus { top: var(--pb-4); color: var(--pb-text-on-brand); }

.pb-eyebrow {
  font-size: var(--pb-fs-2xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pb-text-3);
}

.pb-muted { color: var(--pb-text-2); }
.pb-dim { color: var(--pb-text-3); }
.pb-pos { color: var(--pb-pos); }
.pb-neg { color: var(--pb-neg); }
.pb-nowrap { white-space: nowrap; }
.pb-right { text-align: right; }
.pb-center { text-align: center; }
.pb-hide { display: none !important; }

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