.gb-room {
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --ink: #23305A;
  --paper: #FBF7EE;
  --wine: #8F1C24;
  --stamp: #B0323A;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(50% 45% at 50% 40%, rgba(255, 200, 130, .2), transparent 70%),
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 190px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 7px),
    linear-gradient(135deg, #3E2617, #2A180E 60%, #1E1109);
}
.gb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 100%;
  padding: 72px 16px 48px;
}

.gb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.gb-desk {
  --pw: min(500px, 46vw);
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  animation: gb-in .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes gb-in { from { opacity: 0; transform: translateY(18px); } }

.gb-book {
  position: relative;
  width: var(--pw);
  aspect-ratio: 784 / 631;
  perspective: 2200px;
  transition: transform .9s cubic-bezier(.45, .05, .25, 1);
}

.gb-book.open { transform: translateX(50%); }

.gb-page {
  color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
}

.gb-right {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 18px 34px;
  overflow: hidden;
  border-radius: 0 3px 3px 0;
  background:
    linear-gradient(90deg, rgba(60, 40, 20, .18), rgba(60, 40, 20, .05) 18px, transparent 40px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset -1px 0 0 rgba(0, 0, 0, .08);
  opacity: 0;
  transition: opacity .3s .1s;
}
.gb-book.open .gb-right { opacity: 1; }

.gb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid rgba(35, 48, 90, .55);
}
.gb-kicker {
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--wine);
}
.gb-date { font-family: var(--hand); font-size: 20px; color: var(--ink); }
.gb-date small,
.gb-label {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(35, 48, 90, .6);
}
.gb-date small { margin-right: 10px; }

.gb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
.gb-field { display: flex; flex-direction: column; min-width: 0; }
.gb-comments { margin-top: 10px; }
.gb-reply { margin-top: 8px; }

.gb-in {
  width: 100%;
  min-width: 0;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(84, 124, 176, .45);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 23px;
  line-height: 32px;
  height: 33px;
}
.gb-in::placeholder { color: rgba(35, 48, 90, .34); }
.gb-in:focus { border-bottom-color: var(--wine); }
textarea.gb-in {
  height: 96px;
  resize: none;
  border-bottom: 0;
  background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(84, 124, 176, .45) 31px 32px);
  background-attachment: local;
}
.gb-error {
  min-height: 22px;
  margin: 4px 0 0;
  font-family: var(--hand);
  font-size: 19px;
  line-height: 22px;
  color: #B0323A;
}

.gb-actions { display: flex; justify-content: flex-end; margin-top: auto; }
.gb-sign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 10px 16px;
  border-radius: 999px;
  background: #2C1D11;
  color: #FFF6E2;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
  transition: transform .15s, background .2s, opacity .2s;
}
.gb-sign .icon { font-size: 18px; }
.gb-sign:hover { background: var(--wine); }
.gb-sign:active { transform: scale(.97); }
.gb-right.sending .gb-sign { opacity: .55; pointer-events: none; }

.gb-right.signed .gb-in { border-bottom-color: transparent; }
.gb-right.signed textarea.gb-in { background: none; }
.gb-right.signed .gb-in::placeholder { color: transparent; }
.gb-right.signed .gb-actions { display: none; }

.gb-stamp {
  position: absolute;
  right: 26px;
  bottom: 54px;
  width: 112px;
  height: 112px;
  color: var(--stamp);
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transform: rotate(-14deg) scale(1.7);
}
.gb-right.signed .gb-stamp {
  opacity: .86;
  transform: rotate(-14deg) scale(1);
  transition: transform .22s cubic-bezier(.5, 0, .9, .5), opacity .12s;
}

