/* SPDX-License-Identifier: MIT -- Molecular website.
 * Its own look: a blue-black laboratory, a hexagonal lattice behind the menu, the menu a chain of atoms on a bond (the
 * page you are on the filled one), headings marked by atoms in the pedal's colours, pill-shaped controls in the
 * generator's yellow. Body type Atkinson Hyperlegible (legibility first), headings Space Grotesk, labels IBM Plex Mono. */
:root {
  --bg: #07090c;
  --bg2: #0e1218;
  --bg3: #151b24;
  --line: #222b37;
  --fg: #eceae4;
  --dim: #a3abb5;
  --gen: #ffe63c; --flt: #50dcff; --mod: #ff64d2; --res: #78ff78; --drv: #ff9628; --tim: #b4a0ff; --spc: #d2d2ff;
  --warn: #ff6450;
  --ok: #78ff78;
  --side: 250px;
  --max: 840px;
  --head: "Space Grotesk", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* the lattice: hexagons of thin lines, very faint */
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0v16M28 16 0 32v32l28 16 28-16V32zM28 80v17' fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1.2'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
}
a { color: var(--flt); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
code, pre { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--bg3); border-radius: 4px; padding: 0.08em 0.4em; }
pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--flt); outline-offset: 2px; }

/* the frame: the menu down the left on its lattice, the content beside it */
.layout { display: flex; min-height: 100vh; }
.side {
  width: var(--side); flex: none; position: sticky; top: 0; align-self: flex-start; height: 100vh;
  padding: 30px 24px; display: flex; flex-direction: column;
  background: var(--bg2) var(--lattice); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); text-decoration: none;
         font: 700 19px/1 var(--head); letter-spacing: 0.2em; }
.brand img { width: 40px; height: 40px; }
.top { display: flex; align-items: center; justify-content: space-between; }
.menu-btn, .menu-close, .menu-shade { display: none; }
/* the menu: atoms on one bond */
.side nav { position: relative; display: flex; flex-direction: column; margin: 40px 0 0; }
.side nav::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: 22px; width: 3px; background: var(--line); }
.side nav a { position: relative; display: flex; align-items: center; gap: 16px; padding: 9px 0; color: var(--dim);
              text-decoration: none; font-size: 18px; }
.side nav a::before { content: ""; flex: none; width: 25px; height: 25px; border-radius: 50%; background: var(--bg2);
                      border: 3px solid var(--line); box-sizing: border-box; transition: border-color 0.15s, background 0.15s; }
.side nav a:hover { color: var(--fg); }
.side nav a:hover::before { border-color: var(--dim); }
.side nav a[aria-current="page"] { color: var(--fg); font-weight: 700; }
.side nav a[aria-current="page"]::before { background: var(--gen); border-color: var(--gen); box-shadow: 0 0 0 5px rgba(255, 230, 60, 0.16); }
.donate { margin: auto 0 0; padding-top: 24px; display: flex; justify-content: center; }
.donate input[type="image"] { display: block; }
.donate-foot { display: none; }

.content { flex: 1; min-width: 0; padding: 0 56px; }
main { max-width: var(--max); padding: 44px 0 56px; }
main h1 { font: 700 40px/1.15 var(--head); letter-spacing: -0.01em; margin: 0 0 16px; }
main h2 { display: flex; align-items: center; gap: 14px; font: 700 28px/1.2 var(--head); margin: 56px 0 14px; }
main h2::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--c, var(--gen)); }
main h2:nth-of-type(6n+1) { --c: var(--gen); } main h2:nth-of-type(6n+2) { --c: var(--flt); }
main h2:nth-of-type(6n+3) { --c: var(--mod); } main h2:nth-of-type(6n+4) { --c: var(--res); }
main h2:nth-of-type(6n+5) { --c: var(--drv); } main h2:nth-of-type(6n+6) { --c: var(--tim); }
main h3 { font: 700 21px/1.3 var(--head); margin: 32px 0 8px; }
main h2, main h3 { scroll-margin-top: 20px; }
p.note { color: var(--dim); font-size: 15px; }
p.lead { font-size: 20px; color: var(--dim); margin: 0; max-width: 36em; }
.label { font: 500 13px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }

/* home: the logo, then the title beside a molecule moving (js/drift.js) */
.logo { display: block; width: 100%; max-width: 600px; height: auto; margin: 4px 0 30px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: center; }
.hero h1 { font-size: 32px; line-height: 1.25; margin: 0; }
.lede { font-size: 21px; line-height: 1.55; color: var(--fg); margin: 16px 0 0; }
.drift { width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, var(--bg3), var(--bg) 70%);
         border: 1px solid var(--line); display: block; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: 999px; font-weight: 700;
       font-size: 18px; text-decoration: none; border: 2px solid var(--fg); color: var(--fg); background: transparent;
       cursor: pointer; font-family: inherit; }
.btn::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.btn.primary { background: var(--gen); border-color: var(--gen); color: #000; }
.btn:hover { background: var(--bg3); color: var(--fg); }
.btn.primary:hover { background: #fff3a0; border-color: #fff3a0; color: #000; }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.btn.small { padding: 7px 16px; font-size: 16px; white-space: nowrap; }

/* features: atoms on cards */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 18px 0 0; }
.features > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.features dt { display: flex; align-items: center; gap: 10px; font: 700 19px/1.3 var(--head); }
.features dt::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--flt)); flex: none; }
.features > div:nth-child(6n+1) { --c: var(--gen); } .features > div:nth-child(6n+2) { --c: var(--flt); }
.features > div:nth-child(6n+3) { --c: var(--mod); } .features > div:nth-child(6n+4) { --c: var(--res); }
.features > div:nth-child(6n+5) { --c: var(--drv); } .features > div:nth-child(6n+6) { --c: var(--tim); }
.features dd { margin: 8px 0 0; color: var(--dim); }
.features ul { padding-left: 1.1em; margin: 6px 0 0; }
.features.wide { grid-template-columns: 1fr; }

