/* Albert Sans (SIL Open Font License, fonts/OFL.txt), served from this site: no third party sees visitors */
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/albert-sans-latin.woff2") format("woff2");
}

/* Unslip: one motif, the keycap. Colours are KeBe's own: warm black, keycap cream, the bear's pine green. */
:root {
  color-scheme: dark;
  --bg: #1c1a17;
  --surface: #262320;
  --surface-2: #34302a;
  --ink: #f0efec;
  --muted: #b3ab9f;
  --accent: #3f9e77;
  --accent-ink: #12110f;
  --cap: #f0efec;
  --cap-edge: #d9d2c5;
  --cap-ink: #1c1a17;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3rem, 1rem + 6vw, 6.5rem);

  --margin: clamp(16px, 2.2vw, 32px);
  --r: 14px;
  --gap-section: clamp(120px, 14vw, 200px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-body)/1.5 "Albert Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1; margin: 0; text-wrap: balance; }
button, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
p { margin: 0; }
.skip { position: absolute; left: -9999px; }
.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: var(--margin); top: 8px; z-index: 10; background: var(--ink); color: var(--bg); padding: 8px 12px; }

/* The keycap: the one shape. A cream square with a deeper tone along its foot, never a shadow. */
.cap {
  display: inline-grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--cap);
  color: var(--cap-ink);
  border-radius: 22%;
  border-bottom: 0.12em solid var(--cap-edge);
  font-weight: 600;
  line-height: 1;
}

/* Buttons are keycaps stretched: the same cream foot, the pine of KeBe's bear. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r);
  border-bottom: 4px solid #2d7558;
  font-weight: 600;
  font-size: var(--step-body);
  text-decoration: none;
  transition: transform 160ms var(--ease), border-bottom-width 160ms var(--ease), background 160ms var(--ease);
}
.button:hover { color: var(--accent-ink); background: #48ad84; transform: translateY(-1px); }
.button:active { transform: translateY(3px); border-bottom-width: 1px; }
.button.small { padding: 10px 16px 9px; font-size: var(--step-small); border-bottom-width: 3px; }

/* Header */
.top {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px var(--margin);
  position: relative;
  z-index: 2;
}
.mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: var(--step-lead); letter-spacing: -0.02em; }
.mark .cap { width: 36px; font-size: var(--step-body); }
.top nav { display: flex; gap: 24px; margin-left: auto; font-size: var(--step-small); }
.top nav a { text-decoration: none; color: var(--ink); }
.top nav a.button { color: var(--accent-ink); }
.top nav a:hover { color: var(--accent); }

