/* ============================================
   LINKS MAGAZINE — BASE STYLES
   base.css
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  overflow-x: hidden;
}

/* ----------------------------------------
   TYPOGRAPHY — HEADING SCALE
   ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-5xl), 7vw, var(--text-8xl));
  font-weight: 300;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: 400;
  letter-spacing: -0.015em;
}

h3 {
  font-family: var(--font-headline);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 400;
}

h4 {
  font-family: var(--font-headline);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-weight: 400;
}

h5 {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-green);
}

h6 {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* ----------------------------------------
   BODY COPY
   ---------------------------------------- */
p {
  line-height: 1.75;
  max-width: 75ch;
}

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

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

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

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

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

/* ----------------------------------------
   MEDIA
   ---------------------------------------- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  object-fit: cover;
}

/* ----------------------------------------
   FORMS
   ---------------------------------------- */
input,
button,
textarea,
select {
  font: inherit;
}

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

/* ----------------------------------------
   BLOCKQUOTE
   ---------------------------------------- */
blockquote {
  font-style: italic;
}

/* ----------------------------------------
   HORIZONTAL RULE
   ---------------------------------------- */
hr {
  border: none;
  border-top: var(--border-thin);
  margin: var(--space-8) 0;
}

/* ----------------------------------------
   SELECTION COLOR
   ---------------------------------------- */
::selection {
  background-color: var(--color-green);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-green);
  color: var(--color-white);
}

/* ----------------------------------------
   FOCUS VISIBLE
   ---------------------------------------- */
:focus {
  outline: none;
}

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

/* ----------------------------------------
   UTILITY CLASSES
   ---------------------------------------- */
.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-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.no-scroll { overflow: hidden; }

/* Fade-in animation utility */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slower), transform var(--transition-slower);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slower), transform var(--transition-slower);
}

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

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