:root {
  color-scheme: light dark;
  --color-bg: #0a0a0a;
  --color-surface: #1a1a1a;
  --color-surface-alt: #2a2a2a;
  --color-text: #e0e0e0;
  --color-text-muted: #a0a0a0;
  --color-accent: #4ade80;
  --color-accent-muted: rgba(74, 222, 128, 0.1);
  --color-border: #333333;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  z-index: 10;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 1rem 0;
}

.header-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  font-size: 2rem;
}

.brand-label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* GIF Gallery Styles */
.gif-gallery {
  padding: 1.5rem 0 2rem;
  min-height: calc(100vh - 160px);
}

.media-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.media-filename {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-family: 'Courier New', monospace;
  word-break: break-all;
  padding: 0 0.5rem;
  min-height: 1.5rem;
  display: flex;
  align-items: center;
}

.media-stage {
  position: relative;
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.04), transparent 35%),
              radial-gradient(circle at 80% 30%, rgba(255,255,255,0.04), transparent 35%),
              var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  outline: none;
}

.media-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame {
  position: relative;
  max-width: 100%;
  max-height: 82vh;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 0;
}

.like-btn {
  border-color: var(--color-accent);
}

.like-btn:hover,
.like-btn:focus-visible {
  background: var(--color-accent-muted);
  border-color: var(--color-accent);
}

.like-btn[aria-pressed="true"] {
  background: rgba(74, 222, 128, 0.18);
  border-color: var(--color-accent);
}

.media-frame img,
.media-frame video {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: #000;
}

.media-frame video {
  outline: none;
}

.media-frame.loading {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-alt) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.controls {
  display: flex;
  justify-content: space-between;
  margin: 0.75rem 0 1.25rem;
  gap: 0.5rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  outline: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.danger {
  border-color: #ef4444;
  color: #fca5a5;
}

.btn.danger:hover,
.btn.danger:focus-visible {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
}

.loading-indicator.hidden {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-indicator p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.error-message {
  text-align: center;
  padding: 2rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 600px;
}

.error-message p {
  margin: 0;
}

.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;
}

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

.site-footer p {
  margin: 0.5rem 0;
}

.site-footer a {
  color: var(--color-accent);
}
