@font-face { font-family: "Neue Einstellung"; src: url("/fonts/NeueEinstellung-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Neue Einstellung"; src: url("/fonts/NeueEinstellung-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Neue Einstellung"; src: url("/fonts/NeueEinstellung-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Advercase"; src: url("/fonts/Advercase-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }

:root {
  --navy: #03256c;      /* Worldport Navy */
  --clipper: #005395;   /* Clipper Blue */
  --deep: #0a4f78;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --paper: #f7f5f2;
  --line: rgba(3, 37, 108, .14);
  --white: #fff;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Neue Einstellung", system-ui, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.5; }
a { color: inherit; }
.caps { text-transform: uppercase; letter-spacing: .16em; }
.btn {
  display: inline-flex; align-items: center; gap: .45em; border: 1px solid var(--navy); color: var(--navy);
  background: transparent; padding: .55em 1em; border-radius: 999px; font: 500 14px/1 "Neue Einstellung", sans-serif;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.btn:hover, .btn:focus-visible { background: var(--navy); color: var(--white); outline: none; }
.btn.solid { background: var(--navy); color: var(--white); }
.btn.solid:hover { background: var(--clipper); border-color: var(--clipper); }
.btn.light { border-color: rgba(255,255,255,.7); color: var(--white); }
.btn.light:hover { background: var(--white); color: var(--navy); }
:focus-visible { outline: 2px solid var(--clipper); outline-offset: 2px; }

/* ---------- Bookshelf ---------- */
.hero { background: var(--deep) url("/assets/header-bg.jpg") center / cover; color: var(--white); text-align: center; padding: 48px 16px 56px; }
.hero img.logo { width: min(360px, 78vw); height: auto; display: block; margin: 0 auto 14px; }
.hero .tag { font-size: 12px; font-weight: 500; opacity: .95; margin-bottom: 28px; }
.hero h1 { font: 700 clamp(22px, 4vw, 34px)/1.2 "Neue Einstellung", sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.hero .sub { font-size: clamp(15px, 2.2vw, 18px); margin-top: 10px; opacity: .95; }
.hero .desc { max-width: 640px; margin: 18px auto 0; font-size: 15px; opacity: .9; }
main.shelf { max-width: 1160px; margin: 0 auto; padding: 40px 16px 24px; }
.section { margin-bottom: 44px; }
.section h2 { font: 400 clamp(26px, 3.4vw, 34px)/1.1 "Advercase", Georgia, serif; color: var(--navy); margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 40vw), 1fr)); gap: 26px clamp(14px, 3vw, 22px); }
.card { display: flex; flex-direction: column; }
.card .cover {
  display: block; aspect-ratio: 612 / 792; border-radius: 4px; overflow: hidden; background: #dfe7ee;
  box-shadow: 0 1px 2px rgba(3,37,108,.12), 0 10px 24px -8px rgba(3,37,108,.35); transition: transform .2s, box-shadow .2s;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .cover:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(3,37,108,.14), 0 18px 34px -10px rgba(3,37,108,.45); }
.card h3 { font-size: 16px; font-weight: 500; margin: 14px 0 10px; color: var(--navy); }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.card .actions .btn { font-size: 13px; padding: .5em .85em; }
footer.site { border-top: 1px solid var(--line); text-align: center; padding: 26px 16px 36px; color: var(--muted); font-size: 14px; }
footer.site a { text-decoration: none; color: var(--navy); font-weight: 500; }
footer.site .sep { margin: 0 .6em; opacity: .5; }

/* ---------- Viewer ---------- */
body.viewer { background: #17283d; color: var(--white); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.vbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(0,0,0,.18); }
.vbar .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.vbar .brand img { height: 22px; width: auto; flex: none; }
.vbar .title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.vbar .spacer { flex: 1; }
.vbar .btn { padding: .45em .8em; font-size: 13px; }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 18px 16px; min-height: 0; position: relative; }
#book { margin: 0 auto; }
.page { background: #dfe7ee; position: relative; overflow: hidden; }
.page img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.page a.hot { position: absolute; display: block; border-radius: 3px; }
.page a.hot:hover, .page a.hot:focus-visible { background: rgba(0, 83, 149, .14); outline: 1px solid rgba(0, 83, 149, .5); }
.single { box-shadow: 0 20px 50px -12px rgba(0,0,0,.55); max-height: calc(100dvh - 140px); aspect-ratio: var(--ar-w) / var(--ar-h); }
.single .page { width: 100%; height: 100%; }
.vnav { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 16px 16px; }
.vnav .count { font-size: 14px; min-width: 7em; text-align: center; opacity: .9; }
.vnav button:disabled { opacity: .35; cursor: default; }
.arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.12); color: var(--white); font-size: 22px; cursor: pointer; }
.arrow:hover { background: rgba(255,255,255,.24); }
.arrow.prev { left: 12px; } .arrow.next { right: 12px; }
.arrow:disabled { opacity: 0; pointer-events: none; }
@media (max-width: 640px) { .arrow { display: none; } .vbar .hide-sm { display: none; } }
body.embed .vbar { padding: 6px 10px; }
body.embed .stage { padding: 8px; }

/* modal */
dialog { border: 0; border-radius: var(--radius); padding: 24px; max-width: min(520px, calc(100vw - 32px)); width: 100%; color: var(--ink); }
dialog::backdrop { background: rgba(10, 20, 35, .6); }
dialog h2 { font: 400 26px/1.1 "Advercase", Georgia, serif; color: var(--navy); margin-bottom: 8px; }
dialog p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
dialog textarea, dialog input { width: 100%; font: 14px/1.4 ui-monospace, Menlo, monospace; padding: 10px; border: 1px solid #c9d3de; border-radius: 6px; }
dialog form.lead input { font-family: "Neue Einstellung", sans-serif; margin-bottom: 10px; }
dialog label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
dialog label.check input { width: auto; margin-top: 3px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--white); color: var(--navy);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* admin */
body.admin { padding: 24px 16px; max-width: 1100px; margin: 0 auto; }
body.admin h1 { font: 400 32px/1.1 "Advercase", Georgia, serif; color: var(--navy); margin-bottom: 16px; }
body.admin table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 28px; background: var(--white); }
body.admin th, body.admin td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); }
body.admin th:first-child, body.admin td:first-child { text-align: left; }
body.admin .wrap { overflow-x: auto; }

/* ---------- Book realism ---------- */
.shift { position: relative; z-index: 1; will-change: transform; }
.shift.ready { transition: transform .75s cubic-bezier(.45, .05, .25, 1); }  /* ease in and out with the turn */  /* lands with the page turn, then eases out */
/* shadows only on resting pages: redrawing a blurred shadow on the curling page every frame is what made turns stutter */
#book .page.--simple { box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .04); }
/* spine gutter: the inner edge of each open page darkens slightly, like paper bending into the binding */
#book .page.--simple.--left::after, #book .page.--simple.--right::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
#book .page.--simple.--left::after { background: linear-gradient(to left, rgba(0,0,0,.20), rgba(0,0,0,.06) 3%, rgba(0,0,0,0) 9%); }
#book .page.--simple.--right::after { background: linear-gradient(to right, rgba(0,0,0,.20), rgba(0,0,0,.06) 3%, rgba(0,0,0,0) 9%); }
#book .page.--simple.--right:first-child::after { background: linear-gradient(to right, rgba(0,0,0,.10), rgba(0,0,0,0) 4%); }

/* ---------- Viewer backgrounds ---------- */
body.viewer { --fg: #fff; --bar: rgba(0,0,0,.18); --wm: url("/assets/globe-white.svg"); --wm-op: .05; }
body.viewer .stage { overflow: hidden; }
.wm { position: absolute; left: 50%; top: 50%; width: min(118vh, 92vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: var(--wm) center / contain no-repeat; opacity: var(--wm-op); pointer-events: none; z-index: 0; will-change: transform; }
.stage .arrow { z-index: 2; }

/* 1. Navy globe: deep Worldport navy, soft spotlight, large faint globe */
body.viewer[data-bg="navy"] { background: radial-gradient(ellipse 80% 70% at 50% 45%, #183a63 0%, #0d2240 55%, #081628 100%); }

/* 2. Cover gradient: the brochure covers' dark-to-light blue, so the book sits in its own world */
body.viewer[data-bg="gradient"] { background: #0a4f78 url("/assets/cover-gradient.jpg") center / cover no-repeat; --wm-op: .07; --bar: rgba(5, 35, 60, .35); }

/* 3. Terminal white: light gate-grey room, navy type, blue globe; the page shadow does the work */
body.viewer[data-bg="light"] { background: radial-gradient(ellipse 80% 70% at 50% 45%, #fbfcfd 0%, #eef1f4 60%, #e3e8ed 100%);
  --fg: var(--navy); --bar: rgba(3, 37, 108, .06); --wm: url("/assets/globe-blue.svg"); --wm-op: .06; color: var(--navy); }
body.viewer[data-bg="light"] .btn.light { border-color: rgba(3,37,108,.55); color: var(--navy); }
body.viewer[data-bg="light"] .btn.light:hover { background: var(--navy); color: #fff; }
body.viewer[data-bg="light"] .arrow { background: rgba(3,37,108,.08); color: var(--navy); }
body.viewer[data-bg="light"] .arrow:hover { background: rgba(3,37,108,.16); }
body.viewer[data-bg="light"] .vbar .brand img { content: url("/assets/logo-blue.svg"); }
body.viewer[data-bg="light"] #book .page.--simple { box-shadow: 0 18px 40px -16px rgba(3, 37, 108, .45), 0 0 0 1px rgba(3, 37, 108, .06); }

/* 4. Clipper blue: Pan Am's signature blue with fine latitude lines, a nod to the jet-age globe */
body.viewer[data-bg="clipper"] { background:
  repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 34px),
  radial-gradient(ellipse 80% 70% at 50% 45%, #0a65ad 0%, #005395 55%, #003f73 100%); --wm-op: .08; }

body.viewer .vbar { background: var(--bar); position: relative; z-index: 3; }
body.viewer .vnav { position: relative; z-index: 3; color: var(--fg); }

/* review picker (only with ?options=1) */
.picker { position: fixed; left: 16px; bottom: 16px; z-index: 5; display: flex; gap: 6px; align-items: center;
  background: rgba(255,255,255,.96); color: var(--navy); padding: 6px 8px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 13px; }
.picker[hidden] { display: none; }
.picker span { padding: 0 6px; font-weight: 500; }
.picker button { border: 1px solid rgba(3,37,108,.3); background: #fff; color: var(--navy); border-radius: 999px; padding: 5px 10px; font: 500 12px "Neue Einstellung", sans-serif; cursor: pointer; }
.picker button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (max-width: 900px) { .picker { flex-wrap: wrap; justify-content: center; border-radius: 14px; left: 12px; right: 12px; top: 60px; bottom: auto; } }

/* ---------- Bookshelf watermark ---------- */
body.wm-blue, body.wm-grey { position: relative; }
body.wm-blue::before, body.wm-grey::before { content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: min(86vw, 86vh, 1000px); aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); background: center / contain no-repeat; }
body.wm-blue::before { background-image: url("/assets/globe-blue.svg"); opacity: .055; }
body.wm-grey::before { background-image: url("/assets/globe-grey.svg"); opacity: .09; }
body.wm-blue main.shelf, body.wm-grey main.shelf { position: relative; }
/* white page controls on the cover gradient; a soft shadow keeps them readable on the pale foot */
body.viewer[data-bg="gradient"] .vnav { color: #fff; text-shadow: 0 1px 6px rgba(5, 35, 60, .35); }
body.viewer[data-bg="gradient"] .vnav .btn.light { border-color: rgba(255,255,255,.85); color: #fff; }
body.viewer[data-bg="gradient"] .vnav .btn.light:hover { background: #fff; color: var(--navy); text-shadow: none; }
