/* =====================================================================
   NTTools release site — simple theme: plain white surfaces, thin 1px
   borders, square corners, no shadows or blur.
   ===================================================================== */

@font-face {
  font-family: "akkurat-mono";
  src: url("/static/fonts/akkurat-mono.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:          #f7f7f8;
  --panel:       #ffffff;
  --hover:       #f3f4f6;
  --text:        #111827;
  --text-muted:  #4b5563;
  --text-dim:    #6b7280;
  --border:      #d1d5db;
  --hairline:    #e5e7eb;

  --link:        #1d4ed8;
  --link-hover:  #1e40af;

  --success:     #15803d;
  --warn:        #a16207;

  --mono: "akkurat-mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; border-radius: 0; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

main {
  flex: 1;
  width: calc(100% - 32px);
  max-width: 1040px;
  margin: 20px auto 0;
  padding: 0 32px 40px;
  background: var(--panel);
  border: 1px solid var(--border);
}

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

h1, h2, h3, h4 { color: var(--text); }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.3px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 12px; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(16px, calc((100% - 1040px) / 2));
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 24px; height: 24px; }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: -0.3px; color: var(--text); }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  color: var(--text);
  padding: 5px 14px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
}
.topnav a:hover {
  color: var(--text);
  text-decoration: none;
  border-color: var(--border);
  background: var(--hover);
}

/* ---- Footer ---- */
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: calc(100% - 32px);
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 0 28px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.footer-dim { color: var(--text-dim); }

/* ---- Buttons ---- */
.btn, .btn-primary {
  display: inline-block;
  padding: 7px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
}
.btn:hover, .btn-primary:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--hover);
  border-color: var(--text-dim);
}
.btn-primary { color: #fff; background: var(--link); border-color: var(--link); }
.btn-primary:hover { color: #fff; background: var(--link-hover); border-color: var(--link-hover); }

/* ---- Sections ---- */
.section { padding: 40px 0; border-top: 1px solid var(--hairline); }
.section-top { padding-top: 32px; border-top: none; }
.section-kicker {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin: 0 0 6px;
}
.section-title { font-size: 30px; letter-spacing: -0.8px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.section-sub { max-width: 640px; font-size: 16px; color: var(--text-muted); margin: 0 0 8px; }
.back-link { display: inline-block; font-size: 13px; font-weight: 500; margin-bottom: 12px; }

/* ---- Inline notice ---- */
.notice {
  margin-top: 20px;
  max-width: 620px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #713f12;
  background: #fefce8;
  border: 1px solid #eab308;
}

/* ---- Index: project rows ---- */
.proj-list { margin-top: 24px; display: grid; gap: 8px; }
.proj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
}
.proj-row:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--hover);
  border-color: var(--text-dim);
}
.proj-main { min-width: 0; }
.proj-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.proj-name { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.proj-desc { font-size: 14px; margin: 2px 0 0; }
.proj-head .rel-badge { margin-left: 0; }
.proj-meta { flex-shrink: 0; margin-top: 0; text-align: right; white-space: nowrap; }

/* ---- Project: releases ---- */
.release { padding: 28px 0; border-top: 1px solid var(--hairline); }
.release:first-of-type { margin-top: 16px; }
.release-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.release-name { font-size: 21px; font-weight: 650; letter-spacing: -0.4px; margin: 0; }
.release-head .rel-badge { margin-left: 0; }
.release-date { margin: 0 0 0 auto; }

.rel-list { margin-top: 16px; display: grid; gap: 8px; }
.rel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.rel-row:hover { background: var(--hover); }
.rel-main { min-width: 0; }
.rel-name { font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.rel-file { color: var(--link); }
.rel-file:hover { color: var(--link-hover); text-decoration: underline; }
.rel-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--link);
  border: 1px solid currentColor;
  padding: 0 7px;
  vertical-align: middle;
}
.rel-badge-latest { color: var(--success); }
.rel-badge-pre { color: var(--warn); }
.rel-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Release notes (GitHub-rendered HTML) ---- */
.notes { margin-top: 22px; }
.notes-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 0;
}
.notes-title::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.notes-body { margin-top: 10px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.notes-body h1, .notes-body h2, .notes-body h3 { font-size: 16px; font-weight: 600; margin: 18px 0 8px; }
.notes-body ul, .notes-body ol { padding-left: 22px; margin: 0 0 12px; }
.notes-body code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--hover);
  border: 1px solid var(--hairline);
  padding: 0 4px;
}
.notes-body pre {
  background: var(--hover);
  border: 1px solid var(--hairline);
  padding: 12px 14px;
  overflow-x: auto;
}
.notes-body pre code { background: none; border: none; padding: 0; }
.notes-body img { max-width: 100%; }

@media (max-width: 560px) {
  main { width: 100%; margin-top: 0; padding: 0 16px 32px; border-left: none; border-right: none; border-top: none; }
  footer { width: calc(100% - 32px); }
  .rel-row, .proj-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .proj-meta { text-align: left; white-space: normal; }
  .release-date { margin-left: 0; width: 100%; }
  .section-title { font-size: 26px; }
}
