:root {
  --bg: #ffffff;
  --soft: #f7f7f5;
  --text: #16161a;
  --muted: #6e6d73;
  --faint: #a3a2a8;
  --line: #ececea;
  --accent: #e0618c;      /* the cat's blush */
  --accent-soft: #fdeef3;
  --blue: #5aa9e6;        /* the PC fan glow */
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; }

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

kbd {
  font: 11px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #fff;
}

/* ---------- first-load splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #fff;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  transition: opacity .5s var(--ease), visibility .5s;
}
.splash img {
  width: 120px;
  mix-blend-mode: multiply;
  animation: splash-in .7s var(--ease) both;
}
.splash-name {
  font: 600 22px var(--mono);
  animation: splash-in .7s .15s var(--ease) both;
}
@keyframes splash-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
}
body:not(.loading) .splash { opacity: 0; visibility: hidden; }

.cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* page sections rise in one after another once the splash leaves */
.reveal,
.top {
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
body.loading .reveal { opacity: 0; transform: translateY(16px); }
body.loading .top { opacity: 0; transform: translateY(-100%); }
.rail.reveal { transition-delay: .08s; }
.toolbar.reveal { transition-delay: .16s; }

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-color: var(--line); }

.top-row {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 18px var(--mono);
  text-decoration: none;
  margin-right: auto;
}
.logo img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  transition: transform .4s var(--ease);
}
.logo:hover img { transform: rotate(-8deg) scale(1.06); }

