:root {
  color-scheme: dark;
  --bg: #0A0E0E;
  --surface: #12181A;
  --border: #1F2A28;
  --accent: #1BE0B0;
  --accent-warm: #F5A623;
  --like-active: #FF4D6D;
  --text: #E6EDEC;
  --text-muted: #8A9896;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
}
a { color: inherit; }
.shell { width: min(1060px, calc(100% - 40px)); margin: 0 auto; }
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #0A0E0E;
  background: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.hero {
  max-width: 760px;
  padding: 70px 0 58px;
}
.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
}
h1, h2, h3 { font-family: var(--font-head); }
h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}
h1 em { color: var(--accent); font-style: normal; }
.hero-copy {
  max-width: 600px;
  margin: 22px 0 18px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.65;
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--border);
  padding: 20px 0 16px;
}
.toolbar h2 { margin: 0; font-size: 21px; letter-spacing: -0.04em; }
#story-count { color: var(--text-muted); font-size: 13px; }
.cards-grid, .posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 300px));
  gap: 20px;
  justify-content: center;
  padding-bottom: 64px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.card-meta {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-dot {
  opacity: 0.5;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 10px 0;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a {
  text-decoration: none;
  color: inherit;
}

.card-title a:hover {
  color: var(--accent);
}

.card-summary {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon.active {
  color: var(--accent);
}

.btn-like.active {
  color: var(--like-active);
}

.btn-like.active .heart-icon {
  fill: var(--like-active);
  stroke: var(--like-active);
}

.btn-save.active .bookmark-icon {
  fill: var(--accent);
  stroke: var(--accent);
}
.loading, .empty {
  padding: 25px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.site-footer .shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 560px); }
  .nav { min-height: 62px; }
  .hero { padding: 54px 0 48px; }
  h1 { font-size: clamp(2.8rem, 15vw, 4.8rem); }
  .hero-copy { font-size: 15px; }
  .post { grid-template-columns: 1fr; }
  .post-image { height: 190px; min-height: 0; }
  .post-body { padding: 20px 18px 17px; }
  .site-footer .shell { align-items: flex-start; flex-direction: column; justify-content: center; padding: 20px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
