/* ================================================================
   BASE — Reset, Typography Scale, Utility Classes
   Mobile-first (375px base). Uses var(--vc-*) tokens exclusively.
   ================================================================ */

/* ----------------------------------------------------------------
   1. MODERN CSS RESET
   ---------------------------------------------------------------- */

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

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

body {
  min-height: 100vh;
  background: var(--vc-bg-body);
  color: var(--vc-text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

a {
  color: var(--vc-accent);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  text-decoration: underline;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

iframe {
  border: 0;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: '';
  content: none;
}

/* Remove default summary marker */
summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

/* ----------------------------------------------------------------
   2. SELECTION HIGHLIGHT
   ---------------------------------------------------------------- */

::selection {
  background: var(--vc-accent-subtle);
}

::-moz-selection {
  background: var(--vc-accent-subtle);
}

/* ----------------------------------------------------------------
   3. TYPOGRAPHY SCALE
   ---------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  color: var(--vc-text-primary);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--vc-text-primary);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--vc-text-primary);
}

h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--vc-text-primary);
}

h4 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--vc-text-primary);
}

h5 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--vc-text-primary);
}

h6 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--vc-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--vc-text-secondary);
}

.lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--vc-text-secondary);
}

small,
.text-sm {
  font-size: 14px;
  line-height: 1.5;
}

strong,
b {
  font-weight: 600;
}

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

/* ----------------------------------------------------------------
   4. UTILITY CLASSES
   ---------------------------------------------------------------- */

/* Screen reader only — accessible hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Centered container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* Section label — uppercase mono accent */
.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vc-accent);
  display: block;
  margin-bottom: var(--sp-3);
}

/* Section description — secondary centered body text */
.section-desc {
  font-size: 18px;
  color: var(--vc-text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Gradient text (brand accent) */
.gradient-text {
  background: var(--vc-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Monospace inline (for numbers, stats, codes) */
.mono {
  font-family: var(--font-mono);
}

/* ----------------------------------------------------------------
   5. SCROLL REVEAL ANIMATION
   ---------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-reveal), transform var(--t-reveal);
}

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

/* Staggered children reveal */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 500ms; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 600ms; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 700ms; }

/* ----------------------------------------------------------------
   6. SKELETON LOADING
   ---------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(90deg, var(--vc-bg-surface) 25%, var(--vc-bg-surface-2) 50%, var(--vc-bg-surface) 75%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  color: transparent !important;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: skeletonShimmer 1.5s ease-in-out infinite;
  }
  @keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
}

/* ----------------------------------------------------------------
   7. TOOLTIP SYSTEM
   ---------------------------------------------------------------- */

[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--vc-bg-surface-2);
  border: 1px solid var(--vc-border-default);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--vc-text-secondary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------------
   8. TAB PANEL TRANSITIONS
   ---------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  [role="tabpanel"] {
    animation: panelFadeIn 0.25s ease-out;
  }
  @keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ----------------------------------------------------------------
   9. PREFERS-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;
    scroll-behavior: auto !important;
  }

  .reveal,
  .stagger-children > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----------------------------------------------------------------
   7. PRINT STYLES
   ---------------------------------------------------------------- */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  .site-nav,
  .site-footer,
  .mobile-menu,
  .nav-hamburger,
  .nav-actions,
  .scroll-indicator,
  button,
  .btn,
  .modal,
  [role="dialog"] {
    display: none !important;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }
}
