/* Octet website. Colours, fonts and radii come from tokens.css (a copy of Octet Draw's brand/tokens.css; keep the
   two in step). White page, flat light grey blocks with no shadows, one blue block. Shape rule: buttons and chips
   are pills; blocks are 20px; the app picture is 14px, the radius of a window. */
/* The demo video plays muted on a loop, pauses when it scrolls out of view, and waits for a press when the visitor
   asks for reduced motion (site.js). */

@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --ground: var(--canvas);
  --block: var(--surface-sunken);
  --muted: var(--ink-muted);
  --underline: color-mix(in oklab, var(--brand) 32%, transparent);
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --block: var(--surface); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; -webkit-tap-highlight-color: transparent; background: var(--ground); color: var(--ink); font: 400 17px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
::selection { background: var(--brand-mist); color: var(--ink); }
a { color: inherit; text-decoration: underline 2px var(--underline); text-underline-offset: 0.22em; transition: text-decoration-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: currentColor; } }
a:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 6px; }
.btn:focus-visible, .chip:focus-visible { border-radius: 999px; }
.app:focus-visible { border-radius: 20px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; z-index: 3; background: var(--surface-raised); padding: 8px 12px; border-radius: 6px; }

/* Bar: 56px, the wordmark, the apps, GitHub, Download. */
.bar { position: sticky; top: 0; z-index: 2; background: color-mix(in oklab, var(--ground) 88%, transparent); border-bottom: 1px solid var(--hairline); }
@supports (animation-timeline: scroll()) {
  .bar { animation: hairline linear both; animation-timeline: scroll(); animation-range: 0 64px; }
}
@keyframes hairline { from { border-bottom-color: transparent; } }
@supports (backdrop-filter: blur(1px)) { .bar { backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); } }
.bar-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.home { display: flex; align-items: center; margin-right: auto; }
/* The lockup is inline: the octagon turns once when a download starts, and shows its eight electrons on hover (the
   octet rule), two at a time round the sides. */
