/* Sticky photo album: Caveat for handwriting, Lora for reading text; fonts are self-hosted because the CSP is default-src 'self' */
@font-face { font-family: Caveat; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/static/fonts/caveat-normal-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Caveat; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/static/fonts/caveat-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/static/fonts/lora-italic-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/static/fonts/lora-italic-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/fonts/lora-normal-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/fonts/lora-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --table: #c9b98d; --page: #ebe0b4; --edge: #b8a870; --note: #f6efcf; --snap: #fffdf6;
  --ink: #1d2a63; --ink2: #4a5688; --pen: #8d2a1e; --line: rgb(29 42 99 / .28); --tape: rgb(205 175 95 / .6);
  --glare: rgb(255 255 255 / .32); --shadow: rgb(60 40 10 / .45); --mark: #ffd84a; --soft: rgb(29 42 99 / .07);
  --hand: Caveat, "Segoe Print", "Bradley Hand", cursive; --read: Lora, Georgia, "PT Serif", serif;
  --bind: 34px; --hole: 6px; --gut: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --table: #17140e; --page: #2d281b; --edge: #4a4128; --note: #3a3322; --snap: #e6dfc8;
    --ink: #cbd4ff; --ink2: #9aa6da; --pen: #ff9d8a; --line: rgb(203 212 255 / .25); --tape: rgb(150 125 60 / .55);
    --glare: rgb(255 255 255 / .05); --shadow: rgb(0 0 0 / .6); --mark: rgb(255 216 74 / .38); --soft: rgb(203 212 255 / .08);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--table); color: var(--ink); font: 17px/1.6 var(--read); padding-block: 22px max(30px, env(safe-area-inset-bottom, 0px)); padding-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px)); }
a { color: var(--pen); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 2px; }

/* the album page: yellowed sticky sheet, punched binding on the left, plastic glare on top */
.album { position: relative; overflow: hidden; max-width: 56rem; margin: 0 auto; background: var(--page); border: 1px solid var(--edge); border-radius: 3px; box-shadow: 0 12px 26px var(--shadow); padding-block: 6px 40px; padding-inline: calc(var(--bind) + var(--gut)) max(var(--gut), env(safe-area-inset-right, 0px)); }
.album::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--bind); border-right: 1px dashed var(--edge); background: radial-gradient(circle at 50% 50%, var(--table) 0 var(--hole), rgb(0 0 0 / .22) calc(var(--hole) + 1px), transparent calc(var(--hole) + 4px)) 0 0 / 100% 76px repeat-y; }
.album::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, var(--glare) 42%, transparent 52%, transparent 68%, var(--glare) 75%, transparent 82%); }
.top, main { position: relative; z-index: 1; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-block: 14px 8px; border-bottom: 1px dashed var(--line); }
.brand { font: 700 2.5rem/1.1 var(--hand); color: var(--ink); text-decoration: none; margin-right: auto; padding-block: 4px; }
.search { display: flex; gap: 10px; align-items: center; }
.search input { flex: 1; min-width: 0; }
.top .search { flex: 0 1 280px; }
input[type=search] { font: 500 1.35rem/1.2 var(--hand); color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px solid var(--ink2); border-radius: 0; padding: 10px 4px; min-height: 44px; -webkit-appearance: none; appearance: none; }
input[type=search]::placeholder { color: var(--ink2); opacity: .85; }
input[type=search]:focus-visible { outline-offset: 0; }
button, .btn { font: 700 1.3rem/1.1 var(--hand); min-height: 44px; padding: 8px 20px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--ink); color: var(--page); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.logout button { background: none; color: var(--ink2); border-color: transparent; font-size: 1.15rem; text-decoration: underline; text-underline-offset: 3px; padding-inline: 8px; }
@media (max-width: 640px) {
  :root { --bind: 20px; --hole: 4px; --gut: 14px; }
  body { padding-top: 0; padding-inline: 0; }
  .album { border-radius: 0; border-inline: 0; padding-inline-start: calc(var(--bind) + var(--gut)); padding-inline-end: max(var(--gut), env(safe-area-inset-right, 0px)); min-height: 100vh; }
  .top { padding-top: 10px; }
  .brand { font-size: 2.1rem; }
  .top .search { flex: 1 1 100%; order: 3; }
  .logout { order: 2; }
}

