@font-face { font-family: "Archivo"; src: url(fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

/* Colorway "rjot": a grey case, light alphas, slate mods, copper accents,
   on a charcoal plate. Cap art is rendered by scripts/render-caps.py. */
:root {
  --case: #C7CBCF;
  --case-hi: #D3D6D9;
  --ink: #1C1E21;
  --ink-2: #3F444A;
  --ink-3: #50565D;

  --alpha-legend: #2A2C2F;
  --mod-legend: #F6F7F8;
  --cu-legend: #2B1205;

  --plate: #24272B;
  --plate-ink: #ECEEF0;
  --plate-ink-2: #A9B0B7;
  --plate-line: rgba(255, 255, 255, 0.10);

  /* rjot's label colors. */
  --l-red: #F06A62;
  --l-orange: #F0883E;
  --l-yellow: #E3B341;
  --l-green: #57AB5A;
  --l-blue: #539BF5;
  --l-purple: #B083F0;

  --sans: "Archivo", "Kantumruy Pro", "Khmer Sangam MN", "Noto Sans Khmer", "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", "SF Mono", ui-monospace, monospace;
  /* A key returning under its spring: a small overshoot, once. */
  --release: cubic-bezier(0.3, 1.7, 0.45, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; scrollbar-color: var(--ink-3) var(--case); }
body {
  margin: 0;
  background: var(--case);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
::selection { background: color-mix(in oklab, #E3874D 55%, white); color: var(--ink); }
:focus-visible { outline: 2px solid #8A4519; outline-offset: 3px; border-radius: 6px; }
textarea { caret-color: #B65F2B; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

h1, h2, h3 { margin: 0; font-family: var(--sans); text-wrap: balance; }
h1 { font-size: clamp(52px, 7.4vw, 96px); line-height: 0.98; font-weight: 820; font-stretch: 112%; letter-spacing: -0.03em; }
.section-title { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; font-weight: 780; font-stretch: 112%; letter-spacing: -0.025em; }
h3 { font-size: 26px; line-height: 1.15; font-weight: 720; font-stretch: 108%; letter-spacing: -0.015em; }
.lead, .section-lead { color: var(--ink-2); max-width: 34em; }
.lead { font-size: clamp(18px, 1.6vw, 20px); margin: 24px 0 34px; }
.section-lead { font-size: 18px; margin: 18px 0 0; }
.facts { margin: 22px 0 0; font: 400 13px/1.5 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.num { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
code { font: 400 0.84em/1.4 var(--mono); background: var(--case-hi); padding: 0.1em 0.35em; border-radius: 4px; }

/* ---- Keycaps: the one component family ----
   Each cap is a rendered 9-slice raster (skirt, dished top, PBT grain)
   stretched to the key's width. --u is the cap height; the legend sits on
   the top face, inset from the skirt. */
.key {
  --u: 56px; --w: 1;
  --cap: url(img/caps/alpha.png);
  --legend: var(--alpha-legend);
  position: relative; display: inline-flex; flex: none;
  width: calc(var(--u) * var(--w)); height: var(--u);
  padding: calc(var(--u) * 0.12) calc(var(--u) * 0.18) calc(var(--u) * 0.24);
  border: 0 solid transparent; border-radius: calc(var(--u) * 0.13);
  border-image-source: var(--cap);
  border-image-slice: 40 40 70 40 fill;
  border-image-width: calc(var(--u) * 0.2) calc(var(--u) * 0.2) calc(var(--u) * 0.35) calc(var(--u) * 0.2);
  border-image-repeat: round stretch;
  background: none;
  box-shadow: 0 calc(var(--u) * 0.07) calc(var(--u) * 0.14) -2px rgba(18, 22, 26, 0.34), 0 1px 1px rgba(18, 22, 26, 0.2);
  color: var(--legend); text-decoration: none; font: inherit; cursor: pointer;
  transition: transform 220ms var(--release), box-shadow 220ms var(--release), filter 150ms ease;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.key .cap {
  display: flex; align-items: flex-start; gap: 0.4em; width: 100%; height: 100%;
  font-size: calc(var(--u) * 0.24); font-weight: 600; font-stretch: 104%; line-height: 1.1; letter-spacing: -0.005em;
}
.key .cap svg, .legend-icon { width: 1.05em; height: 1.05em; flex: none; }
.key.down, .key:active {
  transform: translateY(calc(var(--u) * 0.06));
  box-shadow: 0 calc(var(--u) * 0.02) calc(var(--u) * 0.05) -1px rgba(18, 22, 26, 0.36), 0 1px 0 rgba(18, 22, 26, 0.2);
  transition-duration: 60ms; transition-timing-function: ease-out;
}
a.key:hover, button.key:hover { filter: brightness(1.04); }

.key-accent { --cap: url(img/caps/copper.png); --legend: var(--cu-legend); }
.key-mod { --cap: url(img/caps/slate.png); --legend: var(--mod-legend); }
.key-sm { --u: 40px; width: auto; padding: calc(var(--u) * 0.1) 15px calc(var(--u) * 0.22); }
.key-sm .cap { align-items: center; font-size: 14.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .key { --u: 62px; width: auto; padding-inline: 22px; }
.actions .key .cap { align-items: center; font-size: 16.5px; font-weight: 640; }
.key-wide .cap { justify-content: space-between; gap: 28px; }
.key-wide { min-width: 260px; }

/* Inline legends: small caps set in running text, same raster. */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.85em; height: 1.85em; padding: 0 0.45em 0.32em; margin: 0 0.06em;
  font: 600 0.8em/1 var(--sans); color: var(--alpha-legend);
  border: 0 solid transparent;
  border-image: url(img/caps/alpha.png) 40 40 70 40 fill / 0.37em 0.37em 0.65em 0.37em round stretch;
  vertical-align: -0.12em;
}
.kbd svg { width: 0.95em; height: 0.95em; }
.kbd-dark { color: var(--mod-legend); border-image-source: url(img/caps/slate.png); }

/* ---- Top bar ---- */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--case) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bar-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: 112%; font-size: 21px; letter-spacing: -0.02em; }
.brand img { border-radius: 7px; }
nav { display: flex; align-items: center; gap: 8px; }

/* ---- Hero ---- */
.hero { padding: 60px 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.95fr; gap: 56px; align-items: center; }

/* The page's own rjot window, light Copper theme, like the app. */
.window {
  --w-bg: #F7F4F0; --w-card: #FFFFFF; --w-line: #E4DDD5; --w-ink: #25211D; --w-faint: #6B635A; --w-raise: #EFEAE4; --w-accent: #B0643A;
  background: var(--w-bg); color: var(--w-ink);
  border-radius: 14px; padding: 12px 14px 10px;
  box-shadow: 0 1px 1px rgba(18, 22, 26, 0.12), 0 22px 48px -18px rgba(18, 22, 26, 0.45);
  font-size: 14px; line-height: 1.45;
  display: flex; flex-direction: column;
}
.win-bar { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.lights { display: flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.lights i:nth-child(2) { background: #FEBC2E; }
.lights i:nth-child(3) { background: #28C840; }
.win-tabs { display: flex; gap: 2px; padding: 2px; background: var(--w-raise); border-radius: 8px; font-size: 12.5px; color: #6E655C; }
.win-tabs > * { padding: 3px 10px; border-radius: 6px; }
.win-tabs b { font-weight: 560; color: var(--w-ink); background: #E3DDD6; }
.win-tabs em { font-style: normal; color: #5A534B; margin-left: 3px; font-variant-numeric: tabular-nums; }
.composer textarea {
  width: 100%; resize: none; margin: 0 0 8px; padding: 10px 12px;
  font: inherit; color: var(--w-ink); background: var(--w-card);
  border: 1px solid color-mix(in oklab, var(--w-accent) 55%, var(--w-line)); border-radius: 10px; outline: none;
}
.composer textarea::placeholder { color: var(--w-faint); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; align-content: start; }
.notes li {
  position: relative; padding: 9px 12px 7px 14px;
  background: var(--w-card); border: 1px solid var(--w-line); border-radius: 10px;
}
.notes li::before {
  /* The label stripe, painted inside the card the way the app paints it. */
  content: ""; position: absolute; left: 1px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px;
  background: var(--label, transparent);
}
.notes p { margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.notes small { display: block; margin-top: 2px; font-size: 12px; color: var(--w-faint); }
.notes li.fresh { animation: glow 1.6s var(--out); }
@keyframes glow { from { background: #FBE7D8; border-color: #E0A47D; } }
.win-foot { margin: 10px 0 0; font-size: 12px; color: var(--w-faint); }

/* The keyboard row on its charcoal plate. --pitch is one key unit,
   gap included. */
.deck { margin-top: 64px; }
.try { text-align: center; margin: 0 0 18px; padding: 0 20px; color: var(--ink-2); font-size: 16px; transition: color 300ms ease; }
.try.done { color: var(--ink); }
.plate {
  --gap: clamp(4px, 0.5vw, 7px);
  --pitch: clamp(42px, calc((100vw - 64px) / 15.4), 84px);
  display: flex; justify-content: center; gap: var(--gap);
  padding: calc(var(--pitch) * 0.26) 16px calc(var(--pitch) * 0.36);
  background: var(--plate) url(img/caps/plate.png);
  box-shadow: inset 0 10px 18px -12px rgba(0, 0, 0, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}
.plate .key { --u: calc(var(--pitch) - var(--gap)); width: calc(var(--pitch) * var(--w) - var(--gap)); cursor: default; }
.plate .shift { cursor: pointer; }
.plate .shift .cap { justify-content: space-between; flex-direction: column; font-size: calc(var(--u) * 0.2); }
.plate .shift .legend-icon { width: 1.4em; height: 1.4em; }
.plate .two .cap { flex-direction: column; gap: 0; }

/* ---- Kits: catalog entries ---- */
.kits { padding: 140px 0 120px; }
.catalog { margin-top: 72px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 88px 40px; }
.entry { display: grid; gap: 28px; align-content: start; }
.entry-base { grid-column: 1 / -1; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
.entry-half { grid-column: span 6; }
.entry-wide { grid-column: 1 / -1; grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; }
.entry-wide .entry-body { padding-top: 36px; }
.shot { margin: 0; padding: 36px; border-radius: 16px; background: var(--case-hi); display: grid; place-items: center; }
.shot img { width: min(100%, 360px); border-radius: 12px; box-shadow: 0 1px 1px rgba(18, 22, 26, 0.1), 0 26px 44px -22px rgba(18, 22, 26, 0.5); }
.entry-half .shot img { width: min(100%, 320px); }
.entry-wide .shot img { width: min(100%, 320px); }
.entry-body p { color: var(--ink-2); max-width: 32em; margin: 14px 0 0; }
.entry-body .contents { margin-top: 6px; font: 400 13.5px/1.4 var(--mono); color: var(--ink-3); }

/* A tray: the kit's caps at real size on a piece of plate. */
.tray {
  margin-top: 24px; padding: 18px 20px 14px; border-radius: 12px;
  display: flex; flex-wrap: wrap; gap: 14px 26px;
  background: var(--plate) url(img/caps/plate.png);
  box-shadow: inset 0 6px 12px -8px rgba(0, 0, 0, 0.8);
}
.combo { display: grid; grid-auto-flow: column; justify-content: start; gap: 6px; align-items: start; }
.combo .key { --u: 50px; cursor: default; }
.combo .key .cap { font-size: 17px; }
.combo .key .cap svg { width: 18px; height: 18px; }
.combo small { grid-row: 2; grid-column: 1 / span 3; color: var(--plate-ink-2); font-size: 13px; }
.tray-novelty { gap: 10px; }
.key.nov { --u: 62px; --w: 1.25; --legend: #1C1E21; cursor: default; }
.key.nov .cap { font-size: 13.5px; }

.ways { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 18px; font-size: 15px; font-weight: 600; }
.ways li { display: grid; gap: 6px; }
.mini { display: flex; gap: 4px; padding: 6px; border-radius: 8px; background: var(--d); }
.mini i, .mini b { flex: 1; height: 20px; border-radius: 4px; background: var(--dc); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.mini b { flex: 1.6; background: var(--da); }
.mini.light { background: var(--l); }
.mini.light i { background: var(--lc); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08); }
.mini.light b { background: var(--la); }

/* ---- Specs: the dark plate ---- */
.specs { background: var(--plate) url(img/caps/plate.png); color: var(--plate-ink); padding: 120px 0; }
.specs .section-lead { color: var(--plate-ink-2); }
.specs-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 72px; align-items: start; }
.specs-grid > div:first-child { position: sticky; top: 120px; }
.sheet { margin: 0; border-top: 1px solid var(--plate-line); }
.sheet > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--plate-line); }
.sheet dt { font-weight: 640; font-stretch: 108%; }
.sheet dd { margin: 0; color: var(--plate-ink-2); }
.specs code { background: #33373C; color: var(--plate-ink); }
.specs ::selection { background: color-mix(in oklab, #E3874D 60%, black); color: #fff; }

/* ---- Assembly and close ---- */
.assembly { padding: 120px 0 128px; }
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps > li { min-width: 0; }
.step-install { grid-column: 1 / -1; max-width: 880px; }
.step-install p { margin-bottom: 18px; }
.cmd { position: relative; background: var(--plate); color: var(--plate-ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--plate-line); }
.cmd pre { margin: 0; padding: 18px 64px 18px 20px; overflow-x: auto; }
.cmd code { background: none; padding: 0; color: inherit; font-size: 15px; white-space: pre; }
.cmd pre::before { content: "$ "; color: var(--plate-ink-2); }
.cmd-copy { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: #33373C; color: var(--plate-ink); cursor: pointer; }
.cmd-copy:hover { background: #3D4349; }
.cmd-copy:focus-visible, .cmd pre:focus-visible { outline: 2px solid #E3874D; outline-offset: 2px; }
.cmd-copy svg { width: 20px; height: 20px; grid-area: 1 / 1; }
.cmd-copy .i-check { display: none; color: var(--l-green); }
.cmd-copy.done .i-copy { display: none; }
.cmd-copy.done .i-check { display: block; }
.steps h3 { font-size: 21px; margin: 22px 0 8px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.num-key { --u: 64px; cursor: default; }
.num-key .cap { font-size: 20px; }
.closing { margin-top: 112px; display: grid; justify-items: center; text-align: center; }
.key-enter { --u: 92px; width: auto; min-width: min(100%, 420px); padding-inline: 30px; }
.key-enter .cap { align-items: center; justify-content: space-between; gap: 40px; font-size: 24px; font-weight: 680; font-stretch: 110%; }
.closing-note { margin: 22px 0 0; color: var(--ink-2); font-size: 15px; }

.foot { padding: 28px 0 44px; font-size: 14px; color: var(--ink-2); border-top: 1px solid rgba(18, 22, 26, 0.12); }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .key, .key.down, .key:active { transition: none; }
  .notes li.fresh { animation: none; }
}

/* ---- Narrow screens: the row collapses to the two Shift keys ---- */
@media (max-width: 960px) {
  .hero-grid, .entry-base, .entry-wide, .specs-grid { grid-template-columns: 1fr; gap: 36px; }
  .entry-half { grid-column: 1 / -1; }
  .entry-wide .shot { order: -1; }
  .entry-wide .entry-body { padding-top: 0; }
  .specs-grid > div:first-child { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .nav-extra { display: none; }
  .hero { padding-top: 36px; }
  .plate { --pitch: calc((100vw - 56px) / 5.2); }
  .plate .alpha { display: none; }
  .kits { padding-top: 100px; }
  .catalog { gap: 72px 0; }
  .shot { padding: 24px; }
  .ways { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .sheet > div { grid-template-columns: 1fr; gap: 4px; }
  .actions .key { flex: 1 1 100%; min-width: 0; }
  .key-enter { --u: 76px; }
  .key-enter .cap { font-size: 20px; }
}
