/*
 * NEXA POINT GROUP — Base Styles
 * CSS reset, root setup, global typography, selection, scrollbar
 */

/* ─── Google Fonts import ─── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ─── Prevent FOUC on theme load ─── */
html:not([data-theme]) body {
  visibility: hidden;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-6xl); letter-spacing: -0.04em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.03em; }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

p + p {
  margin-top: var(--space-4);
}

/* ─── Links ─── */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── Lists ─── */
ul, ol {
  list-style: none;
}

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

img {
  object-fit: cover;
}

svg {
  flex-shrink: 0;
}

/* ─── Form elements ─── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ─── Tables ─── */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ─── HR ─── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ─── Code ─── */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

pre {
  overflow-x: auto;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* ─── Blockquote ─── */
blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-6);
  color: var(--color-text-muted);
  font-style: italic;
}

/* ─── Selection ─── */
::selection {
  background: rgba(33, 151, 241, 0.25);
  color: var(--color-text);
}

/* ─── Focus ring for accessibility ─── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ─── Scrollbar styling (Webkit) ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* ─── Screen reader only ─── */
.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;
}

/* ─── Skip to content (accessibility) ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-max);
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}
