/* World Explorer Journal — styles
 * Colours and fonts are placeholders until the Voyage Pages brand is applied.
 * Fonts are system fonts for now so the app works fully offline;
 * brand fonts will be self-hosted in /fonts and added to the service worker cache.
 */
:root {
  --bg: #EEF1F4; --page: #FFFFFF; --ink: #1E2A3B; --muted: #5D6B7E; --line: #D5DCE5; --soft: #E4E9EF;
  --navy: #2B3A55; --teal: #21897D; --coral: #D9603F; --amber: #C77F16; --green: #4C7E31; --plum: #74468C; --blue: #2F6DB8;
  --font-display: "Trebuchet MS", "Avenir Next Rounded", "Nunito", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121821; --page: #1B2330; --ink: #E8EDF3; --muted: #9AA8B9; --line: #334052; --soft: #253041;
    --navy: #9FB2D6; --teal: #4CC2B3; --coral: #F08A6B; --amber: #E8A94A; --green: #86BE66; --plum: #B78BD0; --blue: #6FA3E8;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; text-wrap: balance; margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* shell */
.app { display: grid; grid-template-columns: 96px 1fr; height: 100%; }
.rail { background: var(--page); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 14px 8px; overflow-y: auto; }
.brand { display: grid; place-items: center; margin-bottom: 10px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.navbtn { border: 0; background: transparent; border-radius: 12px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 700; min-height: 44px; }
.navbtn svg { width: 26px; height: 26px; }
.navbtn[aria-current="page"] { background: color-mix(in srgb, var(--sec) 16%, transparent); color: var(--sec); }
main { overflow-y: auto; padding-block: 24px 96px; padding-inline: max(16px, 3vw); }
.wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .brand { display: none; }
  .navbtn { padding: 6px 2px; font-size: 11px; flex: 1; }
  main { padding-block: 16px 24px; }
}

/* building blocks */
.eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.title { font-size: clamp(28px, 5vw, 40px); color: var(--sec, var(--ink)); }
.page { background: var(--page); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.page h2 { font-size: 22px; }
.page p { margin: 0; }
.hint { color: var(--muted); font-size: 15px; margin: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14.5px; min-width: 0; }
input[type=text] { width: 100%; border: 1.5px solid var(--line); background: var(--page); border-radius: 10px; padding: 10px 12px; font-weight: 400; font-size: 16px; }
input:focus { border-color: var(--sec, var(--blue)); outline: none; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; background: var(--sec, var(--navy)); color: var(--page);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--sec, var(--navy)); border: 2px solid currentColor; }
.btn.small { padding: 6px 14px; min-height: 40px; font-size: 14.5px; }
.btn.danger { background: transparent; color: var(--coral); border: 2px solid var(--coral); }
.btn:disabled { opacity: .5; cursor: default; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.choice button { border: 2px solid var(--line); background: var(--page); border-radius: var(--r); padding: 18px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 4px; min-height: 44px; }
.choice button[aria-pressed="true"] { border-color: var(--sec, var(--navy)); background: color-mix(in srgb, var(--sec, var(--navy)) 8%, var(--page)); }
.choice b { font-family: var(--font-display); font-size: 20px; }
.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-radius: var(--r); padding: 12px 16px; font-size: 15px;
  background: color-mix(in srgb, var(--sec, var(--amber)) 13%, var(--page)); border: 1px dashed var(--sec, var(--amber)); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.meter { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--teal); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.journal-list { display: flex; flex-direction: column; gap: 8px; }
.journal-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.journal-item[aria-current="true"] { border-color: var(--teal); }
.placeholder { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; color: var(--muted); }
.banner-area { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 20; width: min(92vw, 560px); }
@media (min-width: 701px) { .banner-area { bottom: 24px; } }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--page);
  border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14.5px; z-index: 30; }
.welcome { max-width: 620px; margin: 0 auto; }
.welcome .logo { width: 72px; height: 72px; border-radius: 18px; }
