:root {
  --bg: #0e1014;
  --bg-soft: #151821;
  --text: #f1f4f9;
  --text-muted: #9ca6ba;
  --line: #252c3a;
  --accent-red: #ff4f6d;
  --accent-blue: #53a8ff;
  --accent-gold: #ffcf66;
  --accent-gray: #8c95a8;
  --glow-red: 0 0 22px rgba(255, 79, 109, 0.2);
  --glow-blue: 0 0 22px rgba(83, 168, 255, 0.2);
  --glow-gold: 0 0 22px rgba(255, 207, 102, 0.2);
  --glow-gray: 0 0 22px rgba(140, 149, 168, 0.16);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 12% 20%, rgba(83, 168, 255, 0.08), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(255, 79, 109, 0.08), transparent 42%),
    var(--bg);
  color: var(--text);
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 0.4px, transparent 0.4px);
  background-size: 3px 3px;
  opacity: 0.08;
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(14, 16, 20, 0.82);
  border-bottom: 1px solid var(--line);
}

.topbar__content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.85rem;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand__dot {
  width: 10px;
  height: 10px;
  border-radius: 100%;
  background: var(--accent-red);
  box-shadow: 0 0 12px rgba(255, 79, 109, 0.8);
}

.scarcity {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.cta-btn {
  border: 1px solid rgba(83, 168, 255, 0.6);
  color: var(--text);
  background: linear-gradient(120deg, #243350, #1a1f2d);
  border-radius: 999px;
  padding: 0.58rem 1rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-blue);
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.intro {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.96rem;
  text-align: center;
}

.intro__text {
  margin: 0;
  display: block;
  color: rgba(241, 244, 249, 0.88);
}

.payment-status {
  margin: 1rem auto 0;
  width: fit-content;
  max-width: min(700px, 100%);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(16, 21, 31, 0.8);
  font-size: 0.84rem;
}

.instruction-banner {
  margin: 1rem auto 3rem;
  width: min(980px, 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(241, 244, 249, 0.72);
  font-size: 0.88rem;
}

.instruction-banner__item {
  display: inline-flex;
  align-items: center;
  line-height: 1.35;
}

.instruction-banner__item + .instruction-banner__item::before {
  content: "|";
  margin-right: 0.85rem;
  color: rgba(241, 244, 249, 0.3);
}

.masonry-grid {
  margin-top: 0;
  column-width: 310px;
  column-gap: 1.05rem;
}

.feed-controls {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  margin: 1rem 0 1.25rem;
}

.feed-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.load-more-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #161d2b;
  color: var(--text);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.load-more-btn:hover {
  box-shadow: var(--glow-blue);
}

.secret-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 1rem;
  break-inside: avoid;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 1.5rem;
  background: linear-gradient(160deg, rgba(26, 31, 43, 0.95), rgba(20, 24, 34, 0.95));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.secret-card__text {
  margin: 0;
  font-family: "Literata", serif;
  line-height: 1.55;
  letter-spacing: 0.01em;
  font-size: 1rem;
  white-space: pre-wrap;
}

.secret-card__meta {
  margin-top: 0.95rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.secret-card__author {
  color: rgba(241, 244, 249, 0.82);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.secret-card[data-category="guilt"] {
  border-left-color: var(--accent-red);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    var(--glow-red);
}

.secret-card[data-category="sadness"] {
  border-left-color: var(--accent-blue);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    var(--glow-blue);
}

.secret-card[data-category="joy"] {
  border-left-color: var(--accent-gold);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    var(--glow-gold);
}

.secret-card[data-category="general"] {
  border-left-color: var(--accent-gray);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    var(--glow-gray);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 7, 10, 0.78);
  z-index: 20;
}

.modal {
  width: min(560px, 100%);
  background: linear-gradient(170deg, #141824, #0e121c);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.42);
  position: relative;
}

.modal h2 {
  margin: 0 0 1rem;
  font-size: 1.22rem;
}

.modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border: 1px solid var(--line);
  background: #151c2b;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}

form {
  display: grid;
  gap: 0.8rem;
}

label,
legend {
  font-size: 0.88rem;
  color: var(--text-muted);
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f1420;
  color: var(--text);
  border-radius: 10px;
  padding: 0.75rem;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 122px;
}

.char-counter {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: -0.35rem;
}

.field-help {
  margin: -0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
}

.category-options {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.category-options label {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.pay-btn {
  margin-top: 0.35rem;
  border: 0;
  border-radius: 10px;
  padding: 0.82rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #10151f;
  background: linear-gradient(120deg, #ffcf66, #ffb443);
}

.pay-btn:hover {
  box-shadow: var(--glow-gold);
}

@media (max-width: 820px) {
  .topbar__content {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .cta-btn {
    justify-self: start;
  }

  .intro {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 0.8rem;
  }

  .brand {
    font-size: 0.96rem;
  }

  .scarcity {
    font-size: 0.84rem;
  }

  .cta-btn {
    width: 100%;
    text-align: center;
  }

  .instruction-banner {
    margin: 0.95rem auto 2.6rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
    font-size: 0.86rem;
  }

  .instruction-banner__item + .instruction-banner__item::before {
    content: "";
    margin-right: 0;
  }

  .masonry-grid {
    column-width: 100%;
  }

  .secret-card {
    padding: 1.15rem;
    border-radius: 10px;
  }

  .secret-card__text {
    font-size: 0.97rem;
    line-height: 1.6;
  }

  .category-options {
    grid-template-columns: 1fr;
  }
}
