:root {
  color-scheme: light;
  --bg: #f2f4f3;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --ink: #17201e;
  --muted: #68736f;
  --line: #e1e6e3;
  --accent: #315c52;
  --accent-soft: #e5efeb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.shell {
  width: min(680px, 100%);
  margin: 0 auto;
  padding-bottom: 54px;
}

.app-bar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  min-height: 66px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(225, 230, 227, 0.92);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.back-link {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.2rem;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  background: var(--surface-soft);
}

.app-title,
.app-subtitle {
  margin: 0;
}

.app-title {
  font-size: 0.98rem;
  font-weight: 800;
}

.app-subtitle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
}

.archive-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.feed-intro {
  padding: 42px 20px 24px;
  background: var(--surface);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.11em;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  margin: 9px 0 13px;
  max-width: 560px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.lede {
  max-width: 610px;
  margin: 0;
  color: #46514d;
  font-size: 1.02rem;
  line-height: 1.55;
}

.week-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.week-strip > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.count-number {
  font-size: 1.35rem;
  font-weight: 850;
}

.count-label {
  color: var(--muted);
  font-size: 0.74rem;
}

.scope-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: right;
}

.feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 20px 14px;
}

.feed-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: -0.025em;
}

.feed-note {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: right;
}

.social-feed {
  overflow: hidden;
  margin: 0 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.day-group + .day-group {
  border-top: 8px solid var(--bg);
}

.day-divider {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.post-card {
  padding: 18px;
  background: var(--surface);
}

.post-card + .post-card {
  border-top: 1px solid var(--line);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 11px;
}

.post-avatar {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

.post-identity {
  min-width: 0;
}

.post-author,
.post-carrier,
.post-meta {
  margin: 0;
}

.post-author {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-carrier {
  margin-top: 1px;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 750;
}

.post-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.post-lag {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f4eee2;
  color: #725d3d;
  font-size: 0.66rem;
  font-weight: 800;
}

.post-text {
  margin: 15px 0 16px 53px;
  font-size: clamp(1.08rem, 4vw, 1.28rem);
  letter-spacing: -0.012em;
  line-height: 1.48;
  white-space: pre-line;
}

.post-media {
  margin: 2px 0 16px 53px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #e8ebe9;
}

.media-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #d8dcda;
}

.media-stage-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.media-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 180ms ease, transform 180ms ease;
}

.media-stage.media-portrait {
  aspect-ratio: 3 / 4;
  background: #e6e8e6;
}

.media-stage.media-portrait img {
  object-fit: contain;
  object-position: center top;
}

.media-stage.media-document {
  aspect-ratio: auto;
  background: #f1eee7;
}

.media-stage.media-document .media-stage-link {
  height: auto;
}

.media-stage.media-document img {
  height: auto;
  object-fit: contain;
  object-position: center top;
}

.media-stage.media-newspaper {
  aspect-ratio: 3 / 4;
  background: #f1eee7;
}

.media-stage.media-newspaper img {
  object-fit: contain;
  object-position: center top;
}

.media-stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: transparent;
  content: "";
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: color;
  transition: opacity 180ms ease;
}

.media-stage.is-color::after {
  opacity: 0.76;
}

.restore-neutral-albumen img {
  filter: grayscale(1) sepia(0.06) contrast(1.12) brightness(1.05) saturate(0.92);
}

.restore-neutral-bw img {
  filter: grayscale(1) contrast(1.12) brightness(1.035);
}

.color-kaulia::after {
  background:
    radial-gradient(circle at 51% 27%, rgba(148, 94, 68, 0.95) 0 8%, rgba(148, 94, 68, 0.8) 9% 13%, transparent 18%),
    radial-gradient(ellipse at 51% 63%, rgba(42, 45, 48, 0.96) 0 30%, transparent 47%),
    radial-gradient(ellipse at 51% 58%, rgba(104, 82, 63, 0.88) 0 13%, transparent 21%),
    linear-gradient(rgba(133, 113, 92, 0.86), rgba(96, 82, 72, 0.9));
}

.color-palace::after {
  background:
    radial-gradient(ellipse at 50% 58%, rgba(202, 183, 145, 0.95) 0 28%, rgba(202, 183, 145, 0.8) 31%, transparent 43%),
    linear-gradient(
      to bottom,
      rgba(91, 137, 174, 0.9) 0 31%,
      rgba(87, 105, 75, 0.86) 33% 46%,
      rgba(160, 142, 112, 0.72) 47% 68%,
      rgba(73, 112, 65, 0.92) 72% 100%
    );
}

.color-poi::after {
  background:
    radial-gradient(circle at 38% 50%, rgba(143, 88, 58, 0.88) 0 10%, transparent 17%),
    radial-gradient(circle at 60% 48%, rgba(143, 88, 58, 0.8) 0 10%, transparent 18%),
    linear-gradient(
      to bottom,
      rgba(78, 103, 68, 0.86) 0 42%,
      rgba(112, 86, 60, 0.86) 43% 72%,
      rgba(91, 71, 52, 0.9) 73% 100%
    );
}

.crop-stereo-left img {
  width: 200%;
  max-width: none;
  object-position: left center;
}

.media-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 11px 8px;
  background: var(--surface);
}

