/* ============================================================================
   Root pages — hub, about, contact, privacy, 404.
   A thin layer on base.css, which loads first and does the heavy lifting:
   reset, type, forms, buttons, tables, header, nav, footer, FAQ.
   Only what is specific to these five pages lives here.
   ========================================================================= */

:root {
  /* neutral slate: the hub sits above the five tools rather than competing */
  --accent: #93a4c0;
  --accent-dim: rgba(147, 164, 192, 0.14);

  /* per-tool signal colours (dark), used as card cues on the hub */
  --t-cron:     #a5b4fc;
  --t-ratio:    #2dd4bf;
  --t-epoch:    #fbbf24;
  --t-days:     #fb7185;
  --t-contrast: #4ade80;
  --t-json:     #38bdf8;
}

@media (prefers-color-scheme: light) {
  :root {
    --accent: #475569;                        /* white on it = 7.58:1 */
    --accent-dim: rgba(71, 85, 105, 0.10);

    /* light-theme cues: each >= 4.5:1 as text on --bg and --surface */
    --t-cron:     #5b4bd6;
    --t-ratio:    #0f766e;
    --t-epoch:    #9a4c09;
    --t-days:     #be123c;
    --t-contrast: #15803d;
    --t-json:     #0369a1;
  }
}

/* ---------------------------------------------------------------- a11y --- */

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; border-radius: var(--radius-sm); z-index: 99;
  font-family: var(--mono); font-size: 0.8125rem;
}
.skip:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ----------------------------------------------------------- hub: cards --- */
/* One continuous grid divided by hairlines, rather than five floating cards —
   it reads as a single instrument panel with five channels. */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 2.5rem 0 3.5rem;
  list-style: none;
  padding: 0;
}

/* the <li> is only a grid cell; the <a> inside is the card */
.tools > li { display: flex; }
.tools > li > .tool-card { flex: 1; }

.tool-card {
  --cue: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--surface);
  padding: 1.5rem 1.4rem 1.35rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}
.tool-card:hover { background: var(--surface-2); }

.tool-card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 2px;
  background: var(--cue);
  opacity: 0.85;
}

.tool-card h2, .tool-card h3 {
  display: flex; align-items: center; gap: 0.55rem;
  margin: 0;
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}
.tool-card h2::before, .tool-card h3::before {
  content: "";
  width: 0.4375rem; height: 0.4375rem; border-radius: 50%;
  background: var(--cue); flex: 0 0 auto;
}

.tool-card p { margin: 0; font-size: 0.9375rem; color: var(--text-dim); }

.tool-go {
  margin-top: auto; padding-top: 0.6rem;
  font-family: var(--mono); font-size: 0.78125rem;
  letter-spacing: 0.02em;
  color: var(--cue);
  text-decoration: none;
}
.tool-card:hover .tool-go { text-decoration: underline; text-underline-offset: 0.2em; }

.t-cron     { --cue: var(--t-cron); }
.t-ratio    { --cue: var(--t-ratio); }
.t-epoch    { --cue: var(--t-epoch); }
.t-days     { --cue: var(--t-days); }
.t-contrast { --cue: var(--t-contrast); }
.t-json     { --cue: var(--t-json); }

/* ----------------------------------------------------------- hub: facts --- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1.4rem 2rem;
  list-style: none; padding: 0; margin: 0;
}
.facts li {
  position: relative; padding-left: 1.1rem;
  font-size: 0.9375rem; color: var(--text-dim);
}
.facts li::before {
  content: "—";
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); color: var(--text-faint);
}
.facts strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- lists --- */

.linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.1rem; }
.linklist a {
  display: block;
  font-family: var(--mono); font-size: 0.875rem;
  color: var(--text-dim); text-decoration: none;
  padding: 0.45rem 0.6rem; margin-inline: -0.6rem;
  border-radius: var(--radius-sm);
}
.linklist a:hover { color: var(--accent); background: var(--surface-2); }

/* -------------------------------------------------------------- contact --- */

.contact-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  margin: 1.5rem 0 2rem;
}
.contact-address {
  font-family: var(--mono);
  font-size: 1.0625rem;
  color: var(--accent);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ 404 --- */

.code-404 {
  font-family: var(--mono);
  font-size: clamp(3.5rem, 2rem + 9vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--line-strong);
  margin: 0 0 0.5rem;
}

/* ----------------------------------------------------------------- misc --- */

.updated { font-family: var(--mono); font-size: 0.78125rem; color: var(--text-faint); }

/* Brand glyph: four squares in a module. SVG fills, not text colours —
   reads as four indicator lights, which suits the instrument aesthetic. */
.mark-bg { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; }
.mark-fg { fill: var(--accent); }
.brand:hover .mark-fg { fill: var(--text); }
