:root {
  --bg: #ffffff;
  --panel: #f8f9fb;
  --panel-2: #f1f3f7;
  --border: #e4e7ec;
  --text: #1a1d23;
  --muted: #6b7280;
  --accent: #76b900;
  --accent-2: #5f9500;
  --link: #5f9500;
  --danger: #b42318;
  --success: #027a48;
  --warning: #b54708;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f3f4f7; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
button, input { font: inherit; }

/* ------- nav ------- */
nav.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
nav.top .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
}
nav.top .brand { color: var(--text); font-weight: 700; letter-spacing: 0.3px; }
nav.top a.brand:hover { text-decoration: none; }
nav.top .brand .dot { color: var(--accent); }
nav.top ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
nav.top ul a { color: var(--muted); font-size: 0.92em; }
nav.top ul a:hover { color: var(--text); text-decoration: none; }
nav.top ul a.nav-primary {
  border: 1px solid rgba(118,185,0,0.45);
  border-radius: 999px;
  color: var(--accent-2);
  font-weight: 700;
  padding: 5px 10px;
}

/* ------- hero with banner image ------- */
header.hero { border-bottom: 1px solid var(--border); }
.hero-banner {
  position: relative;
  width: 100%;
  height: clamp(240px, 22vw, 420px);
  overflow: hidden;
  background: #000;
}
.hero-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-content {
  max-width: 1100px; width: 100%; margin: 0 auto;
  padding: 40px 24px 36px;
}
.eyebrow { color: var(--accent-2); font-weight: 600; letter-spacing: 0.14em; font-size: 0.85em; text-transform: uppercase; }
h1.hero-title { font-size: clamp(28px, 4vw, 46px); line-height: 1.1; margin: 8px 0 10px; color: var(--text); }
.hero-lead { max-width: 820px; color: #3c4250; font-size: 1.05em; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ------- layout ------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
section { padding: 56px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 72px; }
section:last-child { border-bottom: 0; }
section > h1,
section > h2 {
  font-size: 28px; margin: 0 0 8px;
  display: flex; align-items: baseline; gap: 12px;
}
section > h1 .sec-num,
section > h2 .sec-num {
  color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7em; letter-spacing: 0.08em;
}
section > p.section-lead { color: #3c4250; max-width: 820px; margin-top: 0; }
section h3 { font-size: 18px; margin: 24px 0 8px; }
.muted { color: var(--muted); }

/* ------- track card ------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px;
  max-width: 720px;
}
.card h3 { margin-top: 0; }
.card .pill {
  display: inline-block; font-size: 0.78em; padding: 3px 9px; border-radius: 999px;
  background: rgba(118,185,0,0.15); color: var(--accent-2); border: 1px solid rgba(118,185,0,0.3);
  margin-bottom: 10px; letter-spacing: 0.04em;
}
.grid {
  display: grid;
  gap: 22px;
}
.two-col {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: start;
}
.form-card {
  max-width: none;
}
.field {
  margin: 14px 0;
}
.field label,
.field-label,
.status-controls label {
  display: block;
  color: #343a46;
  font-weight: 700;
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"] {
  width: 100%;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  padding: 10px 12px;
}
input[type="text"]:focus,
input[type="email"]:focus {
  outline: 3px solid rgba(118,185,0,0.2);
  border-color: var(--accent-2);
}
.help {
  color: var(--muted);
  font-size: 0.9em;
  margin: 6px 0 0;
}
.field-state {
  background: #e8f1ff;
  border-radius: 999px;
  color: #175cd3;
  font-size: 0.72em;
  margin-left: 6px;
  padding: 2px 7px;
  vertical-align: 1px;
}
.field label.remember-row {
  align-items: center;
  display: flex;
  font-size: 0.9em;
  font-weight: 400;
  gap: 8px;
  margin: 10px 0 0;
}
.remember-row input { margin: 0; }
input[type="text"][readonly] {
  background: var(--panel-2);
  color: #343a46;
}
.repository-action { margin-bottom: 14px; }
.subfield-label { font-size: 0.9em; }
.repo-id-row { display: flex; align-items: stretch; gap: 10px; }
.repo-id-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.repo-id-row .button { flex: 0 0 auto; }
.copy-feedback { min-height: 1.4em; }
.readonly-value {
  display: block;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: #343a46;
  padding: 10px 12px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #343a46;
  margin: 18px 0;
}
.check-row input {
  margin-top: 5px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-2);
  border-radius: 8px;
  background: var(--accent);
  color: #102000;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 16px;
}
.button:hover {
  background: #83c90c;
  text-decoration: none;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.button.secondary {
  background: #fff;
  color: var(--accent-2);
}
.button-small {
  font-size: 0.8rem;
  margin-top: 6px;
  padding: 5px 8px;
}
.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  font-weight: 600;
}
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }
.compact-list {
  color: #3c4250;
  padding-left: 20px;
  margin-bottom: 0;
}
.status-controls {
  max-width: 540px;
  margin: 20px 0 18px;
}
.inline-form {
  display: flex;
  gap: 10px;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 22px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
caption {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  margin-bottom: 8px;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
th {
  background: var(--panel);
  color: #343a46;
  font-size: 0.9em;
}
td {
  color: #3c4250;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.status-pill {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 700;
  padding: 2px 8px;
}
.status-queued,
.status-ingestion_pending,
.status-auth_required { background: #fff7e6; color: var(--warning); }
.status-ingesting,
.status-validating,
.status-running,
.status-scoring { background: #e8f1ff; color: #175cd3; }
.status-done { background: #ecfdf3; color: var(--success); }
.status-error,
.status-rejected { background: #fef3f2; color: var(--danger); }
a.organizer-card {
  display: block; color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
a.organizer-card:hover {
  border-color: var(--accent); text-decoration: none; transform: translateY(-1px);
}
a.organizer-card h3 { color: var(--text); }
a.organizer-card p { color: #3c4250; margin-bottom: 0; }

/* ------- timeline ------- */
ol.timeline { list-style: none; padding: 0; margin: 18px 0 0; }
ol.timeline li {
  position: relative; padding: 12px 14px 12px 38px; border-left: 2px solid var(--border); margin-left: 8px;
}
ol.timeline li:before {
  content: ""; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent);
}
ol.timeline li.future:before { background: #ffffff; border: 2px solid var(--accent); }
ol.timeline li .date { color: var(--accent-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
                      font-size: 0.85em; letter-spacing: 0.03em; }
ol.timeline li b { display: block; margin-top: 2px; }
ol.timeline li span.desc { color: var(--muted); display: block; font-size: 0.92em; }

/* ------- terms ------- */
.terms-main { max-width: 900px; }
.terms-header { border-bottom: 1px solid var(--border); padding: 56px 0 36px; }
.terms-header h1 {
  color: var(--text);
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  margin: 8px 0 12px;
}
.terms-version {
  color: var(--accent-2);
  font-weight: 700;
  margin: 0 0 18px;
}
.terms-intro { color: #3c4250; font-size: 1.05em; margin: 0; max-width: 760px; }
.terms-document section { padding: 34px 0; }
.terms-document section > h2 {
  display: block;
  font-size: 22px;
  margin-bottom: 12px;
}
.terms-document section p { color: #3c4250; max-width: 780px; }
.terms-document section p:last-child { margin-bottom: 0; }
.terms-list { color: #3c4250; margin: 12px 0 0; max-width: 780px; padding-left: 24px; }
.terms-list li + li { margin-top: 10px; }
.terms-actions { padding-top: 34px; }

/* ------- footer ------- */
footer { padding: 32px 24px 48px; text-align: center; color: var(--muted); font-size: 0.9em; }

/* ------- responsive ------- */
@media (max-width: 720px) {
  nav.top .inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 18px;
  }
  nav.top .brand { font-size: 0.95em; }
  nav.top ul { gap: 16px; }

  .hero-banner { height: clamp(180px, 42vw, 260px); }
  .hero-content { padding: 28px 18px 24px; }
  .hero-lead { font-size: 1em; }
  main { padding: 0 18px; }
  section { padding: 40px 0; scroll-margin-top: 140px; }
  section > h1,
  section > h2 { font-size: 24px; }

  .card { padding: 18px; }
  .two-col { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; }
  .repo-id-row { align-items: stretch; flex-direction: column; }
  .terms-header { padding: 40px 0 28px; }
  .terms-intro { font-size: 1em; }
  .terms-document section { padding: 28px 0; }
  th, td { padding: 10px; }
}
