:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --text: #e5e5e5;
  --text-muted: #555555;
  --accent: #708090;
  --accent-hover: #8a9aa8;
  --border: #1a1a1a;
  --shadow: rgba(0,0,0,0.5);
  --transition: 0.3s ease;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #f5f5f5;
  --text: #36454f;
  --text-muted: #708090;
  --accent: #36454f;
  --accent-hover: #4a5a6a;
  --border: #d3d3d3;
  --shadow: rgba(0,0,0,0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DejaVu Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="light"] .site-header {
  background: rgba(255,255,255,0.85);
}

/* Shimmer title */
.site-title {
  font-family: 'DejaVu Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--text) 40%,
    var(--accent-hover) 50%,
    var(--text) 60%,
    var(--text) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s ease-in-out infinite;
  display: inline-block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.site-title:hover {
  animation: shimmer 2s ease-in-out infinite;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
}

/* Theme toggle */
.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Page transitions */
.page-transition {
  animation: pageIn 0.4s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Main content transition wrapper */
.main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  animation: pageIn 0.4s ease;
}

/* Post */
.post {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  font-family: 'DejaVu Sans', monospace;
}

.post-text {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  white-space: pre-wrap;
  font-weight: 400;
}

.post-text p {
  margin-bottom: 1rem;
}

/* Media */
.post-media {
  margin-bottom: 2rem;
}

.post-media img,
.post-media video {
  width: 100%;
  border-radius: 0;
  display: block;
  background: transparent;
}

.post-media video {
  object-fit: cover;
}

/* Multiple media grid */
.media-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.media-grid-2 { grid-template-columns: repeat(2, 1fr); }
.media-grid-3 { grid-template-columns: repeat(3, 1fr); }
.media-grid-4 { grid-template-columns: repeat(2, 1fr); }

.media-grid img,
.media-grid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Archive */
.archive-header {
  margin-bottom: 3rem;
}

.archive-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: 'DejaVu Sans', sans-serif;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.archive-item {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.archive-item:hover {
  transform: none;
  box-shadow: none;
}

.archive-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: transparent;
}

.archive-thumb img,
.archive-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition), filter var(--transition);
  border-radius: 0;
  filter: grayscale(0);
}

.archive-item:hover .archive-thumb img,
.archive-item:hover .archive-thumb video {
  transform: scale(1.03);
  filter: grayscale(0.2);
}

/* Video thumbnail */
.archive-thumb video {
  position: absolute;
  top: 0;
  left: 0;
}

.archive-info {
  padding: 1rem 1.25rem;
}

.archive-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'DejaVu Sans', monospace;
}

.archive-text {
  font-size: 0.9375rem;
  margin-top: 0.25rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post nav */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.post-nav span {
  flex: 1;
}

.post-nav span:first-child {
  text-align: left;
}

.post-nav span:last-child {
  text-align: right;
}

.post-nav-top {
  border-bottom: none;
}

.post-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition);
  font-family: 'DejaVu Sans', monospace;
}

.post-nav a:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-top: none;
  opacity: 0.25;
  font-family: 'DejaVu Sans', monospace;
}

.countdown {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

/* Responsive */
@media (max-width: 640px) {
  .site-header {
    padding: 1rem;
  }

  .main-content {
    padding: 2rem 1rem;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .media-grid-2,
  .media-grid-3,
  .media-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0;
}

.admin-card h3 {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.admin-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

.admin-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-list li:last-child {
  border-bottom: none;
}

.admin-list .title {
  flex: 1;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-list .date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
}

.admin-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-btn-danger:hover {
  border-color: #8b0000;
  color: #ff4444;
}

.admin-btn-primary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pin-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pin-form input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  flex: 1;
  font-family: monospace;
  letter-spacing: 0.1em;
  text-align: center;
}

.pin-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.pin-form button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background var(--transition);
}

.pin-form button:hover {
  background: var(--accent-hover);
}

#admin-content {
  display: none;
}

@media (max-width: 640px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}
