/* Lorestar site: the shared world. A dim room where only what needs you is lit.
   Light carries meaning: amber played, white next and the primary action, blue planned,
   teal and rose quest tracks, violet GM-only, red failed. Containers never glow. */

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(../fonts/Unbounded-normal-200_900.woff2) format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(../fonts/Sora-normal-100_800.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-normal-100_800.woff2) format("woff2");
}

:root {
  color-scheme: dark;
  --void: #07080b;
  --surface: #0e1015;
  --float: #151821;
  --raised: #1c2030;
  --press: #232839;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eaf0;
  --text-2: #9aa0ae;
  --text-3: #5e6472;
  --now: #f4f7ff;
  --now-hover: #ffffff;
  --now-pressed: #d9deea;
  --past: #ffb36b;
  --ahead: #6fa8ff;
  --track-main: #f4f7ff;
  --track-side: #8fd3c8;
  --track-personal: #f2a7c3;
  --gm: #b69cff;
  --gm-soft: #ada6c8;
  --gm-tint: rgba(182, 156, 255, 0.065);
  --gm-line: rgba(182, 156, 255, 0.34);
  --failed: #ff6b6b;
  --ok: #8fd3c8;

  --display: "Unbounded", "Sora", system-ui, sans-serif;
  --sans: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: 2rem;
  --bar: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pulse-ease: cubic-bezier(0.45, 0, 0.25, 1);
  --t-state: 0.18s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 1rem); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