.gb-thanks { display: none; margin-top: auto; }
.gb-right.signed .gb-thanks { display: block; animation: gb-in .4s .3s both; }
.gb-thanks-text {
  margin: 0 130px 10px 0;
  font-family: var(--hand);
  font-size: 22px;
  line-height: 1.2;
  color: var(--wine);
}
.gb-thanks-actions { display: flex; gap: 10px; }
.gb-thanks-actions button {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.gb-again { border: 1.5px solid #2C1D11; color: #2C1D11; }
.gb-done { background: #2C1D11; color: #FFF6E2; }

.gb-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(.45, .05, .25, 1);
}
.gb-book.open .gb-cover { transform: rotateY(-180deg); }
.gb-book.open .gb-inside { cursor: pointer; }
.gb-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.gb-front {
  display: block;
  padding: 0;
  border-radius: 3px 4px 4px 3px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 22px 44px rgba(0, 0, 0, .5), 0 3px 6px rgba(0, 0, 0, .3);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.gb-front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.gb-book:not(.open) .gb-front:hover { transform: translateY(-4px); }
.gb-front:focus-visible { outline: 2px solid #F4EEDF; outline-offset: 6px; }

.gb-inside {
  display: flex;
  flex-direction: column;
  padding: 26px 40px 22px 30px;
  border-radius: 3px 0 0 3px;
  background:
    linear-gradient(-90deg, rgba(60, 40, 20, .18), rgba(60, 40, 20, .05) 18px, transparent 40px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  transform: rotateY(180deg);
}
.gb-title {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.05;
  color: #2C1D11;
}
.gb-text {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  color: rgba(44, 29, 17, .85);
}
.gb-me { margin: 8px 0 0; font-family: var(--hand); font-size: 28px; font-weight: 700; color: var(--ink); }
.gb-ps { margin: 8px 0 0; font-family: var(--hand); font-size: 19px; line-height: 1.25; color: rgba(35, 48, 90, .8); }
.gb-ps a { color: #C2410C; text-decoration: underline 1.5px; text-underline-offset: 4px; }
.gb-ps a:hover { color: #FF6719; }

.gb-plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 12px 6px 8px;
  border: 1px solid rgba(143, 28, 36, .35);
  outline: 1px solid rgba(143, 28, 36, .2);
  outline-offset: 3px;
}
.gb-plate img { width: 24px; height: 24px; }
.gb-plate small { font-family: var(--serif); font-size: 13px; font-style: italic; color: var(--wine); }

.gb-ribbon {
  position: absolute;
  left: 5%;
  bottom: -46px;
  z-index: 3;
  width: 14px;
  height: 58px;
  background: linear-gradient(90deg, #8FA6D6, #B4C6EC 50%, #94AADA);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, .3);
  transition: left .9s cubic-bezier(.45, .05, .25, 1);
}
.gb-book.open .gb-ribbon { left: 8%; }

.gb-pen {
  position: absolute;
  top: 30%;
  left: calc(50% + var(--pw) + 30px);
  width: 150px;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #1F2A44 0 62%, #C99A35 62% 66%, #1F2A44 66%);
  box-shadow: 4px 8px 12px rgba(0, 0, 0, .45);
  transform: rotate(-62deg);
  opacity: 0;
  transition: opacity .4s .7s;
}
.gb-book.open ~ .gb-pen { opacity: 1; }
.gb-pen i {
  position: absolute;
  left: -22px;
  top: 1px;
  width: 24px;
  height: 12px;
  background: linear-gradient(90deg, #F5DA8A, #C99A35);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
@media (max-width: 1199px) { .gb-pen { display: none; } }

.gb-welcome { display: none; }
@keyframes gb-turn-fwd { from { opacity: 0; transform: translateX(24px); } }
@keyframes gb-turn-back { from { opacity: 0; transform: translateX(-24px); } }

.gb-nav { display: none; align-items: center; gap: 18px; margin-top: 34px; }
.gb-nav-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #F4EEDF;
  color: #2C1D11;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
  transition: transform .12s, opacity .2s;
}
.gb-nav-btn:active { transform: scale(.94); }
.gb-nav-btn:disabled { opacity: .3; cursor: default; }
.gb-nav-btn .icon { font-size: 20px; }
.gb-count { min-width: 52px; text-align: center; font-family: var(--hand); font-size: 24px; color: #F4EEDF; }
@media (max-width: 859px) {
  .gb-room.is-open .gb-nav { display: flex; animation: gb-in .4s .5s both; }
  .gb-room.is-open .gb-hint { display: none; }
}

.gb-hint {
  margin: 30px 0 0;
  font-family: var(--hand);
  font-size: 24px;
  color: rgba(244, 238, 223, .75);
  transition: opacity .3s;
  pointer-events: none;
}
.gb-room.is-open .gb-hint { opacity: 0; }

@media (max-width: 859px) {
  .gb-desk { --pw: min(520px, 100%); }
  .gb-book { aspect-ratio: auto; }
  .gb-book.open { transform: none; }

  .gb-right { position: relative; inset: auto; min-height: 470px; padding: 20px 18px 18px 24px; border-radius: 3px; }

  .gb-book.open .gb-welcome { min-height: 470px; }
  .gb-book.open[data-page="0"] .gb-right,
  .gb-book.open[data-page="1"] .gb-welcome,
  .gb-book:not(.open) .gb-welcome { display: none; }
  .gb-book.open .gb-welcome {
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px 24px;
    border-radius: 3px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  }
  .gb-welcome .gb-title { font-size: 28px; }
  .gb-welcome .gb-plate { margin-top: auto; }
  .gb-book.open[data-page="0"] .gb-welcome { cursor: pointer; }
  .turn-fwd { animation: gb-turn-fwd .35s cubic-bezier(.2, .8, .2, 1); }
  .turn-back { animation: gb-turn-back .35s cubic-bezier(.2, .8, .2, 1); }
  .gb-row { grid-template-columns: 1fr; gap: 6px; }
  .gb-actions { margin-top: 10px; }
  .gb-thanks { margin-top: 10px; }
  .gb-thanks-text { margin-right: 110px; }
  .gb-stamp { width: 96px; height: 96px; right: 16px; bottom: 20px; }

  .gb-cover { inset: 0; transition: transform 1s cubic-bezier(.45, .05, .25, 1), opacity .4s .6s, visibility 0s 1s; }
  .gb-book.open .gb-cover { opacity: 0; visibility: hidden; }

  .gb-book:not(.open) .gb-cover { transition: transform 1s cubic-bezier(.45, .05, .25, 1), opacity .25s, visibility 0s; }
  .gb-book.open .gb-ribbon { left: 5%; }
}

.gb-x {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F4EEDF;
  color: #2C1D11;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.gb-x .icon { font-size: 22px; }

@media (prefers-reduced-motion: reduce) {
  .gb-book, .gb-cover, .gb-ribbon, .gb-stamp { transition: none !important; }
}
