/* Somike website.
   Three colours: sun (paper), ink (type and the microphone) and hot (whatever
   is playing right now). Things you press are keycaps, like the hotkeys of the
   soundboard: download, the demo keys, the issue links, step numbers. */

@font-face {
  font-family: "Dela Gothic One";
  src: url("assets/fonts/dela-gothic-one.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Radio Canada";
  src: url("assets/fonts/radio-canada.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sun: #ffcb1f;
  --sun-edge: #b38600;
  --sun-hover: #ffd84d;
  --ink: #2b0b3f;
  --ink-edge: #120318;
  --ink-hover: #3d1257;
  --hot: #ff5c9d;
  --hot-edge: #b8306b;
  --pale: #fff3c4;
  --display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --text: "Radio Canada", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --wrap: 1180px;
  /* Side padding that also centres the content on wide screens. */
  --gutter: max(20px, 5vw, calc((100% - var(--wrap)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--sun);
  color: var(--ink);
  font: 400 18px/1.55 var(--text);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 520px) { body { font-size: 17px; } }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 4px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--sun); }
.ink ::selection { background: var(--sun); color: var(--ink); }

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
  hyphens: auto;
  overflow-wrap: break-word;
}
h2 { font-size: clamp(2rem, 1.1rem + 3.2vw, 3.6rem); margin-bottom: 0.5em; }
h3 { margin: 0 0 0.35em; font-size: 1.15rem; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 1em; }
b, strong { font-weight: 700; }

kbd {
  position: relative;
  top: -0.12em;
  display: inline-block;
  min-width: 1.9em;
  margin: 0 0.05em;
  padding: 0.05em 0.45em 0.1em;
  border-radius: 6px;
  background: var(--ink);
  color: var(--sun);
  box-shadow: 0 3px 0 var(--ink-edge);
  font: 600 0.82em/1.5 var(--text);
  text-align: center;
  white-space: nowrap;
}
.ink kbd { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--sun-edge); }

code {
  padding: 0.08em 0.35em;
  border-radius: 5px;
  background: rgb(43 11 63 / 0.09);
  font: 0.88em/1.5 var(--mono);
  overflow-wrap: anywhere;
}
pre {
  margin: 0 0 1.2em;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--ink);
  color: var(--sun);
  font-size: 0.84rem;
  line-height: 1.6;
}
pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--sun);
  font-weight: 700;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ header and footer */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 36px;
  padding: 22px var(--gutter);
}
.logo { color: var(--ink); text-decoration: none; }
.logo svg { width: auto; height: 26px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-weight: 600; }
.top nav a { padding: 2px 0; border-bottom: 3px solid transparent; text-decoration: none; }
.top nav a:hover { border-bottom-color: currentColor; }
@media (max-width: 560px) {
  .top { gap: 10px; padding-block: 16px 8px; }
  .top nav { gap: 2px 18px; font-size: 15px; }
  .wide-only { display: none; }
}

.foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 22px 56px;
  padding: 56px var(--gutter) 64px;
  font-size: 0.95rem;
}
.foot ul { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 0; list-style: none; font-weight: 600; }
.foot p { grid-column: 1 / -1; max-width: 72ch; margin: 0; }
@media (max-width: 640px) { .foot { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ keycaps */

.download, .key, .reports a {
  transition: transform 70ms, box-shadow 70ms, background-color 120ms;
}
.download {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 28px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--sun);
  box-shadow: 0 8px 0 var(--ink-edge);
  text-decoration: none;
}
.download strong { font: 400 clamp(1.2rem, 1rem + 0.8vw, 1.55rem)/1.15 var(--display); }
.download span { font-size: 0.92rem; }
.download:hover { background: var(--ink-hover); }
.download:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink-edge); }

