/* ==========================================================================
   WORLD TV — base styles
   ========================================================================== */

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

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

html[data-motion="reduced"] {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: var(--radius-xs);
  background: var(--bg-3);
  border: 1px solid var(--border);
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Discreet scrollbars ---------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

[data-theme="light"] * {
  scrollbar-color: rgba(9, 10, 14, 0.2) transparent;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
  background-clip: content-box;
}

/* Utilities -------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 12px;
}

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

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.row-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spacer {
  flex: 1;
}

/* App shell -------------------------------------------------------------- */
.app-main {
  display: block;
  min-height: 60vh;
  padding-top: var(--header-h);
  outline: none;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 500;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

/* Boot skeleton ---------------------------------------------------------- */
.boot {
  padding: clamp(24px, 6vw, 72px) 0;
  display: grid;
  gap: 18px;
}

.boot__bar {
  height: 42px;
  width: min(520px, 70%);
  border-radius: var(--radius-sm);
}

.boot__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

/* Animation primitives --------------------------------------------------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    background-position: -220% 0;
  }
  to {
    background-position: 220% 0;
  }
}

.fade-up {
  animation: fade-up var(--dur-slow) var(--ease-out) both;
}

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