/* alu.hashjoin.com: same palette and IBM Plex type as hashjoin.com */
:root {
  --bg: #121417;
  --bg-raised: #1a1d22;
  --bg-sunk: #0d0f11;
  --line: #2a2f37;
  --line-strong: #3a414c;
  --text: #ebe6dc;
  --text-dim: #a7a196;
  --text-faint: #7b766d;
  --amber: #e9a640;
  --sage: #9db58a;
  --rose: #d98c7a;
  --phosphor: #8fd18b;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--amber); color: #121417; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage); margin: 0 0 10px; }
code { font-family: var(--font-mono); font-size: 0.92em; }

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; background: var(--bg); }
.bar { display: flex; align-items: center; gap: 12px 24px; padding: 10px 20px; flex-wrap: wrap; }
.brand { font-family: var(--font-mono); font-weight: 700; color: var(--text); letter-spacing: 0.04em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--amber); }
.brand i { font-style: normal; font-weight: 400; color: var(--text-faint); margin-left: 6px; font-size: 13px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: block; color: var(--text-dim); font-size: 14.5px; padding: 6px 12px; border-radius: 6px; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--amber); border-radius: 0; }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-dim); }
.me img { border-radius: 50%; background: var(--bg-raised); }
.me .signout { color: var(--text-faint); font-size: 13px; }

/* ---------- three columns ---------- */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; min-height: calc(100vh - 53px); }
.tree { border-right: 1px solid var(--line); padding: 20px 14px 40px 18px; font-size: 13.5px; position: sticky; top: 53px; max-height: calc(100vh - 53px); overflow: auto; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 12px; }
.tree > ul { padding-left: 0; }
.tree li { margin: 2px 0; }
.tree a { color: var(--text-dim); }
.tree a[aria-current="page"] { color: var(--amber); font-weight: 600; }
.tree summary { cursor: pointer; color: var(--text-faint); }
.tree summary::marker { color: var(--text-faint); }
main { padding: 28px 36px 60px; min-width: 0; }
main h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
main h2 { font-size: 19px; margin: 36px 0 12px; }
main p { max-width: 68ch; }
.sig { font-family: var(--font-mono); color: var(--text-dim); }
.crumbs { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); margin: 0 0 12px; }
.crumbs a { color: var(--text-dim); }
.meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); margin: 0 0 18px; }
.children { padding-left: 18px; }
.children li { margin: 3px 0; }
pre.log {
  background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.5;
  color: #d9d4c9; tab-size: 8; white-space: pre; max-width: 100%;
}
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 14px; }
.pager .next { margin-left: auto; text-align: right; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.tbl th { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 500; }
.timeline td:first-child { font-family: var(--font-mono); color: var(--amber); width: 9.5em; }

/* ---------- guestbook ---------- */
.guestbook { border-left: 1px solid var(--line); padding: 20px 18px 40px; position: sticky; top: 53px; max-height: calc(100vh - 53px); overflow: auto; }
.guestbook textarea, .field input {
  width: 100%; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14.5px; resize: vertical;
}
.guestbook textarea:focus, .field input:focus { outline: none; border-color: var(--amber); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; background: var(--amber); color: #15120c;
  font-weight: 600; font-size: 14.5px; padding: 9px 16px; border-radius: 8px; border: 0; cursor: pointer;
  font-family: inherit; margin-top: 8px; min-height: 40px;
}
.btn:hover { filter: brightness(1.07); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.gb-status { font-size: 13px; color: var(--text-dim); margin: 6px 0 0; min-height: 1.2em; }
.notify { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin: 6px 0 16px; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.entry img { border-radius: 50%; background: var(--bg-raised); }
.entry .who { font-weight: 600; font-size: 14px; }
.entry .when { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.entry .msg { font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.entry .del { background: none; border: 0; color: var(--text-faint); font-size: 12px; cursor: pointer; padding: 0; margin-top: 4px; }

/* ---------- narrow screens ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .tree { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .guestbook { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  main { padding: 22px 18px 40px; }
  .me span { display: none; }
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px;
  background: radial-gradient(ellipse at 50% 20%, #1b1f25 0%, var(--bg) 60%); }
.login .card { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.login .art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 40px rgba(0,0,0,0.5)); }
.login h1 { font-size: 26px; margin: 0 0 6px; }
.login .lede { color: var(--text-dim); margin: 0 0 22px; font-size: 15px; }
.field { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 12px; margin: 0 0 12px; }
.field label { font-family: var(--font-mono); font-size: 13.5px; color: var(--text-dim); text-align: right; }
.hint { font-size: 13.5px; color: var(--text-faint); margin: 4px 0 16px calc(7.5em + 12px); }
.login .btn { margin-left: calc(7.5em + 12px); }
.login .out { margin: 16px 0 0 calc(7.5em + 12px); font-size: 14.5px; min-height: 1.4em; }
.login .out.ok { color: var(--sage); }
.login .out.err { color: var(--rose); }
@media (max-width: 820px) {
  .login .card { grid-template-columns: 1fr; gap: 26px; }
  .field { grid-template-columns: 1fr; gap: 4px; }
  .field label { text-align: left; }
  .hint, .login .btn, .login .out { margin-left: 0; }
}

/* ---------- gallery ---------- */
.year { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.08em; color: var(--sage); margin: 30px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-raised); display: block; }
.tile:hover img, .tile:focus-visible img { border-color: var(--amber); }
.tile .badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); color: #fff; font-family: var(--font-mono); font-size: 11.5px; padding: 2px 7px; border-radius: 5px; }
.tcap { display: flex; flex-direction: column; gap: 2px; }
.tdate { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.ttext { font-size: 13.5px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
details.upload { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 18px 0 6px; background: var(--bg-raised); max-width: 640px; }
details.upload summary { cursor: pointer; font-weight: 600; }
#up-form { display: grid; gap: 8px; margin-top: 12px; }
#up-form label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
#up-form input[type=number], #up-form textarea { background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14.5px; }
#up-form input[type=number] { max-width: 8em; }
#up-form .btn { justify-self: start; }
.linkbtn { background: none; border: 0; color: var(--amber); cursor: pointer; font: inherit; font-size: 13.5px; padding: 4px 0; margin-right: 12px; }
.btn.sm { font-size: 13.5px; padding: 6px 12px; min-height: 34px; margin-right: 12px; }
body.noscroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(8,9,11,0.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox[hidden] { display: none; }
.lb-box { width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 8px; }
.lb-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 13px; }
.lb-x { background: none; border: 0; color: var(--text); font-size: 30px; line-height: 1; cursor: pointer; padding: 0 4px; }
.lb-stage { display: flex; align-items: center; gap: 8px; min-height: 0; }
#lb-media { flex: 1; display: flex; justify-content: center; min-width: 0; }
#lb-media img, #lb-media video { max-width: 100%; max-height: 72vh; border-radius: 6px; background: #000; }
.lb-nav { background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--text); font-size: 28px; width: 44px; height: 64px; border-radius: 8px; cursor: pointer; flex: none; }
.lb-nav:hover { border-color: var(--amber); }
.lb-meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); margin: 4px 0 0; max-width: none; }
.lb-caption { max-width: 760px; }
.lb-caption .cap { margin: 2px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lb-caption textarea { width: 100%; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14.5px; margin-bottom: 6px; }
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .lb-nav { width: 34px; height: 48px; font-size: 22px; }
}
