:root {
  /* Sky and small accents sampled from bg.png; darker blues keep text readable. */
  --sky: #91b0ec;
  --deep: #34467f;
  --mid: #5b72bd;
  --paper: #fdfcf7;
  --ink: #26305a;
  --muted: #5f6b96;
  --rule: #c5d0f0;
  --accent: var(--star);
  --night: #2a1f4e;
  --wash: #edf3ff;
  --edge: #6e8ac3;
  --pink: #f4b4fd;
  --peach: #fcd0ca;
  --star: #ebf77e;
  --mint: #00f6d4;
  --sunset: #f7a675;
  --gap: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 28px 16px 48px;
  min-height: 100vh;
  background-color: var(--sky);
  background-repeat: repeat;
  color: var(--ink);
  font-family: Verdana, Geneva, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

a { color: var(--mid); text-decoration: none; }
a:hover {
  color: var(--deep);
  text-decoration: underline wavy var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

::selection { background: var(--accent); color: var(--ink); }

h1, h2 { margin: 0; font-weight: 700; }

img { display: block; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px dashed var(--deep);
  outline-offset: 4px;
}
.muted { color: var(--muted); }

.site-head,
.layout,
.site-foot {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.site-head {
  position: relative;
  margin-bottom: 24px;
  text-align: center;
}
.site-head .divider { margin: 10px auto 0; }
.cloud {
  position: absolute;
  pointer-events: none;
  animation: drift 7s ease-in-out infinite;
}
.cloud-left { left: 130px; top: -10px; }
.cloud-right { right: 150px; top: 18px; animation-delay: -3.5s; }
@keyframes drift {
  50% { transform: translateY(6px); }
}
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 8px 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  font-weight: 400;
  font-style: italic;
  color: var(--deep);
  text-decoration: none;
  background: rgba(253, 252, 247, .6);
  border: 1px solid var(--paper);
}
.site-title:hover { color: var(--night); }
.site-title img { margin: 0; }
.tagline {
  display: table;
  margin: 14px auto 0;
  color: var(--deep);
  font-style: italic;
}

.layout {
  margin-bottom: var(--gap);
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar { display: grid; gap: 28px; }
.sidebar .panel { margin: 0; }

.panel {
  background: var(--paper);
  border: 1px solid var(--edge);
  padding: 18px 22px 20px;
  margin: 0 0 20px;
  box-shadow: 2px 2px 0 var(--rule);
}

.divider { margin: 14px auto 0; image-rendering: pixelated; }
.float-right { float: right; margin: 0 0 8px 14px; }
.panel::after { content: ""; display: block; clear: both; }

.panel > h2 {
  margin: 0 0 14px;
  padding: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  color: var(--deep);
  background: none;
  text-transform: lowercase;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel > h2 .h-icon { flex: none; }
.panel > h2 > span:hover {
  text-decoration: underline wavy var(--pink);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.sidebar .panel {
  background: var(--paper);
  border: 1px solid var(--edge);
  padding: 14px 10px;
  box-shadow: 2px 2px 0 var(--rule);
}
.sidebar .panel > h2 { font-size: 1.15rem; margin-bottom: 10px; }
.clock-time {
  margin: 0 0 2px;
  font-variant-numeric: tabular-nums;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  color: var(--deep);
}
.clock-date { font-size: .85rem; }

.panel > p:first-of-type,
.panel > .post:first-of-type { margin-top: 0; }

.panel p { margin: 0 0 10px; }
.panel p:last-child { margin-bottom: 0; }

.actions {
  margin-top: 14px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li { border-bottom: 1px dotted var(--rule); }
.nav-list li:last-child { border-bottom: 0; }
.nav-list a {
  display: block;
  padding: 7px 2px;
  text-decoration: none;
}
.nav-list a::before { content: "·"; display: inline-block; width: 14px; color: var(--rule); }
.nav-list a:hover { text-decoration: underline wavy var(--pink); }
.nav-list a:hover::before { content: "☆"; color: var(--mid); }

.player .track { font-weight: 700; margin: 0 0 8px; }

.ipod {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 14px 12px;
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--rule);
}

.ipod-screen {
  width: 100%;
  padding: 8px 10px;
  background: var(--wash);
  border: 1px solid var(--edge);
  box-shadow: inset 0 0 0 3px var(--paper);
  color: var(--ink);
  font-size: .85rem;
  line-height: 1.3;
}
.screen-title { margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-artist { margin: 0 0 6px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-bar {
  height: 6px;
  background: var(--paper);
  border: 1px solid var(--edge);
}
.screen-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sky);
}
.screen-time {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.wheel {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--wash);
  border: 1px solid var(--edge);
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--rule);
}
.wheel button {
  position: absolute;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.wheel button:hover {
  color: var(--deep);
  text-decoration: underline wavy var(--pink);
  text-underline-offset: 5px;
}
.wheel-side {
  top: 50%;
  transform: translateY(-50%);
  font-size: .8rem;
}
.wheel-prev { left: 14px; }
.wheel-next { right: 14px; }
.wheel .wheel-center {
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--edge);
  box-shadow: 1px 2px 0 var(--pink);
  font-size: .9rem;
}
.wheel .wheel-center:hover { background: var(--peach); }

.sidebar .ipod {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.ipod { position: relative; }
.ipod-cd {
  position: absolute;
  right: -10px;
  top: -14px;
  opacity: 0;
  transition: opacity .4s;
}
.ipod.is-playing .ipod-cd { opacity: 1; }
.ipod.is-playing .ipod-screen {
  animation: oracular 12s linear infinite;
}
@keyframes oracular {
  0%, 100% { background: var(--wash); }
  50% { background: #fceffb; }
}

.chao-bed { position: relative; width: 88px; margin: 0 auto 8px; }
.zzz {
  position: absolute;
  right: -14px;
  top: -6px;
  font-weight: 700;
  font-style: normal;
  color: var(--mid);
}
.zzz i {
  position: absolute;
  font-style: normal;
  opacity: 0;
  animation: zzz 3.6s ease-out infinite;
}
.zzz i:nth-child(2) { animation-delay: 1.2s; font-size: 1.1em; }
.zzz i:nth-child(3) { animation-delay: 2.4s; font-size: 1.25em; }
@keyframes zzz {
  0%   { opacity: 0; transform: translate(0, 10px); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(12px, -22px); }
}

.chao { text-align: center; }
.chao img { margin: 0 auto 8px; }
.chao p {
  display: inline-block;
  margin: 0;
  padding: 0 5px;
  background: var(--paper);
  font-size: .8rem;
}

main {
  min-width: 0;
}
main > .panel:last-child { margin-bottom: 0; }

.intro h2 { font-size: 1.65rem; }

.post {
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px solid var(--rule);
  background: var(--wash);
}
.post:last-child { margin-bottom: 0; }
.post-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  font-size: .9rem;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dotted var(--edge);
}
.post-head time { margin-left: auto; }
.post-body p { margin: 4px 0; }
.post-body { overflow-wrap: anywhere; }

.bestie-list { display: grid; gap: 10px; }
.bestie-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: var(--wash);
  color: var(--ink);
  text-decoration: none;
}
.bestie-row:not(.empty):hover {
  border-color: var(--edge);
  background: var(--paper);
}
.page-home .bestie-row:hover { text-decoration: none; }
.bestie-row:not(.empty):hover strong {
  text-decoration: underline wavy var(--pink);
  text-underline-offset: 4px;
}
.bestie-row img { flex: none; }
.bestie-row.empty {
  min-height: 60px;
  border-style: dashed;
  background: var(--paper);
}
.bestie-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.bestie-text span { font-size: .95rem; }

.bestie-page { text-align: left; }
.bestie-page .bestie-img { margin: 0 0 14px; }
.bestie-page:not(.panel) img { margin-bottom: 14px; }
.panel.bestie-page > h2 span {
  background: var(--accent);
  color: var(--ink);
  padding: 0 8px;
}

.button,
.guest-form button {
  display: inline-block;
  padding: 7px 16px 11px;
  font: italic 1.1rem/1.5 Georgia, "Times New Roman", serif;
  background: var(--wash);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--edge);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--peach);
  cursor: pointer;
}
.button::before,
.guest-form button::before { content: "☆ "; color: var(--mid); }
.button:hover,
.guest-form button:hover {
  background: var(--paper);
  color: var(--deep);
  box-shadow: 2px 2px 0 var(--pink);
  text-decoration: underline wavy var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.button:active,
.guest-form button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--pink);
}

.guest-form { display: grid; gap: 12px; }
.guest-form label {
  display: grid;
  gap: 4px;
  font-weight: 700;
}
.guest-form input,
.guest-form textarea {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--edge);
  background: var(--wash);
  color: var(--ink);
}
.guest-form textarea { resize: vertical; }
.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.form-foot p { margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.entries { list-style: none; padding: 0; margin: 0; }
.entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: .95rem;
}
.entry-head time { color: var(--muted); font-size: .85rem; }
.entry p { margin: 4px 0 0; }
.entry-reply {
  margin: 8px 0 0 16px;
  padding-left: 10px;
  border-left: 2px solid var(--rule);
  font-size: .95rem;
}
.entry-reply p { margin: 2px 0 0; }
.entries .empty { color: var(--muted); padding: 6px 0; }

