/* ==========================================================================
   X.com.ly — base.css
   Minimal modern reset + global element styling + utilities.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  font-weight: var(--fw-medium);
  color: var(--c-text);
  background: var(--c-bg-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--c-text-strong);
  line-height: var(--lh-tight);
  font-weight: var(--fw-extrabold);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { text-wrap: pretty; }

a {
  color: var(--c-secondary-dark);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--c-secondary); }

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

ul, ol { list-style: none; }

::selection {
  background: var(--c-primary);
  color: var(--c-text-invert);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--c-border-strong) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: var(--c-border-strong);
  border-radius: var(--r-pill);
}
*::-webkit-scrollbar-track { background: transparent; }

/* Focus */
:focus-visible {
  outline: 3px solid var(--c-secondary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Emoji helper used across the UI */
.emoji {
  font-family: var(--font-emoji);
  line-height: 1;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  right: var(--sp-4);
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-primary);
  color: var(--c-text-invert);
  border-radius: var(--r-md);
  font-weight: var(--fw-bold);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-2); }

.noscript {
  padding: var(--sp-5);
  margin: var(--sp-5);
  text-align: center;
  background: var(--c-danger-soft);
  color: var(--c-danger-dark);
  border-radius: var(--r-md);
  font-weight: var(--fw-bold);
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
