.site-header .primary-nav:has([data-view-target="guestbook"]) .nav-item:nth-child(-n+2) {
  grid-column: span 2;
}

#guestbook-view {
  --gb-ink: #202d50;
  --gb-text: #465675;
  --gb-muted: #515f7e;
  --gb-border: #d8dfef;
  --gb-action: #3b5096;
  --gb-focus: #405ec0;
  color: var(--gb-ink);
}

body[data-scene="guestbook"] {
  --canvas: #e9f1fa;
  --ink: #202d50;
  --faint: #405576;
}

body[data-scene="guestbook"]::before { content: none; }

body[data-scene="guestbook"] .site-header {
  background: linear-gradient(180deg, #f1f7ffe3 0%, #eff6fbc4 60%, #eff6fb00 100%);
  border-bottom-color: #95a9cc43;
}

@media (max-width: 700px) {
  body[data-scene="guestbook"] .primary-nav:has(#competition-nav-link) .nav-item {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.gb-sky {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #f6faffdb, #edf4fc33 27%, #e5eefa35 58%, #eaf2fa99 100%),
    url('/static/assets/aurora-sky-background-v2.webp') 70% bottom / cover no-repeat,
    #e4eef9;
}

.gb-curtain {
  position: absolute;
  inset: -26% -17% 10%;
  transform-origin: 70% 20%;
  background:
    radial-gradient(ellipse at 75% 53%, #b5f8efad 0%, #a6efe784 12%, transparent 39%),
    radial-gradient(ellipse at 37% 47%, #e7c9fbab 0%, #d5bdf861 20%, transparent 48%),
    radial-gradient(ellipse at 59% 28%, #d5e7ffb3, transparent 56%);
  animation: gb-curtain 19s ease-in-out infinite alternate;
}

.gb-stars {
  position: absolute;
  inset: -28px;
  background:
    radial-gradient(circle at 6% 25%, #fff 0 1px, transparent 3px),
    radial-gradient(circle at 12% 62%, #fff 0 1.4px, transparent 4px),
    radial-gradient(circle at 19% 71%, #697db8b3 0 1px, transparent 2.5px),
    radial-gradient(circle at 21% 20%, #fff 0 1.8px, #fff8 3px, transparent 8px),
    radial-gradient(circle at 27% 48%, #fff 0 1px, transparent 3.5px),
    radial-gradient(circle at 34% 69%, #fff 0 1.8px, transparent 5px),
    radial-gradient(circle at 39% 27%, #6577b49c 0 1px, transparent 3px),
    radial-gradient(circle at 51% 44%, #fff 0 1.5px, transparent 5px),
    radial-gradient(circle at 59% 26%, #fff 0 2px, #fff8 3px, transparent 9px),
    radial-gradient(circle at 65% 71%, #fff 0 1px, transparent 4px),
    radial-gradient(circle at 74% 52%, #fff 0 1.3px, transparent 4px),
    radial-gradient(circle at 76% 13%, #fff 0 1.1px, transparent 4px),
    radial-gradient(circle at 88% 33%, #fff 0 1.4px, transparent 5px),
    radial-gradient(circle at 94% 58%, #a8b2e5bb 0 1.5px, transparent 4px),
    radial-gradient(circle at 96% 16%, #fff 0 1.4px, transparent 4px);
  animation: gb-drift 13s ease-in-out infinite alternate;
}

.gb-meteor {
  position: absolute;
  top: 18%;
  left: 77%;
  width: clamp(75px, 12vw, 155px);
  height: 2px;
  border-radius: 100%;
  background: linear-gradient(90deg, #fff 0%, #ffffff9c 20%, transparent 100%);
  box-shadow: 0 0 9px #e4f2ff;
  opacity: 0;
  animation: gb-meteor 12s linear 1.2s infinite;
}

.gb-hero {
  min-height: 292px;
  display: flex;
  align-items: center;
  position: relative;
}

.gb-intro {
  padding: 34px clamp(8px, 3vw, 38px);
}

.gb-intro h1 {
  margin: 0;
  color: #202d50;
  font-size: clamp(2.65rem, 5.4vw, 4.65rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  text-shadow: 0 2px 22px #f4f9ff, 0 0 38px #f4f9ff;
}

.gb-intro p {
  margin: 15px 0 0;
  color: #344969;
  font-size: clamp(1rem, 1.55vw, 1.12rem);
  text-shadow: 0 1px 8px #fff, 0 0 16px #fff;
}

.gb-motion {
  position: absolute;
  right: 14px;
  bottom: 8px;
  border: 1px solid #8ca2c0;
  border-radius: 999px;
  background: #f7faffef;
  color: #344969;
  padding: 7px 14px;
  min-height: 44px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}

.gb-motion:hover { background: #fff; }

#guestbook-view[data-paused="true"] .gb-curtain,
#guestbook-view[data-paused="true"] .gb-stars,
#guestbook-view[data-paused="true"] .gb-meteor {
  animation-play-state: paused;
}

@keyframes gb-curtain {
  from { transform: translate3d(-2%, -2%, 0) rotate(-5deg); opacity: .7; }
  to { transform: translate3d(8%, 8%, 0) rotate(8deg); opacity: 1; }
}

@keyframes gb-drift {
  from { transform: translate3d(18px, -15px, 0); opacity: .86; }
  to { transform: translate3d(-16px, 20px, 0); opacity: .53; }
}

@keyframes gb-meteor {
  0% { transform: translate3d(85px, -40px, 0) rotate(-24deg); opacity: 0; }
  2% { opacity: .98; }
  9%, 100% { transform: translate3d(-220px, 95px, 0) rotate(-24deg); opacity: 0; }
}
.gb-layout {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(17px, 2.9vw, 32px);
  margin-top: clamp(16px, 2.8vw, 28px);
  align-items: start;
}

.gb-panel {
  min-width: 0;
  border: 1px solid var(--gb-border);
  border-radius: 20px;
  padding: clamp(16px, 2.6vw, 28px);
  background: #fbfdfff2;
  box-shadow: 0 17px 38px #354d7519, inset 0 1px 0 #fff;
}

.gb-panel h2 {
  margin: 0 0 15px;
  color: var(--gb-ink);
  font-size: 1.2rem;
}

.gb-panel textarea {
  display: block;
  width: 100%;
  min-height: 115px;
  resize: vertical;
  border: 1px solid #adb8d6;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--gb-ink);
  background: #fff;
  font: inherit;
  line-height: 1.6;
}

.gb-panel textarea::placeholder { color: var(--gb-muted); }

.gb-actions, .gb-pagination, .gb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.gb-actions { justify-content: space-between; margin-top: 12px; }
.gb-pagination { justify-content: end; margin-top: 14px; }
.gb-actions .button { background: var(--gb-action); color: white; }
.gb-actions .button:hover:not(:disabled) { background: #304279; }

.gb-footnote, .gb-status, .gb-count, .gb-meta time {
  color: var(--gb-muted);
  font-size: .87rem;
}

.gb-footnote { margin: 9px 0 0; line-height: 1.45; }
.gb-status { margin: 0; }
.gb-status:not(:empty) { margin-top: 12px; }
.gb-status[data-error="true"] { color: #8c314b; }

.gb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gb-post {
  padding: 13px 2px;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--gb-border);
}

.gb-post:last-child { padding-bottom: 1px; }
.gb-meta strong { color: #31477e; }
.gb-post p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.65; }
#guestbook-view :focus-visible { outline: 3px solid var(--gb-focus); outline-offset: 3px; }
#guestbook-view [hidden] { display: none; }

@media (max-width: 700px) {
  .gb-layout { grid-template-columns: minmax(0, 1fr); }
  .gb-hero { min-height: 210px; align-items: flex-start; }
  .gb-intro { padding: 32px 4px 57px; }
  .gb-sky { background-position: 70% bottom; }
  .gb-motion { bottom: 8px; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gb-curtain, .gb-stars, .gb-meteor { animation: none; }
  .gb-motion { display: none; }
}
