/* MELIPAL portal — an observatory notebook rather than a dashboard: the landing page's palette and type
   (Newsreader for voice, IBM Plex Sans for interface, self-hosted: no third-party requests), hairline rules
   instead of boxes, small-caps labels, one warm accent. Spacing on a 4 px grid. */
@font-face { font-family: 'Newsreader'; src: url(/fonts/newsreader.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url(/fonts/newsreader-italic.woff2) format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-300.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }

:root { color-scheme: dark;
  --bg: #06090b; --bg-raise: #0b1013; --text: #f0eee7; --subtle: #b0b8b5; --muted: #858f8c; --accent: #cbb395;
  --accent-ink: #f1dac0; --line: rgba(231,226,215,.14); --line-strong: rgba(231,226,215,.26);
  --err: #e5998a; --ok: #a9c9a4;
  --sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif; --serif: 'Newsreader', Georgia, 'Times New Roman', serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 300 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--accent-ink); text-decoration-color: rgba(203,179,149,.45); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---- brand & header ---- */
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; color: var(--text); }
.brand .m { font: italic 400 30px/1 var(--serif); color: var(--accent); padding-right: 13px; border-right: 1px solid rgba(203,179,149,.45); }
.brand .w { font-size: 13px; letter-spacing: .27em; font-weight: 500; }
.wrap { width: min(calc(100% - 48px), 1120px); margin-inline: auto; }
header.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(6,9,11,.92); backdrop-filter: blur(6px); z-index: 5; }
header.top .wrap { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; }
nav.tabs button, .linkbtn { background: none; border: 0; padding: 6px 0; cursor: pointer; color: #d9d7cf;
  font: 500 10.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; border-bottom: 1px solid transparent;
  transition: color .15s ease-out, border-color .15s ease-out; }
nav.tabs button:hover { color: var(--accent); }
nav.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.linkbtn { color: var(--accent); letter-spacing: .1em; }
#logout { color: var(--muted); }

/* ---- page content: a reading column with margin notes ---- */
main#view { padding: 56px 0 96px; max-width: 880px; }
.label { display: block; color: var(--accent); text-transform: uppercase; font-size: 10px; letter-spacing: .24em; font-weight: 500; margin-bottom: 14px; }
.label::before { content: ''; display: inline-block; width: 24px; height: 1px; background: var(--accent); vertical-align: middle; margin-right: 12px; }
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; color: var(--text); }
h1 { font-size: clamp(40px, 5vw, 60px); line-height: 1.04; letter-spacing: -.02em; margin-bottom: 36px; }
h2 { font-size: 23px; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 16px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 13px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--subtle); font-size: 15.5px; line-height: 1.75; }

/* Sections are separated by hairlines and space, not boxes. */
.card { padding: 28px 0; border-top: 1px solid var(--line); min-width: 0; }
.card:first-of-type { border-top-color: var(--line-strong); }
.card h2:not(:first-child) { margin-top: 28px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 56px; }
.grid2 > .card, .grid2 > div > .card:first-child { border-top-color: var(--line-strong); }
@media (max-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* Lists of topics / posts / members: an index with serif titles. */
.item { padding: 18px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 4px; }
.meta { color: var(--muted); font-size: 12px; letter-spacing: .02em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.meta a { color: var(--subtle); text-decoration: none; }
.meta a:hover { color: var(--accent); }
.list-link { background: none; border: 0; padding: 0; color: var(--text); font: 400 21px/1.3 var(--serif); cursor: pointer; text-align: left; transition: color .15s ease-out; }
.list-link:hover { color: var(--accent-ink); }
ul { padding-left: 18px; margin: 6px 0 14px; }
li { margin: 3px 0; color: var(--subtle); }

/* ---- forms ---- */
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
input, textarea, select { font: 400 15px/1.5 var(--sans); letter-spacing: 0; text-transform: none; color: var(--text); width: 100%;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; transition: border-color .15s ease-out; }
input:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 96px; }
button.btn { font: 500 11px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--bg); background: var(--accent);
  border: 1px solid var(--accent); border-radius: 2px; padding: 11px 20px; cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out; }
button.btn:hover { background: var(--accent-ink); }
button.btn.ghost { background: transparent; color: var(--accent); }
button.btn.ghost:hover { background: rgba(203,179,149,.1); }
button.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.msg { margin: 14px 0; padding: 10px 14px; border-left: 1px solid var(--accent); color: var(--subtle); background: rgba(203,179,149,.05);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.msg.err { border-color: var(--err); color: var(--err); background: rgba(229,153,138,.06); }
.msg.ok { border-color: var(--ok); color: var(--ok); background: rgba(169,201,164,.06); }
.rules { margin: -8px 0 18px; padding-left: 16px; font-size: 12px; }
.rules li { color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-strong); }
td { padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; color: var(--subtle); }
.pix { font: 12px/1.6 ui-monospace, 'SFMono-Regular', Menlo, monospace; word-break: break-all; background: var(--bg-raise); border: 1px solid var(--line); padding: 12px 14px; border-radius: 2px; color: var(--accent-ink); }

/* ---- entry (login): the star chart beside the form ---- */
.entry { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); min-height: 100vh; }
.sky { position: relative; margin: 0; overflow: hidden; border-right: 1px solid var(--line); background: var(--bg); }
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sky figcaption { position: absolute; left: 32px; right: 32px; bottom: 28px; color: rgba(240,238,231,.62); font-size: 11.5px; line-height: 1.6; }
.sky .mapu { font: italic 400 15px var(--serif); color: var(--accent-ink); }
.crux .fig { stroke-opacity: .55; }
.crux .ptr { stroke-opacity: .32; stroke-dasharray: 2 7; }
.crux .grid text { fill: #cbb395; fill-opacity: .38; stroke: none; font: 500 10px var(--sans); letter-spacing: .12em; }
.crux .bayer { fill: var(--accent); font: italic 400 15px var(--serif); }
.crux .name { fill: rgba(240,238,231,.62); font: 500 9px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.crux .caption { fill: rgba(203,179,149,.55); font: 500 9.5px var(--sans); letter-spacing: .28em; }
.crux .star > circle:first-child { animation: breathe 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.crux .star:nth-of-type(2n) > circle:first-child { animation-duration: 9s; animation-delay: -3s; }
@keyframes breathe { 50% { opacity: .1; transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .crux .star > circle:first-child { animation: none; } }
.side { display: flex; flex-direction: column; padding: 40px clamp(24px, 5vw, 64px) 32px; min-width: 0; }
.side .brand { margin-bottom: auto; }
.login { width: 100%; max-width: 420px; margin: 64px 0; }
.login h1 { margin-bottom: 28px; }
.login .card { border-top: 0; padding: 0 0 8px; }
.aux { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 4px; }
.aux .linkbtn { font-size: 10px; color: var(--subtle); }
.aux .linkbtn:hover { color: var(--accent); }
.login form:not(#fLogin) { border-top: 1px solid var(--line); padding-top: 26px; margin-top: 18px; }
.fine { margin-top: auto; font-size: 11px; letter-spacing: .04em; }
@media (max-width: 900px) {
  .entry { grid-template-columns: minmax(0, 1fr); }
  .sky { height: 46vh; min-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login { margin: 40px 0; }
}
