:root {
  --paper: #f2efe6;
  --paper-2: #e9e5d9;
  --ink: #17160f;
  --ink-2: #5b574d;
  --line: #d5d0c2;
  --accent: #c8f03c;
  --on-accent: #17160f;
  --win: #fbfaf5;
  --win-line: #e2ded1;
  --shade: rgb(233 229 217 / 0.74);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131310;
    --paper-2: #1b1b17;
    --ink: #eeebe1;
    --ink-2: #a29e91;
    --line: #2f2e28;
    --win: #22221d;
    --win-line: #34332c;
    --shade: rgb(27 27 23 / 0.76);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131310;
  --paper-2: #1b1b17;
  --ink: #eeebe1;
  --ink-2: #a29e91;
  --line: #2f2e28;
  --win: #22221d;
  --win-line: #34332c;
  --shade: rgb(27 27 23 / 0.76);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
img { display: block; }
h1, h2, h3 { font-weight: 400; margin: 0; }
h1 em, h2 em { font-style: italic; }
code { font: 0.9em var(--mono); background: var(--paper-2); padding: 1px 5px; border-radius: 3px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 18px;
}
.label.dim { opacity: 0.75; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.9em;
  height: 1.9em;
  padding: 0 0.45em;
  margin: 0 2px;
  font: 500 0.8em/1 var(--mono);
  color: var(--ink);
  background: var(--win);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
  vertical-align: 0.1em;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  border-radius: 4px;
  box-shadow: 5px 5px 0 var(--accent);
  transition: transform 0.15s, box-shadow 0.15s;
}
.button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--accent); text-decoration: none; }
.button:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--accent); }
.button svg { width: 18px; height: 18px; }
.button.small { padding: 9px 14px; font-size: 14px; box-shadow: 3px 3px 0 var(--accent); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, (100% - 1160px) / 2);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { border-radius: 6px; }
.nav nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.nav nav a:not(.button) { text-decoration: none; color: var(--ink-2); }
.nav nav a:not(.button):hover { color: var(--ink); }

/* Hero */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px); }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(56px, 11vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.hero h1 em { position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: "";
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: 0.08em;
  height: 0.22em;
  background: var(--accent);
  z-index: -1;
}
.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 96px);
  align-items: end;
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.lede { margin: 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.meta { margin: 0; font: 12px/1.6 var(--mono); color: var(--ink-2); }

/* Demo: the whole row runs across the page; the frame in the middle is the screen. */
.demo { padding: 24px 0 0; border-top: 1px solid var(--line); background: var(--paper-2); }
.demo-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.demo-head .label { margin-bottom: 14px; }
.stage {
  --vp-left: 20%;
  --vp-width: 60%;
  --vp-top: 28px;
  --vp-bottom: 28px;
  position: relative;
  height: clamp(300px, 42vw, 480px);
  overflow: hidden;
  outline: none;
  cursor: pointer;
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.desk { position: absolute; inset: 0; }
.shade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--shade);
  pointer-events: none;
  z-index: 2;
}
.shade.left { left: 0; width: var(--vp-left); }
.shade.right { left: calc(var(--vp-left) + var(--vp-width)); right: 0; }
.finder {
  position: absolute;
  left: calc(var(--vp-left) - 8px);
  width: calc(var(--vp-width) + 16px);
  top: calc(var(--vp-top) - 12px);
  bottom: calc(var(--vp-bottom) - 12px);
  pointer-events: none;
  z-index: 3;
  --c: var(--ink);
  background:
    linear-gradient(var(--c), var(--c)) top left / 22px 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 22px,
    linear-gradient(var(--c), var(--c)) top right / 22px 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 22px,
    linear-gradient(var(--c), var(--c)) bottom left / 22px 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 22px,
    linear-gradient(var(--c), var(--c)) bottom right / 22px 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 22px;
  background-repeat: no-repeat;
}
.finder span {
  position: absolute;
  top: -9px;
  left: 30px;
  padding: 0 6px;
  font: 500 11px/18px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: var(--paper-2);
}
.stage:focus-visible .finder { --c: var(--accent); }

