/* birdy gallery. Photos lead; everything else is quiet type on a warm page.
   One palette, one font, three text sizes, no boxes inside boxes. */
:root {
  color-scheme: light dark;
  --bg: #f7f6f2;
  --fg: #1d1c1a;
  --fg-2: #6b6862;      /* secondary text, warm grey, 5.1:1 on --bg */
  --rule: #e4e1da;
  --accent: #2f8a5a;    /* one green, used for focus, selection and bars */
  --bar: #6fb38e;
  --img: #e9e6df;       /* image placeholder while a thumb loads */
  --sel: #d8ecdf;
  --err: #b5473c;       /* 5.0:1 on --bg */
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141412; --fg: #ebe8e1; --fg-2: #9a968d; --rule: #2a2925; --accent: #5fbf87; --bar: #3f8f63; --img: #222120; --sel: #244a35; --err: #e0796d; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 20px clamp(16px, 4vw, 48px) 64px;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--fg);
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--sel); color: var(--fg); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main { max-width: 1320px; margin: 0 auto; }
/* Text links stay on their line but get a 44px-tall hit area (padding cancelled by the margin). */
.hit { display: inline-block; padding: 12px 0; margin: -12px 0; }
/* Off-screen text for assistive tech (chart data tables). */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* header: a wordmark and one line of context */
header { max-width: 1320px; margin: 0 auto 28px; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
header nav, header .tagline { margin: 0; color: var(--fg-2); font-size: 15px; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 40px 0 14px; line-height: 1.2; text-wrap: balance; }
h2.first { margin-top: 0; }
h2 .sub { color: var(--fg-2); font-weight: 400; font-size: 16px; letter-spacing: 0; margin-left: 8px; white-space: nowrap; }
.muted { color: var(--fg-2); }
.err { color: var(--err); }
.err + p { margin-top: 4px; }

/* home: one column per feeder, photos inside as a grid */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 40px 48px; align-items: start; }
.col h2 { margin: 0; font-size: 22px; }
.col .place { margin: 2px 0 14px; color: var(--fg-2); font-size: 15px; }
.col .place a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.col .place a:hover { text-decoration-color: currentColor; }
.col .empty { color: var(--fg-2); margin: 0 0 14px; }
/* A past day's photos are dimmed; their captions stay fully readable. */
.col .past img { opacity: .6; }
.col .past .card:hover img { opacity: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 14px; }
.card { min-width: 0; }

/* a photo and its caption, no frame */
.card { display: block; }
.card img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  background: var(--img); border-radius: 6px;
  transition: transform .35s var(--ease), filter .35s var(--ease), opacity .35s var(--ease);
}
.card:hover img { transform: translateY(-2px); filter: brightness(1.04); }
.card:hover { text-decoration: none; }
.card .cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 7px 2px 0; font-size: 14px; line-height: 1.35; min-width: 0; }
.card .cap b { font-weight: 600; }
.card .cap span { color: var(--fg-2); white-space: nowrap; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 14px; }

/* dashboard: one row of figures, no boxes */
.stats { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 6px 0 0; padding: 0; list-style: none; }
.stats li { display: flex; align-items: baseline; gap: 8px; }
.stats b { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.stats span { color: var(--fg-2); font-size: 15px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px 48px; margin-top: 32px; }
.chart { position: relative; }
.chart .title { color: var(--fg-2); font-size: 14px; margin: 0 0 6px; }
.chart svg { width: 100%; height: 120px; display: block; overflow: visible; }
.chart rect { fill: var(--bar); }
.chart line { stroke: var(--rule); stroke-width: 1; }
.chart text { fill: var(--fg-2); font-size: 11px; }

/* tables: rules only, no fills; the name cell is one tall link so it is easy to tap */
table { border-collapse: collapse; width: 100%; max-width: 760px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; vertical-align: middle; }
th { color: var(--fg-2); font-weight: 500; font-size: 13px; letter-spacing: .01em; }
td.n, th.n { text-align: right; padding-right: 20px; white-space: nowrap; }
td.d, th.d { white-space: nowrap; }
td a { display: block; padding: 11px 0; margin: -9px 0; }
tbody tr:last-child td { border-bottom: 0; }

.filter { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--fg-2); font-size: 15px; }
select { min-height: 44px; padding: 5px 8px; font: inherit; font-size: 16px; background: transparent; color: var(--fg); border: 1px solid var(--rule); border-radius: 6px; }

/* lightbox: the thumbnail shows at full size at once, the full photo fades in over it */
dialog { position: relative; border: 0; padding: 0; background: #0b0b0a; border-radius: 8px; max-width: 96vw; max-height: 96vh; box-shadow: 0 24px 80px rgba(0,0,0,.5); color: #c9c6bf; }
dialog .close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; line-height: 44px; text-align: center; cursor: pointer; }
dialog .close:focus-visible { outline: 2px solid #fff; }
dialog::backdrop { background: rgba(12,12,10,.86); }
dialog img { display: block; width: min(96vw, 117vh); aspect-ratio: 4 / 3; object-fit: contain; background: #0b0b0a; transition: filter .3s var(--ease); }
dialog[aria-busy="true"] img { filter: blur(4px); }
dialog p { margin: 0; padding: 10px 14px; font-size: 14px; }

@media (max-width: 700px) {
  body { padding: 16px 16px 48px; }
  header { margin-bottom: 20px; }
  h2 { font-size: 20px; margin-top: 32px; }
  h2 .sub { display: block; margin: 2px 0 0; white-space: normal; }
  .columns { gap: 32px; }
  .cards, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .stats { gap: 6px 24px; }
  .stats b { font-size: 26px; }
  th, td { padding: 8px 10px 8px 0; font-size: 14px; }
  td a { padding: 12px 0; margin: -8px 0; }
}
@media (prefers-reduced-motion: reduce) { .card img, dialog img { transition: none; } .card:hover img { transform: none; } }