.quote { position: relative; margin: 36px 0; padding: 22px 26px 22px 64px; font-size: 21px; line-height: 1.5;
         background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; }
.quote::before { content: ""; position: absolute; left: 24px; top: 28px; width: 20px; height: 20px; border-radius: 50%;
                 border: 4px solid var(--tim); box-sizing: border-box; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 14px 54px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
                    background: var(--bg3); border: 2px solid var(--line); display: grid; place-items: center;
                    font: 700 16px/1 var(--mono); }

.warn { background: rgba(255, 100, 80, 0.07); border: 1px solid rgba(255, 100, 80, 0.45); border-radius: 14px;
        padding: 16px 20px; margin: 24px 0; }
.warn p { margin: 0; }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--dim); font-size: 15px; max-width: var(--max); }
footer p { margin: 4px 0; }

/* documents */
main table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 16px 0; display: block; overflow-x: auto;
             border: 1px solid var(--line); border-radius: 12px; }
main th, main td { padding: 10px 14px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
main tr:last-child td { border-bottom: 0; }
main th { background: var(--bg2); font: 500 13px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
main td:first-child { white-space: nowrap; font-weight: 700; }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 20px; margin: 24px 0;
       padding: 16px 20px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; }
.toc a { display: block; padding: 3px 0; text-decoration: none; }
.toc a.sub { padding-left: 18px; color: var(--dim); }

/* the screens: as the pedal shows them, in a bezel */
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 22px 0 0; }
.screens figure { margin: 0; }
.screens img { display: block; width: 100%; height: auto; image-rendering: pixelated; background: #000;
               border: 10px solid #1b2029; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.screens figcaption { color: var(--dim); font-size: 16px; margin-top: 8px; }

/* the atoms, as the pedal draws them */
.atoms { display: grid; grid-template-columns: max-content max-content 1fr; gap: 8px 16px; margin: 18px 0 0; align-items: center; }
.atoms .sym { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #000;
              font: 700 15px/1 var(--mono); }
.atoms .nm { font: 700 17px/1.2 var(--head); letter-spacing: 0.04em; }
.atoms .what { color: var(--dim); }
@media (max-width: 600px) { .atoms { grid-template-columns: max-content 1fr; } .atoms .what { grid-column: 1 / -1; margin-bottom: 10px; } }

/* other projects */
.projects { display: grid; gap: 18px; margin: 34px 0 0; }
.project { --accent: var(--gen); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px 26px; }
.project-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
main .project h2 { margin: 0; font-size: 26px; }
main .project h2::before { background: var(--accent); }
.device { font: 500 13px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.project > p { margin: 12px 0 0; color: var(--dim); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* the installer */
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; margin-top: 22px; }
.status { font: 700 23px/1.3 var(--head); margin: 0 0 8px; }
.status.ok { color: var(--ok); } .status.bad { color: var(--warn); }
.detail { color: var(--dim); margin: 0; white-space: pre-line; }
.bar { height: 24px; background: var(--bg); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; margin: 18px 0 6px; }
.bar > div { height: 100%; width: 0; transition: width 0.2s;
             background: radial-gradient(circle, var(--gen) 5px, transparent 6px) 0 50% / 20px 20px repeat-x, rgba(255, 230, 60, 0.18); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; font-size: 17px; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--gen); }
.dev { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 0; }
.dev dt { font: 500 13px/1.9 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.dev dd { margin: 0; font-weight: 700; }
.file { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; font-size: 17px; }
.file input { font: inherit; color: var(--fg); }

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

/* narrow screens: the menu above the content, sliding in from the right */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { width: auto; height: auto; position: static; align-self: stretch; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 20px; }
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 46px; height: 46px;
              padding: 11px; background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
  .menu-btn span { display: block; height: 2px; background: var(--fg); border-radius: 1px; }
  .side nav { position: fixed; top: 0; right: 0; bottom: 0; width: min(80vw, 300px); z-index: 20; margin: 0;
              background: var(--bg2) var(--lattice); border-left: 1px solid var(--line); padding: 70px 22px 24px;
              transform: translateX(100%); transition: transform 0.22s ease; visibility: hidden; }
  .side nav::before { left: 33px; top: 92px; bottom: auto; height: calc(100% - 140px); }
  .menu-open .side nav { transform: none; visibility: visible; }
  .menu-close { display: block; position: absolute; top: 14px; right: 14px; width: 46px; height: 46px;
                background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--fg);
                font-size: 28px; line-height: 1; cursor: pointer; font-family: inherit; }
  .menu-close + a { margin-top: 10px; }
  .menu-shade { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.55); }
  .menu-open .menu-shade:not([hidden]) { display: block; }
  .donate-side { display: none; }
  .donate-foot { display: flex; justify-content: flex-start; margin: 18px 0 0; padding: 0; }
  .content { padding: 0 20px; }
  main { padding: 28px 0 44px; }
  main h1 { font-size: 32px; }
  main h2 { font-size: 25px; }
  .hero { grid-template-columns: 1fr; }
  .hero .drift { order: -1; width: 220px; height: 220px; margin: 0 auto; }
  .quote { padding-left: 56px; }
}
