@font-face {
  font-family: Allura;
  src: url('/assets/fonts/Allura-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --site-paper: #f1e2c7;
  --site-paper-light: #fff4dd;
  --site-ink: #283a2e;
  --site-muted: #60503e;
  --site-line: #c7aa82;
  --site-ochre: #a26c38;
  --site-green: #586849;
  --site-grain: url('/assets/site/library/paper.webp');
  --site-wood: linear-gradient(rgb(42 23 14 / 25%), rgb(33 17 10 / 48%)), url('/assets/site/library/wood.webp') center / auto 100% repeat-x, #4f2d1d;
  --site-serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  --site-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background-color: var(--site-paper);
  background-image:
    radial-gradient(ellipse at top, rgb(255 247 227 / 74%), rgb(255 244 222 / 45%)),
    var(--site-grain);
  background-size: auto, 344px 315px;
  color: var(--site-ink);
  font-family: var(--site-sans);
}

a { color: inherit; text-underline-offset: .24em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid #617860; outline-offset: 4px; }

.paper-frame {
  border: 1px solid var(--site-line);
  border-radius: 10px 7px 9px 7px;
  background-color: rgb(255 246 222 / 56%);
  box-shadow: inset 0 0 0 4px rgb(155 107 59 / 11%), 0 3px 9px rgb(86 51 24 / 13%);
}

.site-footer {
  padding: 16px 0;
  border-top: 1px solid #96673e;
  background: var(--site-wood);
  color: #fff1d8;
}

.site-action,
.control,
.langs button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #c8b58c;
  border-radius: 5px 4px 6px 4px;
  background-color: #fffdf5;
  background-image: repeating-linear-gradient(177deg, transparent 0 10px, rgb(162 128 75 / 5%) 11px 12px);
  box-shadow: 1px 2px 0 rgb(157 132 85 / 20%);
  color: var(--site-ink);
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.site-action:hover,
.control:hover,
.langs button:hover {
  transform: translateY(-1px) rotate(-.25deg);
  box-shadow: 1px 3px 0 rgb(157 132 85 / 25%);
  background-color: #fffef9;
}

.site-action:disabled,
.control:disabled,
.langs button:disabled {
  opacity: .52;
  cursor: default;
  transform: none;
}

.site-action.primary,
.langs button[aria-pressed="true"] {
  background-color: #e9eddf;
  border-color: #91a083;
  color: #2c493c;
}

.login-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 7vw, 65px);
  aspect-ratio: 1;
  min-height: 44px;
  padding: 3px;
  border: 1px solid #d0a977;
  border-radius: 50%;
  background: #f6e7cc;
  box-shadow: 0 2px 6px rgb(32 16 10 / 46%);
}

.login-action:hover {
  background: #fff5dd;
  box-shadow: 0 2px 7px rgb(32 16 10 / 58%);
}

.account-mark {
  display: inline-block;
  flex: none;
  width: 91%;
  aspect-ratio: 1;
  background-image: url('/assets/site/pencil-icons.webp');
  background-size: 200% 200%;
  background-position: right bottom;
  background-repeat: no-repeat;
}

.account-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-dialog {
  width: min(100% - 28px, 450px);
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--site-line);
  border-radius: 8px 6px 9px 7px;
  background-color: var(--site-paper-light);
  background-image: linear-gradient(rgb(255 246 224 / 86%), rgb(255 241 213 / 78%)), var(--site-grain);
  background-size: auto, 344px 315px;
  color: var(--site-ink);
  box-shadow: 3px 5px 0 rgb(80 72 49 / 13%), 0 18px 50px rgb(38 47 39 / 17%);
}

.site-dialog::backdrop { background: rgb(34 43 37 / 50%); }
.site-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-dialog h2 { margin: 0; font: 600 1.42rem/1.4 var(--site-serif); }
.site-dialog p,
.site-dialog label { margin: 8px 0; font-size: .91rem; line-height: 1.7; }
.site-dialog p { overflow-wrap: anywhere; }
.site-dialog form { display: grid; gap: 10px; margin-top: 13px; }
.site-dialog label { display: grid; gap: 5px; margin: 0; }
.site-dialog input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid var(--site-line);
  border-radius: 4px;
  background: #fffef9;
  color: var(--site-ink);
  font: inherit;
}
.site-dialog input:focus-visible { outline: 2px solid var(--site-green); outline-offset: 2px; }
.site-dialog .dialog-links { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.site-dialog .dialog-link {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--site-ink);
  font: inherit;
  font-size: .84rem;
  text-decoration: underline;
  text-decoration-color: var(--site-ochre);
  text-underline-offset: .25em;
  cursor: pointer;
}
.site-dialog .site-message { min-height: 1.55em; margin: 12px 0 0; color: var(--site-muted); font-size: .85rem; }
.site-dialog .site-message[data-error="true"] { color: #8c362b; }
.site-dialog .signed-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.fav-button[aria-pressed="true"] { background-color: #f3ead5; border-color: #c4a46c; }

[data-reveal-pending] { opacity: 0; }

[data-reveal="paper"],
[data-reveal="illustration"],
[data-reveal="book"] {
  position: relative;
  transform-origin: center top;
}

.reveal-flourish::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(110deg,
    transparent 42%,
    rgb(255 217 139 / 20%) 46%,
    rgb(255 249 219 / 70%) 49%,
    rgb(255 223 151 / 30%) 52%,
    transparent 57%) 150% 0 / 300% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgb(206 160 86 / 45%), inset 0 0 24px rgb(255 213 133 / 18%);
  pointer-events: none;
  animation: gilded-light-pass 1150ms 160ms ease-in-out both;
}

[data-reveal="illustration"].reveal-flourish::after {
  animation-duration: 1300ms;
  animation-delay: 250ms;
}

.desk-illustration.reveal-flourish::after {
  mask-image: linear-gradient(transparent, black 21%, black 94%, transparent);
}

.notes h2.reveal-lines {
  position: relative;
}

.notes h2.reveal-lines::after {
  content: "";
  position: absolute;
  inset: auto 35% -8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c39246 25%, #e3bd74 70%, transparent);
  transform-origin: left center;
  animation: ink-underline 1250ms ease-out both;
}

.band-title.reveal-lines::before,
.band-title.reveal-lines::after {
  animation: pencil-rule-in 1250ms cubic-bezier(.2, .7, .25, 1) both;
}

.band-title.reveal-lines::before { transform-origin: right center; }
.band-title.reveal-lines::after { transform-origin: left center; }

.band-title.reveal-lines .sketch-icon {
  animation: quill-flourish 1250ms cubic-bezier(.2, .7, .25, 1) both;
}

@keyframes gilded-light-pass {
  0% { opacity: 0; background-position: 150% 0; }
  20% { opacity: 1; }
  75% { opacity: .85; }
  100% { opacity: 0; background-position: -50% 0; }
}

@keyframes ink-underline {
  0% { opacity: 0; transform: scaleX(0); }
  65% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

@keyframes quill-flourish {
  0% { opacity: 0; transform: translateY(8px) rotate(-18deg) scale(.7); }
  75% { opacity: 1; transform: translateY(-2px) rotate(3deg) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}

@keyframes pencil-rule-in {
  from { opacity: 0; transform: scaleX(.18); }
  to { opacity: 1; transform: scaleX(1); }
}

.record [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.record .reveal-flourish::after { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reveal-lines::before, .reveal-lines::after { animation: none !important; }
  .reveal-lines .sketch-icon { animation: none !important; }
  .reveal-flourish::after { display: none !important; }
}