/* ------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  align-items: center;
  gap: 48px clamp(40px, 7vw, 120px);
  padding: clamp(8px, 3vw, 40px) var(--gutter) clamp(64px, 8vw, 112px);
}
.hero h1 { font-size: clamp(2.7rem, 1rem + 5vw, 5.6rem); margin-bottom: 0.4em; }
.lead { max-width: 36ch; margin-bottom: 1.6em; font-size: clamp(1.15rem, 1rem + 0.45vw, 1.38rem); line-height: 1.5; }
.fine { max-width: 48ch; margin: 28px 0 0; font-size: 0.95rem; }

.stage { display: grid; justify-items: center; }
.mic {
  width: min(100%, 300px);
  height: auto;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}
.mic-arms { fill: none; stroke: var(--ink); stroke-linecap: round; }
.mic-body { fill: var(--ink); cursor: pointer; transition: fill 120ms; }
.mic-body.on { fill: var(--hot); }
.mic-gaps { fill: var(--sun); stroke: var(--sun); stroke-width: 1.5; pointer-events: none; }
.mic-slits { fill: none; stroke: var(--sun); pointer-events: none; }

/* The cable of the microphone runs into the board. */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
  width: min(100%, 400px);
  padding: 12px 12px 18px;
  border-radius: 20px;
  background: var(--ink);
}
.key {
  min-height: 66px;
  padding: 8px 10px 10px;
  border: 0;
  border-radius: 11px;
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--sun-edge);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.key b { display: block; font: 400 1.35rem/1 var(--display); }
.key span { display: block; margin-top: 6px; font-size: 0.86rem; font-weight: 600; line-height: 1.2; }
.key:hover { background: var(--sun-hover); }
.key.on { background: var(--hot); box-shadow: 0 5px 0 var(--hot-edge); }
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sun-edge); }
.key:focus-visible { outline-color: var(--sun); }
.hint { margin: 16px 0 2px; font-size: 0.95rem; text-align: center; }
.status { min-height: 1.55em; margin: 0; font-weight: 700; text-align: center; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .mic { width: min(68vw, 280px); }
}

/* ------------------------------------------------------------ bands */

.band { padding: clamp(72px, 9vw, 128px) var(--gutter); }
.ink { background: var(--ink); color: var(--sun); }
.hot { background: var(--hot); color: var(--ink); }
.ink + .ink, .sun + .sun { padding-top: 0; }
.intro { max-width: 60ch; font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3rem); }

/* The signal path: one thick cable with a plug per stop. */
.path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(56px, 6vw, 80px) 0 0;
  padding: 0;
  list-style: none;
}
.path li { position: relative; padding: 30px 28px 0 0; border-top: 10px solid var(--sun); }
.path li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 8px var(--ink);
}
.path li:nth-child(2)::before { background: var(--hot); }
.path b { display: block; margin-bottom: 8px; font: 400 clamp(1.2rem, 1rem + 0.7vw, 1.6rem)/1.12 var(--display); }
.path span { display: block; max-width: 24ch; }
@media (max-width: 760px) {
  .path { grid-template-columns: minmax(0, 1fr); margin-left: 16px; }
  .path li { padding: 0 0 36px 40px; border-top: 0; border-left: 10px solid var(--sun); }
  .path li:last-child { padding-bottom: 0; }
  .path li::before { left: -26px; top: -6px; }
}

