/* Float a river (the shared look for /learn/experiences/float/kam/, /learn/experiences/float/french/...): a full-screen river with cards over it. Tokens come from /about/about.css. */
html, body.river { height: 100%; }
body.river { margin: 0; overflow: hidden; background: #2f4a2c; color: var(--fg); font-family: var(--body); }
#scene, #scene3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#scene3d { touch-action: none; cursor: grab; }
#scene3d:active { cursor: grabbing; }
.river .card { background: var(--glass); border: 1px solid var(--rule); border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.k-top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 10px; background: linear-gradient(rgba(6,14,17,0.82), rgba(6,14,17,0)); }
.k-top .brand { white-space: nowrap; }
.k-where { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.k-where b { font: 600 22px/1.05 var(--display); letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.k-top-btns { display: flex; gap: 6px; }
.k-top .btn, .k-bar .btn { font-size: 13px; padding: 7px 11px; }

.k-gauges { position: fixed; z-index: 4; right: 16px; top: 72px; width: 230px; padding: 10px 12px 8px; }
.k-gtoggle { display: none; }
#minimap, #profile { display: block; width: 100%; height: auto; }
.k-read { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0; }
.k-read div:last-child { grid-column: 1 / -1; }
.k-read dt { font: 500 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.k-read dd { margin: 1px 0 0; font-size: 13.5px; line-height: 1.3; }
.k-tiny { margin: 6px 0 0; font-size: 10.5px; line-height: 1.35; color: var(--dim); }

.k-toast { position: fixed; z-index: 3; left: 50%; top: 84px; transform: translateX(-50%); width: min(520px, calc(100% - 300px)); margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(6,14,17,0.72); border: 1px solid var(--rule); font-size: 14.5px; line-height: 1.45; text-align: center; opacity: 0; transition: opacity 0.8s; pointer-events: none; }
.k-toast.on { opacity: 1; }

.k-card { position: fixed; z-index: 6; left: 16px; top: 72px; bottom: 76px; width: min(430px, calc(100% - 32px)); padding: 16px 18px 18px; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.k-card h2 { margin: 2px 0 10px; font: 600 28px/1.05 var(--display); letter-spacing: 0.02em; }
.k-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; }
.k-card .ask { margin: 14px 0 8px; font-weight: 600; }
.k-card .choices { display: flex; flex-direction: column; gap: 7px; }
.k-card .choices .btn { text-align: left; white-space: normal; line-height: 1.35; padding: 9px 12px; font-size: 14.5px; }
.k-card .choices .btn[data-tried="no"] { border-color: rgba(243,185,74,0.6); opacity: 0.75; }
.k-card .choices .btn[data-tried="yes"] { border-color: var(--aqua); background: rgba(134,217,221,0.14); }
.k-card .reply { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; line-height: 1.5; }
.k-card .reply.no { border: 1px solid rgba(243,185,74,0.55); background: rgba(243,185,74,0.1); }
.k-card .reply.yes { border: 1px solid rgba(134,217,221,0.55); background: rgba(134,217,221,0.1); }
.k-card .reply b:first-child { display: block; margin-bottom: 3px; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.k-card .reply.no b:first-child { color: var(--amber); }
.k-card .reply.yes b:first-child { color: var(--aqua); }
.k-card .go { margin-top: 12px; width: 100%; }
.k-card .learn { margin: 12px 0 0; font-size: 13px; color: var(--dim); }
.k-card .learn a { white-space: nowrap; }
.k-card .fact { margin: 10px 0; padding: 9px 12px; border-left: 3px solid var(--aqua); background: rgba(134,217,221,0.06); border-radius: 0 9px 9px 0; font-size: 14px; }

.k-flow { margin: 12px 0 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule); background: rgba(255,255,255,0.03); }
.k-flow label { display: block; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.k-flow input { width: 100%; margin: 8px 0 2px; accent-color: var(--aqua); }
.k-flow .ticks { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--dim); }
.k-flow .val { font: 600 22px var(--display); }
.k-flow .status { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.k-flow .pill { padding: 2px 9px; border-radius: 999px; font: 500 11.5px var(--mono); border: 1px solid var(--rule); }
.k-flow .pill.open { border-color: rgba(134,217,221,0.6); color: var(--aqua); }
.k-flow .pill.closed { border-color: rgba(243,185,74,0.7); color: var(--amber); }
.k-flow p { margin: 4px 0 0; font-size: 13.5px; }

.k-bar { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.k-bar .btn { background: var(--glass); }

.k-intro, .k-notes { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(4,10,12,0.55); overflow-y: auto; }
.k-intro[hidden], .k-notes[hidden] { display: none; }
.k-intro-in, .k-notes-in { position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; background: rgba(9,16,19,0.92); }
.k-intro h1 { margin: 6px 0 8px; font: 800 clamp(40px, 8vw, 64px)/0.95 var(--display); letter-spacing: 0.01em; }
.k-intro ul { padding-left: 20px; }
.k-intro li { margin: 6px 0; line-height: 1.5; }
.k-intro-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.k-notes-in { width: min(760px, 100%); }
.k-notes-in .close { position: absolute; top: 12px; right: 12px; }
.k-notes h3 { margin: 22px 0 4px; font: 600 22px var(--display); }
.k-notes h3 small { display: block; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--aqua); }
.k-notes p, .k-notes li { line-height: 1.55; }
.k-notes .ans { font-size: 14px; color: var(--dim); }

.k-fade { position: fixed; z-index: 9; inset: 0; display: grid; place-items: center; padding: 24px; background: #061015; opacity: 0; pointer-events: none; transition: opacity 0.6s; text-align: center; }
.k-fade.on { opacity: 1; pointer-events: auto; }
.k-fade p { max-width: 520px; font: 500 clamp(18px, 2.6vw, 24px)/1.45 var(--body); }

@media (max-width: 760px) {
  .k-top { padding: max(8px, env(safe-area-inset-top)) 10px 8px; gap: 8px; }
  .k-top .brand { display: none; }
  .k-where { align-items: flex-start; text-align: left; }
  .k-where b { font-size: 18px; }
  .k-gauges { top: 58px; right: 10px; width: 168px; padding: 6px 8px; }
  .k-gtoggle { display: block; width: 100%; padding: 4px 0; background: none; border: 0; color: var(--aqua); font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-align: left; cursor: pointer; }
  .k-gtoggle::after { content: " ▾"; }
  .k-gtoggle[aria-expanded="false"]::after { content: " ▸"; }
  .k-read { grid-template-columns: 1fr; gap: 3px; }
  .k-read dd { font-size: 12.5px; }
  #profile, .k-tiny { display: none; }
  .k-toast { top: auto; bottom: 74px; width: calc(100% - 32px); font-size: 13.5px; }
  .k-card { left: 10px; right: 10px; top: auto; bottom: 64px; width: auto; max-height: 62vh; padding: 14px 14px 16px; }
  .k-bar { gap: 6px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .k-bar .btn { white-space: nowrap; font-size: 12.5px; padding: 7px 10px; }
  .k-card h2 { font-size: 24px; }
  .k-card p { font-size: 14.5px; }
  body.card-open .k-gauges { display: none; }
}
@media (prefers-reduced-motion: reduce) { .k-toast, .k-fade { transition: none; } }
.k-card .keeper { margin: -4px 0 12px; padding: 6px 10px; border-radius: 9px; border: 1px solid rgba(243,185,74,0.4); background: rgba(243,185,74,0.08); font-size: 13px; line-height: 1.4; }
.k-card .keeper b { display: block; font: 500 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
/* winter mode (river3d.js): the button while it's on, as at the helm, and the note on the intro card */
#b-winter[aria-pressed="true"] { background: #dfeff5; color: #0b1215; border-color: #dfeff5; }
.winter-note { font-size: 13px; color: #cfe6ee; margin: 6px 0 0; }
