@font-face {
  font-family: Fraunces;
  src: url("/synap-fraunces.woff2") format("woff2");
  font-weight: 550 750;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/synap-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f7f5ee;
  --white: #fffefa;
  --ink: #142035;
  --muted: #50596a;
  --rule: #d8d6ce;
  --green: #383db0;
  --mint: #ebeafb;
  --orange: #5559c7;
  --community-navy: var(--ink);
  --community-indigo: var(--green);
  --community-muted: var(--muted);
  --community-rule: var(--rule);
  --community-white: var(--white);
  --community-lime: var(--mint);
  --community-wash: var(--paper);
  --edition-line: #b0b4be;
  --ui-font: system-ui, sans-serif;
  --serif: Fraunces, Georgia, serif;
  --mono: "JetBrains Mono", monospace;
  --app-header: 60px;
  --dock-offset: calc(12px + env(safe-area-inset-bottom, 0px));
  --dock-space: calc(84px + env(safe-area-inset-bottom, 0px));
  --card-shadow: 0 7px 24px #2639750b;
  font-family: var(--ui-font);
  scroll-padding-block: calc(var(--app-header) + 12px) var(--dock-space);
}

h1, h2, h3, h4 { font-weight: 650; }
.story-meta time, .message-time, #edition-date { font-family: var(--mono); }

