:root {
  color-scheme: light;
  --forest: #182922;
  --moss: #536b50;
  --ink: #293f32;
  --muted: #4c6351;
  --paper: #dee3cf;
  --paper-light: #e9ebdb;
  --note-paper: #f4eddf;
  --note-rule: #6b7b5f38;
  --note-tape: #82957686;
  --note-grid: url('/sites/jackie/about/paper-grid.png');
  --note-tear: url('/sites/jackie/about/paper-tear-left.svg');
  --note-writing: 17px/1.65 "Averia Serif Libre", "Songti SC", Georgia, serif;
  --line: #6b7b5f42;
  --fog: #e5ebd6;
  --serif: 'Awesome Serif Regular', 'Songti SC', 'Noto Serif CJK SC', Georgia, serif;
  --hand: 'Gochi Hand', 'Songti SC', Georgia, serif;
  --mono: 'Geist Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 300px; }
body { margin: 0; background: var(--forest); color: var(--fog); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
:focus-visible { outline: 2px solid #839b72; outline-offset: 4px; }


.skip-link {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  transform: translateY(-180%);
  background: var(--paper);
  color: var(--ink);
}
.skip-link:focus { transform: none; }

.folio {
  display: flex;
  align-items: center;
  gap: .8em;
  color: var(--muted);
  font: 11px/1.35 var(--mono), var(--sans);
  letter-spacing: .14em;
}
.folio > span { width: 23px; border-top: 1px solid currentColor; opacity: .5; }

.inner-page { position: relative; z-index: 3; width: min(932px, calc(100% - 128px)); margin: 20px auto 0; }
.loose-sheet {
  position: relative;
  isolation: isolate;
  min-height: 340px;
  padding: clamp(32px, 5.5vw, 69px);
  border-radius: 0 0 5px 5px;
  background: var(--paper);
  color: var(--red);
  box-shadow: 7px 8px 0 var(--cover), -5px 5px 0 var(--cover), 0 17px 31px #18251d70;
}
.loose-sheet::before, .loose-sheet::after, .paper-dialog::before {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
}
.loose-sheet::before {
  inset: 0;
  background: var(--note-grid) center top / 46.5px auto repeat;
  opacity: .045;
}
.loose-sheet::after, .paper-dialog::before {
  inset: -24px 0 auto;
  height: 29px;
  background: var(--paper);
  mask: var(--note-tear) center bottom / auto 100% repeat-x;
}
.page-heading { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.page-heading h1 {
  margin: 3px 0 4px;
  font: 600 45px/1.15 "Awesome Serif Semi Bold Tall", Georgia, serif;
}
.page-heading > p:last-child { color: var(--muted); font: 16px/1.5 "Averia Serif Libre", Georgia, serif; }
.diary-list, #guest-list { display: grid; gap: 17px; margin-top: 23px; }
.empty-copy { padding: 19px 0; color: var(--muted); font: 18px/1.5 var(--serif); }
.paper-slip {
  position: relative;
  border-radius: 2px 4px 3px 2px;
  background: var(--note-paper);
  box-shadow: 0 1px 3px #3443322b;
}
.paper-slip:is(.diary-entry, .guest-form, .guest-note)::before {
  position: absolute;
  inset: -5px auto auto 22px;
  width: 46px;
  height: 11px;
  background: var(--note-tape);
  clip-path: polygon(2% 1%, 100% 4%, 96% 100%, 0 96%);
  transform: rotate(-3deg);
  pointer-events: none;
  content: "";
}
.diary-entry summary { display: grid; grid-template-columns: 92px minmax(0, 1fr) 22px; align-items: baseline; gap: 12px; padding: 18px 20px; list-style: none; }
.diary-entry summary::-webkit-details-marker { display: none; }
.diary-entry time, .guest-note time { color: var(--muted); font: 11px/1.25 var(--mono); letter-spacing: .04em; }
.entry-title { font: 27px/1.2 var(--serif); overflow-wrap: anywhere; }
.entry-toggle { justify-self: center; color: var(--moss); font: 24px/1 var(--hand); transition: transform .18s ease; }
.diary-entry[open] .entry-toggle { transform: rotate(45deg); }
.entry-body {
  max-width: 70ch;
  margin: 0 20px 0 124px;
  padding: 10px 0 24px;
  border-top: 1px solid var(--note-rule);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: var(--note-writing);
}

.guest-form, .editor-form { display: grid; gap: 16px; }
.guest-form { margin-top: 26px; padding: 20px; }
label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; }
label > span { color: var(--muted); font-size: 11px; font-weight: 400; }
.guest-form label:first-child { grid-template-columns: auto 1fr; align-items: baseline; max-width: 300px; }
.guest-form label:first-child input { grid-column: 1 / -1; }
input:not([type=file]), textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--note-rule);
  border-radius: 0;
  background: color-mix(in srgb, var(--note-paper) 83%, transparent);
  color: #263d30;
  font-weight: 400;
  font-size: 16px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #516756; opacity: .83; }
:is(.guest-form, .dialog-paper) :is(input:not([type=file]), textarea, select):focus-visible {
  outline: none;
  border-bottom-color: var(--red);
  box-shadow: inset 0 -1px var(--red);
  background-color: #fbf7ec80;
}
.form-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.form-bottom p { color: var(--muted); font: 13px/1.4 "Averia Serif Libre", Georgia, serif; }
.action-button, .small-button {
  display: inline-flex;
  width: fit-content;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--red);
  border-radius: 3px 5px 3px 5px;
  background: var(--red);
  color: var(--note-paper);
  font: 16px/1.3 var(--hand);
}
.action-button:hover { background: #344f34; }
.form-status { color: #385643; font-size: 14px; }
.form-status:empty { display: none; }
.guest-entries { margin-top: 31px; border-top: 1px solid var(--line); padding-top: 22px; }
.guest-entries h2 { font: 600 27px/1.2 "Awesome Serif Semi Bold Extra Tall", Georgia, serif; }
.guest-note {
  padding: 16px 20px 17px;
  font: var(--note-writing);
  overflow-wrap: anywhere;
}
.guest-note header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--note-rule); }
.guest-note header strong { font: 20px/1.15 var(--hand); }
.guest-note p { white-space: pre-wrap; }

.contact-email {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  display: grid;
  place-items: center;
  margin: 17px auto 0;
  width: 151px;
  height: 51px;
  text-decoration: none;
  font: 21px/1.2 var(--hand);
  transition: transform .2s ease;
}
.contact-email img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contact-email:is(:hover, :focus-visible) { transform: rotate(-4deg) scale(1.05); }

.guest-form label, .paper-dialog label { font: 19px/1.2 var(--hand); }
.guest-form :is(input, textarea) {
  background-color: transparent;
  font: var(--note-writing);
}
.guest-form textarea, .paper-dialog textarea {
  --writing-line: 28px;
  line-height: var(--writing-line);
  background-image: repeating-linear-gradient(transparent 0 calc(var(--writing-line) - 1px), var(--note-rule) calc(var(--writing-line) - 1px) var(--writing-line));
  background-origin: content-box;
  background-attachment: local;
}
.guest-form .contact-email { margin: 0 0 0 auto; }

.site-footer { position: relative; padding: 60px 20px 54px; }
.site-footer .footer-signature { margin-top: 30px; }
.footer-plant { width: 45px; height: 66px; margin-inline: auto; transform: rotate(13deg); opacity: .74; }

.footer-song {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(655px, 100%);
  height: 47px;
  margin: 43px auto 0;
  overflow: hidden;
  text-decoration: none;
  font: 22px/1.2 var(--hand);
  color: var(--paper);
}
.footer-song > span:not(.footer-ticker) { position: absolute; z-index: 1; background: var(--ink); padding: 4px; }
.footer-song > span:last-child { right: 0; }
.footer-ticker { display: inline-block; white-space: nowrap; animation: ticker 26s linear infinite; }
.footer-song:hover .footer-ticker, .footer-song:focus-visible .footer-ticker { animation-play-state: paused; }
@keyframes ticker { 0% { transform: translateX(3%); } 100% { transform: translateX(-100%); } }
.footer-signature { display: block; width: 152px; margin: 48px auto 0; }

.paper-dialog {
  isolation: isolate;
  position: fixed;
  width: min(720px, calc(100% - 28px));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--red);
}
.dialog-paper {
  --grid-wash: color-mix(in srgb, var(--paper) 94%, transparent);
  max-height: min(790px, calc(100dvh - 68px));
  padding: 27px;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 0 0 5px 4px;
  background: linear-gradient(var(--grid-wash), var(--grid-wash)), var(--note-grid) center top / 46.5px auto repeat var(--paper);
  box-shadow: 5px 6px 0 var(--cover), 0 17px 50px #141f17a6;
}
.paper-dialog::backdrop { background: #141f18a6; backdrop-filter: blur(1.5px); }
.login-dialog { width: min(410px, calc(100% - 32px)); }
.login-dialog form { display: grid; gap: 13px; }
.paper-dialog h2 { font: 39px/1.12 var(--serif); }
.paper-dialog h3 { font: 21px/1.3 var(--hand); }
.dialog-close {
  display: inline-grid;
  min-width: 35px;
  min-height: 35px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--note-rule);
  border-radius: 48% 52% 49% 51%;
  background: var(--note-paper);
  color: var(--red);
  font: 26px/1 var(--hand);
}
.dialog-close:hover { border-color: var(--red); }
.login-dialog .dialog-close { position: absolute; top: 14px; right: 14px; }
.admin-heading, .admin-heading > div:last-child, .editor-actions { display: flex; align-items: center; gap: 10px; }
.admin-heading { justify-content: space-between; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 17px; padding-bottom: 8px; border-bottom: 1px solid var(--note-rule); }
.admin-nav button {
  min-height: 34px;
  padding: 4px 11px;
  border: 0;
  border-radius: 3px 4px 1px 2px;
  background: var(--note-paper);
  color: var(--red);
  font: 16px/1.2 var(--hand);
  box-shadow: 0 1px 2px #34433224;
}
.admin-nav button:hover { box-shadow: 0 2px 2px #3443323d; }
.admin-nav button[aria-pressed="true"] { background: var(--red); color: var(--note-paper); }
.admin-content { min-height: 100px; margin-top: 10px; }
.admin-content .editor-form { padding: clamp(14px, 2.5vw, 20px); }
.profile-copy-group { display: grid; min-width: 0; gap: 13px; margin: 0; padding: 0 0 17px; border: 0; border-bottom: 1px solid var(--note-rule); }
.profile-copy-group legend { padding: 0 0 9px; font: 21px/1.3 var(--hand); }
.editor-form :is(input, select, textarea), .login-dialog input { font-family: "Averia Serif Libre", "Songti SC", Georgia, serif; }
.admin-hint { color: var(--muted); font-size: 13px; }
.text-button { min-height: 34px; padding: 4px 6px; border: 0; background: transparent; color: var(--ink); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.diary-manager { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.manager-list { display: grid; gap: 10px; min-width: 0; }
.manager-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.manager-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 11px; overflow-wrap: anywhere; }
.manager-row strong { font: 17px/1.3 var(--serif); }
.manager-actions, .upload-actions { display: flex; gap: 3px; align-items: center; }
.manager-actions { flex-shrink: 0; }
.small-button { min-height: 30px; padding: 4px 8px; background: transparent; color: var(--red); font-size: 13px; }
.small-button:hover { background: #cbd7be70; }
.manager-message-body { margin-top: 5px; white-space: pre-wrap; font: var(--note-writing); }
.upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.upload-card { min-width: 0; display: grid; align-content: start; gap: 6px; padding: 8px; }
.upload-card h3 { font: 15px/1.3 var(--hand); }
.upload-card input[type=file] { display: none; }
.upload-selected { outline: 2px solid #58764e; outline-offset: -1px; }
.upload-preview { display: grid; place-items: center; aspect-ratio: 1.65; overflow: hidden; border-radius: 3px; background: #c5d1b7; color: #4b624c; font-size: 12px; }
.upload-preview img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }


.paper-dialog::after {
  position: absolute;
  inset: 0;
  opacity: .17;
  mix-blend-mode: soft-light;
  background: var(--noise) 0 0 / 152px repeat;
  pointer-events: none;
  content: "";
}
@media (max-width: 880px) {
  .inner-page { width: calc(100% - 88px); }
}
@media (max-width: 600px) {
  .inner-page { width: calc(100% - 42px); margin-top: 16px; }
  .loose-sheet { min-height: 270px; padding: 27px 20px 29px; }
  .loose-sheet::after { top: -19px; height: 23px; }
  .page-heading h1 { font-size: 39px; }
  .diary-entry summary { grid-template-columns: 1fr 17px; gap: 4px; }
  .diary-entry time { grid-column: 1 / -1; }
  .entry-title { font-size: 25px; }
  .entry-body { margin-left: 20px; }
  .guest-form, .guest-note { padding: 17px; }
  .site-footer { padding-top: 48px; }
  .dialog-paper { padding: 17px; }
  .paper-dialog h2 { font-size: 32px; }
  .diary-manager { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
