/* ============================================
   Granite Elite Intel — Base Styles
   Global typography, body defaults, utilities
   ============================================ */

/* ---- Body ---- */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

/* ---- Selection ---- */
::selection {
  background-color: rgba(0, 87, 184, 0.3);
  color: var(--color-white);
}

/* ---- Focus Visible ---- */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}

p {
  margin-bottom: var(--space-6);
  max-width: 72ch;
}

p:last-child {
  margin-bottom: 0;
}

/* Lead paragraph */
.text-lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-silver-light);
}

/* Small text */
small, .text-small {
  font-size: var(--text-sm);
}

/* Muted text */
.text-muted {
  color: var(--color-text-muted);
}

/* ---- Links ---- */
a {
  color: var(--color-accent);
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* Inline text links */
.text-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 87, 184, 0.3);
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out),
              text-decoration-color var(--duration-fast) var(--ease-out);
}

.text-link:hover {
  color: var(--color-accent-hover);
  text-decoration-color: var(--color-accent-hover);
}

/* ---- Horizontal Rule ---- */
hr {
  border: none;
  border-top: var(--border-subtle);
  margin: var(--space-12) 0;
}

/* ---- Strong / Em ---- */
strong, b {
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

em, i {
  font-style: italic;
}

/* ---- Lists (content areas only) ---- */
.content ul,
.content ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.content ul {
  list-style: none;
}

.content ul li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-3);
}

.content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-blue);
}

.content ol {
  list-style: decimal;
}

.content ol li {
  margin-bottom: var(--space-3);
  padding-left: var(--space-2);
}

/* ---- Blockquote ---- */
blockquote {
  padding: var(--space-6) var(--space-8);
  border-left: 3px solid var(--color-blue);
  background: var(--color-bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-silver-light);
}

/* ---- Utility Classes ---- */

/* 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-width: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--wide {
  max-width: var(--max-width-wide);
}

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text accent */
.text-accent {
  color: var(--color-accent);
}

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

/* Uppercase label */
.label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-accent);
}

/* Section label (above headings) */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--gradient-blue);
  border-radius: 1px;
}

/* Section heading */
.section-heading {
  margin-bottom: var(--space-6);
}

.section-heading h2 {
  margin-bottom: var(--space-4);
}

.section-heading p {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
}

.section-heading--center {
  text-align: center;
}

.section-heading--center p {
  margin-left: auto;
  margin-right: auto;
}

/* Divider with accent */
.divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-blue);
  border-radius: 2px;
  margin: var(--space-6) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

/* Scroll reveal animation base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

/* Stagger delays for grid items */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 560ms; }
.reveal-stagger > .reveal:nth-child(9) { transition-delay: 640ms; }

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-blue);
  color: var(--color-white);
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-toast);
  font-weight: var(--weight-medium);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}
