/**
 * Danish Khan website
 * Small single-purpose utility classes only.
 *
 * Keep this file intentionally limited.
 * Reusable visual patterns belong in components.css.
 */

/* =============================================================
   SCROLL REVEAL
   Pairs with [data-reveal] handling in main.js. Any element can
   opt in; JS adds .is-revealed once it scrolls into view.

   Scoped under .has-js (set by an inline script in <head>, before
   first paint) so content is only ever hidden once JS has proven
   it can actually run. If JS is blocked or fails, [data-reveal]
   elements are just plain, always-visible content — never a
   permanently blank section.
   ============================================================= */

.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.has-js [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.has-js [data-reveal][data-reveal-delay="1"] { transition-delay: 0.1s; }
.has-js [data-reveal][data-reveal-delay="2"] { transition-delay: 0.2s; }
.has-js [data-reveal][data-reveal-delay="3"] { transition-delay: 0.3s; }
.has-js [data-reveal][data-reveal-delay="4"] { transition-delay: 0.4s; }

/* =============================================================
   SCROLL PARALLAX
   Pairs with [data-parallax] handling in main.js, which writes a
   transform (translateY + scale) inline as the page scrolls. This
   just smooths those steps and hints the browser to use the GPU.
   ============================================================= */

[data-parallax] {
  will-change: transform;
  transition: transform 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =============================================================
   ACCESSIBILITY
   ============================================================= */

.visually-hidden {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;

  white-space: nowrap !important;

  border: 0 !important;
}

/* =============================================================
   TEXT COLOR
   ============================================================= */

.text-primary {
  color: var(--color-text-primary);
}

.text-secondary {
  color: var(--color-text-secondary);
}

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

.text-inverse {
  color: var(--color-text-inverse);
}

/* =============================================================
   TEXT ALIGNMENT
   ============================================================= */

.text-left {
  text-align: left;
}

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

.text-right {
  text-align: right;
}

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

.font-sans {
  font-family: var(--font-sans);
}

.font-serif {
  font-family: var(--font-serif);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.uppercase {
  text-transform: uppercase;
}

.no-underline {
  text-decoration: none;
}

/* =============================================================
   STACK
   ============================================================= */

.stack > * + * {
  margin-top: var(--space-4);
}

.stack--xs > * + * {
  margin-top: var(--space-1);
}

.stack--sm > * + * {
  margin-top: var(--space-2);
}

.stack--md > * + * {
  margin-top: var(--space-4);
}

.stack--lg > * + * {
  margin-top: var(--space-6);
}

.stack--xl > * + * {
  margin-top: var(--space-8);
}

/* =============================================================
   FLEX
   ============================================================= */

.flex {
  display: flex;
}

.flex--center {
  align-items: center;
}

.flex--start {
  align-items: flex-start;
}

.flex--end {
  align-items: flex-end;
}

.flex--between {
  justify-content: space-between;
}

.flex--justify-center {
  justify-content: center;
}

.flex--wrap {
  flex-wrap: wrap;
}

.flex--column {
  flex-direction: column;
}

/* =============================================================
   FLEX GAPS
   ============================================================= */

.flex--gap-xs {
  gap: var(--space-1);
}

.flex--gap-sm {
  gap: var(--space-2);
}

.flex--gap-md {
  gap: var(--space-4);
}

.flex--gap-lg {
  gap: var(--space-6);
}

.flex--gap-xl {
  gap: var(--space-8);
}

/* =============================================================
   WIDTH
   ============================================================= */

.w-full {
  width: 100%;
}

.max-reading {
  max-width: var(--reading-width);
}

.mx-auto {
  margin-inline: auto;
}

/* =============================================================
   MARGIN TOP
   ============================================================= */

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: var(--space-1);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-7 {
  margin-top: var(--space-7);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mt-9 {
  margin-top: var(--space-9);
}

/* =============================================================
   MARGIN BOTTOM
   ============================================================= */

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: var(--space-1);
}

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

.mb-3 {
  margin-bottom: var(--space-3);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-5 {
  margin-bottom: var(--space-5);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-7 {
  margin-bottom: var(--space-7);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mb-9 {
  margin-bottom: var(--space-9);
}

/* =============================================================
   PADDING
   ============================================================= */

.pt-0 {
  padding-top: 0;
}

.pb-0 {
  padding-bottom: 0;
}

/* =============================================================
   YELLOW ACCENT
   ============================================================= */

.yellow-underline {
  display: inline;

  border-bottom: 4px solid var(--color-accent-primary);

  line-height: 1.1;
}

.yellow-underline--thin {
  border-bottom-width: 2px;
}

/* =============================================================
   EYEBROW
   ============================================================= */

.eyebrow {
  display: block;

  color: var(--color-text-secondary);

  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;

  letter-spacing: var(--letter-spacing-eyebrow);

  text-transform: uppercase;
}

/* =============================================================
   DISPLAY HELPERS
   ============================================================= */

.hide-mobile {
  display: none;
}

.hide-tablet {
  display: initial;
}

.hide-desktop {
  display: initial;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: initial;
  }

  .hide-tablet {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hide-desktop {
    display: none;
  }
}

/* =============================================================
   FLASH MESSAGE WRAPPER
   ============================================================= */

.flash-wrap {
  padding-top: var(--space-4);
}

/* =============================================================
   LEAD COPY
   ============================================================= */

.lead {
  color: var(--color-text-secondary);

  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.55;
}

/* =============================================================
   MOBILE
   ============================================================= */

@media (max-width: 767px) {
  .text-center-mobile {
    text-align: center;
  }

  .text-left-mobile {
    text-align: left;
  }

  .lead {
    font-size: 1.125rem;
  }
}