.media-toggle {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #53605b;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
}

.media-toggle:hover,
.media-toggle:focus-visible,
.media-toggle.active {
  border-color: #acc7bd;
  background: var(--accent-soft);
  color: var(--accent);
}

.media-full-link {
  align-self: center;
  margin-left: auto;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 800;
  text-decoration: none;
}

.media-full-link:hover,
.media-full-link:focus-visible {
  text-decoration: underline;
}

.media-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 11px 8px;
  background: var(--surface);
}

.media-kind,
.media-relationship,
.media-color-confidence {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
}

.media-kind {
  background: var(--accent-soft);
  color: var(--accent);
}

.media-color-confidence {
  background: #f5efe4;
  color: #725d3d;
}

.media-caption {
  padding: 0 11px 8px;
  background: var(--surface);
  color: #46514d;
  font-size: 0.78rem;
  line-height: 1.42;
}

.media-source {
  margin: 0;
  padding: 0 11px 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 750;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: 53px;
}

.post-action {
  min-width: 0;
}

.post-action[open] {
  flex-basis: 100%;
}

.post-action > summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #4e5a56;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  list-style: none;
}

.post-action > summary::-webkit-details-marker {
  display: none;
}

.post-action > summary:hover,
.post-action > summary:focus-visible,
.post-action[open] > summary {
  border-color: #bfd1ca;
  background: var(--accent-soft);
  color: var(--accent);
}

.action-panel {
  margin-top: 9px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: #394541;
  font-size: 0.88rem;
  line-height: 1.55;
}

.action-panel p {
  margin: 0 0 10px;
}

.action-panel p:last-child {
  margin-bottom: 0;
}

.voice-mode {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.source-line a {
  color: var(--accent);
  font-weight: 750;
}

.resource-links {
  margin: 14px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.resource-links-title {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.resource-link {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.resource-link:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.resource-link-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
}

.resource-link-topline a {
  color: var(--accent);
  font-weight: 800;
}

.resource-kind {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 800;
}

.resource-note {
  margin-top: 5px !important;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.routing-line {
  color: var(--muted);
  font-size: 0.76rem;
}

.feed-end {
  padding: 30px 18px;
  border-top: 8px solid var(--bg);
  color: var(--muted);
  text-align: center;
}

.feed-end p {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.feed-end .caught-up {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

.about-panel {
  margin: 28px 20px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.about-panel > summary {
  padding: 16px 18px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
}

.about-body {
  padding: 0 18px 17px;
  color: #4b5652;
  font-size: 0.86rem;
  line-height: 1.55;
}

.about-body p {
  margin: 0 0 10px;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.loading,
.error {
  margin: 0;
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
}

footer {
  padding: 28px 20px 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

@media (max-width: 560px) {
  .feed-intro {
    padding-top: 32px;
  }

  .week-strip {
    grid-template-columns: 1fr;
  }

  .scope-note {
    text-align: left;
  }

  .feed-heading {
    align-items: start;
    flex-direction: column;
  }

  .feed-note {
    max-width: none;
    text-align: left;
  }

  .social-feed {
    margin: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .post-card {
    padding: 17px 15px;
  }

  .post-text,
  .post-media,
  .post-actions {
    margin-left: 0;
  }

  .post-text {
    margin-top: 14px;
  }

  .post-media {
    border-radius: 14px;
  }

  .media-full-link {
    flex-basis: 100%;
    margin-left: 0;
    padding: 3px 1px 1px;
  }

  .about-panel {
    margin-right: 12px;
    margin-left: 12px;
  }
}
