/* Užrašai, the book: carried over from the flight (../skrydis/index.html) */
    /* Užrašai: a book of two pages on paper, ribbons for its sections, a leaf that turns */
#book { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 20;
  background: rgba(12, 16, 22, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); perspective: 2200px; }
#book.shown { display: flex; animation: bookIn .45s ease; }
@keyframes bookIn { from { opacity: 0; } to { opacity: 1; } }
.book { position: relative; width: min(940px, 94vw); height: min(620px, 84vh); display: grid; grid-template-columns: 1fr 1fr;
  color: #2b2620; transform-style: preserve-3d; animation: bookOpen .5s cubic-bezier(.2,.8,.2,1); }
@keyframes bookOpen { from { transform: translateY(18px) rotateX(8deg); } to { transform: none; } }
.book::before { content: ''; position: absolute; inset: -10px -12px; border-radius: 10px; z-index: -1;
  background: linear-gradient(135deg, #5b3a26, #3c2618); box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.page { position: relative; overflow: hidden; padding: 38px 44px 46px;
  background: radial-gradient(ellipse at 50% 40%, #f7f0df 0%, #efe4cb 75%, #e6d7b6 100%); }
.page::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(120, 90, 50, .06) 1px, transparent 1px); background-size: 3px 3px; }
.page.left { border-radius: 6px 0 0 6px; box-shadow: inset -30px 0 40px -30px rgba(80, 55, 25, .45); }
.page.right { border-radius: 0 6px 6px 0; box-shadow: inset 30px 0 40px -30px rgba(80, 55, 25, .45); }
.page .content { position: relative; z-index: 1; height: 100%; overflow: auto; scrollbar-width: thin; }
.gutter { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); background: rgba(80, 55, 25, .25); z-index: 2; }
.folio { position: absolute; bottom: 16px; font-size: 12px; opacity: .5; font-style: italic; z-index: 1; }
.left .folio { left: 44px; } .right .folio { right: 44px; }
.book h1 { font-weight: 400; margin: 0; font-size: 42px; letter-spacing: .01em; }
.book h2 { font-weight: 400; font-style: italic; margin: 0 0 6px; font-size: 26px; }
.book h2 small { font-style: normal; font-size: 14px; opacity: .55; margin-left: 6px; }
.book .hint { font-size: 13px; opacity: .6; margin: 0 0 14px; }
.book kbd { background: rgba(80, 55, 25, .08); border-color: rgba(80, 55, 25, .25); }
/* The ribbons: bookmarks hanging from the top edge, one per section */
.ribbons { position: absolute; top: -10px; right: 34px; display: flex; gap: 6px; z-index: 5; }
.ribbons button { padding: 22px 10px 12px; border-radius: 0 0 4px 4px; color: #fbf3e2; font-size: 13px; letter-spacing: .03em;
  background: #8b3a2b; box-shadow: 0 3px 8px rgba(0,0,0,.25); transition: padding .25s, background .25s; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%); }
.ribbons button:nth-child(2) { background: #3d4f73; } .ribbons button:nth-child(3) { background: #6b5a2e; } .ribbons button:nth-child(4) { background: #3f5a48; }
.ribbons button.on { padding-top: 32px; }
.ribbons button:hover { padding-top: 28px; }
.corner { position: absolute; bottom: 8px; z-index: 5; width: 40px; height: 40px; font-size: 26px; line-height: 1; color: #6b4d2f; border-radius: 50%; }
.corner.prev { left: 8px; } .corner.next { right: 8px; }
.corner:disabled { opacity: .15; cursor: default; }
.shut { position: absolute; top: 6px; left: 10px; z-index: 5; font-size: 22px; color: #6b4d2f; }
/* The title page */
.title-page { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.title-page .stork { width: 120px; fill: #2b2620; opacity: .8; margin-bottom: 12px; }
.title-page h1 { font-size: 54px; }
.title-page .sub { font-style: italic; margin: 4px 0 22px; opacity: .75; }
.title-page .lead { max-width: 300px; font-size: 15px; line-height: 1.5; }
.title-page .sum { margin-top: 26px; font-size: 14px; line-height: 1.7; }
.toc { list-style: none; padding: 0; margin: 18px 0 26px; }
.toc button { width: 100%; display: flex; align-items: baseline; gap: 8px; font-size: 20px; padding: 8px 0; border-radius: 0; }
.toc i { flex: 1; border-bottom: 1px dotted rgba(43, 38, 32, .4); transform: translateY(-5px); }
.toc span:last-child { font-size: 15px; opacity: .65; }
.forget { margin-top: 30px; font-size: 12px; opacity: .5; padding: 4px 0; }
/* The words' index */
.word-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.word-grid button { width: 100%; text-align: left; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; padding: 6px 8px; border-radius: 6px; }
.word-grid .no { grid-row: span 2; font-size: 12px; opacity: .45; padding-top: 4px; }
.word-grid .name { font-size: 19px; font-style: italic; }
.word-grid .unknown .name { font-style: normal; font-size: 18px; width: 26px; height: 26px; line-height: 24px; text-align: center;
  border: 1px solid rgba(43, 38, 32, .35); border-radius: 50%; opacity: .6; }
.word-grid .when { font-size: 11px; opacity: .5; letter-spacing: .04em; }
.word-grid .when em { font-style: normal; margin-left: 6px; font-size: 9px; }
.word-grid button.on, .animal-grid button.on { background: rgba(139, 58, 43, .1); }
/* An entry's page */
.entry h1 { font-size: 46px; margin-top: 6px; }
.entry .syllables { font-size: 21px; letter-spacing: .05em; color: #5a5148; margin: 2px 0 18px; }
.entry .syllables b { color: #9a3d23; font-weight: 600; }
.entry .syllables i { font-style: normal; opacity: .4; margin: 0 .3em; }
.entry .definition { font-size: 18px; line-height: 1.5; margin: 0 0 18px; }
.entry .note { font-style: italic; font-size: 16px; line-height: 1.55; border-top: 1px solid rgba(43, 38, 32, .15); padding-top: 14px; margin: 0; }
.entry .tags { font-size: 12px; opacity: .55; margin-top: 8px; }
.entry .found-on { font-size: 12px; opacity: .5; margin-top: 26px; font-style: italic; }
.unknown-page, .empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; }
.big-q { font-size: 110px; line-height: 1; opacity: .25; }
.big-q.over { position: absolute; top: 50%; transform: translateY(-75%); opacity: .45; color: #f7f0df; }
/* The animals' index: silhouettes until met */
.animal-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.animal-grid button { width: 100%; aspect-ratio: 1 / 1.08; position: relative; padding: 4px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; }
.animal-grid .figure { width: 100%; flex: 1; }
.animal-grid .name { font-size: 11px; line-height: 1.2; min-height: 1.2em; text-align: center; }
.animal-grid .q { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; color: #f4ecda; text-shadow: 0 0 6px rgba(0,0,0,.4); }
.figure { display: block; background-repeat: no-repeat; background-position: 0 0; }
.figure.shadow { filter: brightness(0); opacity: .55; }
.figure.large { width: 220px; height: 220px; margin: 0 auto; }
.entry.animal { text-align: center; }
/* Turning a leaf over the gutter */
.leaf { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; backface-visibility: hidden; pointer-events: none; }
.leaf.turn-next { right: 0; transform-origin: left center; animation: turnNext .6s ease-in-out forwards; }
.leaf.turn-prev { left: 0; transform-origin: right center; animation: turnPrev .6s ease-in-out forwards; }
@keyframes turnNext { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes turnPrev { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
.slide-next .page { animation: slideNext .35s ease; } .slide-prev .page { animation: slidePrev .35s ease; }
@keyframes slideNext { from { transform: translateX(30px); opacity: .3; } } @keyframes slidePrev { from { transform: translateX(-30px); opacity: .3; } }
/* A phone: one page at a time; choosing an entry turns to its page, ‹ goes back */
/* The scene where something was met, kept as a small picture at the head of its page */
.entry figure.scene { margin: -6px 0 14px; padding: 6px 6px 18px; background: #fbf7ec; box-shadow: 0 2px 8px rgba(60,40,20,.25); transform: rotate(-1.2deg); }
.entry figure.scene img { display: block; width: 100%; border-radius: 1px; filter: sepia(.12) saturate(.95); }
.entry.animal figure.scene { max-width: 300px; margin: 0 auto 10px; }
/* Pressed plants */
.plant-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.plant-grid button { width: 100%; aspect-ratio: 1 / 1.25; position: relative; padding: 4px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; }
.plant-grid .name { font-size: 11px; line-height: 1.2; min-height: 2.4em; text-align: center; }
.plant-grid .q { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; opacity: .55; }
.pressed { display: block; width: 100%; flex: 1; background: no-repeat center bottom / contain; }
.pressed.shadow { filter: brightness(0); opacity: .14; }
.pressed.large { width: 200px; height: 236px; margin: 0 auto 8px; }
.entry.plant { text-align: center; }
.entry .latin { font-style: italic; opacity: .6; margin: -2px 0 12px; }
/* The map of the way */
.journey { width: 100%; height: auto; display: block; }
.journey .way { fill: none; stroke: rgba(80, 55, 25, .3); stroke-width: 2; stroke-dasharray: 3 5; }
.journey .inked { fill: none; stroke: #6b3a24; stroke-width: 2.6; stroke-linecap: round; }
.journey .region { font: italic 13px "Iowan Old Style", Georgia, serif; fill: rgba(60, 40, 20, .55); }
.journey .word { font: 11px "Iowan Old Style", Georgia, serif; fill: #3b2b1e; }
.journey circle.found { fill: #9a3d23; }
.journey circle.unfound { fill: none; stroke: rgba(80, 55, 25, .5); stroke-width: 1.2; }
.journey .beast { fill: #3f5a48; }
.journey .here { fill: rgba(255, 210, 140, .5); stroke: #9a3d23; stroke-width: 1.5; }
.map-key { margin: 4px 0 0; text-align: center; }
.page.right .journey { margin-top: 34px; }
.ribbons button:nth-child(5) { background: #5a3d6b; }

/* A field guide's facts for an animal */
.entry.animal .latin { margin-top: -4px; }
.redbook { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 12px; background: rgba(160, 40, 30, .12); color: #8b2a1f; font-size: 13px; }
.facts { text-align: left; margin: 6px 0 0; font-size: 15px; line-height: 1.45; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin-top: 10px; }
.facts dd { margin: 2px 0 0; }
/* The log */
.log { list-style: none; padding: 0; margin: 6px 0 0; }
.log button { width: 100%; text-align: left; padding: 5px 6px; border-radius: 5px; font-size: 15px; }
.log .when { display: block; font-size: 11px; opacity: .5; }
.log i { opacity: .6; font-size: 13px; }
.ribbons { gap: 4px; }
.ribbons button { padding: 22px 8px 12px; font-size: 12px; }
.ribbons button:nth-child(6) { background: #2f4f5a; }

/* ---- Tidier pages ---- */
/* The ribbons hang over the right page's top margin, so that page starts below them */
.page.right { padding-top: 74px; }
.book a { color: #7a3a22; text-decoration: none; border-bottom: 1px dotted rgba(122, 58, 34, .5); }
.book a:hover { border-bottom-style: solid; }
.about { margin-top: 6px; font-size: 12px; opacity: .7; }
.about summary { cursor: pointer; list-style: none; opacity: .8; }
.about summary::before { content: '▸ '; } .about[open] summary::before { content: '▾ '; }
.about .credits { margin: 6px 0 0; line-height: 1.5; }
.title-page .sum { line-height: 1.8; }
.toc { margin-top: 10px; }

/* Pictures that open large */
.page [data-zoom], .figure.zoomable { cursor: zoom-in; position: relative; }
.entry figure.scene { position: relative; }
.entry figure.scene::after, .pressed[data-zoom]::after { content: '⤢'; position: absolute; right: 8px; bottom: 6px; width: 22px; height: 22px; line-height: 22px;
  text-align: center; font-size: 13px; border-radius: 50%; background: rgba(251, 247, 236, .85); color: #6b4d2f; opacity: .75; }
.zoom { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(10, 12, 16, .82); cursor: zoom-out; animation: bookIn .25s ease; padding: 24px; }
.zoom[hidden] { display: none; }
.zoom .frame { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: transparent; }
.zoom .figure.zoomed { width: min(70%, 70vh); aspect-ratio: 1; height: auto; max-height: 100%; }
.zoom .caption { margin: 0; color: #f3ead6; font-size: 16px; font-style: normal; text-align: center; }
.zoom .caption i { opacity: .7; }
.zoom .shut { position: absolute; top: 10px; right: 14px; left: auto; color: #f3ead6; font-size: 28px; }

/* ---- One page at a time (a narrow window): a list, and choosing one turns to its page; ‹ goes back ---- */
#book.single .book { grid-template-columns: 1fr; width: 94%; height: 88%; }
#book.single .page.right, #book.single .gutter { display: none; }
#book.single .book.detail .page.left { display: none; }
#book.single .book.detail .page.right { display: block; border-radius: 6px; }
#book.single .page.left { border-radius: 6px; padding-top: 74px; }
#book.single .ribbons { right: 10px; left: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- A phone, sideways: the book fills the screen, the ribbons become tabs down its right edge ---- */
#book.compact { background: rgba(12, 16, 22, .6); }
#book.compact .book { width: calc(100% - 92px - env(safe-area-inset-left) - env(safe-area-inset-right)); height: calc(100% - 20px);
  margin-right: 70px; margin-left: env(safe-area-inset-left); }
#book.compact .book::before { inset: -6px -8px; border-radius: 8px; }
#book.compact .page { padding: 18px 20px 26px; }
#book.compact .page.right { padding-top: 18px; }
#book.compact .page.left { padding-top: 40px; }
#book.compact .ribbons { top: 6px; right: -78px; flex-direction: column; gap: 3px; }
#book.compact .ribbons button { padding: 9px 12px 9px 18px; font-size: 12px; text-align: left; border-radius: 0 4px 4px 0;
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%); transition: transform .2s; }
#book.compact .ribbons button.on { padding-top: 9px; transform: translateX(8px); }
#book.compact .ribbons button:hover { padding-top: 9px; }
#book.compact .shut { top: 4px; left: 6px; }
#book.compact .folio { display: none; }
#book.compact .corner { width: 34px; height: 34px; font-size: 22px; bottom: 2px; }
#book.compact h1, #book.compact .entry h1 { font-size: 28px; }
#book.compact h2 { font-size: 20px; }
#book.compact .hint { font-size: 12px; margin-bottom: 8px; }
#book.compact .title-page .stork { width: 70px; margin-bottom: 4px; }
#book.compact .title-page h1 { font-size: 36px; }
#book.compact .title-page .sub { margin: 2px 0 10px; }
#book.compact .title-page .lead { font-size: 13px; }
#book.compact .title-page .sum { margin-top: 10px; font-size: 13px; }
#book.compact .toc { margin: 4px 0 12px; }
#book.compact .toc button { font-size: 16px; padding: 5px 0; }
#book.compact .entry .syllables { font-size: 16px; margin-bottom: 10px; }
#book.compact .entry .definition { font-size: 15px; margin-bottom: 10px; }
#book.compact .entry .note { font-size: 14px; padding-top: 8px; }
#book.compact .entry .found-on { margin-top: 12px; }
#book.compact .facts { font-size: 13px; }
/* The picture beside the text, not above it: the page is short */
#book.compact .entry figure.scene { float: right; width: 46%; margin: 2px 0 8px 12px; padding: 4px 4px 12px; }
#book.compact .entry.animal, #book.compact .entry.plant { text-align: left; }
#book.compact .entry.animal figure.scene { max-width: none; margin: 2px 0 8px 12px; }
#book.compact .figure.large { float: right; width: 120px; height: 120px; margin: 0 0 6px 10px; }
#book.compact .pressed.large { float: right; width: 110px; height: 130px; margin: 0 0 6px 10px; }
#book.compact .unknown-page .figure.large, #book.compact .unknown-page .pressed.large { float: none; margin: 0 auto; }
#book.compact .big-q { font-size: 70px; }
#book.compact .word-grid { gap: 2px 10px; }
#book.compact .word-grid button { padding: 3px 6px; }
#book.compact .word-grid .name { font-size: 16px; }
#book.compact .animal-grid, #book.compact .plant-grid { gap: 4px; }
#book.compact .page.right .journey { margin-top: 6px; }
#book.compact .journey { max-height: calc(100% - 40px); }
#book.compact .log button { font-size: 14px; padding: 3px 6px; }
#book.compact .zoom { padding: 12px 70px 12px 12px; }

/* Užduotys: what was asked of the light */
.quests { list-style: none; padding: 0; margin: 10px 0 0; }
.quest { padding: 10px 0 12px; border-bottom: 1px dotted rgba(43, 38, 32, .3); }
.quest b { font-size: 19px; font-weight: 600; }
.quest.done b { color: #4d6b3a; }
.quest.unknown b { font-size: 26px; opacity: .45; }
.quest p { margin: 4px 0 0; }
.quest .when { font-size: 12px; opacity: .6; }
.quest .again { color: inherit; }
