/* Personal Daily Feed — Void aesthetic
   Time-of-day temperature palette, mycelium dividers, breathing background,
   spore-glow on arrival. No counters, no badges, no notification dots. */

:root {
  --tone-warm:    #2c1f15;  /*  6 → 12  morning amber      */
  --tone-neutral: #1f1f24;  /* 12 → 18  daylight slate     */
  --tone-cool:    #1a2530;  /* 18 → 24  evening blue       */
  --tone-deep:    #0e0e10;  /*  0 → 6   deep night         */

  /* Live values, set by app.js based on local clock (smooth interpolation) */
  --bg:        var(--tone-deep);
  --fg:        rgba(255, 255, 255, 0.86);
  --fg-muted:  rgba(255, 255, 255, 0.55);
  --accent:    rgba(255, 255, 255, 0.18);

  --serif: ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", serif;
  --mono:  ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  transition: background 8s ease, color 8s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top, 1.5rem) 1.25rem env(safe-area-inset-bottom, 1.5rem);
  position: relative;
  overflow-x: hidden;
}

/* Subtle breathing field behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, var(--accent) 0%, transparent 70%);
  opacity: 0.18;
  animation: breathe 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes breathe {
  0%, 100% { opacity: 0.14; transform: scale(1.0); }
  50%      { opacity: 0.22; transform: scale(1.03); }
}

#feed {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 38rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 2rem;
}

#items {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  column-gap: 0.85rem;
  padding: 1.05rem 0.25rem;
  align-items: baseline;
  word-wrap: break-word;
}
.feed-item > * { min-width: 0; }

.feed-item .glyph {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  background: var(--accent);
}

.feed-item .title {
  color: var(--fg);
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1.4;
}

.feed-item .title:hover { color: var(--tone-warm); }

.feed-item .meta {
  grid-column: 2;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-family: var(--mono);
}

/* Article body — full_text rendered HTML from RSS / readability extraction */
.feed-item .body {
  grid-column: 2;
  margin-top: 0.65rem;
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.6;
  min-width: 0;        /* allow grid child to shrink below content width */
  overflow-wrap: break-word;
  word-break: break-word;
}
.feed-item .body * { max-width: 100%; }
.feed-item .body p { margin: 0 0 0.85em; }
.feed-item .body a {
  color: #d9b787;      /* warm amber accent — readable over all bg tones */
  text-decoration: none;
  border-bottom: 1px solid rgba(217,183,135,0.35);
  word-break: break-all;
}
.feed-item .body a:hover { border-bottom-color: #d9b787; }
.feed-item .body img,
.feed-item .body video,
.feed-item .body iframe {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0.25rem;
  margin: 0.5rem 0;
}
.feed-item .body table { display: block; max-width: 100%; overflow-x: auto; }
.feed-item .body blockquote {
  margin: 0.5rem 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent);
  color: var(--fg-muted);
  font-style: italic;
}
.feed-item .body h1,
.feed-item .body h2,
.feed-item .body h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.4rem; }
.feed-item .body figure { margin: 0.5rem 0; }
.feed-item .body figcaption { font-size: 0.75rem; color: var(--fg-muted); font-family: var(--mono); margin-top: 0.25rem; }
.feed-item .body pre,
.feed-item .body code { font-family: var(--mono); font-size: 0.85rem; }
.feed-item .body pre { background: var(--accent); padding: 0.5rem; border-radius: 0.25rem; overflow-x: auto; }

.mycelium-divider {
  list-style: none;
  width: 100%;
  height: 12px;
  color: var(--fg-muted);
  animation: breathe 15s ease-in-out infinite;
}

.mycelium-divider svg { width: 100%; height: 100%; display: block; }

/* Spore arrival — newly-surfaced items glow for 5s on render */
.spore-arrival {
  animation: spore 5s ease-out;
}
@keyframes spore {
  0%   { background: rgba(255, 255, 255, 0.0); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  10%  { background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 24px 2px rgba(255,255,255,0.18); }
  100% { background: rgba(255, 255, 255, 0.0); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

#empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  position: relative;
  z-index: 1;
}
#empty-state .absence-text {
  font-size: 1.1rem;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  font-style: italic;
  text-align: center;
}

#sources-link {
  display: block;
  margin: 3rem auto 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  opacity: 0.5;
}
#sources-link:hover { opacity: 1; color: var(--tone-warm); }

/* Slight bias toward narrower lines on wider screens */
@media (min-width: 720px) {
  body { padding: 2.5rem 2rem; }
  html, body { font-size: 18px; }
}
