/* HAIZ · 校园活着 — the sketchbook, the living map, a passing word. */
:root { --lf-paper: #eee5cf; --lf-ink: #2a2620; --lf-cloth: #2f4a3c; --lf-seal: #b0201c; }

/* the map's button: a small sketchbook */
.lf-map-btn { display: inline-flex; align-items: center; gap: 7px; }
.lf-map-btn i { width: 15px; height: 18px; border-radius: 2px 3px 3px 2px; background: var(--lf-cloth); box-shadow: inset 3px 0 0 rgba(0,0,0,.25), 1px 1px 0 rgba(0,0,0,.15); position: relative; }
.lf-map-btn i::after { content: ''; position: absolute; left: 6px; top: 6px; width: 5px; height: 5px; border-radius: 1px; background: var(--lf-seal); opacity: .85; }

/* a word from someone passing */
.lf-line { position: absolute; left: 50%; bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px)); transform: translateX(-50%); margin: 0; max-width: min(560px, calc(100vw - 32px));
  color: #fbf8f0; text-shadow: 0 1px 10px rgba(10, 25, 30, .7), 0 0 2px rgba(10, 25, 30, .5); font: 16px/1.5 "Songti SC", "Noto Serif SC", serif; text-align: center; pointer-events: none;
  opacity: 0; transition: opacity .7s var(--ease, ease); }
.lf-line.on { opacity: 1; }
.lf-line b { font-weight: 600; margin-right: .5em; opacity: .85; }

/* the book */
.lf-map { position: fixed; inset: 0; z-index: 7; display: grid; place-items: center; perspective: 1600px; }
.lf-map[hidden], .lf-line[hidden], .lf-card[hidden] { display: none; }
.lf-map::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 100% at 50% 60%, rgba(20, 28, 26, .22), rgba(12, 18, 16, .55)); opacity: 0; transition: opacity .5s ease; }
.lf-map.on::before { opacity: 1; }
.lf-book { position: relative; width: min(1180px, calc(100vw - 28px)); height: min(820px, calc(100vh - 28px)); height: min(820px, calc(100dvh - 28px));
  transform: translateY(70vh) rotateX(32deg) scale(.86); transform-origin: 50% 100%; transition: transform .75s cubic-bezier(.2, .9, .25, 1); transform-style: preserve-3d; }
.lf-map.on .lf-book { transform: none; }
.lf-page { position: absolute; inset: 0; border-radius: 4px 10px 10px 4px; overflow: hidden; background: var(--lf-paper);
  box-shadow: 0 30px 60px rgba(10, 20, 15, .45), 0 2px 0 rgba(255,255,255,.4) inset, -14px 0 24px -16px rgba(0, 0, 0, .45) inset; }
.lf-page::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 26px; background: linear-gradient(90deg, rgba(60, 45, 25, .28), rgba(60, 45, 25, 0)); pointer-events: none; z-index: 2; }
#lf-map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#lf-map-canvas:active { cursor: grabbing; }
.lf-cover { position: absolute; inset: 0; border-radius: 4px 10px 10px 4px; transform-origin: 0 50%; backface-visibility: hidden; z-index: 3;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px), linear-gradient(135deg, #36574a, #243c32);
  box-shadow: 0 30px 60px rgba(10, 20, 15, .45), inset 6px 0 0 rgba(0,0,0,.25); display: grid; place-items: center; transition: transform .9s cubic-bezier(.45, 0, .2, 1) .45s; }
.lf-cover span { font: 500 20px/1 "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif; letter-spacing: .4em; color: #e7dcc0; border: 1px solid rgba(231, 220, 192, .5); padding: 14px 18px 14px 26px; }
.lf-map.on .lf-cover { transform: rotateY(-178deg); }
.lf-map-head { position: absolute; left: 30px; top: 16px; display: flex; align-items: flex-start; gap: 12px; pointer-events: none; z-index: 2; }
.lf-map-title { margin: 0; display: flex; flex-direction: column; color: var(--lf-ink); }
.lf-map-title b { font: 600 22px/1.2 "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Songti SC", serif; letter-spacing: .12em; }
.lf-map-title span { font: 13px/1.5 "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Songti SC", serif; opacity: .75; }
.lf-seal { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; margin-top: 2px; background: var(--lf-seal); color: #f6e9d8; border-radius: 3px;
  font: 600 12px/1.15 "Songti SC", "Noto Serif SC", serif; text-align: center; opacity: .9; transform: rotate(-3deg); }
.lf-map-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px 30px; pointer-events: none; z-index: 2; }
.lf-map-foot > * { pointer-events: auto; }
.lf-map-foot button { border: 1px solid rgba(42, 38, 32, .35); background: rgba(238, 229, 207, .85); color: var(--lf-ink); border-radius: 999px; padding: 6px 13px; cursor: pointer; font: 13px/1 "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif; }
.lf-map-foot button[aria-pressed="true"] { background: #2a2620; color: #eee5cf; }
.lf-map-foot kbd { font: 11px/1 ui-monospace, monospace; opacity: .6; margin-left: 4px; }
.lf-map-note { margin: 0 auto 0 0; font: 12px/1.4 "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif; color: rgba(42, 38, 32, .6); }
.lf-card { position: absolute; right: 18px; top: 60px; width: min(280px, calc(100% - 36px)); background: rgba(246, 240, 225, .96); border: 1px solid rgba(42, 38, 32, .2);
  border-radius: 6px; padding: 12px 14px; color: var(--lf-ink); font: 13px/1.6 "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Songti SC", serif; box-shadow: 0 8px 24px rgba(40, 30, 10, .18); z-index: 2; }
.lf-card h3 { margin: 0; font-size: 18px; } .lf-card h3 small { font-size: 12px; opacity: .65; margin-left: 8px; font-weight: 400; }
.lf-card p { margin: 6px 0 0; } .lf-card .lf-now { font-size: 14px; } .lf-card .lf-far { opacity: .7; font-size: 12px; }
.lf-card button { margin-top: 8px; border: 0; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; font: inherit; opacity: .8; }
@media (max-width: 600px) {
  .lf-book { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .lf-map-head { left: 22px; top: 12px; } .lf-map-title b { font-size: 19px; }
  .lf-map-note { display: none; }
  .lf-card { top: auto; bottom: 58px; right: 10px; width: calc(100% - 20px); }
  .lf-map-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lf-book, .lf-cover { transition: none !important; } }
