:root {
  --ink-900: #0b0c10;
  --ink-800: #15161e;
  --ink-700: #202230;
  --paper: #ede9e1;
  --muted: #96939f;
  --gold: #c9a24b;
  --gold-soft: rgba(201, 162, 75, 0.16);
  --blue: #7c93b8;
  --line: rgba(237, 233, 225, 0.09);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 1.6rem 1rem 1.1rem;
  background: linear-gradient(180deg, var(--ink-900) 70%, transparent);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.topbar__mark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
}

.topbar__tag {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Feed layout ---------- */
.feed-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.intro {
  max-width: 46ch;
  margin: 2rem auto 2.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ---------- Post ---------- */
.post {
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
}

.post__header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.post__avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, var(--gold) 0%, var(--ink-700) 70%);
  border: 1px solid var(--line);
}

.post__name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
}

.post__sub {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ink-800);
  outline-offset: 3px;
}

.carousel:focus-visible {
  outline: 2px solid var(--blue);
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    transition: none;
  }
}

.carousel__slide {
  flex: 0 0 100%;
  height: 100%;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: none;
  background: rgba(11, 12, 16, 0.45);
  color: var(--paper);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.carousel:hover .carousel__arrow,
.carousel:focus-within .carousel__arrow {
  opacity: 1;
}

.carousel__arrow--prev {
  left: 0.6rem;
}

.carousel__arrow--next {
  right: 0.6rem;
}

.carousel__dots {
  position: absolute;
  bottom: 0.7rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.carousel__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(237, 233, 225, 0.4);
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel__dot.is-active {
  background: var(--gold);
  transform: scale(1.35);
}

/* ---------- Actions ---------- */
.post__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.vote-btn:hover {
  border-color: var(--gold);
}

.vote-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.vote-btn__heart {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vote-btn.is-voted {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.vote-btn.is-voted .vote-btn__heart {
  fill: var(--gold);
  stroke: var(--gold);
  transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .vote-btn__heart {
    transition: none;
  }
}

.vote-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: auto;
}

.vote-bar {
  margin-top: 0.6rem;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.vote-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.4s ease;
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 560px;
  margin: 1rem auto 0;
  padding: 1.4rem 1rem 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer__total {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.footer__brand {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--paper);
}
