:root {
  color-scheme: dark light;
  --bg: #070b16; --panel: #0f1628; --panel2: #151f37; --line: #22304f; --text: #e3e9f5; --muted: #8b9bb6;
  --accent: #7c9bff; --accent2: #b58cff; --on-accent: #070b16; --radius: 14px;
  --shadow: 0 10px 40px #0007;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef2fa; --panel: #fff; --panel2: #f4f7fd; --line: #dbe3f1; --text: #16233a; --muted: #5d6e87;
    --accent: #3454d1; --accent2: #7a45e0; --on-accent: #fff; --shadow: 0 10px 40px #2a3f7414;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(60rem 30rem at 85% -10%, #7c9bff22, transparent), radial-gradient(50rem 30rem at -10% 0, #b58cff1a, transparent), var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); text-underline-offset: .2em; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 9; background: var(--panel); padding: .5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.5rem;
  padding: .7rem max(1rem, calc((100% - 56rem) / 2)); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(14px);
}
.logo { font: 800 2rem/1 system-ui, sans-serif; letter-spacing: -.05em; color: var(--text); text-decoration: none; }
.logo span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav { display: flex; flex-wrap: wrap; gap: .2rem; margin-left: auto; }
nav a { color: var(--muted); text-decoration: none; padding: .3rem .55rem; border-radius: 999px; font-size: .9rem; font-weight: 500; transition: .15s; }
nav a:hover { color: var(--text); background: var(--panel2); }
nav a[aria-current] { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.menu-check, .menu-btn { display: none; }

/* content */
main {
  max-width: 56rem; margin: 2rem auto; padding: 2rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
h1 { margin: 0 0 1rem; font-size: 2.1rem; line-height: 1.15; letter-spacing: -.03em; }
h2 { margin: 2.5rem 0 .5rem; font-size: 1.3rem; letter-spacing: -.01em; }
h3 { margin-bottom: .3rem; }
.prose, .set, .body { white-space: pre-line; overflow-wrap: anywhere; }
.intro { margin-bottom: 1.25rem; color: var(--muted); }
.card, .set { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1rem 0; }
.title { margin: 0; font-size: 1.2rem; letter-spacing: -.01em; }
.body .title { margin: 1rem 0 .15rem; }
.date, time { color: var(--muted); font-size: .88rem; }
.set .date { font-weight: 600; margin-bottom: .25rem; }
.category, .detail { margin: 1.5rem 0 .25rem; color: var(--accent); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.link { white-space: normal; }
.event { display: grid; grid-template-columns: 7rem 1fr 1fr 1fr; gap: .5rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.event .date { font-size: 1rem; color: var(--accent); font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.tabs a { padding: .3rem .85rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .92rem; color: var(--muted); }
.tabs a:hover { color: var(--text); border-color: var(--accent); }
.tabs a[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--line); transition: transform .2s, filter .2s; }
.grid a:hover img { transform: scale(1.03); filter: brightness(1.1); }

/* forms */
.form { display: grid; gap: .8rem; max-width: 36rem; margin: 1rem 0; }
label { display: grid; gap: .25rem; font-weight: 600; font-size: .95rem; }
label.inline { display: block; font-weight: 400; font-size: 1rem; }
input:not([type=radio]):not([type=checkbox]), select, textarea, button {
  font: inherit; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px #7c9bff33; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; vertical-align: -.15em; }
textarea { width: 100%; }
.editor { font: .9rem/1.5 ui-monospace, Consolas, monospace; max-width: none; }
button { cursor: pointer; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); border: 0; font-weight: 600; justify-self: start; transition: filter .15s; }
button:hover { filter: brightness(1.1); }
button.danger { background: #d64545; color: #fff; }
.hp { position: absolute; left: -999px; }
.notice { padding: .7rem 1rem; border-left: 4px solid var(--accent); background: var(--panel2); border-radius: 0 10px 10px 0; }
.entry { border-top: 1px solid var(--line); padding: .8rem 0; }
.entry p { margin: .25rem 0 0; overflow-wrap: anywhere; }
audio { display: block; width: 100%; max-width: 28rem; margin: .5rem 0; }
.file { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.file form { margin-left: auto; }
progress { width: 100%; max-width: 36rem; accent-color: var(--accent); }
pre { overflow-x: auto; padding: .8rem; background: var(--bg); border-radius: 10px; }
details { margin: 1rem 0; }
footer { display: flex; justify-content: space-between; max-width: 56rem; margin: 0 auto 2rem; padding: 0 1rem; color: var(--muted); font-size: .88rem; }
footer a { color: var(--muted); }

/* lightbox */
dialog.lb { border: 0; padding: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: transparent; touch-action: none; }
dialog.lb::backdrop { background: #000e; backdrop-filter: blur(6px); }
dialog.lb img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; user-select: none; -webkit-user-drag: none; }
dialog.lb button { position: absolute; background: #0009; color: #fff; font-size: 2rem; line-height: 1; padding: .3rem .9rem; border-radius: 999px; }
dialog.lb .prev { left: 8px; top: 50%; }
dialog.lb .next { right: 8px; top: 50%; }
dialog.lb .close { right: 8px; top: 8px; }
@media (hover: none) { dialog.lb .prev, dialog.lb .next { display: none; } } /* touch screens: swipe instead */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .top { justify-content: space-between; }
  .menu-check { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
  .menu-btn { display: block; padding: .4rem 1rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); cursor: pointer; font-weight: 600; }
  .menu-check:focus-visible + .menu-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
  nav { display: none; width: 100%; flex-direction: column; margin: 0; padding-bottom: .4rem; }
  nav a { padding: .6rem .9rem; border-radius: 10px; }
  .menu-check:checked ~ nav { display: flex; }
  main { margin: 0; border-radius: 0; border-width: 1px 0; padding: 1.1rem; box-shadow: none; }
  h1 { font-size: 1.75rem; }
  .event { grid-template-columns: 1fr; gap: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .4rem; }
  footer { padding: 1rem; }
}
