:root {
  --bg-0: #040405;
  --bg-1: #0b0b0d;
  --bg-2: #111115;
  --panel: rgba(15, 15, 19, 0.9);
  --panel-strong: rgba(11, 11, 14, 0.96);
  --line: #381219;
  --line-soft: #2a1116;
  --text: #f0e7e7;
  --muted: #bba9aa;
  --accent: #db1a34;
  --accent-bright: #ff475e;
  --accent-dark: #6b0714;
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.52);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shell-max: 1920px;
  --post-max: 1960px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  line-height: 1.72;
  background:
    radial-gradient(1000px 420px at 6% -20%, rgba(240, 32, 60, 0.25), transparent 58%),
    radial-gradient(900px 420px at 94% -10%, rgba(160, 14, 34, 0.24), transparent 52%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 42%, var(--bg-0) 100%);
}

.noise-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.013) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  opacity: 0.18;
  z-index: 1;
}

main,
.site-header,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(8, 8, 10, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 43, 75, 0.22);
  padding: 0.75rem 0.3rem;
  transition: transform 220ms ease, opacity 220ms ease, background-color 160ms ease, border-color 160ms ease;
  will-change: transform;
}

.site-header.site-header--hidden {
  transform: translateY(calc(-100% - 4px));
  opacity: 0;
  pointer-events: none;
}

.header-inner {
  width: min(100%, var(--shell-max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: min(100%, 320px);
  height: auto;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: #ffffff;
}

main {
  width: min(100% - 0.35rem, var(--shell-max));
  margin-inline: auto;
  padding: 1.2rem 0 3.6rem;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(1.2rem, 0.85rem + 2.1vw, 2.6rem);
  background:
    linear-gradient(140deg, rgba(255, 67, 94, 0.12) 0%, rgba(23, 10, 12, 0.95) 42%, rgba(10, 10, 12, 0.98) 100%);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.4rem;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(255, 55, 84, 0.15), transparent 40%),
    repeating-linear-gradient(
      -36deg,
      rgba(255, 255, 255, 0.018),
      rgba(255, 255, 255, 0.018) 2px,
      transparent 2px,
      transparent 14px
    );
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: #f8b2bd;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
}

.hero h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 0.93;
  font-size: clamp(2.8rem, 2rem + 5.2vw, 6.1rem);
}

.hero-copy {
  margin: 0.9rem 0 0;
  max-width: 86ch;
  color: #e4d7d8;
  font-size: clamp(0.98rem, 0.88rem + 0.35vw, 1.16rem);
}

.hero-actions {
  margin-top: 1.05rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.68rem;
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo {
  width: clamp(180px, 22vw, 360px);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 34px rgba(143, 14, 30, 0.6));
  opacity: 0.96;
}

.btn {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.62rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent), var(--accent-bright));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 94, 119, 0.45), 0 12px 28px rgba(216, 29, 55, 0.35);
}

.btn-secondary {
  border-color: rgba(255, 79, 108, 0.45);
  background: rgba(255, 255, 255, 0.018);
}

.controls {
  margin-top: 1.15rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 0.9rem;
  display: grid;
  gap: 0.85rem;
}

.search-wrap {
  display: grid;
  gap: 0.38rem;
}

.search-wrap span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.search-wrap input {
  width: 100%;
  border: 1px solid rgba(255, 76, 105, 0.38);
  border-radius: 10px;
  background: #09090c;
  color: #f7f0f0;
  padding: 0.72rem 0.82rem;
  font-family: inherit;
}

.search-wrap input:focus {
  outline: 2px solid rgba(255, 95, 123, 0.58);
  outline-offset: 1px;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  border: 1px solid rgba(255, 78, 107, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: #e6c3ca;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.filter-chip.active {
  color: #ffffff;
  border-color: rgba(255, 112, 136, 0.9);
  background: linear-gradient(140deg, rgba(219, 26, 52, 0.96), rgba(110, 9, 21, 0.96));
}

.post-grid-section {
  margin-top: 1.3rem;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-title-row h2,
.about-panel h2,
.post-meta h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-title-row h2,
.about-panel h2 {
  font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.8rem);
}

#resultsCounter {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.post-grid {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.9rem;
}

