/* ============================================
   Base Styles
   ============================================ */

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Page entrance */
body.is-loading {
  opacity: 0;
}
body.is-loaded {
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* === Selection === */

::selection {
  background: rgba(240, 165, 0, 0.25);
  color: var(--color-text);
}

/* === Scrollbar (Webkit) === */

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-void);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 165, 0, 0.3);
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) var(--color-void);
}

/* === Focus Visible === */

:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* === Scroll Progress Bar === */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--color-amber);
  box-shadow: 0 0 10px var(--color-amber-glow-strong);
  z-index: 200;
  width: 0%;
  will-change: width;
}

/* === Headings === */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.1;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-hero); font-weight: 700; }
h2 { font-size: var(--text-section); font-weight: 700; }
h3 { font-size: var(--text-sub); font-weight: 600; }

p {
  max-width: 65ch;
}

/* === Links === */

a {
  transition: color var(--dur-hover) var(--ease-hover);
}

/* === Layout === */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-padding);
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

/* === Utilities === */

.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;
}

.text-muted { color: var(--color-text-muted); }
.text-amber { color: var(--color-amber); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.font-heading { font-family: var(--font-heading); }

.max-w-prose { max-width: 680px; }
.max-w-narrow { max-width: 550px; }
.mx-auto { margin-inline: auto; }