/* Hero: a card beside the photograph */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px;
  min-height: calc(100svh - 76px);
}
.card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 0 clamp(24px, 4vw, 64px) 40px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.band { --kb: clamp(80px, 10vw, 150px); display: flex; gap: 8px; padding: 28px 0 0; align-items: flex-start; }
.band .cap { height: var(--kb); width: auto; font-size: var(--step-head); flex: 0 0 var(--kb); text-transform: lowercase; }
.band .blank { background: var(--surface-2); border-bottom-color: #2a2622; }
.band .slip { position: relative; }
.card .body { margin-top: auto; max-width: 34rem; }
.card h1 { font-size: var(--step-head); margin-bottom: 24px; }
.card .lead { font-size: var(--step-lead); line-height: 1.35; margin-bottom: 36px; }
.card .fact { margin-top: 14px; color: var(--muted); font-size: var(--step-small); }
.card .links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 48px; font-size: var(--step-small); }
.room { position: relative; border-radius: var(--r); overflow: hidden; background: #0b0a09; }
.room video { width: 100%; height: 100%; object-fit: cover; position: sticky; top: 0; }
.pause { position: absolute; right: 16px; bottom: 14px; font: 500 var(--step-small)/1 "Albert Sans", system-ui, sans-serif; background: rgba(12, 11, 9, 0.7); color: var(--ink); border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.pause:hover { background: rgba(12, 11, 9, 0.9); }
.still .band .slip { animation-play-state: paused; }
.room figcaption { position: absolute; left: 20px; bottom: 18px; font-size: var(--step-small); color: var(--ink); background: rgba(12, 11, 9, 0.7); padding: 6px 10px; border-radius: 8px; }

section { padding: 0 var(--margin); }
#try { overflow-x: clip; }
.section { margin-top: var(--gap-section); }

/* Live demo: pick a keyboard, type a slip */
.demo {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(0, 1.9fr);
  gap: 48px;
  align-items: end;
  min-height: 92svh;
}
.demo .pick { list-style: none; margin: 0; padding: 0; font-size: var(--step-lead); line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; }
.demo .pick li:first-child { color: var(--muted); }
.demo .pick button {
  all: unset;
  cursor: pointer;
  color: var(--muted);
  transition: color 200ms var(--ease);
}
.demo .pick button[aria-pressed="true"] { color: var(--ink); }
.demo .pick button:hover { color: var(--accent); }
.demo .pick button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.stage { position: relative; display: grid; place-items: center; padding: 6vh 0; }
.stage .disc {
  position: absolute;
  inset: 0 2%;
  background: var(--accent);
  border-radius: 48px;
  transition: background 300ms var(--ease);
}
.stage[data-board="kebe"] .disc { background: var(--surface-2); }
.board { position: relative; display: grid; gap: 6px; padding: 18px; background: var(--bg); border-radius: var(--r); width: min(100%, 720px); }
.board .row { display: flex; gap: 6px; }
.board .k {
  flex: 0 0 auto;
  width: var(--kw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 22%;
  background: var(--surface-2);
  color: var(--muted);
  border-bottom: 3px solid #26231f;
  font-weight: 600;
  font-size: 0;
  transition: background 220ms var(--ease), color 220ms var(--ease), transform 220ms var(--ease);
}
.board .k::after { content: attr(data-key); font-size: calc(var(--kw) * 0.42); }
.board .k.letter { background: var(--cap); color: var(--cap-ink); border-bottom-color: var(--cap-edge); }
.board .k.near { background: #cfe8dd; }
.board .k.hit { background: #e3b04b; transform: translateY(-3px); }
.board .k.meant { background: var(--accent); color: var(--accent-ink); border-bottom-color: #2d7558; transform: translateY(-3px); }
.board .k.gap { visibility: hidden; }
.board .k.mid { background: var(--surface); color: var(--muted); border-bottom-color: var(--surface); }
.try { position: relative; margin-top: 22px; width: min(100%, 720px); display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.try input {
  font: 600 var(--step-lead)/1 "Albert Sans", system-ui, sans-serif;
  padding: 14px 18px;
  border-radius: var(--r);
  border: 0;
  background: var(--cap);
  color: var(--cap-ink);
  width: 100%;
}
.try output { font-size: var(--step-head); font-weight: 600; letter-spacing: -0.035em; line-height: 1; min-width: 4ch; }
.why { position: relative; width: min(100%, 720px); margin-top: 14px; min-height: 3em; }
.samples { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; width: min(100%, 720px); }
.samples button {
  font: 500 var(--step-small)/1 "Albert Sans", system-ui, sans-serif;
  background: var(--surface-2);
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.samples button:hover { background: var(--surface); }
.samples button:active { transform: translateY(2px); }

/* How it works: the fix's timeline, drawn to scale */
.how h2 { font-size: var(--step-display); max-width: 14ch; margin-bottom: 64px; }
.bar { display: flex; gap: 6px; height: 22vh; min-height: 150px; }
.bar > div { border-radius: var(--r); padding: 20px; display: flex; min-width: 12%; }
.bar .dur { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; }
.bar .s1 { flex: 100; background: var(--surface-2); }
.bar .s2 { flex: 10; background: var(--muted); color: var(--bg); }
.bar .s3 { flex: 1; background: var(--accent); color: var(--accent-ink); }
.bar .s4 { flex: 1; background: var(--cap); color: var(--cap-ink); }
.bar-notes { display: flex; gap: 6px; margin-top: 16px; }
.bar-notes p { flex: 1; min-width: 12%; max-width: 24ch; font-size: var(--step-body); }
.bar-notes .n1 { flex: 100; }
.bar-notes .n2 { flex: 10; }
.bar-notes .n3, .bar-notes .n4 { flex: 1; }

/* What you meant stays: an inset panel with a keycap-shaped photograph */
.panel {
  margin: var(--gap-section) 20px 0;
  background: var(--surface);
  border-radius: var(--r);
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 56px;
  gap: 40px;
}
.panel h2 { font-size: var(--step-head); max-width: 11ch; }
.panel .shape { margin-top: 56px; width: min(38vw, 560px); aspect-ratio: 1; border-radius: 22%; overflow: hidden; margin-bottom: -18%; }
.panel .shape img { width: 100%; height: 100%; object-fit: cover; }
.panel .text { display: grid; gap: 56px; align-content: start; max-width: 26rem; justify-self: end; }
.panel h3 { font-size: var(--step-lead); letter-spacing: -0.02em; margin-bottom: 12px; }

/* Privacy: the field turns keycap cream */
.private { margin-top: var(--gap-section); background: var(--cap); color: var(--cap-ink); padding: clamp(72px, 10vw, 140px) var(--margin); }
.private a { color: var(--cap-ink); }
.private a:hover { color: #2d7558; }
.private h2 { font-size: var(--step-display); max-width: 12ch; margin-bottom: 72px; }
.private dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 0; max-width: 1200px; }
.private dt { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; }
.private dd { margin: 0; }
.private .more { margin-top: 56px; font-weight: 500; }

/* Made by KeBe: one keycap-shaped frame, pictures change inside it */
.kebe { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; min-height: 90svh; }
.frame { border: 0; padding: 0; display: block; position: relative; width: min(40vw, 560px); aspect-ratio: 4 / 5; border-radius: 22%; overflow: hidden; justify-self: center; background: #0b0a09; cursor: pointer; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 600ms var(--ease); }
.frame img.on { opacity: 1; }
.kebe .caption { margin-top: 16px; font-size: var(--step-small); color: var(--muted); text-align: center; min-height: 1.5em; }
.kebe h2 { font-size: var(--step-head); margin-bottom: 24px; }
.kebe p + p { margin-top: 16px; }
.kebe .button { margin-top: 32px; }

/* Download: the keycap returns, huge */
.get { position: relative; margin-top: var(--gap-section); min-height: 90svh; background: var(--accent); color: var(--accent-ink); overflow: hidden; display: grid; grid-template-columns: 8fr 4fr; align-items: center; }
.get .giant { position: absolute; left: -10vw; bottom: -24vh; width: 58vw; aspect-ratio: 1; border-radius: 22%; background: var(--cap); border-bottom: 3vw solid var(--cap-edge); display: grid; place-items: center; }
.get .giant svg { width: 62%; height: auto; fill: var(--cap-ink); }
.get .text { grid-column: 2; position: relative; padding: 40px var(--margin); }
.get h2 { font-size: var(--step-head); margin-bottom: 20px; }
.get .fact { font-size: var(--step-lead); font-weight: 600; margin: 20px 0 28px; }
.get .button { background: var(--bg); color: var(--ink); border-bottom-color: #000; }
.get .button:hover { background: #2a2722; color: var(--ink); }
.get .soon { margin-top: 28px; }

/* Questions */
.faq { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; }
.faq h2 { font-size: var(--step-head); align-self: start; }
.faq details { background: var(--surface); border-radius: var(--r); margin-bottom: 8px; transition: background 200ms var(--ease); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 72px; padding: 18px 24px; font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { position: relative; flex: 0 0 16px; height: 16px; }
.faq .plus::before, .faq .plus::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; background: currentColor; border-radius: 2px; transition: transform 200ms var(--ease); }
.faq .plus::after { transform: rotate(90deg); }
.faq details[open] { background: var(--accent); color: var(--accent-ink); }
.faq details[open] .plus::after { transform: rotate(0deg); }
.faq details p { padding: 0 24px 24px; max-width: 52ch; }
.faq details a { color: var(--accent-ink); }

/* Footer: the name, built from keycaps */
footer { margin-top: var(--gap-section); background: var(--surface); padding: 56px var(--margin) 32px; }
.word { display: flex; gap: 4px; align-items: flex-end; height: 34svh; min-height: 220px; }
.word .cap { flex: 1; aspect-ratio: auto; height: 100%; font-size: var(--step-display); text-transform: uppercase; border-radius: 9%; border-bottom-width: 1.2vw; }
.word .cap:nth-child(2) { height: 72%; }
.word .cap:nth-child(3) { height: 88%; }
.word .cap:nth-child(4) { height: 64%; }
.word .cap:nth-child(5) { height: 94%; }
.word .cap:nth-child(6) { height: 78%; }
.foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 2fr; gap: 24px; margin-top: 56px; font-size: var(--step-small); }
.foot a { display: block; text-decoration: none; margin-bottom: 8px; }
.foot a:hover { text-decoration: underline; }
.foot .credits { color: var(--muted); }
.foot .ig { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot .ig span { color: var(--muted); }
.last { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; font-size: var(--step-small); color: var(--muted); }

/* Privacy page */
.doc { max-width: 44rem; padding: 48px var(--margin) 0; }
.doc h1 { font-size: var(--step-display); margin-bottom: 24px; }
.doc h2 { font-size: var(--step-lead); letter-spacing: -0.02em; margin: 56px 0 12px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 8px 0; }
.doc .lead { font-size: var(--step-lead); line-height: 1.35; margin-top: 24px; }
.doc .muted { color: var(--muted); }

/* Entrances: parts of each section rise in turn. Without the script nothing is hidden. */
.js [data-reveal] > * { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js [data-reveal].seen > * { opacity: 1; transform: none; }
.js [data-reveal].seen > *:nth-child(2) { transition-delay: 80ms; }
.js [data-reveal].seen > *:nth-child(3) { transition-delay: 160ms; }
.js [data-reveal].seen > *:nth-child(4) { transition-delay: 240ms; }
.js [data-reveal].seen > *:nth-child(5) { transition-delay: 320ms; }

/* The signature: the slipped keys trade places, the fix made physical */
.band .slip.e { animation: swap-right 4.8s var(--ease) infinite; }
.band .slip.h { animation: swap-left 4.8s var(--ease) infinite; }
@keyframes swap-right { 0%, 35% { transform: none; } 50%, 85% { transform: translateX(calc(var(--kb) + 8px)); } 100% { transform: none; } }
@keyframes swap-left { 0%, 35% { transform: none; } 50%, 85% { transform: translateX(calc(-1 * var(--kb) - 8px)); } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .band .slip { animation: none; }
  .band .slip.e { transform: translateX(calc(var(--kb) + 8px)); }
  .band .slip.h { transform: translateX(calc(-1 * var(--kb) - 8px)); }
  .js [data-reveal] > * { opacity: 1; transform: none; transition: none; }
  .frame img { transition: none; }
}

/* Phones: each section its own composition */
@media (max-width: 820px) {
  .top nav a:not(.button) { display: none; }
  .hero { grid-template-columns: 1fr; padding: 0 12px; min-height: 0; }
  .room { order: -1; height: 48svh; }
  .card { margin-top: -24px; position: relative; padding: 0 22px 28px; }
  .band { --kb: 52px; padding-top: 20px; gap: 8px; }
  .band .cap { font-size: var(--step-lead); }
  .card .body { margin-top: 24px; }
  .demo { grid-template-columns: 1fr; min-height: 0; gap: 24px; }
  .demo .pick { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .demo .pick li:first-child { flex-basis: 100%; }
  .stage { order: 2; padding: 4vh 0; }
  .stage .disc { inset: 0; border-radius: 28px; }
  .board { padding: 10px; gap: 4px; }
  .board .row { gap: 4px; }
  .how h2 { font-size: 11vw; }
  .bar { flex-direction: column; height: 70svh; }
  .bar > div { min-height: 72px; }
  .bar .s1 { flex: 6; } .bar .s2 { flex: 2; } .bar .s3, .bar .s4 { flex: 1.2; }
  .bar-notes { display: none; }
  .bar > div { flex-direction: column; gap: 6px; }
  .bar .note { display: block; font-size: 16px; }
  .panel { grid-template-columns: 1fr; margin: var(--gap-section) 10px 0; padding: 28px 22px; min-height: 0; }
  .panel .text { justify-self: start; gap: 32px; }
  .panel .shape { width: 100%; margin: 28px 0 0; }
  .private dl { grid-template-columns: 1fr; }
  .kebe { grid-template-columns: 1fr; min-height: 0; }
  .kebe > div:last-child { order: -1; } /* the heading leads; the caption stays under its picture */
  .frame { width: 72vw; }
  .get { grid-template-columns: 1fr; min-height: 0; padding-bottom: 60svh; }
  .get .text { grid-column: 1; }
  .get .giant { width: 110vw; left: -20vw; bottom: -40vw; }
  .faq { grid-template-columns: 1fr; gap: 24px; }
  .faq h2 { position: static; }
  .faq summary { font-size: 18px; min-height: 64px; }
  .word { height: 22svh; min-height: 120px; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot .credits { grid-column: 1 / -1; }
}
@media (min-width: 821px) { .bar .note { display: none; } }