.sitemap { margin: 0; padding-left: 20px; columns: 2; }

.site-foot {
  margin: 0 auto;
  max-width: 980px;
  padding: 12px 18px;
  text-align: center;
  font-size: .9rem;
  border: 0;
  background: none;
}
.site-foot p { margin: 2px 0; }
.site-foot > p {
  display: table;
  margin: 5px auto;
  padding: 1px 8px;
  background: var(--paper);
}
.site-foot .divider { margin: 0 auto 8px; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: contents; }
  .sidebar nav { order: 0; }
  main { order: 1; }
  main > .panel { padding: 16px 18px 20px; }
  .sidebar .panel:not(nav) { max-width: 220px; justify-self: center; width: 100%; }
  .sidebar .clock, .sidebar .player { order: 2; }
  .sidebar .chao { order: 3; }
  .nav-list { display: flex; flex-wrap: wrap; gap: 0 14px; }
  .nav-list li { border: 0; }
  .sidebar nav > h2 { margin-bottom: 4px; }
  .cloud { display: none; }
  .site-title { font-size: clamp(1.25rem, 5vw, 1.9rem); gap: 10px; padding: 8px 10px; }
  .site-title img { width: 20px; height: 20px; }
  .divider { max-width: 100%; object-fit: contain; }
  .sitemap { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .zzz i, .ipod.is-playing .ipod-screen { animation: none; }
  .zzz i { opacity: 1; position: static; }
}