main { padding-top: 4px; }
h1 { font: 700 2.7rem/1.05 var(--hand); margin: 18px 0 6px; text-wrap: balance; overflow-wrap: anywhere; }
h2 { font: 700 1.85rem/1.15 var(--hand); margin: 1.4em 0 .4em; color: var(--ink); }
h3 { font: 700 1.5rem/1.2 var(--hand); margin: 1.2em 0 .3em; }
@media (max-width: 640px) { h1 { font-size: 2.3rem; } h2 { font-size: 1.65rem; } }
.lead { font: 500 1.55rem/1.2 var(--hand); color: var(--ink2); margin: 0 0 14px; }

.list { list-style: none; padding: 0; margin: 0; max-width: 40rem; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.list a { font: 500 1.5rem/1.2 var(--hand); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; display: inline-block; padding-block: 2px; }
.list a:hover { text-decoration: underline wavy var(--pen); text-underline-offset: 4px; }
.desc { display: block; color: var(--ink2); font: italic .92rem/1.4 var(--read); overflow-wrap: anywhere; }
.more { font: 700 1.5rem var(--hand); color: var(--pen); }

/* people as snapshots with initials, since the export carries no photos */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 20px; padding-block: 6px 4px; }
.ph5 { display: block; min-width: 0; color: var(--ink); text-decoration: none; transform: rotate(var(--r, 0deg)); --c1: #c9a77a; --c2: #8c6b52; }
.ph5:nth-child(4n+1) { --r: -1.6deg; } .ph5:nth-child(4n+2) { --r: 1.2deg; } .ph5:nth-child(4n+3) { --r: -.7deg; } .ph5:nth-child(4n) { --r: 1.8deg; }
.ph5:nth-child(6n+2) { --c1: #9fb0a4; --c2: #5f7068; } .ph5:nth-child(6n+3) { --c1: #d7a08a; --c2: #a0604e; }
.ph5:nth-child(6n+4) { --c1: #a8b4cc; --c2: #5e6f93; } .ph5:nth-child(6n+5) { --c1: #c8b27a; --c2: #8a7440; } .ph5:nth-child(6n) { --c1: #b99ab0; --c2: #7a5e78; }
.snap { display: grid; place-items: center; aspect-ratio: 1; border: 6px solid var(--snap); background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 2px 6px var(--shadow), inset 0 0 34px rgb(50 25 0 / .38); font: 700 clamp(2.4rem, 8vw, 3.4rem)/1 var(--hand); color: rgb(255 255 255 / .82); text-shadow: 0 1px 3px rgb(0 0 0 / .35); letter-spacing: .02em; }
.cap { display: block; margin-top: 8px; text-align: center; font: 700 1.3rem/1.1 var(--hand); overflow-wrap: anywhere; }
.cap small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font: 500 1.08rem/1.15 var(--hand); color: var(--ink2); }
@media (prefers-reduced-motion: no-preference) { .ph5 { transition: transform .18s; } .ph5:hover, .ph5:focus-visible { transform: rotate(0deg) translateY(-3px); } }
@media (max-width: 640px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } }

article { max-width: 42rem; }
.body { overflow-wrap: anywhere; }
.body h2 { border-bottom: 1px dashed var(--line); padding-bottom: 2px; }
.body p, .body ul, .body ol { margin: 0 0 .9em; }
.body ul, .body ol { padding-left: 1.4em; }
.body blockquote { margin: 1em 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--pen); font-style: italic; color: var(--ink2); }
.body code { font-size: .9em; background: var(--soft); padding: 1px 5px; border-radius: 3px; }
.body pre { overflow-x: auto; background: var(--soft); padding: 10px 12px; border-radius: 3px; }
.body pre code { background: none; padding: 0; }
.body hr { border: 0; border-top: 1px dashed var(--line); margin: 1.4em 0; }
.body table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 1em; }
.body th, .body td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.body th { background: var(--soft); font-family: var(--hand); font-size: 1.15rem; }

/* related pages: a note taped to the sheet */
.backlinks { position: relative; max-width: 42rem; margin-top: 38px; padding: 16px 18px 8px; background: var(--note); box-shadow: 0 3px 8px var(--shadow); transform: rotate(-.4deg); }
.backlinks::before { content: ""; position: absolute; top: -11px; left: 50%; width: 88px; height: 22px; margin-left: -44px; background: var(--tape); transform: rotate(-2.5deg); }
.backlinks h2 { margin-top: 0; font-size: 1.6rem; }

mark { background: linear-gradient(transparent 12%, var(--mark) 12% 92%, transparent 92%); color: inherit; padding: 0 2px; }