::selection { background: rgba(244, 247, 255, 0.86); color: var(--void); }
input, textarea { caret-color: var(--now); }
* { scrollbar-width: thin; scrollbar-color: #2c3142 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c3142; border-radius: 999px; border: 2px solid var(--void); }
::-webkit-scrollbar-thumb:hover { background: #3a4054; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--now); outline-offset: 3px; border-radius: 4px; }
main:focus, [tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(232, 234, 240, 0.4); text-underline-offset: 0.22em; text-decoration-thickness: 1px; transition: color var(--t-state) var(--ease), text-decoration-color var(--t-state) var(--ease); }
a:hover { color: var(--now-hover); text-decoration-color: currentColor; }

h1, h2, h3, h4 { margin: 0; font-weight: inherit; }
p { margin: 0; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
.num { font-variant-numeric: tabular-nums; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.6rem 1rem; border-radius: 999px; background: var(--now); color: var(--void); font-weight: 600; text-decoration: none; transition: top 0.2s var(--ease); }
.skip:focus { top: 0.75rem; }
.skip:hover { color: var(--void); }

.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------------------------------------------------------- type */
.display { font-family: var(--display); font-weight: 200; font-size: clamp(2.6rem, 1.3rem + 3.5vw, 4.5rem); line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; color: var(--now); }
.headline { font-family: var(--display); font-weight: 200; font-size: clamp(2rem, 1.2rem + 2.7vw, 3.5rem); line-height: 1.08; letter-spacing: -0.022em; text-wrap: balance; color: var(--now); }
.title { font-family: var(--display); font-weight: 300; font-size: clamp(1.5rem, 1.15rem + 1vw, 2rem); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.lead { font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); line-height: 1.65; color: var(--text-2); max-width: 36rem; text-wrap: pretty; }
.prose { font-size: 1.0625rem; line-height: 1.7; max-width: 65ch; }
.prose p + p { margin-top: 1rem; }
.meta { font-size: 0.8125rem; color: var(--text-2); }
.dim { color: var(--text-2); }

/* ---------------------------------------------------------------- controls */
.btn {
  --h: 2.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: var(--h); padding: 0 1.1rem; border-radius: 999px;
  border: 1px solid var(--hairline-strong); background: var(--float); color: var(--text);
  font: 500 0.875rem/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background var(--t-state) var(--ease), border-color var(--t-state) var(--ease), color var(--t-state) var(--ease), transform 0.12s var(--ease);
}
.btn:hover { background: var(--raised); border-color: rgba(255, 255, 255, 0.24); color: var(--now-hover); }
.btn:active { background: var(--press); transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { background: transparent; border-color: var(--hairline); color: var(--text-3); cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-primary { background: var(--now); border-color: var(--now); color: var(--void); font-weight: 600; }
.btn-primary:hover { background: var(--now-hover); border-color: var(--now-hover); color: var(--void); }
.btn-primary:active { background: var(--now-pressed); border-color: var(--now-pressed); }
.btn-primary:disabled { background: var(--raised); border-color: var(--raised); color: var(--text-3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--raised); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--failed); }
.btn-danger:hover { border-color: rgba(255, 107, 107, 0.5); color: #ff8a8a; }
.btn-sm { --h: 2rem; padding: 0 0.85rem; font-size: 0.8125rem; }
.btn-lg { --h: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.btn svg { width: 1.0625rem; height: 1.0625rem; flex: none; }

/* disclosure rows: a drawn chevron that turns when the row opens, in place of the browser's triangle */
details > summary { list-style: none; display: flex; align-items: center; gap: 0.6rem; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; flex: none; width: 0.42rem; height: 0.42rem; margin: 0 0.15rem 0 0.05rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--t-state) var(--ease); }
details[open] > summary::before { transform: rotate(45deg); }

.linkish { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-decoration: underline; text-decoration-color: rgba(232, 234, 240, 0.4); text-underline-offset: 0.22em; cursor: pointer; }
.linkish:hover { color: var(--now-hover); text-decoration-color: currentColor; }

.field { display: grid; gap: 0.4rem; }
.label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.label i { font-style: normal; color: var(--text-2); font-weight: 400; }
.input, .textarea, select.input {
  width: 100%; min-height: 2.75rem; padding: 0 0.95rem; border-radius: 12px;
  border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--text);
  font: 400 0.9375rem/1.4 var(--sans);
  transition: border-color var(--t-state) var(--ease), background var(--t-state) var(--ease);
}
.textarea { padding: 0.75rem 0.95rem; resize: vertical; min-height: 6rem; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-2); opacity: 1; }
.input:hover, .textarea:hover { border-color: rgba(255, 255, 255, 0.26); }
.input:focus, .textarea:focus { border-color: rgba(244, 247, 255, 0.7); background: var(--float); outline: 2px solid var(--now); outline-offset: 2px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: rgba(255, 107, 107, 0.7); }
.input.key { font-family: var(--mono); font-size: clamp(0.75rem, 0.4rem + 1.6vw, 1.0625rem); letter-spacing: 0.02em; text-transform: uppercase; }
.input.key::placeholder { text-transform: none; letter-spacing: 0.02em; }
.hint { font-size: 0.8125rem; color: var(--text-2); }
.err { font-size: 0.8125rem; color: #ff9a9a; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 4.5rem; }
.pw-show { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); height: 2rem; padding: 0 0.7rem; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font: 500 0.8125rem/1 var(--sans); cursor: pointer; }
.pw-show:hover { background: var(--raised); color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.9375rem; }
.check input { width: 1.125rem; height: 1.125rem; accent-color: var(--now); }

/* a status line under a form: what happened, in words */
.say { min-height: 0; font-size: 0.875rem; color: var(--text-2); }
.say:empty { display: none; }
.say p + p { margin-top: 0.35rem; }
.say .ok { color: var(--text); }
.say .bad { color: #ff9a9a; }

/* a point of light: the status mark. Lit marks glow; resting marks don't. */
.lp { display: inline-block; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 0.25rem rgba(244, 247, 255, 0.12), 0 0 0.75rem rgba(244, 247, 255, 0.45); vertical-align: middle; }
.lp.rest { width: 0.375rem; height: 0.375rem; background: var(--text-2); box-shadow: none; }
.lp.ring { background: transparent; border: 1.5px solid currentColor; box-shadow: none; }
.lp.past { background: var(--past); box-shadow: none; }
.lp.ahead { background: transparent; border: 1.5px solid var(--ahead); box-shadow: none; }
.lp.bad { background: var(--failed); box-shadow: none; border-radius: 1px; transform: rotate(45deg) scale(0.8); }
.lp.gm { background: var(--gm); box-shadow: none; }

.tag { display: inline-flex; align-items: center; gap: 0.45rem; height: 1.75rem; padding: 0 0.75rem; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); font-size: 0.8125rem; color: var(--text-2); white-space: nowrap; }
.tag.lit { color: var(--text); }
.tag.gm { border-color: var(--gm-line); background: var(--gm-tint); color: var(--gm); }

.lock { width: 0.9rem; height: 0.9rem; flex: none; }

/* ---------------------------------------------------------------- top bar */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--bar); padding: 0.75rem var(--gutter);
  background: var(--void);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.bar.scrolled { border-bottom-color: var(--hairline); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--now); text-decoration: none; }
.brand:hover { color: var(--now-hover); }
.brand svg { width: 1.75rem; height: 1.75rem; }
.brand-word { font-family: var(--display); font-weight: 300; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1; }
.bar-right { display: flex; align-items: center; gap: 0.5rem; }

/* ---------------------------------------------------------------- the dock */
.dock {
  position: fixed; z-index: 40; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 0.125rem; padding: 0.375rem;
  border-radius: 20px; border: 1px solid var(--hairline); background: var(--float);
}
.dock a {
  position: relative; display: grid; justify-items: center; gap: 0.3rem;
  min-width: 4.75rem; padding: 0.5rem 0.625rem 0.75rem; border-radius: 14px;
  color: var(--text-2); font-size: 0.75rem; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background var(--t-state) var(--ease), color var(--t-state) var(--ease);
}
.dock a svg { width: 1.125rem; height: 1.125rem; }
.dock a:hover { background: var(--raised); color: var(--text); }
.dock a:active { background: var(--press); }
.dock a[aria-current="true"] { color: var(--now); }
.dock a[aria-current="true"]::after {
  content: ""; position: absolute; left: 50%; bottom: 0.3rem; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--now); box-shadow: 0 0 6px 1px rgba(244, 247, 255, 0.7);
}
.dock .short { display: none; }
/* on the landing page the dock waits until the first view is passed */
.dock { transition: transform 0.35s var(--ease), opacity 0.35s var(--ease), visibility 0s linear 0s; }
.dock.away { transform: translateX(-50%) translateY(140%); opacity: 0; visibility: hidden; transition: transform 0.35s var(--ease), opacity 0.35s var(--ease), visibility 0s linear 0.35s; }

