/* Lartist Shorts — mobile-first short-video feed. Static, no frameworks. */

:root {
  --bg: #0b0b0d;
  --bg-soft: #15151a;
  --fg: #f5f5f7;
  --muted: #9a9aa3;
  --accent: #f5a623;
  --accent-ink: #1a1206;
  --topbar-h: 56px;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* Top bar overlays the feed; only its controls take pointer events. */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  z-index: 40;
  background: linear-gradient(rgba(11, 11, 13, 0.85), rgba(11, 11, 13, 0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.01em; }
.brand-accent { color: var(--accent); }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.icon-button svg { width: 22px; height: 22px; }
.icon-close { display: none; }
.menu-open .icon-menu { display: none; }
.menu-open .icon-close { display: block; }

/* Menu */
.menu {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  right: 12px;
  z-index: 45;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.menu[hidden] { display: none; }

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.menu-item[data-view="feed"] { color: var(--accent); font-weight: 600; }

/* Vertical feed */
.feed {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.reduce-motion .feed { scroll-behavior: auto; }

.slide {
  position: relative;
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Invisible full-cover button: tapping the video toggles play/unmute/pause. */
.toggle {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

/* Small state chip; grows into a centred play icon when paused. */
.indicator {
  position: absolute;
  top: calc(var(--topbar-h) + 8px);
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  pointer-events: none;
}
.indicator svg { width: 18px; height: 18px; }
.slide.is-paused .indicator {
  top: 50%;
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  background: rgba(0, 0, 0, 0.55);
}
.slide.is-paused .indicator svg { width: 36px; height: 36px; }

/* Info overlay: title, artist and actions. Background is click-through. */
.info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 24px 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  pointer-events: none;
}
.title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.artist { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.actions { display: flex; gap: 10px; margin-top: 12px; }
.action {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.action:hover { background: rgba(255, 255, 255, 0.18); }
.action svg { width: 18px; height: 18px; }
.action.like.liked { background: var(--accent); color: var(--accent-ink); }

/* About / Privacy pages */
.page {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: var(--bg);
  overflow-y: auto;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 24px + env(safe-area-inset-top)) 20px 40px;
}
.page[hidden] { display: none; }
.page h2 { font-size: 1.5rem; margin-bottom: 12px; }
.page p { color: var(--muted); line-height: 1.6; margin-bottom: 14px; max-width: 55ch; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

/* Loading / error / empty states */
.state {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: var(--bg);
}
.state[hidden] { display: none; }
.state-title { font-size: 1.2rem; font-weight: 700; }
.state p { color: var(--muted); }

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.reduce-motion .spinner { animation: none; }

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}
.toast[hidden] { display: none; }

.noscript { padding: 20px; color: var(--fg); }

/* Desktop: the video stays centred over a dark background. */
@media (min-width: 640px) {
  .title { font-size: 1.3rem; }
}

.clipboard-helper { position: fixed; opacity: 0; }