.top-links a {
  font: 14px var(--mono);
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.top-links a:hover { color: var(--text); }

.status {
  font: 12px var(--mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.live { background: #2fb344; animation: pulse 2s infinite; }
.dot.err { background: #e03131; }
@keyframes pulse {
  from { box-shadow: 0 0 0 0 rgba(47, 179, 68, .45); }
  to   { box-shadow: 0 0 0 9px rgba(47, 179, 68, 0); }
}

/* ---------- intro ---------- */
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 32px;
}
.eyebrow {
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin: 0 0 10px;
}
.intro h1 {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.mew {
  font-family: var(--mono);
  color: var(--accent);
  display: inline-block;
  margin-left: 6px;
  animation: wiggle 3s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0); }
  86% { transform: rotate(-12deg); }
  92% { transform: rotate(9deg); }
}
.lede { margin: 0; color: var(--muted); max-width: 46ch; }

.hero-cat {
  width: 170px;
  flex-shrink: 0;
  mix-blend-mode: multiply;
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-7px) rotate(1deg); }
}

/* ---------- source chips ---------- */
.sources {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  scroll-behavior: auto; /* we animate scrolling ourselves */
}
.sources::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 13px var(--sans);
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: #d5d4d0; transform: translateY(-1px); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.chip .count { font: 11px var(--mono); opacity: .5; }
.chip.all { padding-left: 12px; }

/* company logo with letter fallback */
.co {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #fff;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font: 600 10px var(--mono);
  color: var(--muted);
  overflow: hidden;
}
.co img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- source rail + cat scrollbar ---------- */
.rail {
  position: relative;
  margin-bottom: 14px;
}

/* soft fade at whichever edge has more chips */
.rail::before,
.rail::after {
  content: "";
  position: absolute;
  top: 0;
  height: 36px;
  width: 64px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity .25s;
}
.rail::before { left: 0; background: linear-gradient(90deg, #fff 30%, transparent); }
.rail::after { right: 0; background: linear-gradient(-90deg, #fff 30%, transparent); }
.rail.can-left::before,
.rail.can-right::after { opacity: 1; }

.rail-arrow {
  position: absolute;
  top: 3px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(22, 22, 26, .2);
  opacity: 0;
  pointer-events: none;
  transform: scale(.7);
  transition: opacity .25s, transform .3s var(--ease), border-color .2s;
}
.rail-arrow.left { left: -4px; }
.rail-arrow.right { right: -4px; }
.rail-arrow:hover { border-color: var(--accent); }
.rail-arrow:active { transform: scale(.9); }
.rail.can-left .rail-arrow.left,
.rail.can-right .rail-arrow.right { opacity: 1; pointer-events: auto; transform: scale(1); }

.rail-track {
  position: relative;
  height: 4px;
  margin: 18px 13px 4px;
  border-radius: 4px;
  background: var(--soft);
  opacity: 0;
  transition: opacity .3s;
  cursor: pointer;
}
.rail.scrollable .rail-track { opacity: 1; }
.rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}
.rail-cat {
  position: absolute;
  top: 50%;
  left: 0;
  margin: -14px 0 0 -13px;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 2px 3px rgba(22, 22, 26, .15));
  transition: scale .25s var(--ease);
}
.rail-cat svg { display: block; transition: transform .3s var(--ease); }
.rail-cat:hover { scale: 1.15; }
.rail-cat.dragging { cursor: grabbing; scale: 1.2; }
/* head tilts in the direction it's moving, ears twitch while it walks */
.rail-cat.walk-right svg { transform: rotate(8deg); }
.rail-cat.walk-left svg { transform: rotate(-8deg); }
.rail-cat.walk-right .ears,
.rail-cat.walk-left .ears { animation: twitch .3s ease-in-out infinite alternate; transform-origin: 16px 14px; }
@keyframes twitch { to { transform: scaleY(.85); } }

/* ---------- page scrollbar ---------- */
html { scrollbar-color: #f2b8cb transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #f2c4d3;
  border: 3px solid #fff;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--faint);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.search:focus-within {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: 14px var(--sans);
  color: var(--text);
  padding: 9px 0;
}

.seg {
  display: flex;
  padding: 3px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg button {
  font: 500 13px var(--sans);
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.icon-btn {
  width: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: #d5d4d0; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- lead story ---------- */
.lead {
  display: block;
  text-decoration: none;
  padding: 22px 22px 20px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 100% 0%, #eaf4fd 0%, transparent 50%),
    radial-gradient(120% 140% at 0% 100%, var(--accent-soft) 0%, transparent 50%),
    #fff;
  animation: rise .6s var(--ease) both;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.lead:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(22, 22, 26, .18);
}
.lead-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.lead-title {
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.lead .meta { margin-top: 12px; }

/* ---------- feed ---------- */
.feed { list-style: none; padding: 0; margin: 0; }

.item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: 12px;
  position: relative;
  transition: background .2s;
}
.item + .item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 62px;
  right: 12px;
  border-top: 1px solid var(--line);
  transition: opacity .2s;
}
.item:hover { background: var(--soft); }
.item:hover::before,
.item:hover + .item::before { opacity: 0; }

.item.enter { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.item.fresh .title::after {
  content: "new";
  display: inline-block;
  margin-left: 8px;
  vertical-align: 2px;
  font: 600 10px var(--mono);
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 0 5px;
  animation: pop .4s var(--ease) both;
}
@keyframes pop { from { transform: scale(0); } }

.item .co {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
  transition: transform .3s var(--ease);
}
.item:hover .co { transform: scale(1.08) rotate(-4deg); }
.item .co img { padding: 7px; }

/* underline that sweeps in on hover */
.title,
.lead-title {
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat;
  transition: background-size .35s var(--ease);
}
.title { font-weight: 500; line-height: 1.4; }
.item:hover .title,
.lead:hover .lead-title { background-size: 100% 1.5px; }

.meta {
  font: 12px var(--mono);
  color: var(--faint);
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.meta > * + *::before { content: "·"; margin-right: 6px; color: var(--faint); }
.meta .src { color: var(--muted); font-weight: 500; }
.meta a { color: var(--faint); text-decoration: none; }
.meta a:hover { color: var(--text); }

.side {
  text-align: right;
  font: 12px var(--mono);
  color: var(--faint);
  white-space: nowrap;
  padding-top: 2px;
}
.ago.hot { color: var(--accent); font-weight: 600; }
.side a {
  display: block;
  margin-top: 4px;
  text-decoration: none;
  color: var(--faint);
  transition: color .2s;
}
.side a:hover { color: var(--text); }

/* loading skeleton */
.skeleton .bar,
.skeleton .co {
  background: linear-gradient(90deg, var(--soft) 25%, #ececee 50%, var(--soft) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.2s infinite;
  border-color: transparent;
}
.skeleton .bar { height: 13px; border-radius: 5px; margin-bottom: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { color: var(--muted); text-align: center; padding: 48px 0; }

/* ---------- subscribe ---------- */
.subscribe {
  margin-top: 48px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, #eaf4fd 0%, transparent 55%),
    radial-gradient(120% 140% at 0% 100%, var(--accent-soft) 0%, transparent 55%),
    #fff;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 16px 28px;
  align-items: end;
}
.subscribe h2 {
  font-size: clamp(20px, 3.4vw, 24px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px;
}
.sub-copy p:last-child { margin: 0; color: var(--muted); font-size: 14px; }

.sub-field {
  display: flex;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.sub-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sub-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: 14px var(--sans);
  padding: 0 10px;
}
.sub-field button {
  font: 600 14px var(--sans);
  color: #fff;
  background: var(--text);
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.sub-field button:hover { background: var(--accent); }
.sub-field button:active { transform: scale(.96); }
.sub-field button:disabled { opacity: .6; cursor: wait; }

.sub-msg {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.5em;
  font: 13px var(--mono);
  color: var(--muted);
}
.sub-msg.ok { color: #2a9d48; animation: rise .4s var(--ease) both; }
.sub-msg.bad { color: #d6336c; }
.subscribe.shake .sub-field { animation: shake .35s; }
@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- footer ---------- */
.foot {
  padding: 40px 16px 56px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.foot p { margin: 0; }
.foot a { color: var(--text); text-decoration-color: var(--line); text-underline-offset: 3px; }
.foot a:hover { text-decoration-color: var(--accent); }
.keys kbd { margin: 0 2px 0 8px; }

@media (max-width: 600px) {
  .status span:last-child { display: none; }
  .intro { padding-top: 28px; }
  .hero-cat { width: 96px; align-self: flex-start; }
  .item { grid-template-columns: 32px 1fr; }
  .item .co { width: 32px; height: 32px; }
  .side { grid-column: 2; text-align: left; display: flex; gap: 10px; padding: 0; }
  .side a { margin: 0; }
  .item + .item::before { left: 58px; }
  .keys { display: none; }
  .subscribe { grid-template-columns: 1fr; padding: 22px; }
}

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