.points { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.points li { position: relative; max-width: 52ch; padding-left: 30px; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: currentColor;
}

/* ------------------------------------------------------------ the app, live */

/* App audio on ink, the soundboard on hot, the app window between them. */
.try {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  background: linear-gradient(90deg, var(--ink) 50%, var(--hot) 50%);
  overflow-x: clip;
}
.try-side { padding-block: clamp(72px, 9vw, 120px); }
.try-mic { padding-inline: var(--gutter) 56px; color: var(--sun); }
.try-sb { padding-inline: 56px var(--gutter); color: var(--ink); }
.try-side h2 { font-size: clamp(1.9rem, 1rem + 1.8vw, 2.8rem); }
.try-side .intro { font-size: 1.1rem; }
.try-mic kbd { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--sun-edge); }
.try-tab {
  margin-top: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 700 1.02rem/1.45 var(--text);
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.try-tab:hover { text-decoration-thickness: 4px; }
.try-stage { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 22px; padding-block: 72px; }
.try-caption {
  display: grid;
  align-content: center;
  max-width: 420px;
  /* Room for three lines, so the page doesn't move when the text changes. */
  min-height: calc(3 * 1.45em + 20px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  /* Sun on both halves: an ink pill would melt into the ink side. */
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--sun-edge);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.app-window { position: relative; z-index: 5; width: 420px; height: 660px; max-width: 100%; }
.win-body {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #0b0b0e;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.14), 0 40px 80px -30px rgb(18 3 24 / 0.85);
}
.app-window iframe {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #0b0b0e url("assets/demo-mic.webp") top / 100% auto no-repeat;
  color-scheme: dark;
}
.titlebar {
  display: flex;
  flex: none;
  align-items: center;
  height: 32px;
  background: #1f1f1f;
  color: #e8e8e8;
  font: 12px/1 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  user-select: none;
}
.win-icon { width: 16px; height: 16px; margin: 0 10px 0 12px; }
.titlebar span { flex: 1; }
.win-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: default;
}
.win-btn svg { width: 10px; height: 10px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1; }
.win-btn:hover { background: rgb(255 255 255 / 0.09); }
.win-btn:active { background: rgb(255 255 255 / 0.05); }
.win-btn.close:hover { background: #c42b1c; color: #fff; }
.win-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; border-radius: 0; }
.restore-icon, .max .max-icon { display: none; }
.max .restore-icon { display: block; }

.app-window.max { position: fixed; inset: 0; z-index: 100; width: auto !important; height: auto !important; max-width: none; }
.app-window.max .win-body { border-radius: 0; }
html.app-max { overflow: hidden; }

/* Resize grips just outside the edges, like Windows. */
.grip { position: absolute; z-index: 2; touch-action: none; }
.grip-e { top: 40px; right: -7px; bottom: 18px; width: 14px; cursor: ew-resize; }
.grip-s { left: 18px; right: 18px; bottom: -7px; height: 14px; cursor: ns-resize; }
.grip-se { right: -9px; bottom: -9px; width: 26px; height: 26px; cursor: nwse-resize; }
.max .grip { display: none; }
.resizing iframe { pointer-events: none; }
.resizing { user-select: none; }

.cracks { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: hidden; border-radius: 10px; pointer-events: none; }
.crack { fill: none; stroke: rgb(255 255 255 / 0.92); stroke-linecap: round; }
.crack-shade { fill: none; stroke: rgb(0 0 0 / 0.5); stroke-linecap: round; }
.shards { position: fixed; z-index: 90; pointer-events: none; }
.shard { position: absolute; inset: 0; background-color: #0b0b0e; background-repeat: no-repeat; }

@media (max-width: 1079px) {
  .try { grid-template-columns: minmax(0, 1fr); background: none; }
  .try-mic { padding: 72px var(--gutter) 32px; background: var(--ink); }
  .try-stage { padding: 24px var(--gutter); background: linear-gradient(var(--ink) 50%, var(--hot) 50%); }
  .try-sb { padding: 32px var(--gutter) 72px; background: var(--hot); }
  .app-window { width: 440px; height: 640px; }
}

/* ------------------------------------------------------------ install */

.install {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 48px clamp(40px, 6vw, 96px);
  margin-top: 12px;
}
@media (max-width: 860px) { .install { grid-template-columns: minmax(0, 1fr); } }
.steps { display: grid; gap: 30px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  min-height: 58px;
  padding: 12px 0 0 80px;
  counter-increment: step;
  font-size: clamp(1.08rem, 1rem + 0.3vw, 1.25rem);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--sun);
  box-shadow: 0 5px 0 var(--ink-edge);
  font: 400 1.6rem/1 var(--display);
}
.facts ul { margin: 0 0 1em; padding-left: 1.2em; }
.facts li + li { margin-top: 0.3em; }
.note { margin-bottom: 30px; padding: 20px 22px 4px; border: 3px solid currentColor; border-radius: 16px; }
.hash { font-size: 0.95rem; }
.hash code { display: block; margin-top: 4px; font-size: 0.78rem; }

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px clamp(32px, 5vw, 80px);
  max-width: 1040px;
}
.faq p { margin: 0; }
@media (max-width: 760px) { .faq { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ report */

.reports { display: grid; gap: 22px; max-width: 900px; margin: 40px 0 36px; padding: 0; list-style: none; }
.reports a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
  padding: 20px 24px 22px;
  border-radius: 14px;
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--sun-edge);
  text-decoration: none;
}
.reports b { flex: 0 0 min(100%, 13em); font: 400 clamp(1.2rem, 1rem + 0.7vw, 1.55rem)/1.15 var(--display); }
.reports span { flex: 1 1 20em; }
.reports a:hover { background: var(--sun-hover); }
.reports a:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--sun-edge); }
.reports a:focus-visible { outline-color: var(--sun); outline-offset: 5px; }