body {
  min-height: 100svh;
  padding-bottom: var(--dock-space);
  background: var(--paper);
}
.shell { width: min(1136px, calc(100% - clamp(28px, 6vw, 90px))); }
.top {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  border-top: 0;
  border-color: var(--rule);
  background: var(--white);
}
@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .top {
    background: #fffefae8;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
.bar {
  min-height: var(--app-header);
  flex-wrap: nowrap;
  gap: .75rem;
  padding: 0;
}
.bar .brand { min-height: 44px; }
.bar .brand-lockup { width: clamp(132px, 23vw, 164px); }
.app-top-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.app-top-action:hover { background: var(--mint); }
:focus-visible { outline-color: var(--green); }
.skip { z-index: 40; }
.site-footer { padding-block: .9rem; }
.site-footer .brand-lockup { width: 112px; }
.edition { border: 0; }
.edition-row { min-height: 34px; }
.edition-row :is(#actor, #community-actor) { min-height: 44px; }
.edition-row p { max-width: none; }
.edition-row label { white-space: nowrap; }

.app-dock {
  position: fixed;
  z-index: 20;
  inset: auto 0 var(--dock-offset);
  margin-inline: auto;
  width: min(424px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 5px;
  border-radius: 25px;
  border: 1px solid #aab9f05e;
  background: #1c2544;
  box-shadow: 0 14px 38px #1220484d, inset 0 1px 0 #f7f7ff24;
}
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
  .app-dock {
    background: #202946de;
    -webkit-backdrop-filter: blur(20px) saturate(1.45);
    backdrop-filter: blur(20px) saturate(1.45);
  }
}
.app-dock a {
  position: relative;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 19px;
  padding: 3px 1px 2px;
  color: #e1e5f6;
  font-size: .68rem;
  font-weight: 650;
  line-height: 1.15;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.app-dock a:hover { background: #ffffff17; }
.app-dock a[aria-current="page"] {
  background: #b9c7ff2f;
  color: #fff;
  text-decoration: none;
}
.app-dock a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 2px;
  margin-inline: auto;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: #b7c5ff;
}
.app-dock a:focus-visible { outline-color: #ced6ff; outline-offset: -3px; }

@media (min-width: 1050px) {
  :root { --workspace-rail: 166px; }
  body:not(:has(.welcome)) {
    padding-inline-start: var(--workspace-rail);
    padding-bottom: 0;
  }
  body:not(:has(.welcome))::before {
    content: "";
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 11;
    width: var(--workspace-rail);
    border-inline-end: 1px solid var(--rule);
    background: #f0eee6;
  }
  body:not(:has(.welcome)) .top {
    z-index: 12;
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body:not(:has(.welcome)) .bar { justify-content: flex-end; }
  body:not(:has(.welcome)) .bar > .brand {
    position: absolute;
    inset: 0 auto 0 calc(0px - var(--workspace-rail) + 16px);
  }
  .bar .brand-lockup { width: 132px; }
  .app-dock {
    inset: calc(var(--app-header) + 23px) auto auto 12px;
    width: calc(var(--workspace-rail) - 24px);
    margin: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .app-dock a {
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    gap: 10px;
    min-height: 48px;
    padding-inline: 11px;
    border-radius: 10px;
    color: var(--muted);
    font-size: .8rem;
  }
  .app-dock a:hover { background: var(--white); }
  .app-dock a[aria-current="page"] { background: var(--mint); color: var(--green); }
  .app-dock a[aria-current="page"]::after { content: none; }
  .app-dock a:focus-visible { outline-color: var(--green); }
}
.dock-glyph { position: relative; display: grid; place-items: center; }
.dock-glyph svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#badge:not(:empty) {
  position: absolute;
  inset: -4px auto auto calc(100% - 5px);
  min-width: 16px;
  padding: 2px 4px;
  border-radius: 50px;
  background: #dfe5ff;
  color: #262962;
  font: 750 .6rem/1 var(--ui-font);
}

main { padding-block: .85rem 2.5rem; }
.app-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem 1rem;
}
.app-page-head h1,
.community-head h1,
.digest-masthead h1,
.inbox h1 {
  font: 720 clamp(1.9rem, 4.2vw, 3.2rem)/1.06 var(--serif);
  letter-spacing: -.047em;
}
.feed-controls { margin: 0; }
.feed-tabs,
.digest-modes {
  display: inline-flex;
  flex-wrap: nowrap;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 30px;
  background: var(--mint);
}
.feed-tab, .digest-modes .feed-tab { min-height: 44px; padding-inline: .85rem; white-space: nowrap; }
.feed-tab[aria-pressed="true"],
.feed-tab[aria-pressed="true"]:hover:enabled {
  background: var(--white);
  color: var(--green);
  box-shadow: 0 1px 4px #25388426;
}
.feed-tab:hover:enabled { background: var(--white); }

#radar { margin-top: .2rem; scroll-margin-top: 0; }
.filters { padding-block: .6rem .8rem; }
.filters :is(input, select) { border-radius: 12px; border-color: var(--rule); }
.filters input { font-size: 1rem; }
.filters select { padding-inline: .75rem; }
#radar .section-title { margin-block: 1.4rem .65rem; }
#radar .section-title h2, .digest-toolbar h2, .community h2, #community-dialog h2 {
  font: 680 clamp(1.2rem, 2.3vw, 1.65rem)/1.2 var(--serif);
  letter-spacing: -.035em;
}
.cards { gap: clamp(.75rem, 1.8vw, 1.35rem); }
.card, .inbox-empty, .comment, .notice {
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}
.topic-break {
  font: 700 1rem/1.5 var(--ui-font);
  letter-spacing: 0;
}
.article-photo img { border-radius: 16px; }

.inbox {
  width: min(100%, 56rem);
  margin: clamp(.7rem, 3vw, 2rem) 0 0;
}
.inbox > .back-link { color: var(--green); }
.inbox h1 {
  padding-bottom: .8rem;
  margin: .4rem 0 0;
  border-bottom: 2px solid var(--ink);
  font-size: clamp(2.65rem, 6vw, 4.45rem);
}
.inbox-empty, .inbox .notice {
  margin: 0;
  padding: clamp(.85rem, 2.5vw, 1.5rem) 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.inbox .notices { margin: 0; }
.inbox .notices > .muted { padding: 1rem 0; }
.inbox .notice.new {
  padding-inline-start: .9rem;
  border-inline-start: 3px solid var(--green);
  background: var(--mint);
}
.inbox .notice .meta { color: var(--muted); font: .74rem/1.5 var(--mono); }
.inbox .notice a { display: inline-flex; align-items: center; min-height: 44px; }
.inbox-empty .back-link { color: var(--green); }


body:has(.welcome) {
  min-height: 100svh;
  min-height: 100dvh;
  padding-bottom: 0;
}
body:has(.welcome) .top { position: relative; }
body:has(.welcome) :is(.app-dock, .app-top-action) { display: none; }
.welcome .btn { border-radius: 8px; }
.welcome h1 { font-family: var(--serif); letter-spacing: -.045em; }
.welcome-signal span { border-color: #a4aefe75; box-shadow: 0 0 45px #bfc4ff20 inset; }
.welcome-signal img { box-shadow: 0 0 45px #c2c9ff66; }
.welcome-meter span { background: #a2a9e374; }
.welcome .btn:hover:enabled { background: white; }

@media (max-width: 650px) {
  main { padding-top: .65rem; }
  .edition-row .date { display: inline; }
}

@media (max-width: 480px) {
  .app-page-head h1 { font-size: clamp(1.55rem, 6.2vw, 1.8rem); }
  .filters select { flex: 1 1 0; }
}

.app-dock a:active { transform: scale(.96); }
@keyframes app-enter {
  from { opacity: .65; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  main { animation: app-enter 150ms cubic-bezier(.22, 1, .36, 1) both; }
  .app-dock a { transition: background-color 140ms ease, transform 140ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  .app-dock a:active { transform: none; }
}
