/* Fonte web. Tokens from fonte-ios-app/DESIGN.md, night cobalt world, dark appearance. */

@font-face {
  font-family: "Instrument Sans";
  font-weight: 500;
  font-display: swap;
  src: url("/static/InstrumentSans-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Instrument Sans";
  font-weight: 600;
  font-display: swap;
  src: url("/static/InstrumentSans-SemiBold.ttf") format("truetype");
}

:root {
  --ground: #0B1030;
  --surface: #141A3C;
  --surface-2: #1C2350;
  --accent: #2B4EFF;
  --accent-text: #8FA3FF;
  --accent-soft: #1F2A66;
  --live: #27C8FF;
  --ink: #F4F3EE;
  --ink-2: #A0A6B4;
  --ink-3: #9CA3B3;
  --control-border: #7F8797;
  --border: rgba(244, 243, 238, 0.10);
  --error: #FF6B81;
  --warmup: #F5B453;
  --drop: #B5A6F5;
  --failure: #F08C9B;
  --superset: #8B5CF6;
  --on-accent: #FFFFFF;

  --radius-field: 8px;
  --radius-card: 16px;
  --radius-pill: 999px;

  --gutter: 20px;
  --card: 16px;
  --section: 22px;

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ground); color: var(--ink); }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(43, 78, 255, 0.55), transparent 70%),
    var(--ground);
  background-repeat: no-repeat;
  min-height: 100vh;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shell: the bloom sits behind the header and fades before content begins. */
.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.04em;
}
.wordmark:hover { text-decoration: none; }
.plate {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3.5px solid var(--ink);
  background: radial-gradient(circle, var(--accent) 0 2.5px, transparent 2.6px);
  display: inline-block;
}

.nav { display: flex; gap: 18px; font-size: 14px; }
.nav a { color: var(--ink-2); }
.nav a[aria-current="page"] { color: var(--ink); }

/* Type registers. */
h1 {
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 28px 0 6px;
  font-variant-numeric: tabular-nums;
}
.lede { color: var(--ink-2); margin: 0 0 var(--section); }
h2 {
  font-weight: 600;
  font-size: 17px;
  margin: var(--section) 0 10px;
}
.meta { color: var(--ink-2); font-size: 14px; }
.hint { color: var(--ink-3); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* Cards and lists. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card);
  margin-bottom: 12px;
}
a.card { display: block; color: var(--ink); }
a.card:hover { text-decoration: none; background: var(--surface-2); }
.card-title { font-weight: 600; font-size: 17px; margin: 0 0 4px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }

.stats {
  display: flex;
  gap: 28px;
  margin: 8px 0 var(--section);
}
.stats .value {
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stats .label { color: var(--ink-3); font-size: 13px; }

/* Set tables: dense, dividers only. SET and the result column heads are the one allowed
   uppercase exception. */
table.sets {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
table.sets th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 4px 4px;
  border-bottom: 1px solid var(--border);
}
table.sets td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.sets tr:last-child td { border-bottom: 0; }
table.sets .n { width: 72px; color: var(--ink-2); white-space: nowrap; }
table.sets .side { width: 64px; color: var(--ink-2); }
table.sets .kind { color: var(--ink-3); font-size: 13px; margin-left: 4px; }
.kind-warmup { color: var(--warmup); }
.kind-drop { color: var(--drop); }
.kind-failure { color: var(--failure); }
.skipped { color: var(--ink-3); }
/* Superset label: the hue marks it, the text stays in ink-3 for AA contrast on surface. */
.superset { color: var(--ink-3); font-size: 13px; margin: 0 0 4px; }
.superset-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--superset);
  margin-right: 6px;
  vertical-align: middle;
}
.flush { margin: 0; }

/* Forms and buttons. */
label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
input[type="email"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-field);
  padding: 12px 10px;
  min-height: 44px;
}
input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-field);
  padding: 10px;
  min-height: 44px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-card);
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
}
.button:hover { filter: brightness(0.92); }
.button.secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
}
.button.text {
  background: none;
  color: var(--accent-text);
  min-height: 44px;
  padding: 0;
}
.stack > * + * { margin-top: 14px; }
.error { color: var(--error); font-size: 14px; }
.notice { color: var(--ink-2); font-size: 14px; }

.pager {
  display: flex;
  justify-content: space-between;
  margin-top: var(--section);
  font-size: 14px;
}

.empty {
  text-align: center;
  padding: 48px var(--card);
  color: var(--ink-2);
}
.empty p:first-child { color: var(--ink); font-weight: 600; font-size: 17px; }

.signin { max-width: 420px; margin: 48px auto 0; }

dl.facts { margin: 0; }
dl.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
dl.facts div:last-child { border-bottom: 0; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; text-align: right; }

@media (max-width: 480px) {
  h1 { font-size: 28px; }
  .stats { gap: 18px; }
}