.lockup { display: block; height: 28px; width: auto; overflow: visible; }
.lockup .mark { fill: #213C99; transform-box: fill-box; transform-origin: center; }
.lockup .word { fill: var(--ink); }
.lockup .e { fill: var(--brand); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.4); transition: opacity 120ms ease, transform 160ms var(--ease-out-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lockup .mark { fill: #FFFFFF; } }
@media (hover: hover) and (pointer: fine) {
  .home:hover .e { opacity: 1; transform: none; transition-duration: 200ms, 260ms; }
  .home:hover .e:nth-child(2n) { transition-delay: 25ms; }
  .home:hover .e:nth-child(n+3) { transition-delay: 50ms; } .home:hover .e:nth-child(n+5) { transition-delay: 100ms; } .home:hover .e:nth-child(n+7) { transition-delay: 150ms; }
}
.lockup.turn .mark { animation: turn 640ms cubic-bezier(0.77, 0, 0.175, 1); }
@keyframes turn { to { transform: rotate(45deg); } }
.bar ul { display: flex; gap: 26px; margin: 0; padding: 0; list-style: none; font-size: 15px; font-weight: 500; }
.bar ul a { color: var(--brand); text-decoration-color: transparent; }
@media (hover: hover) and (pointer: fine) { .bar ul a:hover { text-decoration-color: var(--underline); } }

/* Buttons: pills. The visitor's own system is solid blue and comes first; the others are pale blue. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 22px;
  border-radius: 999px; background: var(--brand-mist); color: var(--brand);
  font: 600 17px/1 var(--font-sans); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease, transform 160ms var(--ease-out-strong);
}
.btn svg { width: 22px; height: 22px; transition: transform 200ms var(--ease-out-strong); }
@media (hover: hover) and (pointer: fine) { .btn:hover svg { transform: translateY(-1px) scale(1.06); } }
.btn.small { min-height: 32px; padding: 0 16px; font-size: 14px; background: var(--brand); color: var(--on-brand); }
.btn.big { min-height: 60px; padding: 0 28px; font-size: 18px; }
.btn.mine { background: var(--brand); color: var(--on-brand); }
.btn:not(.mine) .for { display: none; }
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: color-mix(in oklab, var(--brand-mist) 80%, var(--brand)); }
  .btn.small:hover, .btn.mine:hover { background: var(--brand-hover); }
}

/* Hero: the app's name and one line on the left, the downloads under it, then the app. */
.hero { padding-block: clamp(48px, 8vw, 104px) clamp(36px, 5vw, 56px); }
h1 { display: flex; flex-wrap: wrap; align-items: flex-end; font-weight: 600; font-size: clamp(52px, 8vw, 96px); line-height: 1; letter-spacing: -0.04em; }
h1 .draw { color: var(--brand); }
.tagline { margin-top: 16px; max-width: 22em; font-size: clamp(21px, 2.4vw, 28px); line-height: 1.3; letter-spacing: -0.015em; color: var(--muted); text-wrap: pretty; }
.get { margin-top: clamp(28px, 4vw, 40px); }
.downloads { display: flex; flex-wrap: wrap; gap: 12px; }
.meta a { white-space: nowrap; }
.meta { margin-top: 16px; font: 400 14px/1.5 var(--font-mono); color: var(--muted); }

.shot {
  display: block; width: 100%; height: auto; border-radius: 14px; background: var(--block);
  border: 1px solid var(--hairline);
}

/* Blocks: flat grey tiles of different sizes in one grid. */
.blocks { padding-top: clamp(72px, 10vw, 128px); }
.head { margin-bottom: 20px; font-size: clamp(30px, 3.6vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.block {
  display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 20px; background: var(--block);
  transition: transform 220ms var(--ease-out-strong), box-shadow 220ms ease, background-color 150ms ease;
}
.block > svg, .logos svg { width: 30px; height: 30px; margin-bottom: 14px; color: var(--brand); }
.block h3 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.block p { font-size: 16px; line-height: 1.45; color: var(--muted); }
.wide { grid-column: span 2; }
.logos { display: flex; gap: 12px; }


.open { background: var(--brand); color: var(--on-brand); }
.open > svg, .open p { color: inherit; }
.open p { opacity: 0.86; }
.open a { --underline: color-mix(in oklab, currentColor 45%, transparent); }

/* The Octet apps: three tiles, Draw live, the others to come. */
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.app { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 28px; border-radius: 20px; background: var(--block); color: var(--ink); text-decoration: none; transition: background-color 150ms ease, transform 160ms var(--ease-out-strong); }
@media (hover: hover) and (pointer: fine) { .live:hover { background: color-mix(in oklab, var(--block) 85%, var(--brand)); } }
.app img { width: 56px; height: 56px; margin-bottom: 14px; }
.app:not(.live) img { filter: grayscale(1); opacity: 0.45; }
.app h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.app p { font-size: 16px; color: var(--muted); }
.chip { margin-top: 18px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--outline); font-size: 14px; font-weight: 500; color: var(--muted); }
.live .chip { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.live:active { transform: scale(0.98); }

/* The last word: download again. */
.last { display: flex; flex-direction: column; align-items: center; gap: 28px; padding-block: clamp(96px, 12vw, 160px); text-align: center; }
.last h2 { font-size: clamp(36px, 5vw, 60px); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; }
.last .downloads { justify-content: center; }

/* Footer: one quiet line. */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 28px 40px; border-top: 1px solid var(--hairline); font-size: 14px; color: var(--muted); }
.foot img { width: 24px; height: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot .copy { margin-left: auto; }

/* Arrival: the hero settles in once, top to bottom, 50ms apart. Only transforms move, so if the animation never
   runs (a paused tab, a crawler) everything is still in place and fully visible. */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > *, .downloads > *, .meta { animation: rise 520ms var(--ease-out-strong) both; }
  .hero-text > :nth-child(2) { animation-delay: 50ms; }
  .hero .downloads > :nth-child(1) { animation-delay: 100ms; }
  .hero .downloads > :nth-child(2) { animation-delay: 140ms; }
  .hero .downloads > :nth-child(3) { animation-delay: 180ms; }
  .meta { animation-delay: 220ms; }
  .last .downloads > * { animation: none; }
}
@keyframes rise { from { transform: translateY(10px); } }

/* Blocks and app tiles fade up as they come into view, in a quick stagger. site.js sets data-reveal on <html> only
   when it can watch them, so without it nothing is ever hidden. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] :is(.block, .app):not(.in) { opacity: 0; transform: translateY(16px); transition: none; }
  [data-reveal] :is(.block, .app).in:not(.seen) { transition: opacity 500ms ease, transform 600ms var(--ease-out-strong), background-color 150ms ease; transition-delay: calc(var(--i, 0) * 45ms), calc(var(--i, 0) * 45ms), 0ms; }
}

/* The app grows to full size as it scrolls into view. Browsers without scroll timelines show it at full size. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .shot { animation: grow linear both; animation-timeline: view(); animation-range: cover 10% cover 45%; }
  }
}
@keyframes grow { from { transform: scale(0.94); } to { transform: scale(1); } }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .price { grid-row: auto; }
  .apps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bar ul { display: none; }
  .shot { border-radius: 10px; }
  .foot .copy { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .wide, .price { grid-column: auto; }
  .downloads { flex-direction: column; align-items: stretch; }
  .block { padding: 20px; }
  .block > svg { margin-bottom: 6px; }
}

/* Name to Structure: a small Octet Draw canvas. The name field, its suggestion and the faint structure that shows
   where the name will land are the app's own (editor.css .name-field, .name-suggestion, .ghost), and so is the
   Actions panel, here listing what Octet reads. The canvas is white in both themes, as the app's page is. */
/* One centred column: the heading, its line, then the canvas, so the eye runs straight down into the field. */
.n2s { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: clamp(56px, 8vw, 96px); }
.n2s-canvas { width: 100%; max-width: 760px; margin-top: 28px; text-align: left; }
.n2s h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; }
.n2s-line { margin-top: 8px; font-size: clamp(19px, 2vw, 22px); color: var(--muted); }
.n2s-canvas {
  --c-ink: #0F172A; --c-muted: #475569; --c-faint: #64748B; --c-hair: #E2E8F0; --c-sunken: #EEF2F8; --c-mist: #DCE4F6; --c-link: #213C99;
  --c-float: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.10);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
  cursor: text; padding: 16px; border: 1px solid var(--hairline); border-radius: 14px; background: #FFFFFF; color: var(--c-ink);
}
.n2s-top { position: relative; grid-column: 1; justify-self: center; width: min(360px, 100%); z-index: 1; }
.name-field {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--c-hair); border-radius: 10px; background: #FFFFFF; box-shadow: var(--c-float);
  color: var(--c-ink); font: 400 15px/1 var(--font-sans); outline: none; cursor: text; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.name-field:focus, .name-field.typing { border-color: #3F6BFF; box-shadow: var(--c-float), 0 0 0 2px #3F6BFF; }
.name-field::placeholder { color: var(--c-faint); }
.name-suggestion {
  position: absolute; left: 0; right: 0; top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0;
  padding: 4px 12px; border-radius: 6px; background: #FFFFFF; box-shadow: var(--c-float); color: var(--c-ink); font: 400 15px/1.4 var(--font-sans);
  animation: fade-in 150ms var(--ease-out-strong);
}
.name-suggestion[hidden] { display: none; }
.name-suggestion mark { background: var(--c-mist); color: var(--c-link); border-radius: 2px; }
.name-suggestion kbd { font: 11px var(--font-sans); color: var(--c-faint); }
@keyframes fade-in { from { opacity: 0; } }
.n2s-structure { grid-column: 1; grid-row: 2; display: grid; place-items: center; min-height: 300px; padding: 40px 8px 16px; }
.n2s-structure svg { grid-area: 1 / 1; display: block; max-width: 100%; max-height: 270px; height: auto; transition: opacity 180ms var(--ease-out-strong); }
.n2s-structure svg.ghost { opacity: 0.35; }
.n2s-problem { grid-column: 1; grid-row: 2; align-self: start; justify-self: center; margin-top: 52px; font-size: 14px; color: var(--c-muted); }
.n2s-problem:empty { display: none; }

/* What Octet reads, under the canvas, styled as the app's Actions panel. A row types its example. */
.actions { grid-column: 1; grid-row: 3; padding: 4px 4px 8px; border: 1px solid var(--c-hair); border-radius: 16px; background: #FFFFFF; cursor: default; }
.actions header { padding: 4px 4px 4px 8px; }
.actions h3 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--c-ink); }
.actions-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.action {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent;
  color: var(--c-ink); font: 400 13px/1 var(--font-sans); text-align: left; cursor: pointer; transition: background-color 150ms ease;
}
.action > svg { flex: none; width: 18px; height: 18px; color: var(--c-muted); }
.action-name { flex: 1; }
.action[aria-current="true"] { background: var(--c-mist); color: var(--c-link); }
.action[aria-current="true"] > svg { color: var(--c-link); }
.action:focus-visible { outline: none; box-shadow: 0 0 0 2px #3F6BFF; }
@media (hover: hover) and (pointer: fine) { .action:not([aria-current="true"]):hover { background: var(--c-sunken); } }

/* The price as a reaction: ChemDraw's price, an arrow with Octet over it, and Free. The arrow draws itself as the
   block comes into view (its .in from site.js), and is simply there without the script. */
.price-arrow span { font-size: 13px; font-weight: 600; }
.price-arrow svg { width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.price-arrow .shaft { stroke-dasharray: 112; }
.price-arrow .head { stroke-dasharray: 28; }
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] .price:not(.in) .shaft { stroke-dashoffset: 112; }
  [data-reveal] .price:not(.in) .head { stroke-dashoffset: 28; }
  [data-reveal] .price:not(.in) .price-arrow span { opacity: 0; }
  [data-reveal] .price.in:not(.seen) .shaft { transition: stroke-dashoffset 520ms cubic-bezier(0.77, 0, 0.175, 1) 260ms; }
  [data-reveal] .price.in:not(.seen) .head { transition: stroke-dashoffset 200ms var(--ease-out-strong) 720ms; }
  [data-reveal] .price.in:not(.seen) .price-arrow span { transition: opacity 300ms ease 600ms; }
}

/* The cursor: an arrow with a bond beside it, as in Octet Draw. Text and controls keep their own. */
@media (pointer: fine) {
  html { cursor: url("img/cursor.svg") 3 2, auto; }
  a, button, label, summary { cursor: pointer; }
  input, textarea, code { cursor: text; }
}


/* 404: a tert-butyl cation, drawn skeletal (a bare + by the vertex), and the way home. */
.lost { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 100dvh; text-align: center; }
.lost h1 { font-size: clamp(40px, 6vw, 64px); }
.lost p { max-width: 28em; font-size: 19px; color: var(--muted); }
.lost .btn { margin-top: 12px; }
.cation { width: 120px; height: auto; margin-bottom: 8px; color: var(--ink); }
.cation path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.cation text { fill: var(--brand); font: 600 26px/1 var(--font-sans); }
@media (prefers-reduced-motion: no-preference) {
  .cation { animation: wobble 2.4s cubic-bezier(0.77, 0, 0.175, 1) infinite alternate; transform-origin: 50% 50%; }
}
@keyframes wobble { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.name-field[aria-invalid="true"] { border-color: #B42323; }
.name-field[aria-invalid="true"]:focus { box-shadow: var(--c-float), 0 0 0 2px #B42323; }

/* Name to Structure, 20% larger on wide screens, and a soft red glow (the oxygen red, --atom-o) round the name
   field to draw the eye. The glow brightens once as the canvas comes into view (.lit from site.js). A visitor's
   own focus swaps it for the app's blue ring. */
@media (min-width: 1000px) { .n2s { zoom: 1.2; } }
.name-field, .name-field.typing { border-color: color-mix(in oklab, #C42B2B 45%, var(--c-hair)); box-shadow: var(--c-float), 0 0 0 4px rgba(196, 43, 43, 0.08), 0 0 28px 6px rgba(196, 43, 43, 0.22); transition: border-color 150ms ease, box-shadow 900ms ease; }
.name-field.lit { box-shadow: var(--c-float), 0 0 0 5px rgba(196, 43, 43, 0.14), 0 0 40px 12px rgba(196, 43, 43, 0.34); transition-duration: 150ms, 500ms; }
.name-field:focus { border-color: #3F6BFF; box-shadow: var(--c-float), 0 0 0 2px #3F6BFF; transition-duration: 150ms; }
.film { padding-top: clamp(72px, 10vw, 128px); }

/* What it does, in three levels: the price leads (brand mist, the biggest type on the section), Open source answers
   it in solid brand blue, and each feature takes one of Octet's atom colours: a pale wash with the icon in full. A
   block lifts and grows a little under the pointer. */
.grid > .block:not(.price, .open) { background: color-mix(in oklab, var(--tint) 14%, var(--ground)); }
.grid > .block:not(.price, .open) > svg, .grid > .block .logos svg { color: var(--tint); }
.grid > :nth-child(2) { --tint: var(--atom-metal); }
.grid > :nth-child(3) { --tint: var(--atom-halogen); }
.grid > :nth-child(4) { --tint: var(--atom-p); }
.grid > :nth-child(5) { --tint: var(--atom-o); }
.grid > :nth-child(6) { --tint: var(--atom-o); }
.grid > :nth-child(7) { --tint: var(--atom-metal); }
.grid > :nth-child(8) { --tint: var(--atom-halogen); }
.grid > :nth-child(9) { --tint: var(--atom-s); }
.grid > :nth-child(10) { --tint: var(--atom-n); }
.price {
  grid-column: span 2; grid-row: span 2; display: grid; grid-template-columns: auto 1fr auto; align-content: center; align-items: center;
  gap: 0 clamp(16px, 2.4vw, 28px); padding: clamp(28px, 4vw, 44px); background: var(--brand-mist);
}
.price .who { grid-row: 1; font-size: 16px; font-weight: 500; color: var(--muted); }
.price .who:nth-child(2), .price .now, .price .unit:nth-of-type(6) { grid-column: 3; }
.price .amount { grid-row: 2; margin-block: 8px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.price .was { color: var(--muted); font-size: clamp(36px, 3.8vw, 48px); text-decoration: line-through 3px color-mix(in oklab, #C42B2B 70%, transparent); text-decoration-skip-ink: none; }
.price .now { color: var(--brand); font-size: clamp(56px, 6.4vw, 84px); }
.price .unit { grid-row: 3; color: var(--muted); }
.price .source { grid-column: 1 / -1; grid-row: 4; margin-top: 28px; font-size: 13px; color: var(--muted); }
.price-arrow { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; justify-self: center; width: 100%; max-width: 120px; min-width: 56px; color: var(--brand); }
.price .who:first-child, .price .was, .price .unit:nth-of-type(5) { grid-column: 1; }
@media (hover: hover) and (pointer: fine) {
  .block:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 2px 4px color-mix(in oklab, var(--tint, var(--brand)) 8%, transparent), 0 18px 40px color-mix(in oklab, var(--tint, var(--brand)) 18%, transparent); }
  .grid > .block:not(.price, .open):hover { background: color-mix(in oklab, var(--tint) 20%, var(--ground)); }
}
@media (max-width: 900px) { .price { grid-row: auto; } }
@media (max-width: 560px) {
  .price { grid-column: auto; grid-template-columns: auto minmax(40px, 1fr) auto; }
  .price .was { font-size: 34px; }
  .price .now { font-size: 48px; }
}
.n2s-line .try { color: var(--brand); font-weight: 600; }
[data-count] { display: inline-block; font-variant-numeric: tabular-nums; }
[data-count][hidden] { display: none; }
/* The download count, on its own line under the buttons: larger, with a slow blue shimmer through it. */
.count { margin-top: 14px; min-height: 1.2em; font: 600 clamp(19px, 1.8vw, 22px)/1.2 var(--font-sans); letter-spacing: -0.015em; }
.count [data-count] {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand) 35%, var(--brand-bright) 50%, var(--brand) 65%, var(--brand) 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .count [data-count] { animation: shimmer 3.2s cubic-bezier(0.77, 0, 0.175, 1) infinite; }
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.count + .meta { margin-top: 6px; }
@media (prefers-reduced-motion: no-preference) { .count { animation: rise 520ms var(--ease-out-strong) 200ms both; } }

/* The tour: Name to Structure, then the other things Octet Draw does, each on the same small canvas. The canvases
   slide sideways (a slow ease-in-out: it is movement on screen), the heading above crossfades, and the tabs under
   it say where you are. site.js plays each demo, then moves on, until someone presses an arrow or a tab. */
.tour-heads { display: grid; }
.tour-head { grid-area: 1 / 1; transition: opacity 420ms ease, transform 520ms var(--ease-out-strong), visibility 0s; }
.tour-head:not(.on) { opacity: 0; transform: translateY(6px); visibility: hidden; transition: opacity 260ms ease, transform 260ms ease, visibility 0s 260ms; }
.tour-head kbd { display: inline-block; min-width: 1.5em; padding: 0 0.35em; border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 6px; font: 500 0.8em/1.45 var(--font-sans); color: var(--ink); text-align: center; }
.tour-stage { display: grid; grid-template-columns: 44px minmax(0, 760px) 44px; align-items: center; justify-content: center; gap: 20px; width: 100%; margin-top: 28px; }
.tour .n2s-canvas { margin-top: 0; max-width: none; }
.tour-view { overflow: hidden; padding: 6px; margin: -6px; }
.tour-track { display: flex; gap: 48px; transition: transform 900ms cubic-bezier(0.65, 0, 0.35, 1); }
.tour-slide { flex: 0 0 100%; display: flex; min-width: 0; }
.tour-slide > .n2s-canvas { flex: 1; }
.tour-arrow {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface-raised); color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 160ms var(--ease-out-strong), color 150ms ease, border-color 150ms ease;
}
.tour-arrow svg { width: 20px; height: 20px; }
.tour-arrow:active { transform: scale(0.94); }
.tour-arrow:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
@media (hover: hover) and (pointer: fine) { .tour-arrow:hover { color: var(--brand); border-color: color-mix(in oklab, var(--brand) 35%, var(--hairline)); } }
.tour-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 18px; }
.tour-tabs button {
  position: relative; overflow: hidden; padding: 7px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: 500 14px/1.2 var(--font-sans); cursor: pointer; transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out-strong);
}
.tour-tabs button:active { transform: scale(0.97); }
.tour-tabs button[aria-selected="true"] { background: var(--brand-mist); color: var(--brand); }
.tour-tabs button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
@media (hover: hover) and (pointer: fine) { .tour-tabs button[aria-selected="false"]:hover { background: var(--block); color: var(--ink); } }
@media (max-width: 700px) {
  .tour-stage { grid-template-columns: minmax(0, 1fr); }
  .tour-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tour-track, .tour-head, .tour-head:not(.on) { transition: none; } }

/* A demo canvas: the structure (the app's renderer, at 1.6 times), marks and a pointer over it, the keys being
   pressed at the bottom, and for the Actions demo, the panel. */
.demo-canvas { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; min-height: 420px; overflow: hidden; cursor: default; }
.demo-art { position: relative; max-width: 100%; }
.demo-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.demo-marks { opacity: 0.28; }
.demo-marks circle { fill: #3F6BFF; }
.demo-marks line { stroke: #3F6BFF; stroke-linecap: round; }
.demo-hover { fill: rgba(63, 107, 255, 0.14); }
.demo-box { fill: rgba(63, 107, 255, 0.14); stroke: #3F6BFF; stroke-width: 1; vector-effect: non-scaling-stroke; }
.demo-press { fill: none; stroke: #3F6BFF; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.demo-ink { fill: none; stroke: var(--c-ink); stroke-linecap: round; }
.demo-head { fill: var(--c-ink); }
.demo-text { fill: var(--c-ink); font-family: Arial, Helvetica, sans-serif; }
.demo-keys { position: absolute; left: 50%; bottom: 18px; display: flex; gap: 6px; transform: translateX(-50%); }
.demo-keys kbd {
  min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--c-hair); border-bottom-width: 3px; border-radius: 9px; background: #FFFFFF;
  box-shadow: var(--c-float); color: var(--c-ink); font: 500 15px/30px var(--font-sans); text-align: center;
}
.demo-panel {
  position: absolute; right: 16px; bottom: 16px; width: 248px; padding: 4px 4px 8px; border: 1px solid var(--c-hair); border-radius: 12px;
  background: #FFFFFF; box-shadow: var(--c-float); color: var(--c-ink); font: 400 13px/18px var(--font-sans); transform-origin: bottom right;
}
.demo-panel header { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 8px; }
.demo-panel h4 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; }
.demo-panel header svg { width: 16px; height: 16px; color: var(--c-faint); margin: 4px; }
.demo-row { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; transition: background-color 120ms ease, color 120ms ease; }
.demo-row svg, .demo-small svg { flex: none; width: 18px; height: 18px; color: var(--c-muted); }
.demo-smalls { display: flex; gap: 2px; padding: 2px 4px; }
.demo-small { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; transition: background-color 120ms ease; }
.demo-row.hot, .demo-small.hot { background: var(--c-sunken); }
.demo-row.on, .demo-small.on { background: var(--c-mist); color: var(--c-link); }
.demo-row.on svg, .demo-small.on svg { color: var(--c-link); }
.demo-facts { display: flex; justify-content: space-between; padding: 6px 8px 0; margin-top: 4px; border-top: 1px solid var(--c-hair); color: var(--c-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .demo-canvas { min-height: 360px; }
  .demo-panel { right: 8px; bottom: 8px; width: 210px; }
}
/* With the Actions panel, the structure sits to the left of it. */
.demo-canvas.with-panel { justify-items: start; padding-left: clamp(24px, 12%, 110px); }
@media (max-width: 700px) { .demo-canvas.with-panel { align-items: start; padding-top: 24px; } }
.demo-facts sub { font-size: 0.75em; vertical-align: -0.2em; line-height: 0; }

/* The name, spelt out: over "Octet" in the hero, each letter opens into its word (Open source Chemistry Toolkit for
   Experiments & Typesetting), the capitals turn blue, Draw folds away, and the line shrinks to fit (site.js sets the
   size). Each word opens a beat after the one before. */
.acro { flex-shrink: 0; white-space: nowrap; cursor: default; }
.cap { display: inline-block; transition: color 300ms ease; }
.xs { display: inline-grid; grid-template-columns: 0fr; opacity: 0; transition: grid-template-columns 650ms cubic-bezier(0.65, 0, 0.35, 1), opacity 400ms ease; }
.xs > span { overflow: hidden; white-space: pre; }
.xs.draw { grid-template-columns: 1fr; opacity: 1; }
h1.spelt .xs { grid-template-columns: 1fr; opacity: 1; }
h1.spelt .xs.draw { grid-template-columns: 0fr; opacity: 0; }
h1.spelt .cap { color: var(--brand); }
.acro .xs:nth-of-type(2) { transition-delay: 40ms; }
.acro .xs:nth-of-type(3) { transition-delay: 80ms; }
.acro .xs:nth-of-type(4) { transition-delay: 120ms; }
.acro .xs:nth-of-type(5) { transition-delay: 160ms; }
h1.sizing { transition: font-size 650ms cubic-bezier(0.65, 0, 0.35, 1); }
@media (prefers-reduced-motion: reduce) { .xs, .cap, h1.sizing { transition: none; } }

/* A page of text: the code signing policy. */
.doc { max-width: 720px; padding-block: clamp(48px, 8vw, 96px); overflow-wrap: anywhere; }
.doc h1 { margin: 12px 0 16px; font-size: clamp(36px, 5vw, 52px); }
.doc h2 { margin: 40px 0 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.doc p, .doc li { color: var(--ink); line-height: 1.6; }
.doc p + p, .doc ul + p { margin-top: 12px; }
.doc ul { margin: 0; padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
