* { box-sizing: border-box; }
:root { color-scheme: dark; font-family: "Segoe UI", system-ui, sans-serif; }
body {
  --bg: #120e0b; --accent: #ff9750; --ink: #fff0e6; --muted: #d2aea0;
  --panel: color-mix(in srgb, var(--bg) 90%, white);
  --line: color-mix(in srgb, var(--accent) 30%, var(--panel));
  --action: color-mix(in srgb, var(--accent) 12%, var(--panel));
  margin: 0; min-height: 100svh; color: var(--ink);
  background: radial-gradient(ellipse at 48% 0, color-mix(in srgb, var(--accent) 12%, var(--bg)), var(--bg) 52%);
}
body.light { --ink: #2b1a12; --muted: #634332; --panel: color-mix(in srgb, var(--bg) 97%, black); color-scheme: light; }
a { color: var(--ink); }
a:hover { text-decoration-color: var(--accent); }
.site { width: min(100% - 36px, 1380px); margin: 0 auto; }
.topbar { min-height: 77px; display: flex; gap: 14px 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; gap: 4px 8px; flex-wrap: wrap; }
.topbar a { text-decoration: none; }
.topbar nav a, .profile-link { padding: 7px 10px; border-radius: 7px; }
.topbar nav a:hover, .topbar nav a[aria-current], .profile-link:hover { background: var(--action); }
.wordmark { font: 700 clamp(1.2rem, 3vw, 1.6rem)/1.2 Georgia, serif; white-space: nowrap; }
.wordmark span, .wordmark em { color: var(--accent); }
.profile-link { display: inline-flex; align-items: center; gap: 8px; }
.avatar { width: 30px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.avatar-initial { display: grid; place-items: center; background: var(--action); border: 1px solid var(--line); }
.large-avatar { width: 100px; margin-bottom: 18px; }
main { padding: 26px 0 50px; }
h1, h2, h3 { font-family: Georgia, serif; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0; font-weight: 500; }
h2 { margin: 0 0 12px; font-weight: 500; }
h3 a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
p { line-height: 1.55; }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.page-heading p { margin: 5px 0 0; color: var(--muted); }
main:has(> .page-heading), main:has(> .back-link) { max-width: 1000px; margin-inline: auto; }
.panel { padding: clamp(15px, 3vw, 26px); margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.stack { display: grid; gap: 13px; }
.stack > .panel { margin: 0; }
.stack button { justify-self: start; }
label { display: grid; gap: 6px; }
input, textarea, select, button { font: inherit; color: inherit; }
input:not([type=range]), textarea, select { min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 8px 10px; }
input[type=color] { width: 70px; height: 42px; padding: 4px; }
textarea { resize: vertical; width: 100%; }
button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--action); cursor: pointer; }
button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 23%, var(--panel)); }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.muted, .helptext, figcaption { color: var(--muted); }
.error, .errorlist { color: #ef755e; }
.login-card { max-width: 480px; margin: clamp(22px, 12vh, 120px) auto; padding: clamp(23px, 4vw, 44px); }
.login-mark { font-size: 2rem; display: block; margin-bottom: 12px; color: var(--accent); }
.login-card form > div { display: grid; gap: 5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs a { padding: 9px 12px; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; }
.tabs a[aria-current] { background: var(--action); }
summary { cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: 15px; }
.prose { overflow-wrap: anywhere; line-height: 1.65; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 18px; text-align: center; }
.calendar-grid > * { min-height: 40px; display: grid; place-content: center; border-radius: 6px; }
.calendar-grid > a { border: 1px solid var(--line); text-decoration: none; }
.calendar-grid > a:hover, .calendar-grid .marked { background: var(--action); }
.calendar-grid .marked span { color: var(--accent); }
.calendar-grid .empty { opacity: .28; }
.date-link { display: block; width: fit-content; padding: 6px 0; }
.back-link { display: block; margin-bottom: 15px; }
.diary-entry { margin-bottom: 14px !important; }
.diary-entry figure { margin: 16px 0; }
.diary-entry img { display: block; max-width: 100%; max-height: 560px; border-radius: 7px; }
.block { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 11px; display: grid; gap: 8px; }
.block-actions button { font-size: .86rem; }
.editor-preview { width: 130px; max-height: 130px; object-fit: cover; border-radius: 5px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); gap: 12px; }
.photos figure { margin: 0; }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; }
.collage { grid-auto-flow: dense; }
.collage figure:nth-child(4n + 1) { grid-column: span 2; }
figcaption { padding-top: 5px; font-size: .88rem; }
.terminal { overflow: hidden; border: 1px solid #785037; border-radius: 14px; background: #15100e; color: #ffeadc; font-family: Consolas, "Courier New", monospace; box-shadow: 0 24px 70px #0005; }
.terminal-bar { padding: 13px 20px; border-bottom: 1px solid #785037; background: #251811; font-size: 14px; }
.terminal-bar span, .prompt { color: #f9bd90; }
.terminal-body { padding: 15px clamp(10px, 3vw, 32px); }
.prompt { margin: 0; overflow-wrap: anywhere; }
.prompt span { color: #ff924d; }
canvas { display: block; width: 100%; height: clamp(345px, 68svh, 780px); background: radial-gradient(ellipse at 50% 44%, #321c16 0, transparent 64%); }
.terminal-footer { border-top: 1px solid #62402e; padding-top: 13px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.terminal-footer p { margin: 0; }
.player { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 8px 10px; border: 1px solid #7d5136; border-radius: 8px; background: #241710; font-size: 14px; }
.player button { background: #432819; border-color: #875736; }
.track { display: grid; gap: 3px; max-width: 220px; overflow-wrap: anywhere; }
.track span, .volume, #audio-status { color: #e6bfa6; }
.volume { display: flex; align-items: center; gap: 7px; }
.volume input { width: 65px; accent-color: #ff9750; }
#audio-status { flex-basis: 100%; }
.disc { flex: 0 0 40px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #a57251; background: radial-gradient(circle, #1c1410 0 10%, #f2a664 11% 15%, transparent 16%), repeating-radial-gradient(circle, transparent 0 2px, #1d161060 3px 4px), conic-gradient(#553728, #efae78, #512d25, #ac7056, #553728); animation: rotate-disc 3s linear infinite paused; }
.player.is-playing .disc { animation-play-state: running; }
@keyframes rotate-disc { to { transform: rotate(1turn); } }
@media (max-width: 600px) {
  .site { width: min(100% - 20px, 1380px); }
  .topbar { padding: 12px 0; gap: 5px; }
  .topbar nav { order: 3; flex-basis: 100%; gap: 0; }
  canvas { height: clamp(335px, 56svh, 525px); }
  .collage figure:nth-child(4n + 1) { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .disc { animation: none; } }
