:root {
  --bg-page: #faf9f6;
  --bg-page-alt: #f2f0ea;
  --bg-surface: #ffffff;
  --border: #e2ded4;
  --border-soft: #ebe8e0;
  --text: #000000;
  --text-muted: #4a4a4a;
  --text-faint: #7a7a7a;
  --red: #dc2a2a;
  --red-bright: #ef4444;
  --red-deep: #b91c1c;
  --red-glow: rgba(220, 42, 42, 0.14);
  --red-glow-strong: rgba(220, 42, 42, 0.32);
  --black: #000000;
  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  background-image: radial-gradient(ellipse 900px 480px at 50% -8%, rgba(220, 42, 42, 0.1), transparent),
    radial-gradient(ellipse 700px 400px at 100% 8%, rgba(220, 42, 42, 0.05), transparent);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

/* -- nav ------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 12px;
  z-index: 10;
  width: calc(100% - 24px);
  max-width: calc(var(--max-width) + 40px);
  margin: 12px auto 0;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 11px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--black);
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand img {
  height: 28px;
  width: 28px;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.nav-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(220, 42, 42, 0.25);
  transition: border-color 150ms var(--ease), background 150ms var(--ease),
    box-shadow 150ms var(--ease), transform 150ms var(--ease);
}

.nav-social:hover {
  border-color: var(--red-deep);
  background: var(--red-deep);
  box-shadow: 0 6px 18px rgba(220, 42, 42, 0.32);
  transform: translateY(-1px);
}

.nav-social svg {
  width: 15px;
  height: 15px;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -- header ----------------------------------------------------------- */

.site-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 13vh, 120px) 24px 40px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  max-width: 920px;
}

.brand img {
  width: clamp(104px, 18vw, 148px);
  height: auto;
  display: block;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg), 0 0 70px -18px var(--red-glow-strong);
}

.brand-name {
  margin: 0;
  font-size: clamp(24px, 4.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--black);
  white-space: nowrap;
}

.brand-sub {
  margin: -6px auto 0;
  max-width: 760px;
  font-size: clamp(15px, 2vw, 17.5px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (max-width: 620px) {
  .brand-name {
    white-space: normal;
  }
}

/* -- animations ----------------------------------------------------------- */

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

.fade-in-up {
  animation: fadeInUp 0.8s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    animation: none;
  }
}

/* -- category tabs ------------------------------------------------------- */

.cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
}

.cat {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms var(--ease), background 150ms var(--ease),
    color 150ms var(--ease), box-shadow 150ms var(--ease),
    transform 150ms var(--ease);
}

.cat:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}

.cat.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(220, 42, 42, 0.28);
}

.cat:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* -- feed: horizontal belt -------------------------------------------- */

.feed {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 24px 0 80px;
}

.feed-panel {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4px 24px 18px;
  overflow-x: auto;
  overflow-y: hidden;
  /* centered while the posts fit; scrolls (from the start edge) once they
     overflow, so a short belt never drifts off-centre */
  justify-content: safe center;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.feed-panel[hidden] {
  display: none;
}

.feed-panel::-webkit-scrollbar {
  height: 8px;
}
.feed-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.feed-panel::-webkit-scrollbar-track {
  background: transparent;
}

.x-slot {
  flex: 0 0 auto;
  width: min(550px, 86vw);
  scroll-snap-align: center;
}

.feed-panel .twitter-tweet {
  width: 100%;
}

/* -- loading placeholder (until each post is built) -------------------- */

.x-slot.is-loading {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* shown only when JS never gets to build the embed */
.x-slot__fallback {
  display: block;
  width: -moz-fit-content;
  width: fit-content;
  margin: 40px auto;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.x-slot__fallback:hover {
  border-color: var(--red);
}

.x-slot.is-loading .x-slot__fallback,
.x-slot.is-loaded .x-slot__fallback {
  display: none;
}

.x-slot__spinner {
  display: none;
}

.x-slot.is-loading .x-slot__spinner {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .x-slot.is-loading .x-slot__spinner {
    animation-duration: 2.4s;
  }
}

/* -- footer ----------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-page-alt);
  padding: 28px 24px;
}

.footer-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}

.footer-inner > span {
  font-weight: 500;
  color: var(--text-muted);
}

.footer-disclaimer {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
}

.footer-disclaimer a {
  color: var(--red);
  text-decoration: none;
}

.footer-disclaimer a:hover {
  text-decoration: underline;
}

