/* alexanderjb launcher — instrument panel identity
   slate ground, one sodium-amber signal, monospace readout. */

:root {
  --bg:      #0f1319;
  --bg2:     #141b23;
  --surface: #1a222c;
  --surface2:#202b37;
  --press:   #26323f;
  --line:    #2a3947;

  --ink:   #e7edf3;
  --dim:   #8ba0b2;
  --faint: #5f7182;

  --signal:     #f2a33c;   /* sodium amber — the one accent */
  --signal-ink: #1a1206;
  --ok:  #5fd08a;
  --err: #f2705c;

  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gap: 12px;
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  overscroll-behavior: none;
}

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7;
      stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header readout (the signature) ---------- */
.readout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .04em;
  color: var(--dim);
  background: linear-gradient(var(--bg2), var(--bg));
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.readout .brand { color: var(--ink); font-weight: 600; letter-spacing: .12em; }
.readout .clock { color: var(--ink); font-variant-numeric: tabular-nums; }
.readout .sep { color: var(--faint); }
.readout .spacer { flex: 1; }
.readout .status { display: inline-flex; align-items: center; gap: 6px; }
#syncdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--faint); box-shadow: 0 0 0 0 transparent;
}
#syncdot[data-state="idle"]      { background: var(--ok); }
#syncdot[data-state="syncing"]   { background: var(--signal); animation: pulse 1.1s ease-in-out infinite; }
#syncdot[data-state="connecting"]{ background: var(--signal); animation: pulse 1.1s ease-in-out infinite; }
#syncdot[data-state="offline"]   { background: var(--faint); }
#syncdot[data-state="error"]     { background: var(--err); }
#syncdot[data-state="off"]       { background: var(--faint); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(242,163,60,.18); } }

.iconbtn {
  background: none; border: none; color: var(--dim); cursor: pointer;
  padding: 4px; margin: -4px 2px -4px -4px; display: inline-flex;
}
.iconbtn:hover { color: var(--ink); }
.iconbtn[hidden] { display: none; }   /* author display: overrides UA [hidden] otherwise */

/* ---------- screen ---------- */
#screen { flex: 1; overflow-y: auto; padding: var(--gap); -webkit-overflow-scrolling: touch; }

/* ---------- launcher grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.tile {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--ink); text-decoration: none;
  position: relative;
  transition: background .12s ease, transform .06s ease;
}
.tile:active { background: var(--press); transform: scale(.97); }
.tile-ic { width: 30px; height: 30px; fill: none; stroke: var(--signal); stroke-width: 1.6;
           stroke-linecap: round; stroke-linejoin: round; }
.tile-label { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--dim); }
.tile[data-tile="settings"] .tile-ic { stroke: var(--dim); }

/* ---------- bars / buttons ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.bar h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.01em; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 14px; font-weight: 550;
  padding: 9px 14px; border-radius: 10px;
  background: var(--surface2); color: var(--ink); border: 1px solid var(--line);
  text-decoration: none; cursor: pointer;
}
.btn:active { background: var(--press); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--signal); color: var(--signal-ink); border-color: transparent; }
.btn.primary .ic { stroke: var(--signal-ink); }
.btn.danger { background: transparent; color: var(--err); border-color: transparent; }
.btn.danger .ic { stroke: var(--err); }
.btn.wide { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------- notes list ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.row:active { background: var(--press); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--dim); font-size: 13px; margin-top: 3px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-family: var(--mono); font-size: 11px; color: var(--faint); flex-shrink: 0; }

.empty { text-align: center; padding: 48px 16px; color: var(--dim); }
.empty p { margin: 0 0 14px; }

/* ---------- editor ---------- */
.editor { display: flex; flex-direction: column; gap: 10px; }
.f-title, .f-body, .f-input {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  font-family: var(--sans); padding: 12px 14px;
}
.f-title { font-size: 19px; font-weight: 600; }
.f-body { min-height: 46vh; resize: vertical; font-size: 16px; line-height: 1.5; }
.f-title:focus, .f-body:focus, .f-input:focus {
  outline: 2px solid var(--signal); outline-offset: 1px; border-color: transparent;
}

/* ---------- settings form ---------- */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.section { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
           color: var(--faint); margin: 12px 2px 0; }
.f-row { display: flex; flex-direction: column; gap: 6px; }
.f-row > span { font-size: 13px; color: var(--dim); }
.f-row.toggle, .f-row.toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.f-check { width: 44px; height: 26px; }
.hint { font-family: var(--mono); font-size: 12px; color: var(--faint); margin: 4px 2px; }

/* respect reduced motion (and the low-power device generally) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
