/* Zeitgeist — a reading screen before it is anything else.

   The colours are Nabble's, because this is read next to it and a second
   palette to maintain is a second palette to get wrong. Everything is a token
   so the whole thing can be re-skinned from six lines. */

:root {
  --navy: #0C1D36;
  --cream: #F4E9D8;
  --card: #FAF5F3;
  --line: #CFC3AE;
  --green: #2FBF71;
  --orange: #FF8A3D;
  --muted: rgba(12, 29, 54, .65);

  --gutter: 15px;
  --radius: 14px;

  /* The tab bar, as Nabble draws its own. */
  --tabs-height: 64px;
  --highlight: #FDD55A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* The last card has to scroll clear of the tab bar, not end under it. */
  padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + 24px);
}

/* ── the bar ─────────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px var(--gutter);
  background: var(--navy);
  color: #fff;
  padding-top: max(10px, env(safe-area-inset-top));
}

.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.wordmark { color: #fff; font-weight: 800; letter-spacing: -.3px; text-decoration: none; }

.top-controls { display: flex; align-items: center; gap: 8px; }

.windows { display: flex; gap: 2px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 2px; }

.window {
  padding: 4px 9px;
  border-radius: 999px;
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.window.on { background: #fff; color: var(--navy); }

.go {
  border: none;
  border-radius: 999px;
  padding: 7px 13px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.go[disabled] { background: rgba(255,255,255,.2); cursor: default; }

.quiet-link { color: rgba(255,255,255,.7); font-size: 12px; text-decoration: none; }

/* ── the tabs ────────────────────────────────────────────────────────────── */

/* Nabble's bottom bar: frosted cream, equal columns, an icon over a word, and
   the one it is on filled yellow. Padded below by the gesture bar so the
   words are never under a thumb's swipe. */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  /* Solid, not frosted. A backdrop blur on a fixed bar is redrawn over every
     card that scrolls under it, and in the Android WebView that made each tap
     on the bar lag behind the thumb. */
  background: rgb(250, 242, 204);
  box-shadow: 0 -1px 0 rgba(44, 35, 30, .1), 0 -4px 20px rgba(44, 35, 30, .06);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms ease-out;
}

.tab:active { transform: scale(.94); transition-duration: 80ms; }

.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.on { background: var(--highlight); font-weight: 800; }
/* Tapped, and the next page is on its way: the bar says so at once. */
.tabs.going .tab:not(.on) { opacity: .45; }
.tab.on svg { stroke-width: 2.2; }

/* ── the page ────────────────────────────────────────────────────────────── */

main { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

/* The four platforms inside Socials: the window pills, turned out for cream.
   Scrolls sideways rather than wrapping, so a narrow phone keeps one row. */
.socials {
  display: flex;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin: 16px 0 0;
  padding: 2px;
  border-radius: 999px;
  background: rgba(12, 29, 54, .07);
  overflow-x: auto;
  scrollbar-width: none;
}

.social {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.social.on { background: var(--navy); color: #fff; }

.summary { margin: 16px 0 4px; font-size: 14px; }
.account { margin: 16px 0 0; font-size: 14px; }
.account a { color: var(--navy); font-weight: 700; }
main > .status { margin-top: 14px; }
.quiet { color: var(--muted); font-size: 13px; }
.not-searched { margin: 0 0 14px; line-height: 1.6; }

.status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--card);
  font-size: 13px;
}

.group { margin: 22px 0; }

.group h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── a card ──────────────────────────────────────────────────────────────── */

.card {
  margin: 0 0 10px;
  padding: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(12, 29, 54, .08);
  /* A feed is two hundred of these. Off screen, the browser skips laying
     them out and painting them until they scroll near; the size is a guess
     it replaces with the real one once it has drawn a card. */
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

.card.is-ignore { opacity: .45; }
.card.is-keep { box-shadow: inset 0 0 0 1.5px var(--green), 0 1px 3px rgba(12,29,54,.08); }
.card.is-answered { box-shadow: inset 0 0 0 1.5px var(--orange), 0 1px 3px rgba(12,29,54,.08); }

.strap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
}

.score {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(12, 29, 54, .07);
  font-variant-numeric: tabular-nums;
}

/* Where it came from, on lists that mix sources — a saved LinkedIn post should
   be recognisable as one before it is read. */
.source { padding: 1px 7px; border-radius: 999px; background: var(--navy); color: #fff; }

.saved { margin: 14px 0 22px; }

.mood.positive { color: var(--green); }
.mood.negative { color: var(--orange); }
.mood em { font-style: normal; opacity: .7; }

.card h3 { margin: 7px 0 4px; font-size: 16px; line-height: 1.35; }
.card h3 a { color: var(--navy); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }

.snippet { margin: 0; font-size: 14px; color: rgba(12, 29, 54, .8); }
.note { margin: 6px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }

.doings { display: flex; align-items: center; gap: 6px; margin-top: 10px; }

.doings button {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.doings button.on { border-color: var(--green); background: var(--green); color: #fff; }
.doings .state { margin-left: auto; font-size: 11px; text-transform: uppercase; color: var(--muted); }

/* ── the weak, folded ────────────────────────────────────────────────────── */

.weak summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.weak ul { margin: 8px 0 0; padding-left: 0; list-style: none; }
.weak li { margin: 0 0 6px; font-size: 13px; line-height: 1.4; }
.weak a { color: var(--navy); }

/* ── the digest ──────────────────────────────────────────────────────────── */

/* A document rather than cards, so it wraps anywhere: headlines and bare links
   are long, and a phone is narrow. */
.digest { margin: 16px 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.digest h1 { margin: 0 0 12px; font-size: 20px; line-height: 1.25; }
.digest h2 {
  margin: 26px 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}
.digest p { margin: 0 0 10px; padding: 12px 14px; background: var(--card); border-radius: var(--radius); }
.digest > ul:first-of-type { padding-left: 18px; }
.digest a { color: var(--navy); }
.digest p a { color: var(--muted); font-size: 12px; }
.digest .weak { margin: 0 0 14px; }
.digest em { color: var(--muted); }

/* ── by hand, and the gate ───────────────────────────────────────────────── */

.link-button {
  border: none;
  background: none;
  padding: 0;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.add { display: grid; gap: 8px; margin: 0 0 16px; }

/* `display: grid` beats `[hidden]`, so the form for LinkedIn and X was open on
   every page load until this line. The attribute has to be given back its
   meaning wherever a display is set. */
.add[hidden] { display: none; }

.add input, .add select, .gate input {
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.add button, .gate button {
  padding: 11px;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.gate { max-width: 340px; margin: 12vh auto; display: grid; gap: 12px; padding: 0 var(--gutter); }
.gate h1 { margin: 0; font-size: 26px; }
.warn { margin: 0; color: var(--orange); font-size: 13px; }
pre { background: var(--card); padding: 10px; border-radius: 12px; font-size: 12px; overflow-x: auto; }

/* Offered, never forced; clear of the phone's gesture bar, and of the tabs. */
.new-build {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 10;
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--cream);
  font: inherit;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(12, 29, 54, .3);
  cursor: pointer;
}

/* Where there are tabs, it floats just above them rather than over them. The
   script adds it after the tab bar, so the tab bar is its older sibling. */
.tabs ~ .new-build { bottom: calc(var(--tabs-height) + 12px + env(safe-area-inset-bottom)); }

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