/* Nirwan Technologies — shared stylesheet.
   Plain CSS, no build step, no external fonts or CDNs.
   Design: flat surfaces, hairline rules, generous whitespace, one accent.
   Theme-aware via prefers-color-scheme. */

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --text: #17181c;
  --muted: #5c626e;
  --border: #e7e8ec;
  --border-strong: #d6d8de;
  --accent: #2c50d8;
  --accent-ink: #22409f;
  --focus: #2c50d8;
  --maxw: 64rem;
  --maxw-read: 42rem;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --surface: #191b20;
    --text: #eceef2;
    --muted: #a2a8b4;
    --border: #282b32;
    --border-strong: #363a43;
    --accent: #93a8ff;
    --accent-ink: #b9c6ff;
    --focus: #93a8ff;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 640;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.015em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

strong { font-weight: 640; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--read { max-width: var(--maxw-read); }

.muted { color: var(--muted); }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

/* ---------- header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 660;
  letter-spacing: -0.02em;
  color: var(--text);
  font-size: 1.02rem;
}
.wordmark:hover { text-decoration: none; }
.wordmark .mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem);
  border-bottom: 1px solid var(--border);
}
.hero h1 { max-width: 16ch; }
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 52ch;
  margin-top: 1rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 560;
  font-size: 0.98rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #10121a; }
}
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { background: var(--surface); text-decoration: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 8vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 46ch; margin-bottom: 2.5rem; }

/* ---------- product cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg);
  color: inherit;
  transition: border-color 0.15s ease;
}
a.card:hover { border-color: var(--border-strong); text-decoration: none; }
.card h3 { margin-bottom: 0.35rem; }
.card p { color: var(--muted); margin: 0; font-size: 0.97rem; }
.card .card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

/* ---------- feature list ---------- */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem 2rem;
}
.feature-list li { border-top: 2px solid var(--text); padding-top: 0.85rem; }
.feature-list h3 { font-size: 1.02rem; margin-bottom: 0.25rem; }
.feature-list p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- long-form / legal ---------- */
.doc { padding: clamp(2.5rem, 6vw, 4rem) 0 5rem; }
.doc h1 { margin-bottom: 0.25rem; }
.doc .doc-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 2.5rem; }
.doc h2 { margin-top: 2.5rem; }
.doc h3 { margin-top: 1.75rem; }
.doc ul, .doc ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.doc li { margin-bottom: 0.4rem; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}
.doc th, .doc td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
.doc th { background: var(--surface); font-weight: 600; }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  background: var(--surface);
}
.toc p { font-weight: 600; margin: 0 0 0.5rem; font-size: 0.9rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: 0.3rem; }

/* ---------- back link ---------- */
.backlink {
  display: inline-block;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.backlink:hover { color: var(--text); text-decoration: none; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--text); text-decoration: none; }
.footer-org { max-width: 40ch; }

/* ---------- utilities ---------- */
.stack > * + * { margin-top: 1rem; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }

/* ---------- 404 ---------- */
.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .nav-links { gap: 1rem; }
  .toc ol { columns: 1; }
}
