:root {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #121212;
  --muted: #767676;
  --line: #e9e9e9;
  --chip: #f1f1f1;
  --accent: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.appHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}

.brandMark {
  display: inline-block;
  color: var(--ink);
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.headerSearch {
  display: block;
  min-width: 0;
}

.headerSearch input {
  width: 100%;
  height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f1f1;
  color: var(--ink);
  padding: 0 18px;
  outline: none;
}

.headerSearch input:focus {
  border-color: color-mix(in srgb, var(--accent) 44%, white);
}

.headerStats {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.headerLinks {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

.languageToggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 2px;
}

.languageToggle button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.languageToggle button.active {
  background: var(--ink);
  color: #fff;
}

.headerStats span,
.detailLink {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.headerStats strong {
  margin-right: 4px;
  color: var(--ink);
  font-size: 15px;
}

.detailLink {
  color: var(--ink);
}

main {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.6vw, 34px) 54px;
}

.homeControls {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 4px 0 12px;
}

.audienceFilters,
.viewModes {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.audienceFilters::-webkit-scrollbar,
.viewModes::-webkit-scrollbar {
  display: none;
}

.controlPill {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.controlPill.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.quickTopics {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 4px 0 18px;
  scrollbar-width: none;
}

.quickTopics::-webkit-scrollbar {
  display: none;
}

.topicPill {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.topicPill.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.boardHeader {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding: 4px 2px 14px;
}

.boardHeader p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.pinBoard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 8px;
  gap: 14px;
  align-items: start;
}

.pinCard {
  display: block;
  width: 100%;
  margin: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
  box-shadow: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.pinCard:hover {
  transform: translateY(-3px);
  box-shadow: none;
}

.pinCard:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, white);
  outline-offset: 3px;
}

.pinMedia {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 0;
  border-radius: 8px;
  background: #f1f1f1;
  overflow: hidden;
}

.pinMedia.tall {
  aspect-ratio: 3 / 4;
}

.pinMedia.short {
  aspect-ratio: 1 / 1;
}

.pinMedia::after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0%) 0%, rgb(0 0 0 / 72%) 100%);
  pointer-events: none;
}

.pinMedia img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pinMedia.tall img {
  min-height: 0;
}

.pinMedia.short img {
  min-height: 0;
  max-height: none;
}

.pinOverlay {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  z-index: 2;
}

.pinBadge,
.pinScore {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 92%);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.pinScore {
  color: var(--accent);
}

.pinBody {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 52px 13px 13px;
  color: #fff;
}

.pinTitle {
  margin: 0;
  font-size: 20px;
  line-height: 1.16;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  color: #fff;
  text-shadow: 0 1px 16px rgb(0 0 0 / 48%);
}

.pinMeta {
  margin: 7px 0 0;
  color: rgb(255 255 255 / 82%);
  font-size: 13px;
  line-height: 1.4;
}

.brandStrip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.brandChip {
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 88%);
  padding: 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emptyMessage {
  border-radius: 8px;
  background: #f7f7f7;
  padding: 26px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .pinBoard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .appHeader {
    grid-template-columns: auto 1fr auto;
    gap: 10px 12px;
  }

  .headerSearch {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .headerStats {
    grid-column: 1 / -1;
    grid-row: 3;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .headerStats::-webkit-scrollbar {
    display: none;
  }

  .detailLink {
    flex: 0 0 auto;
  }

  .headerLinks {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .languageToggle {
    grid-column: 2;
    grid-row: 1;
  }

  .homeControls {
    display: grid;
    gap: 10px;
  }

  .pinBoard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }

  .pinCard {
    border-radius: 8px;
  }
}

@media (max-width: 520px) {
  .appHeader {
    min-height: auto;
    padding: 12px;
  }

  main {
    padding-inline: 10px;
  }

  .brandMark {
    font-size: 22px;
  }

  .headerStats span {
    flex: 0 0 auto;
  }

  .boardHeader {
    padding-top: 6px;
  }

  .pinBoard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pinMedia,
  .pinMedia img {
    min-height: 0;
  }

  .pinMedia.tall img {
    min-height: 0;
  }

  .pinMedia.short img {
    min-height: 0;
  }

  .pinOverlay {
    left: 7px;
    right: 7px;
    bottom: 7px;
  }

  .pinBadge,
  .pinScore {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .pinBody {
    padding: 44px 10px 10px;
  }

  .pinTitle {
    font-size: 15px;
  }

  .pinMeta {
    font-size: 12px;
  }

  .brandChip {
    max-width: 100%;
    min-height: 27px;
    font-size: 11px;
    padding: 0 8px;
  }

  .brandStrip {
    gap: 6px;
  }
}
