/* SPDX-License-Identifier: MIT -- Norilsk website (the frame after Tonitor's and Bigorna's; soot, smog, sulphur,
 * the oxide red of a poisoned river; a smelter's skyline at the foot of the window; grain over everything. The text
 * itself always on a near-solid plate, large and high in contrast) */
:root {
  --bg: #080705;
  --plate: rgba(15, 13, 10, 0.965);   /* the content's plate */
  --plate2: #1a1712;
  --line: #3a3429;
  --fg: #ede7d4;             /* ash white */
  --ash: #ddd5bf;
  --dim: #b9b09a;
  --sulphur: #d2b84a;        /* the accent */
  --oxide: #c4512c;          /* the red river: rules, warnings */
  --bile: #a9b04e;           /* (done: a sickly green) */
  --mid: #6d6555;
  --link: #e9dca6;
  --warn: #ef6a43;
  --side: 250px;
  --max: 880px;
  --head: "Big Shoulders Stencil Display", "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--fg);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.62;
  background-color: var(--bg);
  /* the polar night, black above, smog at the horizon (no glow: no sun); the smelter at the foot of it */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 220' preserveAspectRatio='xMidYMax slice'%3E%3Cg fill='%23040302'%3E%3Crect x='0' y='196' width='1600' height='24'/%3E%3Crect x='70' y='60' width='22' height='160'/%3E%3Crect x='104' y='30' width='26' height='190'/%3E%3Crect x='142' y='84' width='18' height='136'/%3E%3Crect x='40' y='150' width='160' height='70'/%3E%3Cpath d='M300 220 L318 120 Q340 104 362 120 L380 220 Z'/%3E%3Crect x='420' y='132' width='240' height='88'/%3E%3Crect x='460' y='104' width='60' height='30'/%3E%3Crect x='600' y='70' width='16' height='150'/%3E%3Crect x='660' y='170' width='300' height='14'/%3E%3Crect x='700' y='150' width='10' height='70'/%3E%3Crect x='820' y='150' width='10' height='70'/%3E%3Crect x='980' y='96' width='30' height='124'/%3E%3Crect x='1022' y='20' width='34' height='200'/%3E%3Crect x='1070' y='54' width='24' height='166'/%3E%3Crect x='950' y='160' width='190' height='60'/%3E%3Cpath d='M1220 220 L1240 112 Q1266 94 1292 112 L1312 220 Z'/%3E%3Crect x='1360' y='140' width='200' height='80'/%3E%3Crect x='1400' y='80' width='14' height='140'/%3E%3C/g%3E%3Cg fill='%23c4512c' opacity='.5'%3E%3Crect x='104' y='44' width='26' height='6'/%3E%3Crect x='104' y='66' width='26' height='6'/%3E%3Crect x='1022' y='36' width='34' height='6'/%3E%3Crect x='1022' y='60' width='34' height='6'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(to bottom, #050403 0%, #0a0907 38%, #110f0c 72%, #1a1814 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: bottom center, top left;
  background-size: 100% 190px, 100% 100%;
  background-attachment: fixed;
}
/* the grain: smog and soot over everything */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0.11; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.78 0 0 0 0 0.55 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* a stained band across the top: soot, rust, a thread of sulphur */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 8px; z-index: 30;
  background: linear-gradient(to bottom, transparent 6px, var(--sulphur) 6px, var(--sulphur) 7px, transparent 7px),
              repeating-linear-gradient(-45deg, #2d2418 0 14px, #120e09 14px 28px);
  border-bottom: 1px solid #000;
}
a { color: var(--link); text-decoration-color: var(--mid); text-underline-offset: 3px; }
a:hover { color: #fff6cf; text-decoration-color: var(--sulphur); }
:focus-visible { outline: 3px solid var(--sulphur); outline-offset: 3px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em; }
code { background: var(--plate2); border: 1px solid var(--line); border-radius: 2px; padding: 0.05em 0.35em; }
pre { background: #060504; border: 1px solid var(--line); border-left: 3px solid var(--oxide); padding: 14px 16px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }
img { max-width: 100%; }

/* the frame: the menu down the left, the content on a plate beside it */
.layout { display: flex; min-height: 100vh; padding-top: 8px; }
.side {
  width: var(--side); flex: none; position: sticky; top: 8px; align-self: flex-start; height: calc(100vh - 8px);
  padding: 26px 22px; background: rgba(6, 5, 4, 0.94); border-right: 2px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { display: block; text-decoration: none; }
.brand img { display: block; width: 100%; height: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 22px;
        margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.menu-btn, .menu-close, .menu-shade { display: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--dim); text-decoration: none; padding: 7px 12px; border-left: 3px solid transparent;
              font-family: var(--head); font-weight: 800; font-size: 23px; letter-spacing: 0.07em; text-transform: uppercase; }
.side nav a:hover { color: var(--fg); background: var(--plate2); }
.side nav a[aria-current="page"] { color: var(--fg); background: var(--plate2); border-left-color: var(--sulphur); }
.donate { margin: auto 0 0; padding-top: 28px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.donate input[type="image"] { display: block; filter: grayscale(1) contrast(1.1); opacity: 0.8; }
.donate input[type="image"]:hover { filter: none; opacity: 1; }
.donate-foot { display: none; }

.content { flex: 1; min-width: 0; padding: 28px 40px 200px; }
main { max-width: var(--max); padding: 36px 42px 46px; background-color: var(--plate);
       border: 1px solid var(--line); border-top: 3px solid var(--oxide);
       box-shadow: 0 30px 60px -30px #000; }
main h1, main h2, main h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ash); }
main h1 { font-size: 50px; line-height: 1.02; margin: 0 0 16px; font-weight: 800; }
main h2 { font-size: 36px; line-height: 1.08; margin: 52px 0 12px; padding: 12px 0 0 14px; border-top: 1px solid var(--line);
          border-left: 4px solid var(--oxide); font-weight: 800; }
main h3 { font-size: 27px; margin: 30px 0 8px; font-weight: 800; color: var(--sulphur); }
main h2, main h3 { scroll-margin-top: 24px; }
p.note { color: var(--dim); font-size: 16px; }

/* home */
.hero { padding: 4px 0 6px; }
.hero h1 { font-size: 40px; line-height: 1.1; max-width: 22em; margin: 0; }
.hero p { color: var(--fg); font-size: 21px; max-width: 36em; margin: 18px 0 0; }
.hero p.grim { color: var(--dim); font-size: 19px; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.btn { display: inline-block; padding: 11px 22px; font-weight: 800; text-decoration: none; border: 2px solid var(--ash);
       color: var(--fg); background: transparent; font-size: 21px; cursor: pointer; font-family: var(--head);
       letter-spacing: 0.07em; text-transform: uppercase; border-radius: 0; }
.btn.primary { background: var(--sulphur); border-color: var(--sulphur); color: #0b0904; }
.btn:hover { background: var(--plate2); color: #fff; }
.btn.primary:hover { background: #ead372; border-color: #ead372; color: #0b0904; }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* the demos: one plays at a time, looped until stopped; a spectrum while one plays (js/demo.js) */
.demo { position: relative; margin: 36px 0 8px; padding: 24px 30px 14px; overflow: hidden;
        background-color: #0d0b08; border: 1px solid var(--line); border-top: 3px solid var(--sulphur); }
.demo-head { position: relative; z-index: 1; }
.demo-title { margin: 0; font-family: var(--head); font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: 0.06em;
              text-transform: uppercase; color: var(--ash); }
.demo-state { margin: 8px 0 0; color: var(--dim); font-size: 16px; }
.demo-scope { position: absolute; right: 30px; top: 18px; width: 46%; height: 62px; opacity: 0.95;
              -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%); mask-image: linear-gradient(90deg, transparent, #000 25%); }
.demo-list { list-style: none; margin: 18px 0 0; padding: 0; position: relative; z-index: 1; }
.demo-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 12px 0;
                border-top: 1px solid var(--line); }
.demo-name { font-weight: 700; color: var(--fg); }
.demo-name small { display: block; font-weight: 400; color: var(--dim); font-size: 16px; }
.demo-bpm { color: var(--dim); font-size: 16px; font-variant-numeric: tabular-nums; }
.demo-play { width: 50px; height: 50px; border-radius: 0; display: grid; place-items: center; padding: 0;
             border: 2px solid var(--sulphur); background: var(--sulphur); color: #0b0904; cursor: pointer;
             transition: background-color 0.15s ease; }
.demo-play:hover { background: #ead372; border-color: #ead372; }
.demo-play svg { width: 20px; height: 20px; fill: currentColor; }
.demo-play .i-stop, li.on .demo-play .i-play { display: none; }
li.on .demo-play .i-stop { display: block; }
li.on .demo-play { background: transparent; color: var(--sulphur); }
li.wait .demo-play { opacity: 0.6; cursor: progress; }

/* the machine, drawn: generators, effect slots, the master */
.flow { margin: 22px 0 6px; padding: 18px; background: #0b0907; border: 1px solid var(--line); }
.flow svg { display: block; width: 100%; height: auto; }
.layers { counter-reset: lv; list-style: none; padding: 0; margin: 18px 0 0; }
.layers li { counter-increment: lv; position: relative; padding: 14px 0 14px 66px; border-top: 1px solid var(--line); }
.layers li::before { content: counter(lv); position: absolute; left: 0; top: 14px; width: 44px; height: 44px;
                     border: 2px solid var(--oxide); color: var(--sulphur); display: grid; place-items: center;
                     font-family: var(--head); font-weight: 800; font-size: 26px; }
.layers b { color: var(--ash); }

.features { display: grid; grid-template-columns: max-content 1fr; gap: 10px 26px; margin: 16px 0 0; }
.features dt { font-weight: 700; color: var(--ash); }
.features dd { margin: 0; color: var(--dim); }

/* the FM-1's screen, as the firmware draws it */
.shot { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; padding-top: 26px; margin-top: 26px;
        border-top: 1px solid var(--line); }
.shot img { display: block; width: 240px; height: 240px; image-rendering: pixelated; border: 6px solid #020201;
            outline: 1px solid var(--line); box-sizing: content-box; }
main .shot h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 30px; }
.shot p { margin: 0 0 8px; color: var(--dim); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 12px 54px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border: 2px solid var(--mid);
                    color: var(--ash); display: grid; place-items: center; font-weight: 800; font-family: var(--head); font-size: 23px; }

.warn { border-left: 5px solid var(--warn); padding: 8px 0 8px 18px; margin: 22px 0; background: rgba(196, 81, 44, 0.08); }
.warn p { margin: 0; }

footer { padding: 24px 0 40px; color: var(--dim); font-size: 16px; max-width: var(--max); }
footer p { margin: 4px 0; }

/* documents (manual, changelog) */
main table { border-collapse: collapse; width: 100%; margin: 14px 0; display: block; overflow-x: auto; }
main th, main td { border: 1px solid var(--line); padding: 8px 12px; vertical-align: top; text-align: left; }
main th { background: var(--plate2); font-family: var(--head); text-transform: uppercase; letter-spacing: 0.05em; font-size: 20px; color: var(--ash); }
main td:first-child { white-space: nowrap; }
main blockquote { border-left: 4px solid var(--oxide); margin: 16px 0; padding: 4px 18px; color: var(--dim); }
.toc { border-left: 3px solid var(--line); padding: 4px 0 4px 18px; columns: 2 240px; margin: 20px 0; }
.toc a { display: block; padding: 2px 0; text-decoration: none; }
.toc a.sub { padding-left: 16px; color: var(--dim); }

/* other projects */
p.lead { font-size: 21px; color: var(--dim); margin: 0; max-width: 36em; }
.projects { display: grid; gap: 24px; margin: 34px 0 0; }
.project { --accent: var(--mid); background-color: var(--plate2); border: 1px solid var(--line); border-top: 4px solid var(--accent);
           padding: 24px 28px 26px; }
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; }
main .project h2 { margin: 0; padding: 0; border: 0; font-size: 34px; }
.device { color: var(--dim); font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.project > p { margin: 12px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn.small { padding: 6px 16px; font-size: 18px; white-space: nowrap; }
.editions { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.editions li { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center;
               padding: 16px 0; border-bottom: 1px solid var(--line); }
.editions li:last-child { border-bottom: 0; padding-bottom: 0; }
.ed-name { font-weight: 700; font-size: 20px; }
.ed-note { color: var(--dim); font-size: 17px; line-height: 1.5; margin: 4px 0 0; }
.ed-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tag { display: inline-block; margin-left: 10px; padding: 1px 9px; border: 1px solid var(--line);
       color: var(--dim); font-size: 14px; font-weight: 700; vertical-align: 2px; }
.tag.current { color: var(--fg); border-color: var(--sulphur); }

/* apps */
.apps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 34px 0 0; }
.app { --accent: #e0784a; min-width: 0; background-color: var(--plate2); border: 1px solid var(--line); border-top: 4px solid var(--accent);
       padding: 24px 28px 26px; }
.app-head { display: flex; align-items: center; gap: 18px; }
.app-icon { width: 72px; height: 72px; border-radius: 16px; flex: none; }
main .app h2 { margin: 0 0 4px; padding: 0; border: 0; font-size: 34px; }
main .app h3 { margin: 26px 0 8px; font-size: 24px; }
.app > p { margin: 16px 0 0; }
.app-art { display: block; width: 100%; height: auto; margin: 20px 0 0; }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 0; }
.stores a { display: block; line-height: 0; border-radius: 8px; }
.stores img { height: 44px; width: auto; }
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 24px 0 0; }
.shots a { display: block; line-height: 0; border: 1px solid var(--line); overflow: hidden; }
.shots img { width: 100%; height: auto; }
.shots a:hover, .shots a:focus-visible { border-color: var(--accent); }
.app-features { margin: 0; padding-left: 1.2em; }
.app-features li { margin: 6px 0; }

/* the installer and the backup page */
.panel { background-color: var(--plate2); border: 1px solid var(--line); border-left: 4px solid var(--sulphur); padding: 24px 28px; margin-top: 20px; }
.status { font-size: 27px; font-weight: 800; margin: 0 0 8px; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.05em; }
.status.ok { color: var(--bile); } .status.bad { color: var(--warn); }
.detail { color: var(--dim); margin: 0; white-space: pre-line; }
.bar { height: 22px; background: var(--bg); border: 2px solid var(--ash); overflow: hidden; margin: 16px 0 6px; }
.bar > div { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--sulphur) 0 12px, #8a7630 12px 24px); transition: width 0.2s; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; font-size: 18px; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--sulphur); }
.dev { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 10px 0 0; }
.dev dt { color: var(--dim); }
.dev dd { margin: 0; font-weight: 700; }

/* narrow screens: the menu above the content */
@media (max-width: 860px) {
  body { background-size: 160% 120px, 100% 100%; font-size: 18px; }
  .layout { flex-direction: column; }
  .side { width: auto; height: auto; position: static; align-self: stretch; border-right: 0; border-bottom: 2px solid var(--line); padding: 16px 20px 12px; }
  .brand img { width: auto; height: 34px; }
  .top { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; flex: none;
              padding: 10px; background: none; border: 1px solid var(--line); cursor: pointer; }
  .menu-btn span { display: block; height: 2px; background: var(--fg); }
  .side nav { position: fixed; top: 0; right: 0; bottom: 0; width: min(80vw, 300px); z-index: 60;
              background: #070605; border-left: 2px solid var(--line); padding: 64px 18px 24px;
              transform: translateX(100%); transition: transform 0.22s ease; visibility: hidden; }
  .menu-open .side nav { transform: none; visibility: visible; }
  .side nav a { font-size: 24px; padding: 11px 14px; }
  .menu-close { display: block; position: absolute; top: 12px; right: 12px; width: 44px; height: 44px;
                background: none; border: 1px solid var(--line); color: var(--fg);
                font-size: 28px; line-height: 1; cursor: pointer; font-family: inherit; }
  .menu-shade { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.65); }
  .menu-shade[hidden] { display: none; }
  .menu-open { overflow: hidden; }
  .donate-side { display: none; }
  .donate-foot { display: flex; margin: 24px 0 8px; padding-top: 24px; }
  .content { padding: 16px 12px 130px; }
  main { padding: 24px 18px 34px; }
  main h1 { font-size: 40px; }
  main h2 { font-size: 30px; }
  .hero h1 { font-size: 31px; }
  .features { grid-template-columns: 1fr; gap: 0; }
  .features dd { margin-bottom: 10px; }
  .shot { grid-template-columns: 1fr; gap: 14px; }
  .project { padding: 20px 18px 22px; }
  .app { padding: 20px 18px 22px; }
  main .app h2 { font-size: 28px; }
  .app-icon { width: 56px; height: 56px; border-radius: 13px; }
  .shots { grid-template-columns: 1fr; }
  .editions li { grid-template-columns: 1fr; }
  .ed-links { justify-content: flex-start; }
  .demo { padding: 20px 18px 10px; }
  .demo-scope { right: 18px; width: 50%; height: 48px; opacity: 0.5; }
  .layers li { padding-left: 58px; }
  main td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .side nav, .bar > div { transition: none; } }
