/* seancxk.com's look: warm paper, one ink, one grey, hairlines, Inter.
   Everything diet draws stays in that palette. A newsletter or a web page is
   the only colour on screen, because it's the thing being read. */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --edge: 1.25rem;
}
/* Themes, chosen in settings. Each is one ink on one paper with a grey and a
   hairline between them, like seancxk.com; only the paper changes mood. */
:root, [data-theme="paper"] {
  --paper: #f7f4ee; --ink: #1a1a1a; --faint: #8a857b; --line: #e5dfd4; --raised: #fdfbf7; --red: #c4432f;
}
[data-theme="linen"] {
  --paper: #ede4d3; --ink: #2b241c; --faint: #857a69; --line: #d9cdb8; --raised: #f5eee2; --red: #b5412b;
}
[data-theme="dusk"] {
  --paper: #2b2723; --ink: #e9e2d6; --faint: #9b9285; --line: #3d3730; --raised: #36312c; --red: #e07a5f;
  color-scheme: dark;
}
[data-theme="night"] {
  --paper: #141312; --ink: #d8d3cb; --faint: #7f796f; --line: #2a2724; --raised: #1f1d1b; --red: #d9705a;
  color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Screens stack; the one on top slides in from the right. */
.screen {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: var(--paper);
  padding-top: env(safe-area-inset-top);
  transition: transform .5s var(--ease-out);
}
.screen.off { transform: translateX(100%); }
.screen.under { transform: translateX(-22%); }
/* On a laptop the column is the site's width, centred. */
.screen > * { max-width: 42rem; margin-left: auto; margin-right: auto; }

/* ── the list ── */
.top { display: flex; justify-content: space-between; align-items: baseline; padding: 1.4rem var(--edge) 0; }
.name { font-size: 0.95rem; font-weight: 500; }
.link { color: var(--faint); font-size: 0.95rem; transition: color .2s ease; }
.link:hover { color: var(--ink); }
.filter { display: flex; gap: 1.1rem; padding: 2.2rem var(--edge) 0.4rem; }
.filter button { color: var(--faint); font-size: 0.95rem; transition: color .2s ease; }
.filter button.on { color: var(--ink); font-weight: 500; }
.group { color: var(--faint); font-size: 0.8rem; margin: 2rem var(--edge) 0; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.item { position: relative; overflow: hidden; transition: height .35s var(--ease-out), opacity .35s ease; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.item::after { content: attr(data-swipe); position: absolute; right: var(--edge); top: 50%; transform: translateY(-50%); color: var(--red); font-size: 0.85rem; z-index: 0; }
.inner { position: relative; z-index: 1; background: var(--paper); padding: 0.9rem var(--edge); cursor: pointer; transition: transform .35s var(--ease-out); }
/* Dividers belong to the row, not to what slides, so they stay put in a swipe. */
.item + .item::before, .sources .item::before { content: ""; position: absolute; top: 0; left: var(--edge); right: var(--edge); border-top: 1px solid var(--line); z-index: 2; }
a.inner { display: block; color: inherit; text-decoration: none; -webkit-user-drag: none; }
.item.drag .inner { transition: none; }
.title { font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; text-wrap: pretty; transition: color .3s ease; }
.meta { color: var(--faint); font-size: 0.85rem; margin-top: 0.15rem; }
.item.read .title { color: var(--faint); font-weight: 500; }
.empty { color: var(--faint); padding: 4rem var(--edge); }
.tail { height: 4rem; }

/* ── the thin bar over a newsletter ── */
.bar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 3rem 1fr 3rem; align-items: center; height: 3rem; background: var(--paper); border-bottom: 1px solid var(--line); }
/* Screens with a bar let the bar cover the status bar area too, so nothing
   scrolls up behind the clock and battery. */
#reader, #sources { padding-top: 0; }
#reader .bar, #sources .bar { top: 0; height: calc(3rem + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
.bar .src { text-align: center; color: var(--faint); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar button { height: 3rem; font-size: 1.05rem; color: var(--faint); transition: color .2s ease; }
.bar button:hover { color: var(--ink); }
#reader { overflow-y: auto; }
#reader iframe { display: block; width: 100%; height: 100vh; border: 0; background: #fff; }
/* Newsletters keep their own colours; on a dark theme they're dimmed a little. */
[data-theme="dusk"] #reader iframe, [data-theme="night"] #reader iframe { filter: brightness(0.82); }

/* ── themes ── */
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; padding-bottom: 0.4rem; }
.theme { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--faint); }
.theme .tile { width: 100%; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; box-shadow: inset 0 0 0 1px rgba(128,120,110,.25); transition: box-shadow .2s ease; }
.theme.on { color: var(--ink); font-weight: 500; }
.theme.on .tile { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }

/* ── sources ── */
.sources { padding: 0 var(--edge); }
.sources h3 { color: var(--faint); font-size: 0.8rem; font-weight: 400; padding: 2rem 0 0.6rem; }
.addr { display: flex; justify-content: space-between; align-items: baseline; width: 100%; text-align: left; padding: 0.2rem 0 0.6rem; }
.addr b { font-weight: 600; }
.addr span { color: var(--faint); font-size: 0.85rem; }
.hint { color: var(--faint); font-size: 0.85rem; text-wrap: pretty; margin-bottom: 0.8rem; }
.sources .item { margin: 0 calc(-1 * var(--edge)); }
.sources .inner { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.7rem var(--edge); cursor: default; }
.sources .inner p { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sources .inner span { color: var(--faint); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.sources .inner span.err { color: var(--red); }
.none { color: var(--faint); font-size: 0.85rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.add { display: flex; gap: 0.8rem; margin-top: 0.8rem; border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
.add input { flex: 1; min-width: 0; font: inherit; font-size: 0.95rem; border: 0; background: none; outline: none; color: var(--ink); }
.add input::placeholder { color: var(--faint); }
.add button { color: var(--faint); font-size: 0.95rem; }
.add.busy button { opacity: .5; pointer-events: none; }

/* ── the pill that answers an action ── */
.toast { position: fixed; left: 50%; bottom: calc(2rem + env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 1.2rem; align-items: center; max-width: calc(100vw - 2rem); padding: 0.7rem 1.2rem; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.2); font-size: 0.85rem; color: var(--faint); transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; transition: transform .4s var(--ease-out), opacity .25s ease; }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { color: var(--ink); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .screen, .inner, .item, .toast { transition: none; }
}