.win {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background: var(--win);
  border: 1px solid var(--win-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--win-line), 0 12px 24px -16px rgb(0 0 0 / 0.35);
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s;
}
.win.focused { border-color: var(--ink); box-shadow: 4px 4px 0 var(--accent); z-index: 1; }
.win.entering { opacity: 0; }
.still .win { transition: none; }
.win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  flex: none;
  font: 500 11px/1 var(--mono);
  color: var(--ink-2);
  border-bottom: 1px solid var(--win-line);
  white-space: nowrap;
}
.win-bar b { width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 2px; flex: none; }
.win.focused .win-bar { background: var(--accent); color: var(--on-accent); border-color: var(--ink); }
.win-bar span { overflow: hidden; text-overflow: ellipsis; }
.win-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.line { height: 7px; border-radius: 4px; background: var(--win-line); flex: none; }
.swatch { height: 38%; min-height: 40px; border-radius: 5px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tiles div { aspect-ratio: 1; border-radius: 4px; background: var(--win-line); }
.tiles div:nth-child(3n + 2) { background: color-mix(in srgb, var(--accent) 35%, var(--win-line)); }
.term { font: 11px/1.6 var(--mono); color: var(--ink-2); white-space: pre; }

.controls { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 18px 0 28px; }
.controls button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  background: none;
  border: 0;
  font: 13px var(--mono);
  color: var(--ink-2);
  cursor: pointer;
}
.controls button:hover { color: var(--ink); }
.controls kbd { font-size: 11px; }

/* Sections */
section h2 { font-family: var(--serif); font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -0.02em; }
.section-lede { color: var(--ink-2); max-width: 34em; margin: 20px 0 0; font-size: 18px; }

.how, .faq {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(72px, 10vw, 128px) 0;
}
.side { position: sticky; top: 100px; align-self: start; }

.points { list-style: none; margin: 0; padding: 0; counter-reset: point; border-top: 1px solid var(--line); }
.points li {
  counter-increment: point;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 8px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.points li::before { content: counter(point, decimal-leading-zero); font: 500 12px/2.2 var(--mono); color: var(--ink-2); }
.points h3 { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.points p { margin: 0; color: var(--ink-2); }

.keys { background: var(--ink); color: var(--paper); padding: clamp(72px, 10vw, 128px) 0; }
.keys .label, .keys .section-lede { color: color-mix(in srgb, var(--paper) 65%, var(--ink)); }
.keys h2 kbd { font-size: 0.42em; vertical-align: 0.35em; }
.keylist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin: 48px 0 0;
}
.keylist div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, var(--ink));
}
.keylist dt { white-space: nowrap; }
.keylist dt kbd { font-size: 15px; }
.keylist dd { margin: 0; color: color-mix(in srgb, var(--paper) 80%, var(--ink)); }

.setup { padding: clamp(72px, 10vw, 128px) 0 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.steps li { padding: 0 32px 0 0; border-left: 1px solid var(--line); padding-left: 24px; }
.steps li:first-child { border-left: 0; padding-left: 0; }
.num { display: block; font: 400 88px/1 var(--serif); color: var(--ink); margin-bottom: 12px; }
.steps h3 { font-family: var(--serif); font-size: 28px; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--ink-2); }

.answers { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 22px/1 var(--mono); color: var(--ink-2); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: -6px 0 22px; color: var(--ink-2); max-width: 40em; }

.closer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 32px;
  padding: clamp(56px, 8vw, 104px) 0;
  border-top: 1px solid var(--line);
}
.closer h2 { font-size: clamp(48px, 8vw, 104px); max-width: 9em; }

footer {
  display: flex;
  gap: 24px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font: 12px var(--mono);
  color: var(--ink-2);
}
footer span { margin-right: auto; }

/* Privacy and 404 */
.page { width: min(720px, 100% - 32px); margin: 0 auto; padding: 72px 0 96px; }
.page h1 { font-family: var(--serif); font-size: clamp(48px, 8vw, 80px); line-height: 1; margin-bottom: 12px; }
.page h2 { font-family: var(--serif); font-size: 30px; margin: 40px 0 8px; }
.page p { color: var(--ink-2); }
.page .button { color: var(--paper); }
.updated { font: 12px var(--mono); }
body > footer { width: min(1160px, 100% - 32px); margin-inline: auto; }

@media (max-width: 860px) {
  .hero-foot, .how, .faq { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .keylist { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps li, .steps li:first-child { border-left: 0; padding: 0; }
}
@media (max-width: 640px) {
  .nav nav a:not(.button) { display: none; }
  .points li { grid-template-columns: 36px minmax(0, 1fr); }
  .points p { grid-column: 2; }
  .keylist div { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .demo-head .dim { display: none; }
  .num { font-size: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .win, .button { transition: none; }
}

/* Keycaps on the inverted keys section */
.keys kbd {
  color: var(--paper);
  background: color-mix(in srgb, var(--paper) 8%, var(--ink));
  border-color: color-mix(in srgb, var(--paper) 32%, var(--ink));
}
