/* honeypot: a sticky, hand-made honey theme.
   Swap the font: replace the files in /fonts/ and the --font-* tokens below.
   Swap a stage icon: replace the file in /doodles/ under the same name. */

@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Light: black ink on white paper, one honey yellow.
   The backlinks box is inverted (white on black). */
:root {
  color-scheme: light dark;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #ffffff;
  --text: #000000;
  --muted: #000000;
  --link: #000000;
  --wilting-text: #3d3d3d;
  --dried-text: #5c5c5c;

  --inv-bg: #000000;
  --inv-text: #ffffff;
  --inv-wilting-text: #c2c2c2;
  --inv-dried-text: #a3a3a3;

  --surface: #ffe734;
  --on-surface: #000000;
  --hover-bg: #ffe734;
  --hover-text: #000000;
  --accent: #ffe734;
  --line: #ffe734;
  --radius: 0.9rem;
}

/* Dark: everything flipped; the yellow stays yellow. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #ffffff;
    --muted: #ffffff;
    --link: #ffffff;
    --wilting-text: #c2c2c2;
    --dried-text: #a3a3a3;

    --inv-bg: #ffffff;
    --inv-text: #000000;
    --inv-wilting-text: #3d3d3d;
    --inv-dried-text: #5c5c5c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1rem 1rem 4rem;
  font: 0.9375rem/1.6 var(--font-body);
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
h1 { font-size: 1.6rem; margin: 0.5rem 0 0.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }

a {
  color: var(--link);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.25em;
  text-underline-offset: 0.12em;
  text-decoration-skip-ink: none;
}
a:hover { color: var(--hover-text); background: var(--hover-bg); text-decoration-color: var(--hover-bg); }
a:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 0.2rem; }

img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 2px dashed var(--line); margin: 2rem 0; }
blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--on-surface);
}
blockquote a { color: var(--on-surface); text-decoration-color: currentColor; text-decoration-thickness: 0.08em; }
pre {
  overflow-x: auto;
  padding: 0.85rem 1rem;
  background: var(--surface);
  color: var(--on-surface);
  border-radius: var(--radius);
}
code { font-family: var(--font-code); font-size: 0.9em; }
:not(pre) > code { padding: 0.05em 0.3em; background: var(--surface); color: var(--on-surface); border-radius: 0.3em; }

/* Header spans the full width: name in the top-left corner, nav on the right */
main { max-width: 42rem; margin: 0 auto; }
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 2.5rem;
}
.site-name {
  display: inline-flex;
  align-items: baseline; /* the logo's bottom (the bowl) sits on the text baseline */
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
/* The logo (public/logo.svg) in the text colour, so it follows light/dark */
.site-name::before {
  content: "";
  width: 1.05rem;
  height: 1.7rem;
  background: currentColor;
  -webkit-mask: url("/logo.svg") center bottom / contain no-repeat;
  mask: url("/logo.svg") center bottom / contain no-repeat;
}
.site-header nav a { margin-left: 0.9rem; font-weight: 600; }

.meta, .muted { color: var(--muted); font-size: 0.85rem; }

/* Home page: notes grouped by month of last tended date */
.month { margin-top: 2.25rem; }
.month h2 { margin: 0 0 0.25rem; }

/* Note lists */
.note-list { list-style: none; padding: 0; }
.note-list li {
  position: relative;
  isolation: isolate;
  margin: 0.3rem -0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
}
.note-list li:hover { background: var(--hover-bg); }
.note-list li:hover,
.note-list li:hover a,
.note-list li:hover time { color: var(--hover-text); }
.note-list li:hover a { background: none; }
.note-list time {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* Tags overview: only the tag itself highlights on hover, not the whole row */
.tag-list { list-style: none; padding: 0; }
.tag-list li { margin: 0.3rem 0; }

.tags a {
  display: inline-block;
  margin-right: 0.3rem;
  padding: 0 0.45em;
  background: var(--surface);
  border-radius: 0.6em;
  color: var(--on-surface);
  text-decoration: none;
  font-size: 0.85rem;
}
.tags a:hover { background: var(--inv-bg); color: var(--inv-text); }

.unplanted { color: var(--muted); border-bottom: 1px dashed currentColor; cursor: help; }

/* Stage labels: icon (a replaceable doodle) + word */
.stage {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0 0.5em 0 0.35em;
  border: 1.5px solid var(--line);
  border-radius: 1em 0.8em 1em 0.7em;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg);
  cursor: help;
  white-space: nowrap;
}
.stage::before {
  content: "";
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: var(--stage-icon) center / contain no-repeat;
  mask: var(--stage-icon) center / contain no-repeat;
}
.stage[data-stage="seed"] { --stage-icon: url("/doodles/seed.svg"); }
.stage[data-stage="sprout"] { --stage-icon: url("/doodles/sprout.svg"); }
.stage[data-stage="evergreen"] { --stage-icon: url("/doodles/evergreen.svg"); }
.stage[data-stage="fruit"] { --stage-icon: url("/doodles/fruit.svg"); }
.note-list .stage { margin-left: 0.3rem; vertical-align: 0.1em; }

/* Vitality: untended notes fade */
.note[data-vitality="wilting"],
.note-list li[data-vitality="wilting"],
.note-list li[data-vitality="wilting"] a { color: var(--wilting-text); }
.note[data-vitality="dried"],
.note-list li[data-vitality="dried"],
.note-list li[data-vitality="dried"] a { color: var(--dried-text); }
.note-list li[data-vitality="dried"] a { text-decoration-style: dotted; }
[data-vitality="dried"] .stage { filter: saturate(0.3); }

/* Floating back button (bottom left), inverted colours, yellow on hover */
.back-button {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--inv-bg);
  color: var(--inv-text);
  text-decoration: none;
  box-shadow: 0 0.15rem 0.6rem rgb(0 0 0 / 0.25);
}
.back-button:hover,
.back-button:focus-visible { background: var(--hover-bg); color: var(--hover-text); }
.back-button svg { width: 1.3rem; height: 1.3rem; }
@media print { .back-button { display: none; } }

/* Backlinks: an inverted box (white on black in light mode, black on white in dark) */
.backlinks {
  --bg: var(--inv-bg);
  --text: var(--inv-text);
  --muted: var(--inv-text);
  --link: var(--inv-text);
  --wilting-text: var(--inv-wilting-text);
  --dried-text: var(--inv-dried-text);
  margin-top: 3rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius) 1.4rem var(--radius) 1.1rem;
}
.backlinks h2 { font-size: 1rem; margin: 0 0 0.5rem; }
