/* eclipse.upsa.org.ua — UPSA Eclipse Almanac.
   Light instrument page in the UPSA family: IBM Plex, square corners,
   navy ink on paper, yellow reserved for "next"/selection marks.
   The simulator viewport is the one deliberately dark surface. */

:root {
  --paper: #FAFBFD;
  --panel: #FFFFFF;
  --ink: #0B1526;
  --navy: #0B2050;
  --muted: #5A6B85;
  --line: #D8DEE9;
  --line-strong: #AEB9CC;
  --accent: #FFD400;
  --space: #050A16;
  --red: #B5432E;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--paper); }
body {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--navy); }
a:hover { background: var(--accent); color: var(--ink); text-decoration: none; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* utility bar */
.utility {
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.utility .wrap {
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap;
}
.utility a { color: var(--navy); text-decoration: none; }
.utility a:hover { background: var(--accent); }

/* masthead: almanac title block, left-aligned, ruled like a ledger */
.masthead { padding: 36px 0 0; }
.masthead h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.05;
}
.masthead .sub {
  max-width: 62ch; margin-top: 10px; color: var(--muted); font-size: 15px;
}
.masthead .rule {
  margin-top: 24px; border: 0; border-top: 3px solid var(--ink);
}
.counts {
  display: flex; gap: 28px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.counts b { color: var(--ink); font-weight: 500; }

/* next-eclipse strip */
.next {
  margin: 28px 0; border: 1px solid var(--ink);
  display: grid; grid-template-columns: 10px 1fr auto; background: var(--panel);
}
.next .flag { background: var(--accent); }
.next .body { padding: 18px 22px; }
.next .body .tag { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.next .body h2 { font-size: 24px; font-weight: 600; margin: 2px 0 6px; }
.next .body p { color: var(--muted); font-size: 14px; max-width: 70ch; }
.next .clock {
  padding: 18px 22px; text-align: right; display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--line); min-width: 210px;
}
.next .clock .cd { font-family: var(--mono); font-size: 26px; font-weight: 500; white-space: nowrap; }
.next .clock .lbl { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.next .open { margin-top: 8px; font-size: 14px; }

/* filters */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px;
}
.filters .grp { display: flex; }
.filters button {
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-strong); border-left-width: 0;
  padding: 6px 12px;
}
.filters .grp button:first-child { border-left-width: 1px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters select {
  font-family: var(--mono); font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
}
.filters .count { color: var(--muted); margin-left: auto; }

/* catalog table */
.years { margin-bottom: 80px; }
.yearblock { display: grid; grid-template-columns: 84px 1fr; border-bottom: 1px solid var(--line); }
.yearblock .y {
  font-family: var(--mono); font-size: 20px; font-weight: 500; color: var(--line-strong);
  padding: 18px 0; position: sticky; top: 0; align-self: start;
}
table.cat { width: 100%; border-collapse: collapse; }
table.cat td {
  padding: 12px 14px 12px 0; border-top: 1px solid var(--line);
  vertical-align: baseline; font-size: 14px;
}
table.cat tr:first-child td { border-top: 0; }
table.cat .d { font-family: var(--mono); font-size: 13px; white-space: nowrap; width: 90px; }
table.cat .g { width: 34px; vertical-align: middle; }
table.cat .k { width: 190px; }
table.cat .k b { font-weight: 600; }
table.cat .k span { color: var(--muted); font-family: var(--mono); font-size: 11px; display: block; }
table.cat .best { color: var(--muted); }
table.cat .best b { color: var(--ink); font-weight: 500; }
table.cat .go { text-align: right; white-space: nowrap; }
table.cat .go a { font-family: var(--mono); font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--navy); }
tr.is-next td { background: #FFFBE0; }

/* glyphs */
.gl { display: inline-block; vertical-align: middle; }

/* footer */
footer {
  border-top: 3px solid var(--ink); padding: 20px 0 48px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
footer .wrap { display: grid; gap: 6px; }

/* ===================== eclipse page ===================== */
.crumbs {
  font-family: var(--mono); font-size: 12px; padding: 14px 0; color: var(--muted);
}
.evhead { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; padding-bottom: 18px; }
.evhead h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em; }
.evhead .id { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.evgrid {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px;
  border-top: 3px solid var(--ink); padding-top: 24px; margin-bottom: 64px;
}
@media (max-width: 980px) { .evgrid { grid-template-columns: 1fr; } }

/* simulator */
.sim { border: 1px solid var(--ink); background: var(--space); }
.simtabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #223; }
.simtabs button {
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  background: transparent; color: #8FA0BC; border: 0; border-right: 1px solid #223;
  padding: 8px 12px;
}
.simtabs button[aria-pressed="true"] { background: var(--accent); color: var(--ink); }
#cv { display: block; width: 100%; height: auto; cursor: pointer; }
.sim:fullscreen { display: flex; flex-direction: column; }
.sim:fullscreen #cv { flex: 1; min-height: 0; object-fit: contain; background: #000; width: 100%; }
.sim:fullscreen .simtabs, .sim:fullscreen .rail, .sim:fullscreen .simbar, .sim:fullscreen .readout { flex: none; }
.simbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #223; flex-wrap: wrap; }
.simbar button {
  font-family: var(--mono); font-size: 13px; cursor: pointer;
  background: transparent; color: #E8EEFA; border: 1px solid #445; padding: 5px 12px;
}
.simbar button:hover { border-color: var(--accent); color: var(--accent); }
.simbar select {
  font-family: var(--mono); font-size: 12px; background: var(--space); color: #E8EEFA;
  border: 1px solid #445; padding: 5px 6px;
}
.simbar .t { font-family: var(--mono); font-size: 12px; color: #8FA0BC; margin-left: auto; text-align: right; }
.simbar .t b { color: #E8EEFA; font-weight: 500; display: block; font-size: 13px; }
.rail { position: relative; padding: 30px 12px 8px; border-top: 1px solid #223; }
.rail input[type="range"] { width: 100%; accent-color: var(--accent); }
.rail .marks { position: absolute; left: 12px; right: 12px; top: 4px; height: 24px; font-family: var(--mono); font-size: 9px; color: #8FA0BC; }
.rail .marks span { position: absolute; transform: translateX(-50%); border-left: 1px solid #556; padding-left: 3px; white-space: nowrap; height: 22px; }
.rail .marks span:nth-child(even) { padding-top: 11px; }
.readout {
  display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 12px 12px;
  font-family: var(--mono); font-size: 12px; color: #8FA0BC;
}
.readout b { color: #E8EEFA; font-weight: 500; }
.readout .phase b { color: var(--accent); }

/* data sheet */
.sheet { border: 1px solid var(--line-strong); background: var(--panel); align-self: start; }
.sheet h2 {
  font-size: 13px; font-weight: 600; font-family: var(--mono);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.sheet dl { display: grid; grid-template-columns: 1fr 1fr; }
.sheet dl div { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sheet dt { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sheet dd { font-size: 14px; }
.pts { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pts th {
  font-family: var(--mono); font-size: 10px; text-align: left; color: var(--muted);
  padding: 8px 5px; border-bottom: 1px solid var(--line); font-weight: 400;
}
.pts th:first-child, .pts td:first-child { padding-left: 10px; }
.pts td { padding: 8px 5px; border-bottom: 1px solid var(--line); }
.pts tr.pt { cursor: pointer; }
.pts tr.pt:hover td { background: #F0F4FA; }
.pts tr.pt[aria-selected="true"] td { background: #FFFBE0; }
.pts .mono { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.badge {
  font-family: var(--mono); font-size: 10px; padding: 1px 6px;
  border: 1px solid var(--ink); white-space: nowrap;
}
.badge.T { background: var(--ink); color: #fff; }
.badge.A { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge.P { background: transparent; }
.badge.N { border-color: var(--muted); color: var(--muted); }

/* map */
.mapbox { border: 1px solid var(--line-strong); background: var(--panel); margin-top: 24px; }
.mapbox h2 { font-size: 13px; font-weight: 600; font-family: var(--mono); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mapbox svg { display: block; width: 100%; height: auto; }
.mapnote { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 8px 14px 12px; }

/* about panel */
.about { margin: 0 0 64px; max-width: 76ch; }
.about summary { font-family: var(--mono); font-size: 13px; cursor: pointer; padding: 10px 0; }
.about p { color: var(--muted); font-size: 14px; margin: 8px 0; }
.about b { color: var(--ink); font-weight: 500; }

.loading { padding: 60px 0; font-family: var(--mono); color: var(--muted); }
