/* JJ's desk: retro windows (Win98 bevels) in JJ's own colours, a night sky with pixel sakura behind them. */
:root {
  --night: #120f14;     /* hoodie black */
  --night2: #1d1722;
  --crimson: #d7263d;   /* hair */
  --crimson-d: #8f1426;
  --amber: #f2b630;     /* eyes */
  --sakura: #f4a7b9;    /* sleeves */
  --sakura-l: #fbe3ea;
  --paper: #fbf4ea;     /* window body */
  --paper-d: #e8dccd;
  --ink: #241a22;
  --muted: #7a6670;
  --bevel-l: #fffaf3;
  --bevel-d: #8a6f7a;
  --pix: "Pixelify Sans", "DotGothic16", monospace;
  --body: "DotGothic16", "Pixelify Sans", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh; background: var(--night); color: var(--ink); font-family: var(--body); font-size: 15px;
  line-height: 1.55; padding: 24px 16px 96px; display: flex; justify-content: center;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.wrapper { position: relative; z-index: 1; display: flex; gap: 22px; width: 100%; max-width: 1180px; align-items: flex-start; }
.sidebar { flex: 0 0 250px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.container { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- windows ---------- */
.win {
  background: var(--paper); border: 2px solid var(--bevel-d); border-top-color: var(--bevel-l); border-left-color: var(--bevel-l);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .55), inset -1px -1px 0 var(--paper-d);
}
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px 4px 10px;
  background: linear-gradient(90deg, var(--crimson-d), var(--crimson) 55%, #e8556a); color: #fff7f2;
  font-family: var(--pix); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}
.ctl { display: flex; gap: 3px; }
.ctl i {
  font-style: normal; width: 18px; height: 16px; display: grid; place-items: center; font-size: 11px; line-height: 1;
  background: var(--paper); color: var(--ink); border: 1px solid var(--bevel-d); border-top-color: var(--bevel-l); border-left-color: var(--bevel-l);
  text-shadow: none;
}
.body { padding: 14px 16px; }
.center { text-align: center; }
.right { text-align: right; }
.tiny { font-size: 12px; color: var(--muted); }
a { color: var(--crimson-d); }
a:hover { color: var(--crimson); }
:focus-visible { outline: 2px dashed var(--amber); outline-offset: 2px; }

/* ---------- sidebar ---------- */
.tag { font-family: var(--pix); color: var(--muted); font-size: 12px; margin-bottom: 10px; letter-spacing: .04em; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; text-decoration: none; color: var(--ink);
  font-family: var(--pix); font-size: 15px; border: 1px solid transparent;
}
nav a b { color: var(--crimson); width: 16px; text-align: center; font-weight: 400; }
nav a:hover { background: var(--sakura-l); border-color: var(--sakura); }
nav a.on { background: var(--night); color: var(--sakura-l); border-color: var(--night); }
nav a.on b { color: var(--amber); }

.player .track { display: flex; align-items: center; gap: 8px; font-family: var(--pix); font-size: 13px; }
.disc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--night); color: var(--amber); }
.disc.spin { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#viz { width: 100%; height: 34px; margin: 8px 0; background: var(--night); display: block; image-rendering: pixelated; }
.controls { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.controls input { flex: 1; min-width: 0; accent-color: var(--crimson); }
.btn {
  font-family: var(--pix); font-size: 13px; padding: 4px 10px; cursor: pointer; color: var(--ink); text-decoration: none;
  background: var(--paper); border: 2px solid var(--bevel-d); border-top-color: var(--bevel-l); border-left-color: var(--bevel-l);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .3); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.btn:hover { background: var(--sakura-l); }
.btn:active { border-color: var(--bevel-l); border-top-color: var(--bevel-d); border-left-color: var(--bevel-d); transform: translate(1px, 1px); }
.colan img { image-rendering: pixelated; border: 2px solid var(--night); display: block; margin: 0 auto 8px; }

/* ---------- home ---------- */
.hero { display: flex; gap: 18px; align-items: center; }
.face { width: 180px; height: 180px; flex: none; border: 3px solid var(--night); box-shadow: 4px 4px 0 var(--crimson); object-fit: cover; }
h1 { font-family: var(--pix); font-size: clamp(28px, 5vw, 42px); line-height: 1.05; margin: 6px 0 10px; color: var(--night); }
.act { color: var(--muted); font-style: italic; }
.say { margin-bottom: 8px; }
.think { color: var(--crimson-d); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.status { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.status dt { color: var(--muted); font-family: var(--pix); }
.status dd { font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; background: #3cc46b; box-shadow: 0 0 6px #3cc46b; margin-right: 4px; }
.strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--night); cursor: zoom-in; display: block; }
.latest h3 { font-family: var(--pix); font-size: 17px; margin-bottom: 2px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.card { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--sakura-l); border: 2px solid var(--night); }
.card th, .card td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px dashed var(--sakura); }
.card th { font-family: var(--pix); color: var(--crimson-d); white-space: nowrap; font-weight: 600; }
.card code { font-family: var(--body); background: var(--paper); padding: 0 3px; }
.sw { display: inline-block; width: 11px; height: 11px; background: var(--c); border: 1px solid var(--night); vertical-align: -1px; margin: 0 2px 0 4px; }
.prose { max-width: 65ch; }
.prose h2 { font-family: var(--pix); font-size: 18px; color: var(--crimson-d); margin: 18px 0 6px; letter-spacing: .04em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 10px; }
.plain { list-style: none; margin: 10px 0 14px; display: grid; gap: 6px; }

/* ---------- diary ---------- */
.diary { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
.entries { list-style: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-right: 2px dashed var(--paper-d); padding-right: 14px; }
.entries button {
  width: 100%; text-align: left; background: none; border: 1px solid transparent; padding: 6px 8px; cursor: pointer;
  font-family: var(--body); font-size: 14px; color: var(--ink); line-height: 1.3;
}
.entries button small { display: block; color: var(--muted); font-size: 11px; font-family: var(--pix); }
.entries button:hover { background: var(--sakura-l); border-color: var(--sakura); }
.entries button.on { background: var(--night); color: var(--sakura-l); }
.entries button.on small { color: var(--amber); }
.entry h2 { font-family: var(--pix); font-size: 24px; line-height: 1.1; color: var(--night); }
.entry .meta { font-family: var(--pix); color: var(--muted); font-size: 12px; margin: 4px 0 14px; letter-spacing: .04em; }
.entry .meta b { color: var(--crimson); font-weight: 400; }
.entry p { margin-bottom: 11px; max-width: 65ch; }
.entry .think { margin-top: 6px; }

/* ---------- gallery ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tabs button[aria-selected="true"] { background: var(--night); color: var(--sakura-l); }
.blurb { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.masonry { columns: 3 220px; column-gap: 10px; }
.masonry figure { break-inside: avoid; margin: 0 0 10px; background: var(--night); border: 2px solid var(--night); }
.masonry img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.masonry figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 6px; color: var(--sakura-l); font-size: 12px; font-family: var(--pix); }
.masonry figcaption a { color: var(--amber); text-decoration: none; }

.lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(10, 6, 12, .93); display: flex; align-items: center; justify-content: center; padding: 14px; }
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border: 3px solid var(--paper); }
.lightbox figcaption { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; color: var(--sakura-l); font-family: var(--pix); }

footer { color: var(--sakura); font-family: var(--pix); font-size: 12px; text-align: center; padding: 10px; opacity: .85; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  body { padding: 12px 12px 120px; }
  .wrapper { flex-direction: column; gap: 12px; }
  .sidebar { position: static; flex: none; width: 100%; }
  .sidebar .colan { display: none; }
  nav { flex-direction: row; flex-wrap: wrap; }
  nav a { flex: 1 1 auto; justify-content: center; padding: 6px 8px; }
  .player { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
  .player .bar, .player .tiny, #viz { display: none; }
  .player .body { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
  .player .controls { margin: 0; flex: 1; }
  .grid2, .about, .diary { grid-template-columns: minmax(0, 1fr); }
  .entries { border-right: 0; border-bottom: 2px dashed var(--paper-d); padding: 0 0 10px; flex-direction: row; overflow-x: auto; }
  .entries button { min-width: 180px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .face { width: 120px; height: 120px; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .strip img:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .disc.spin { animation: none; } }