.post-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(255, 66, 95, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(17, 17, 21, 0.93), rgba(9, 9, 12, 0.95));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  padding: 0.95rem;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 90, 120, 0.7);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.42);
}

.post-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.post-card p {
  margin: 0;
  color: #decbce;
  font-size: 0.92rem;
}

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.pill {
  border: 1px solid rgba(255, 86, 117, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: #f4b1bc;
  padding: 0.28rem 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.66rem;
  line-height: 1.1;
}

.card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.empty-state {
  margin-top: 1rem;
  color: #f6b4c0;
  border: 1px dashed rgba(255, 98, 127, 0.46);
  border-radius: 10px;
  padding: 0.8rem;
}

.about-panel {
  margin-top: 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 0.95rem;
}

.about-panel p {
  margin: 0.75rem 0 0;
  color: #dfd0d0;
}

.about-panel pre {
  margin: 0.8rem 0 0;
  background: #0a0a0c;
  border: 1px solid rgba(255, 79, 108, 0.3);
  border-radius: 10px;
  padding: 0.7rem;
  overflow-x: auto;
}

.site-footer {
  border-top: 1px solid rgba(255, 39, 72, 0.2);
  text-align: center;
  color: var(--muted);
  padding: 1rem 0.8rem 1.2rem;
  font-size: 0.84rem;
}

.post-main {
  width: min(100% - 0.35rem, var(--post-max));
}

.post-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(170deg, rgba(255, 58, 86, 0.08), transparent 25%),
    var(--panel-strong);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 0.6rem + 1.8vw, 2.25rem);
}

.post-meta {
  border-bottom: 1px solid rgba(255, 72, 104, 0.28);
  padding-bottom: 0.95rem;
  margin-bottom: 1rem;
}

.post-meta h1 {
  line-height: 0.96;
  font-size: clamp(2rem, 1.32rem + 3.4vw, 4.6rem);
}

.post-meta p {
  margin: 0.4rem 0 0;
  color: #c9b4b7;
  font-size: 0.9rem;
}

.markdown-body {
  width: 100%;
  overflow-x: auto;
}

.markdown-body :is(h1, h2, h3, h4) {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.08;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}

.markdown-body h1 {
  font-size: clamp(2.1rem, 1.6rem + 2vw, 3.8rem);
}

.markdown-body h2 {
  font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.9rem);
}

.markdown-body h3 {
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 2.1rem);
}

.markdown-body p,
.markdown-body li,
.markdown-body td,
.markdown-body th {
  color: #ebdede;
  font-size: clamp(0.95rem, 0.89rem + 0.2vw, 1.08rem);
  line-height: 1.84;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.3rem;
}

.markdown-body a {
  color: #ff889d;
}

.markdown-body code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 87, 117, 0.24);
  border-radius: 7px;
  padding: 0.13rem 0.35rem;
}

.markdown-body pre {
  width: 100%;
  margin: 0.95rem 0;
  border: 1px solid rgba(255, 74, 106, 0.32);
  border-radius: 12px;
  padding: 0.9rem;
  overflow-x: auto;
  background: #08090b;
}

.markdown-body pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

.markdown-body blockquote {
  margin: 1rem 0;
  border-left: 4px solid rgba(255, 85, 115, 0.72);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem 0.9rem;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 90, 120, 0.25);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid rgba(255, 77, 106, 0.26);
  padding: 0.45rem;
  text-align: left;
}

.post-error {
  color: #ffbdc9;
  border: 1px dashed rgba(255, 95, 124, 0.55);
  border-radius: 10px;
  padding: 0.8rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.controls,
.post-grid-section,
.about-panel,
.post-shell {
  animation: rise-in 300ms ease-out both;
}

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

  .hero-logo-wrap {
    justify-content: flex-start;
  }
}

@media (min-width: 1024px) {
  html {
    font-size: 92%;
  }

  :root {
    --shell-max: 1760px;
    --post-max: 1800px;
  }
}

@media (max-width: 860px) {
  .top-nav {
    display: none;
  }

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

@media (max-width: 620px) {
  .site-header {
    padding-inline: 0.25rem;
  }

  main,
  .post-main {
    width: min(100% - 0.2rem, var(--post-max));
  }

  .brand-logo {
    width: min(100%, 250px);
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
