/* ===== THEME: single dark palette modelled on blog.faav.net. Edit here to restyle. ===== */
:root {
  --theme: #0a0a0a;    /* page background */
  --accent: #101010;   /* cards, form fields, photo tiles */
  --ink: #d4d4d4;      /* main text */
  --muted: #666666;    /* summaries, nav links */
  --faint: #4a4a4a;    /* dates */
  --line: rgba(255,255,255,.07);
  --hl: #cbc2d8;       /* highlight colour: brand, top line, hover date, ">" markers, links. faav's is red: #ff1a1a */
  --gate-text: #fefefe;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--theme); color: var(--ink); font: 16px/1.7 'Inconsolata', ui-monospace, Menlo, Consolas, monospace; }
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; background: linear-gradient(90deg, var(--hl) 0%, color-mix(in srgb, var(--hl) 55%, #000) 40%, transparent 100%); }
a { color: inherit; }
h1, h2 { line-height: 1.2; margin: 0; }
::selection { background: color-mix(in srgb, var(--hl) 28%, transparent); color: #fff; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: #444; }

/* Top bar */
.bar { position: sticky; top: 2px; z-index: 100; background: rgba(10,10,10,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255,255,255,.04); }
.wrap { max-width: 800px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--hl); transition: opacity .15s; }
.avatar { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid color-mix(in srgb, var(--hl) 30%, transparent); }
.brand:hover { opacity: .8; }
.bar nav { display: flex; gap: 24px; }
.bar nav a { text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 500; letter-spacing: .04em; transition: color .2s; }
.bar nav a:hover { color: #e0e0e0; }

main { max-width: 800px; margin: 0 auto; padding: 24px 24px 4rem; }

/* Entry list: flat rows like faav's */
.entry { display: block; padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,.04); text-decoration: none; color: inherit; }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }
.entry time { display: block; color: var(--faint); font-size: .82rem; font-weight: 500; letter-spacing: .04em; transition: color .2s; }
.entry h2 { display: block; margin: 6px 0 0; font-size: 1.2rem; font-weight: 700; line-height: 1.4; color: var(--ink); transition: color .2s; }
.entry h2::before { content: '>'; color: var(--hl); font-weight: 400; opacity: 0; width: 0; margin-right: 0; display: inline-block; transition: opacity .2s, width .2s, margin .2s; }
.entry p { margin: 8px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.6; transition: color .2s; }
.entry:hover h2 { color: #fff; }
.entry:hover h2::before { width: auto; margin-right: 8px; opacity: .7; }
.entry:hover time { color: var(--hl); }
.entry:hover p { color: #888; }
.lock { vertical-align: -2px; margin-left: .4rem; color: var(--muted); }
.tag { font-size: .72rem; margin-left: .5rem; padding: .05rem .5rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); }

/* Post page - same structure as faav's posts */
article > h1 { font-size: 2rem; color: #fff; margin-bottom: 8px; }
article > h1::after { content: ''; display: block; width: 48px; height: 2px; background: var(--hl); margin-top: 14px; border-radius: 1px; }
article > time { display: block; color: var(--faint); font-size: .85rem; font-weight: 500; letter-spacing: .04em; margin: 0 0 24px; }
article h2, article h3 { color: #e8e8e8; font-weight: 700; margin: 28px 0 16px; }
article h2 { font-size: 1.65rem; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
article h3 { font-size: 1.45rem; }
article h2::before, article h3::before { content: '> '; color: var(--hl); font-weight: 400; opacity: .6; }
article p, article ul, article ol, article blockquote { font-size: 1.05rem; line-height: 1.75; margin: 0 0 18px; }
article a { color: var(--hl); } article a:hover { color: color-mix(in srgb, var(--hl) 70%, #fff); }
article strong { color: #fff; }
article ul { list-style: none; padding: 0; }
article ul > li::before { content: '> '; color: var(--hl); opacity: .6; }
article li a { color: #bbb; } article li a:hover { color: var(--hl); }
article blockquote { padding-left: 20px; border-left: 2px solid color-mix(in srgb, var(--hl) 40%, transparent); color: #888; font-style: italic; }
article code { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 4px; padding: .2em .5em; font-size: 85%; }
article pre { background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06); border-radius: 8px; padding: 20px 24px; overflow: auto; font-size: 90%; line-height: 1.6; margin: 0 0 16px; }
article pre code { background: none; border: 0; padding: 0; font-size: inherit; }
article p img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid rgba(255,255,255,.06); }
article p:has(> img) { margin: 0 0 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-top: 2rem; }
.grid figure { margin: 0; background: var(--accent); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.grid img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: zoom-in; }
.dl { display: block; padding: .4rem .75rem; font-size: .85rem; color: var(--muted); text-decoration: none; }
#dlall { margin-top: 1rem; }
#lb { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.88); cursor: zoom-out; }
#lb[hidden] { display: none; }
#lb img { max-width: 95vw; max-height: 95vh; }

/* Cards, forms, admin */
.card { background: var(--accent); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; margin-top: 1.5rem; }
form.stack { display: flex; flex-direction: column; gap: .75rem; }
input, select, textarea, button { font: inherit; padding: .55rem .75rem; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: var(--theme); color: var(--ink); color-scheme: dark; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--hl); border-color: var(--hl); }
input::placeholder, textarea::placeholder { color: #777; }
textarea { min-height: 14rem; font-size: .95rem; }
button { background: var(--ink); color: var(--theme); border: 0; cursor: pointer; font-weight: 700; }
button:hover { background: #fff; }
button.ghost, a.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); text-decoration: none; display: inline-block; }
.err { color: #ff8a8a; }
.row { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.thumbs form { position: relative; width: 90px; }
.thumbs button.copy { position: static; display: block; width: 100%; margin-top: 4px; padding: .1rem; font-size: .75rem; background: transparent; color: var(--muted); border: 1px solid var(--line); }
.thumbs img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; display: block; }
.thumbs button { position: absolute; top: 3px; right: 3px; padding: 0 .4rem; border-radius: 6px; }

/* Login form note, read-only admin form, login log, name in the top bar */
.note { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .75rem; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; cursor: not-allowed; }
table.log { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.log th, table.log td { text-align: left; padding: .45rem .75rem .45rem 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.log th { color: var(--faint); font-weight: 500; }

.page-title { font-size: 2rem; color: #fff; margin-bottom: 24px; }
.page-title::after { content: ''; display: block; width: 48px; height: 2px; background: var(--hl); margin-top: 14px; border-radius: 1px; }
.sec { margin-top: 2rem; font-size: 1.15rem; color: #e8e8e8; }

/* Entry screen (homepage only). Drop a photo at public/bg.jpg to use it as the background. */
#gate { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--gate-text); background: var(--theme) url(/bg.jpg) center/cover; transition: opacity .6s; text-shadow: 0 1px 12px rgba(0,0,0,.45); }
#gate::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); }
#gate > div { position: relative; }
#gate h1 { font-size: clamp(2.2rem, 8vw, 4rem); }
#gate span { display: block; margin-top: 2rem; opacity: .85; animation: pulse 2s ease-in-out infinite; }
#gate.out { opacity: 0; pointer-events: none; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { #gate span { animation: none; } }
@media (max-width: 600px) {
  .wrap, main { padding-left: 16px; padding-right: 16px; }
  .bar nav { gap: 10px; } .bar nav a { font-size: .78rem; } .brand { font-size: .9rem; }
  article > h1, .page-title { font-size: 1.5rem; }
}

/* Top bar v2: name on the left next to the title, current tab highlighted; entry-password field in the editor */
.left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.left .brand { align-self: center; }
.left .who { color: var(--faint); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.bar nav a.on { color: var(--hl); }
.pwrow { display: flex; gap: .5rem; } .pwrow input { flex: 1; min-width: 0; }
label.chk { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; }
label.chk input { padding: 0; width: auto; }
@media (max-width: 600px) {
  .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 6px; }
  .left { width: 100%; }
  .bar nav { width: 100%; gap: 18px; }
  .left .who { max-width: 45vw; }
}

/* Sealed (private) entries: date + scrambled title, not clickable */
.entry.sealed { cursor: default; }
.entry.sealed h2 { color: var(--muted); font-weight: 400; letter-spacing: .02em; }
.entry.sealed:hover h2 { color: var(--muted); } .entry.sealed:hover h2::before { opacity: 0; width: 0; margin: 0; } .entry.sealed:hover time { color: var(--faint); }
.obf { font-variant-ligatures: none; }

/* Filter bar above the entry lists */
.filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.filter button { padding: .2rem .7rem; font-size: .78rem; font-weight: 500; letter-spacing: .04em; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; }
.filter button:hover { color: #e0e0e0; background: transparent; }
.filter button.on { color: var(--hl); border-color: color-mix(in srgb, var(--hl) 45%, transparent); }
.list > [hidden] { display: none; }
