/**
 * Base Styles
 *
 * CSS reset and base theme styles.
 * Applies global styles using design system variables.
 */

/* ==================== RESET ==================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  background-color: var(--color-bg-dark);
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  text-rendering: optimizeLegibility;
}

/* ==================== BASE TYPOGRAPHY ==================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-6);
}

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

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

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

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}


p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

strong, b {
  font-weight: var(--font-weight-semibold);
}

em, i {
  font-style: italic;
}

/* ==================== LISTS ==================== */

ul, ol {
  list-style: none;
  margin-bottom: var(--space-4);
  padding-left: 0;
}

li {
  margin-bottom: var(--space-2);
}

/* ==================== IMAGES ==================== */

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

figure {
  margin: 0;
}

figcaption {
  font-size: var(--font-size-sm);
  color: var(--color-secondary);
  margin-top: var(--space-2);
}

/* ==================== BASE BUTTONS ==================== */

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==================== BASE FORMS ==================== */

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
}

input:focus, textarea:focus, select:focus {
  outline: none;
}

/* ==================== GLOBAL UTILITIES ==================== */

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

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

/* Skip to content link (accessibility) */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 0;
}

/* ==================== SECTION LABELS & HEADINGS ==================== */

.section-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-heading {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: var(--font-size-5xl);
  color: var(--color-text-primary);
  line-height: 1.15;
}

.section-desc {
  font-family: var(--font-body);
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ==================== HIGHLIGHT UTILITIES ==================== */

.highlight-text {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.highlight-text::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 0.25em;
  bottom: 0.2em;
  background: var(--color-peach);
  opacity: 0.3;
  border-radius: 2px;
  z-index: -1;
  transform: skewY(-0.5deg);
}

.highlight-block {
  background: linear-gradient(var(--color-accent), var(--color-accent)) no-repeat center / 100% 80%;
  font-style: italic;
  padding: 0 0.2em 0 0;
}

/* ==================== GRID BACKGROUND ==================== */

.grid-bg {
  position: relative;
}

.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grid-bg);
  background-size: var(--grid-size);
}

/* ==================== CURSOR BLINK ANIMATION ==================== */

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background-color: var(--color-accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
