/* ═══════════════════════════════════════════════════════════════════════════
   BAYLINK BASE STYLES
   Reset, Typography, Global Elements
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   MODERN RESET
   ───────────────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Remove default list styles */
ul, ol {
  list-style: none;
}

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Remove default button styles */
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Make images responsive */
img, picture, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* SVGs should be inline and sized explicitly */
svg {
  flex-shrink: 0;
}

/* Remove built-in form typography styles */
input, button, textarea, select {
  font: inherit;
}

/* Remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   FONT IMPORTS
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/syne/v22/8vIS7w4qzmVxsWxjBZRjr0FKM_04uT6kR47NCV5Z.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/dmsans/v15/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/jetbrainsmono/v18/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxjPVmUsaaDhw.woff2') format('woff2');
}

/* ─────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl));
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--weight-bold);
}

h3 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
}

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

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

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

p {
  color: var(--color-text-secondary);
  max-width: 65ch;
}

.text-lead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
}

.text-small {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-mono {
  font-family: var(--font-mono);
}

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

.text-gradient {
  background: linear-gradient(135deg, var(--color-accent-primary) 0%, var(--color-accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────────────────────────────────────────────────
   LAYOUT UTILITIES
   ───────────────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-lg {
  max-width: var(--container-2xl);
}

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

.section {
  padding-block: var(--space-20);
}

.section-lg {
  padding-block: var(--space-32);
}

/* ─────────────────────────────────────────────────────────────────────────
   FOCUS STYLES (Accessibility)
   ───────────────────────────────────────────────────────────────────────── */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   SELECTION STYLES
   ───────────────────────────────────────────────────────────────────────── */

::selection {
  background-color: var(--color-accent-primary);
  color: var(--color-bg-primary);
}

/* ─────────────────────────────────────────────────────────────────────────
   SCROLLBAR STYLING
   ───────────────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-surface);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-bg-hover);
}

/* ─────────────────────────────────────────────────────────────────────────
   SKIP LINK (Accessibility)
   ───────────────────────────────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-max);
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-accent-primary);
  color: var(--color-bg-primary);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ─────────────────────────────────────────────────────────────────────────
   BACKGROUND PATTERNS
   ───────────────────────────────────────────────────────────────────────── */

.bg-grid {
  background-image:
    linear-gradient(var(--color-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-grid-dense {
  background-image:
    linear-gradient(var(--color-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-subtle) 1px, transparent 1px);
  background-size: 30px 30px;
}

.bg-dots {
  background-image: radial-gradient(var(--color-border-default) 1px, transparent 1px);
  background-size: 20px 20px;
}

.bg-noise {
  position: relative;
}

.bg-noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   DIVIDERS
   ───────────────────────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-border-default) 20%,
    var(--color-border-default) 80%,
    transparent 100%
  );
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--color-border-default) 20%,
    var(--color-border-default) 80%,
    transparent 100%
  );
}

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

.flex {
  display: flex;
}

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

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

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

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

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.inset-0 { inset: 0; }

.overflow-hidden { overflow: hidden; }

.pointer-events-none { pointer-events: none; }
