/* Nofa Applications shared styles. Dark theme, mobile first.
   Each app page sets its own accent with one variable: --accent. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #E99C46;
  --bg: #121317;
  --surface: #1A1C21;
  --surface-2: #22252B;
  --border: #30333B;
  --text: #EEEAE0;
  --muted: #B5B0A5;
  --on-accent: #17120B;
  --radius: 14px;
  --measure: 44rem;
  --wide: 66rem;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: 16px; top: -100px;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; z-index: 10;
}
.skip:focus { top: 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 13%), radial-gradient(circle at 50% 50%, #d9d6cf, #6f6d6a 75%);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 6px 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }

/* Breadcrumbs and app sub-navigation */
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 20px 0 0; padding: 0; font-size: 0.875rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--border); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.breadcrumbs a[aria-current] { color: var(--text); }

.subnav { margin-top: 14px; }
.subnav ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.subnav a {
  display: inline-block; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 0.875rem; line-height: 1.4;
}
.subnav a:hover { color: var(--text); border-color: var(--muted); }
.subnav a[aria-current] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* Main content */
main { padding-bottom: 56px; }
.prose { max-width: var(--measure); }
.page-head { margin: 32px 0 24px; }
.page-icon { display: block; border-radius: 18px; margin-bottom: 16px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); margin: 0 0 10px; font-weight: 750; }
h2 { font-size: 1.45rem; margin: 2.2em 0 0.6em; font-weight: 700; }
h3 { font-size: 1.12rem; margin: 1.6em 0 0.4em; font-weight: 650; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin: 0.3em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose strong { color: #fff; font-weight: 650; }
.updated, .byline, .meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

blockquote {
  margin: 1.2em 0; padding: 0.6em 1em; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text);
}
blockquote p:last-child { margin-bottom: 0; }

/* Tables scroll inside their own box on small screens, never the page. */
.table-wrap { overflow-x: auto; margin: 1.2em 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
caption { text-align: left; padding: 12px 14px 0; color: var(--muted); font-size: 0.85rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; background: var(--surface); }
tbody th { font-weight: 600; color: var(--text); }
.facts tbody th { width: 34%; }
.facts td a { overflow-wrap: anywhere; }

/* Call to action */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 1.4em 0 0.4em; }
.btn {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  font-weight: 650; text-decoration: none; padding: 12px 20px; border-radius: 999px;
}
.btn:hover { filter: brightness(1.08); }
.cta-note { color: var(--muted); font-size: 0.875rem; }

/* Boxes made with ":::name" in Markdown */
.box { margin: 1.4em 0; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.box > :last-child { margin-bottom: 0; }
.box-label { font-weight: 700; margin: 0 0 0.4em; }
.box-todo { border: 2px dashed var(--accent); }
.box-todo .box-label { color: var(--accent); }

.box-steps { padding: 0; background: none; border: 0; }
.box-steps ol { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.box-steps li {
  counter-increment: step; position: relative; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px 16px 62px;
}
.box-steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 15px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.95rem;
}

/* App cards and lists */
.cards { list-style: none; padding: 0; margin: 1em 0; display: grid; gap: 14px; }
.card {
  display: flex; gap: 16px; align-items: flex-start; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.card img { border-radius: 16px; flex: none; }
.card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0 0 6px; }
.card-meta { color: var(--muted); font-size: 0.875rem; }

.article-list { list-style: none; padding: 0; margin: 1em 0; }
.article-list li { padding: 14px 0; border-bottom: 1px solid var(--border); margin: 0; }
.article-list h3 { margin: 0 0 4px; }
.article-list p { margin: 0 0 4px; }

.link-list { padding-left: 1.2em; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 1.6em; }
.toc-title { font-size: 1rem; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.2em; }

.related {
  max-width: var(--measure); margin-top: 40px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.related h2 { margin: 0 0 8px; font-size: 1.1rem; }
.related ul { margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--muted); font-size: 0.9rem; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.footer-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); margin: 0 0 8px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 4px 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-contact { margin: 28px 0 6px; }
.footer-note { margin: 0; font-size: 0.8rem; }

@media (min-width: 720px) {
  body { font-size: 1.0625rem; }
  .page-head { margin-top: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .subnav, .skip { display: none; }
  a { color: #000; }
}
