/*
  Copyright (c) 2026 Anton Bespalov. All rights reserved.
  Licensed under the terms specified by the PolyForm Shield License 1.0.0
  Part of the csiNitka project https://github.com/ABespalov/csinitka

  Purpose: The look of nitka.csilab.am, in the palette of the unit's screen, portal and utility
  Contributors: None
*/

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --surface: #172033;
  --border: #334155;
  --text: #e2e8f0;
  --strong: #f8fafc;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --link: #93c5fd;
  --warm: #fbbf24;
  --radius: 10px;
  --width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

a { color: var(--link); }
a:hover { color: var(--strong); }
figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
code { font: 0.92em ui-monospace, Consolas, monospace; background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.skip-link { position: absolute; left: -999px; top: 0; padding: 8px 12px; background: var(--primary); color: #fff; z-index: 10; }
.skip-link:focus { left: 8px; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: var(--width); margin: auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--link); text-decoration: none; padding: 6px 0; font-weight: 500; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--strong); border-bottom: 2px solid var(--primary); }

.lang-switch {
  appearance: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.lang-switch:hover { background: var(--panel); color: var(--strong); border-color: var(--primary); }
.lang-switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

main { display: block; }
.section { max-width: var(--width); margin: auto; padding: 52px 20px; }
.section + .section { border-top: 1px solid var(--border); }
.eyebrow { color: var(--primary); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; margin: 0 0 8px; }
h1, h2, h3 { color: var(--strong); line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: clamp(28px, 5vw, 50px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 18px; }
p { margin: 0 0 16px; }
.lead { font-size: 18px; color: var(--text); max-width: 780px; }
.muted { color: var(--muted); }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 8px; background: #334155; color: var(--text); text-decoration: none; font-weight: 600; border: 0; cursor: pointer; }
.button:hover { background: #475569; color: var(--strong); }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); color: #fff; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

/* The line's boards side by side: a row a property, a column a board; it scrolls sideways on a phone. */
.compare-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 15px; }
.compare th, .compare td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.compare thead th { border-top: none; background: var(--panel); color: var(--strong); font-size: 17px; }
.compare tbody th { color: var(--muted); font-weight: 500; width: 22%; }
.compare .tier { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }

.note { background: var(--surface); border-left: 3px solid var(--warm); padding: 12px 16px; border-radius: 6px; color: var(--text); margin-top: 24px; }
.note.danger { border-left-color: #ef4444; margin: 0 0 20px; }

.docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.docs li { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.docs a, .docs strong { font-weight: 600; color: var(--link); }
.docs span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

/* No wider than the page: a long line, as the command under How to open, scrolls in its own box rather than
   widen the card, and the page with it, on a phone. */
/* What a release on the roadmap was of, beside its number. */
.card h3 .kind { margin-left: 6px; color: var(--muted); font-size: 0.85em; font-weight: 600; }
.downloads { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.product { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.product h3 { margin: 0 0 4px; }
.product .about { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.builds { display: grid; }
.platform { border-top: 1px solid var(--border); padding: 14px 0 4px; }
.platform h4 { margin: 0 0 6px; font-size: 16px; }
.platform.unavailable { opacity: 0.6; }
.download { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: center; padding: 6px 0; }
.download + .download { border-top: 1px dashed var(--border); }
.download .meta { color: var(--muted); font-size: 14px; grid-column: 1; margin: 0; }
.download .hash { font: 12px ui-monospace, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; word-break: break-all; grid-column: 1 / -1; margin: 0; }
.download .button { grid-row: 1 / span 2; grid-column: 2; }
.platform .meta { color: var(--muted); font-size: 14px; }
.download .same { color: var(--muted); font-size: 14px; grid-column: 1 / -1; margin: 0; }
/* The builds before the newest, folded under it, each with its own Download. */
.older { margin-top: 4px; }
.older summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 15px; padding: 6px 0; }
.older summary:hover { color: var(--strong); }
/* How to open a download, folded under the platforms but plain to see. */
.howto { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 15px; }
.howto summary { cursor: pointer; color: var(--link); font-weight: 600; }
.howto summary:hover { color: var(--strong); }
.howto ol { margin: 10px 0 8px; padding-left: 22px; }
.howto li + li { margin-top: 6px; }
.howto p { margin: 8px 0 6px; color: var(--muted); }
.howto pre { margin: 0; padding: 10px 12px; background: var(--surface); border-radius: 6px; overflow-x: auto; }
.howto pre code { padding: 0; background: none; overflow-wrap: normal; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.site-footer .section { padding: 28px 20px; display: flex; gap: 12px 16px; flex-wrap: wrap; justify-content: space-between; }

/* 1:1 pressed: the picture is at its own size, and a second press fits it again. */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 680px) {
  .site-header-inner { padding: 10px 16px; gap: 8px 12px; justify-content: space-between; }
  .brand img { width: 136px; }
  .lang-switch { order: 2; }
  /* Rows from the left, as text runs: spread out, a short last row would sit at both edges. */
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    gap: 2px 18px;
    justify-content: flex-start;
    font-size: 14px;
  }
  .section { padding: 32px 16px; }
  .lead { font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 16px; }
  .download { grid-template-columns: 1fr; gap: 8px; padding: 10px 0; }
  .download .button { grid-row: auto; grid-column: 1; justify-self: start; width: 100%; }
  .product { padding: 14px 16px; }
}

@media (max-width: 440px) {
  .cta-row .button { flex: 1 1 auto; }
}
