:root {
  --ink: #171916;
  --muted: #72766e;
  --paper: #f4f2ec;
  --surface: #fff;
  --line: rgba(23, 25, 22, 0.12);
  --lime: #b7d932;
  --sage: #dce4d2;
  --lilac: #ded4ea;
  --shadow: 0 22px 70px rgba(29, 31, 27, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Sora", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

a { color: inherit; }

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

body.panel-open { overflow: hidden; }

.feed-header {
  position: sticky;
  z-index: 20;
  top: 0;
  width: min(1440px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 236, 0.88);
  backdrop-filter: blur(18px);
}

.feed-brand {
  justify-self: start;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  text-decoration: none;
}

.feed-brand span { color: #9dbb1d; }

.feed-heading { text-align: center; }

.feed-heading > span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
}

.feed-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.52rem;
}

.feed-account {
  justify-self: end;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 25, 22, 0.2);
  border-radius: 50%;
  background: var(--lilac);
  font-size: 0.62rem;
  font-weight: 700;
  text-decoration: none;
}

.feed-main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 132px;
}

.feed-intro {
  max-width: 760px;
  margin-bottom: 32px;
}

.feed-kicker {
  margin: 0 0 10px;
  color: #67801a;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.feed-intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6.7vw, 6.5rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.feed-intro h1 em {
  color: #69745d;
  font-style: normal;
  font-weight: 300;
}

.feed-search-prompt {
  width: min(570px, 100%);
  min-height: 56px;
  margin-top: 28px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 9px 30px rgba(30, 32, 29, 0.06);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.feed-search-prompt > span:nth-child(2) {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-search-prompt kbd {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f5f1;
  font-size: 0.48rem;
}

.feed-search-icon,
.search-glyph {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.feed-search-icon::after,
.search-glyph::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 6px;
  height: 1.8px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(46deg);
}

.topic-row {
  margin-top: 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-row::-webkit-scrollbar { display: none; }

.topic-row button {
  flex: 0 0 auto;
  min-height: 35px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}

.topic-row button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.masonry-feed {
  columns: 5 210px;
  column-gap: 18px;
}

.feed-card {
  margin: 0 0 24px;
  break-inside: avoid;
  display: inline-block;
  width: 100%;
}

.feed-image {
  position: relative;
  overflow: hidden;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  background: #dddcd5;
}

.feed-image.tall { aspect-ratio: 4 / 5.8; }
.feed-image.short { aspect-ratio: 4 / 4.35; }

.feed-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(13, 15, 12, 0.32));
  pointer-events: none;
}

.feed-image img {
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.feed-image:hover img { transform: scale(1.025); }

.image-source {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 12px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(16, 18, 15, 0.66);
  color: white;
  font-size: 0.45rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.product-source {
  background: var(--lime);
  color: var(--ink);
}

.feed-card-copy { padding: 12px 5px 0; }

.feed-card-copy > a { text-decoration: none; }

.feed-card-copy h2 {
  margin: 0;
  font-size: 0.77rem;
  line-height: 1.42;
  letter-spacing: -0.035em;
}

.feed-card-copy > p {
  margin: 6px 0 11px;
  color: var(--muted);
  font-size: 0.53rem;
  line-height: 1.55;
}

.feed-tag {
  display: inline-block;
  margin-bottom: 7px;
  color: #6a7a28;
  font-size: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.feed-author {
  display: grid;
  grid-template-columns: 27px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-decoration: none;
}

.feed-author > span {
  grid-row: 1 / 3;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--lime);
  font-size: 0.5rem;
  font-weight: 800;
}

.feed-author strong {
  font-size: 0.48rem;
  line-height: 1.2;
}

.feed-author small {
  color: var(--muted);
  font-size: 0.42rem;
}

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

.feed-end {
  margin: 54px 0 0;
  color: var(--muted);
  font-size: 0.54rem;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(430px, calc(100% - 28px));
  min-height: 68px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(24, 26, 23, 0.94);
  box-shadow: 0 16px 44px rgba(16, 18, 15, 0.3);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav > a,
.bottom-nav > button {
  min-width: 0;
  padding: 6px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #b8bcb3;
  text-decoration: none;
  cursor: pointer;
}

.bottom-nav > .is-active {
  background: rgba(183, 217, 50, 0.13);
  color: var(--lime);
}

.bottom-nav small {
  font-size: 0.43rem;
  font-weight: 600;
}

.nav-glyph {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.home-glyph::before {
  content: "";
  position: absolute;
  inset: 5px 3px 2px;
  border: 1.7px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.home-glyph::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 10px;
  height: 10px;
  border-top: 1.7px solid currentColor;
  border-left: 1.7px solid currentColor;
  transform: rotate(45deg);
}

.profile-glyph::before,
.profile-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 1.7px solid currentColor;
  transform: translateX(-50%);
}

.profile-glyph::before {
  top: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.profile-glyph::after {
  bottom: 0;
  width: 15px;
  height: 8px;
  border-radius: 9px 9px 4px 4px;
}

.menu-glyph::before,
.menu-glyph::after {
  content: "";
  position: absolute;
  left: 2px;
  width: 14px;
  height: 1.7px;
  border-radius: 2px;
  background: currentColor;
}

.menu-glyph::before { top: 5px; box-shadow: 0 7px 0 currentColor; }

.feed-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgba(14, 16, 13, 0.5);
  backdrop-filter: blur(5px);
}

.search-sheet,
.menu-sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 0;
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 30px));
  overflow: auto;
  padding: 10px 28px max(28px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.menu-sheet { width: min(590px, 100%); }

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: #cccbc5;
}

.search-sheet header,
.menu-sheet header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.search-sheet header p,
.menu-sheet header p {
  margin: 0 0 4px;
  color: #718322;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-sheet h2,
.menu-sheet h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  letter-spacing: -0.05em;
}

.search-sheet header button,
.menu-sheet header button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 1.15rem;
  cursor: pointer;
}

.universal-search {
  min-height: 58px;
  margin-top: 24px;
  padding: 0 17px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid #a8aaa3;
  border-radius: 17px;
  background: white;
}

.universal-search:focus-within {
  border-color: #7c9125;
  box-shadow: 0 0 0 3px rgba(183, 217, 50, 0.22);
}

.universal-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.68rem;
}