/* ------------------------------------------------------------ docs */

body.docs { background: var(--pale); }
.docs .top, .docs-head { background: var(--sun); }
.docs-head { padding: 16px var(--gutter) 64px; }
.docs-head h1 { margin-bottom: 0.35em; font-size: clamp(2.4rem, 1rem + 4vw, 4.4rem); }
.docs-head .lead { margin: 0; }
.docs-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 64px;
  padding: 64px var(--gutter) 112px;
}
.toc { position: sticky; top: 24px; font-size: 0.95rem; }
.toc h2 { margin: 0 0 12px; font: 700 0.95rem/1.3 var(--text); letter-spacing: 0; }
.toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 5px 0 5px 14px; border-left: 3px solid rgb(43 11 63 / 0.18); font-weight: 600; text-decoration: none; }
.toc a:hover { border-left-color: var(--ink); }
.doc { max-width: 70ch; }
.doc section + section { margin-top: 72px; }
.doc h2 { font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.5rem); }
.doc h3 { margin-top: 1.9em; }
.doc ul, .doc ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.doc li + li { margin-top: 0.4em; }
.doc .note { margin: 0 0 1.2em; }
.note h3 { margin-top: 0; }
@media (max-width: 860px) {
  .docs-body { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .toc { position: static; }
}

/* ------------------------------------------------------------ 404 */

.lost-box { padding: 40px var(--gutter) 120px; }
.lost-box .block-word { width: min(100%, 460px); height: auto; margin-bottom: 48px; color: var(--ink); }
.lost-box h1 { margin-bottom: 0.4em; font-size: clamp(2.2rem, 1rem + 3vw, 3.6rem); }

/* ------------------------------------------------------------ link preview image (1200x630) */

body.social {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  gap: 80px;
  width: 1200px;
  height: 630px;
  margin: 0;
  padding: 0 90px;
  overflow: hidden;
}
.social .mic { width: 300px; align-self: end; margin-bottom: -40px; }
.social .block-word { width: auto; height: 38px; margin-bottom: 40px; }
.social h1 { margin-bottom: 24px; font-size: 70px; line-height: 1.02; }
.social p { margin: 0; font-size: 28px; }

/* ------------------------------------------------------------ Google thumbnail (1200x1200) */

body.search-image {
  display: grid;
  place-items: end center;
  width: 1200px;
  height: 1200px;
  margin: 0;
  overflow: hidden;
}
.search-image .mic { width: 680px; margin-bottom: -40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.nobr { white-space: nowrap; }
