/* =============================================================
   PlusBIT Systems — Base: reset, document, typography, a11y
   ============================================================= */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--fz-body);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

ul, ol { list-style: none; }

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
button { cursor: pointer; }

/* ---- Headings (Fraunces display, optical) ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
h1 { font-size: var(--fz-h1); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: var(--fz-h2); line-height: var(--lh-tight); letter-spacing: -0.016em; }
h3 { font-size: var(--fz-h3); }

p { text-wrap: pretty; }

strong { color: var(--ink); font-weight: 600; }

::selection { background: var(--primary); color: #fff; }

/* ---- Scrollbar (subtle) ---- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Layout primitives ---- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-section); position: relative; }
.section--tight { padding-block: clamp(56px, 5vw, 96px); }
.section--paper-2 { background: var(--paper-2); }

/* Section header block */
.section__head { max-width: 660px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section-title { margin-top: 0.5rem; }
.section-lead {
  margin-top: 1.1rem;
  font-size: var(--fz-lead);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 56ch;
}
.section__head--center .section-lead { margin-inline: auto; }

/* ---- Accessibility ---- */
.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;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 2000;
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: var(--fz-small);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Visible, branded focus ring everywhere */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.section--deep :focus-visible,
.site-footer :focus-visible { outline-color: var(--primary-bright); }

/* ---- Reduced motion: stop all transitions/animations cleanly ---- */
@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;
    scroll-behavior: auto !important;
  }
}

/* ---- AOS safety net ----
   AOS's stylesheet hides [data-aos] elements globally. If JS is off,
   the CDN fails, or reduced-motion is on, we never add `.aos-on`, so
   this rule keeps every element fully visible. Content first. */
html:not(.aos-on) [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}