/* ---------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--hairline); padding: 3rem 0 7.5rem; }
.foot-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: start; }
.foot-word { font-family: var(--display); font-weight: 300; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--now); }
.foot-tag { margin-top: 0.4rem; color: var(--text-2); font-size: 0.875rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.875rem; }
.foot-nav a { color: var(--text-2); text-decoration: none; }
.foot-nav a:hover { color: var(--text); }
.foot-legal { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--text-2); max-width: 60ch; }
.page .foot { padding-bottom: 3rem; }

/* ---------------------------------------------------------------- pages that aren't the landing page */
.page-main { padding: clamp(2rem, 6vh, 4rem) 0 4rem; }
.narrow { max-width: 46rem; }
.panel { border-radius: 16px; border: 1px solid var(--hairline); background: var(--float); padding: 1.5rem; }
.notice { border-radius: 12px; border: 1px solid var(--hairline-strong); background: var(--surface); padding: 0.9rem 1.1rem; font-size: 0.9375rem; }
.notice.gm { border-color: var(--gm-line); background: var(--gm-tint); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 0.6rem 0; border-top: 1px solid var(--hairline); }
.kv dt { color: var(--text-2); padding-right: 2rem; font-size: 0.9375rem; }
.kv dd { font-size: 0.9375rem; overflow-wrap: anywhere; }
.kv > :nth-child(-n+2) { border-top: 0; }

@media (max-width: 760px) {
  :root { --gutter: 1rem; }
  .bar { padding: 0.6rem var(--gutter); }
  .bar .opt { display: none; }
  .dock { left: 0.375rem; right: 0.375rem; transform: none; justify-content: space-between; border-radius: 18px; }
  .dock.away { transform: translateY(140%); }
  .dock a { min-width: 0; flex: 1 1 0; padding: 0.5rem 0.25rem 0.75rem; font-size: 0.75rem; }
  .dock .long { display: none; }
  .dock .short { display: inline; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
html.rm *, html.rm *::before, html.rm *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }

/* Things that aren't real yet say so: test mode (no money moves) and placeholders a setting fills in later. They take
   the "not decided yet" look (a dashed Strong Hairline, as .tbd on the legal pages) and a mono tag; no new colour. */
.test-flag { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; padding: 0.65rem 0.9rem; border: 1px dashed var(--hairline-strong); border-radius: 10px; font-size: 0.875rem; line-height: 1.5; color: var(--text); }
.test-flag::before { content: "Test mode"; flex: none; font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--now); }
.test-flag:empty { display: none; }
.ph { padding: 0 0.3em; border: 1px dashed var(--hairline-strong); border-radius: 4px; font-family: var(--mono); font-size: 0.875em; color: var(--text); }