.search-hint {
  margin: 10px 2px 16px;
  color: var(--muted);
  font-size: 0.48rem;
  line-height: 1.5;
}

.search-results {
  display: grid;
  gap: 7px;
}

.search-results > a {
  min-height: 66px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  text-decoration: none;
}

.result-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: var(--lime);
  font-size: 0.62rem;
  font-weight: 800;
}

.result-avatar-dark { color: white; }
.result-avatar-lilac { background: var(--lilac); color: var(--ink); }
.result-avatar-lime { background: var(--lime); color: var(--ink); }

.search-results strong,
.search-results small { display: block; }
.search-results strong { margin-bottom: 4px; font-size: 0.61rem; }
.search-results small { color: var(--muted); font-size: 0.46rem; }
.search-results i { color: var(--muted); font-style: normal; }

.search-empty {
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.58rem;
  text-align: center;
}

.menu-profile {
  margin: 22px 0 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 43px 1fr auto;
  align-items: center;
  gap: 11px;
  border-radius: 17px;
  background: var(--lilac);
}

.menu-profile > span {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  font-size: 0.58rem;
  font-weight: 700;
}

.menu-profile strong,
.menu-profile small { display: block; }
.menu-profile strong { font-size: 0.6rem; }
.menu-profile small { margin-top: 3px; color: #605c67; font-size: 0.44rem; }

.menu-profile a {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  font-size: 0.45rem;
  font-weight: 700;
  text-decoration: none;
}

.workspace-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.workspace-menu > a {
  min-height: 76px;
  padding: 12px;
  display: grid;
  grid-template-columns: 29px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  text-decoration: none;
}

.workspace-menu > a > span {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f0efe9;
  font-size: 0.65rem;
}

.workspace-menu strong,
.workspace-menu small { display: block; }
.workspace-menu strong { font-size: 0.52rem; }
.workspace-menu small { margin-top: 4px; color: var(--muted); font-size: 0.4rem; line-height: 1.35; }
.workspace-menu i { color: #6e8029; font-size: 0.42rem; font-style: normal; font-weight: 800; }

.menu-sheet footer a {
  margin-top: 13px;
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  border-radius: 15px;
  background: var(--ink);
  color: white;
  font-size: 0.53rem;
  font-weight: 700;
  text-decoration: none;
}

[hidden] { display: none !important; }

@media (max-width: 680px) {
  .feed-header {
    width: calc(100% - 28px);
    height: 66px;
    grid-template-columns: 1fr 1fr;
  }

  .feed-heading { display: none; }

  .feed-main {
    width: calc(100% - 24px);
    padding-top: 30px;
  }

  .feed-intro { margin-bottom: 22px; }

  .feed-intro h1 {
    max-width: 340px;
    font-size: clamp(2.75rem, 15vw, 4.5rem);
  }

  .feed-search-prompt { margin-top: 22px; }
  .feed-search-prompt kbd { display: none; }

  .masonry-feed {
    columns: 2;
    column-gap: 10px;
  }

  .feed-card { margin-bottom: 19px; }
  .feed-image { border-radius: 16px; }
  .feed-card-copy { padding: 9px 3px 0; }
  .feed-card-copy h2 { font-size: 0.67rem; }
  .feed-card-copy > p { display: none; }
  .feed-author { margin-top: 9px; }
  .feed-author small { display: none; }
  .image-source { left: 8px; bottom: 8px; padding: 6px 7px; font-size: 0.37rem; }

  .search-sheet,
  .menu-sheet {
    padding: 10px 15px max(22px, env(safe-area-inset-bottom));
  }

  .workspace-menu { grid-template-columns: 1fr; }
}

@media (min-width: 681px) and (max-width: 1050px) {
  .masonry-feed { columns: 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .feed-image img { transition: none; }
}
