/* Kraken Control site. Dark, low-glare page (deep slate, a step darker than
   the app); the app's own Dark Grey surfaces wherever the product appears
   (demo, screenshots, footer). One accent: the app's teal. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* page */
  --paper: #121417;
  --surface: #181B1F;
  --ink: #EEF0F2;
  --ink-2: #C9CDD3;
  --ink-3: #9EA4AD;
  --line: #2A2E34;
  --code-bg: #23272D;
  --teal-ink: #5ED6C5;          /* teal for text on the page */
  --on-teal: #0F1514;
  /* graphite: the app's Dark Grey theme */
  --g-bg: #1F2023;
  --g-chrome: #17181A;
  --g-card: #27292D;
  --g-edge: #313338;
  --g-line: #36383D;
  --g-text: #F0F1F2;
  --g-body: #DCDEE1;
  --g-muted: #ABAFB6;
  --g-plate: #1A1B1E;
  --g-key-top: #393C42;
  --g-key-skirt: #2C2E33;
  --teal: #3CC8B4;
  --teal-hi: #5ED6C5;
  --amber: #F2B04A;
  --radius: 12px;
  --sans: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; text-wrap: balance; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--teal-ink); outline-offset: 3px; border-radius: 6px; }
.dark :focus-visible, .demo :focus-visible { outline-color: var(--teal); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--teal); color: var(--on-teal); padding: 10px 14px; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 20, 23, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.brand:hover { color: var(--ink); }
.nav { display: none; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink-3); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--ink); }
.top .btn-small { margin-left: auto; }
@media (min-width: 860px) {
  .nav { display: flex; }
  .top .btn-small { margin-left: 8px; }
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--teal); color: var(--on-teal);
  font-weight: 700; text-decoration: none;
  border: 1px solid var(--teal); border-radius: 10px;
  transition: background .15s, transform .08s;
}
.btn:hover { background: var(--teal-hi); border-color: var(--teal-hi); color: var(--on-teal); }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 7px 14px; font-size: .95rem; }
.btn-big { padding: 14px 24px; font-size: 1.1rem; }

/* Hero */
.hero { padding: 48px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; }
@media (min-width: 980px) {
  .hero { padding: 80px 0 88px; }
  .hero-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 64px; align-items: center; }
}
h1 { font-size: clamp(2.3rem, 4.8vw, 3.6rem); font-weight: 800; letter-spacing: -0.025em; max-width: 13em; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 32em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin: 28px 0 22px; }
.cta-meta { margin: 0; color: var(--ink-3); font-size: .97rem; line-height: 1.5; }
.fine { color: var(--ink-3); font-size: .9rem; margin: 0; }

/* Demo: rendered like the app */
.demo {
  background: var(--g-bg);
  color: var(--g-body);
  border: 1px solid var(--g-edge);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -18px rgba(0,0,0,.7);
}
@media (min-width: 720px) { .demo { padding: 26px 28px; } }
.demo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 14px; }
.demo h2 { font-size: 1.25rem; font-weight: 800; color: var(--g-text); margin: 0; }
.tabs { display: inline-flex; background: var(--g-plate); border: 1px solid var(--g-line); border-radius: 10px; padding: 3px; }
.tabs button {
  font: inherit; font-size: .92rem; font-weight: 700;
  color: var(--g-muted); background: transparent; border: 0; border-radius: 7px;
  padding: 6px 12px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--g-key-top); color: var(--g-text); }
.tabs button:hover { color: var(--g-text); }
.demo-help { color: var(--g-muted); font-size: .95rem; max-width: 42em; }
.demo-note { color: var(--g-muted); font-size: .84rem; margin: 14px 0 0; }

.rig {
  --well: 168px; --cap-size: 120px; --legend: 2.6rem;
  display: flex; align-items: center; justify-content: center; gap: 28px; margin: 20px 0 18px;
}
@media (max-width: 520px) { .rig { --well: 132px; --cap-size: 94px; --legend: 2rem; gap: 14px; } }
@media (max-width: 360px) { .rig { --well: 116px; --cap-size: 82px; --legend: 1.8rem; gap: 12px; } }

.key-well {
  position: relative; flex: none;
  width: var(--well); height: var(--well);
  display: grid; place-items: center;
  background: var(--g-plate);
  border: 1px solid var(--g-line);
  border-radius: 20px;
  transition: box-shadow .12s, border-color .12s;
}
.key-well.on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), 0 0 24px -4px rgba(60, 200, 180, .45); }

.key {
  --depth: 0;
  --travel: 14px;
  width: var(--cap-size); height: var(--cap-size);
  margin-top: calc(-1 * var(--travel));
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  border-radius: 14px;
}
.key:active { cursor: grabbing; }
.key:focus-visible { outline: none; }
.key:focus-visible .key-cap { outline: 3px solid var(--teal); outline-offset: 5px; }
.key-cap {
  position: relative;
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: var(--g-key-top);
  border: 1px solid #45484F;
  border-radius: 14px;
  transform: translateY(calc(var(--depth) * var(--travel)));
  box-shadow: 0 calc((1 - var(--depth)) * var(--travel)) 0 0 var(--g-key-skirt);
}
.key-main { font-size: var(--legend); font-weight: 700; color: var(--g-text); line-height: 1; }
.key-well.on .key-main { color: var(--teal); }

.gauge { display: flex; gap: 8px; padding-right: 84px; flex: none; }
.gauge-track {
  position: relative;
  width: 26px; height: 216px;
  background: var(--g-plate);
  border: 1px solid var(--g-line);
  border-radius: 7px;
}
.gauge-fill {
  position: absolute; left: 0; right: 0; top: 0; height: 0;
  background: var(--g-muted);
  border-radius: 6px 6px 0 0;
}
.gauge-fill.on { background: var(--teal); }
.mark { position: absolute; left: -6px; width: 38px; height: 0; border-top: 2px solid var(--amber); }
.mark span {
  position: absolute; left: 46px; top: -1.45em;
  font-size: .8rem; font-weight: 700; white-space: nowrap; color: var(--amber);
}
.mark-rt { border-top: 2px dashed var(--g-text); display: none; }
.mark-rt span { color: var(--g-text); top: .2em; }   /* RT point is always at or below the actuation point */
.mark-rt.show { display: block; }
.gauge-scale {
  list-style: none; margin: 0; padding: 0;
  height: 216px; display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--mono); font-size: .72rem; color: var(--g-muted);
  text-align: right; line-height: 1;
}
@media (max-width: 520px) { .gauge { padding-right: 66px; } .mark span { font-size: .72rem; } }
@media (max-width: 360px) { .demo { padding: 16px; } .gauge { padding-right: 60px; } }

.readout {
  display: grid; grid-template-columns: auto auto auto; align-items: center; justify-content: space-between; gap: 10px 12px;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--g-card); border: 1px solid var(--g-edge); border-radius: 10px;
}
.readout .label, .stats dt { color: var(--g-muted); font-size: .88rem; margin-right: 4px; }
.num { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--g-text); }
.readout .num { font-size: clamp(1.05rem, 4vw, 1.3rem); }
.readout .unit { color: var(--g-muted); font-size: .88rem; margin-left: 3px; }
.state {
  display: inline-block; min-width: 5.6em; text-align: center;
  padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  background: var(--g-plate); color: var(--g-muted); border: 1px solid var(--g-line);
}
.state.on { background: rgba(60, 200, 180, .16); color: var(--teal-hi); border-color: var(--teal); }

.controls { display: grid; gap: 12px 22px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .controls { grid-template-columns: 1fr 1fr; align-items: end; }
  .ctl-check { grid-column: 1 / -1; }
}
.ctl { display: grid; gap: 6px; font-weight: 600; font-size: .93rem; color: var(--g-body); }
.ctl > span:first-child { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.ctl output { font-family: var(--mono); font-weight: 600; color: var(--teal); }
.ctl input[type=range] { width: 100%; accent-color: var(--teal); }
.ctl-check { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ctl-check input { width: 18px; height: 18px; accent-color: var(--teal); }

/* Live keyboard test */
.live {
  position: relative; margin: 16px 0;
  background: var(--g-plate); border: 1px solid var(--g-line); border-radius: 10px;
  height: 196px; overflow: hidden;
}
.live canvas { display: block; width: 100%; height: 100%; }
.live-empty {
  position: absolute; inset: 0; margin: 0;
  display: grid; place-items: center; color: var(--g-muted); font-size: .95rem;
}
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.touch-note { display: none; color: var(--amber); font-size: .92rem; }
@media (hover: none) and (pointer: coarse) { .touch-note { display: block; } }
.stats > div { background: var(--g-card); border: 1px solid var(--g-edge); border-radius: 10px; padding: 8px 12px; }
.stats dt { margin: 0; font-size: .8rem; }
.stats dd { margin: 2px 0 0; font-size: 1.15rem; }

/* Screenshot band */
.shot-band { background: var(--g-bg); padding: 56px 0; }
.window { margin: 0; border: 1px solid var(--g-edge); border-radius: var(--radius); overflow: hidden; background: var(--g-chrome); }
.window figcaption { padding: 12px 18px; color: var(--g-muted); font-size: .95rem; border-top: 1px solid var(--g-edge); }

/* Sections */
.section-title { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -0.015em; }
.features, .keyboards, .safety, .install, .faq { padding: 72px 0; }
.features .section-title { margin-bottom: 1em; }
.keyboards, .install { background: var(--surface); border-block: 1px solid var(--line); }

.row { display: grid; gap: 24px; align-items: center; padding: 32px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 900px) { .row { grid-template-columns: 5fr 7fr; gap: 56px; padding: 44px 0; } }
.row h3, .pair h3 { font-size: 1.4rem; font-weight: 800; }
.row-text p, .pair p { color: var(--ink-2); max-width: 34em; }
.row-text p:last-child, .pair p:last-child { margin-bottom: 0; }

.crop {
  --x: 0; --y: 0; --w: 1180; --h: 760;
  aspect-ratio: var(--w) / var(--h);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid #2C2E33;
  background: var(--g-bg);
  box-shadow: 0 16px 36px -20px rgba(0,0,0,.7);
}
.crop img {
  width: calc(1180 / var(--w) * 100%);
  max-width: none;
  margin-left: calc(var(--x) / var(--w) * -100%);
  margin-top: calc(var(--y) / var(--w) * -100%);
}
.crop-keys   { --x: 222; --y: 140; --w: 540; --h: 380; }
.crop-keymap { --x: 222; --y: 286; --w: 600; --h: 424; }
.crop-light  { --x: 206; --y: 64;  --w: 964; --h: 448; }

.pair { display: grid; gap: 32px; padding-top: 44px; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .pair { grid-template-columns: 1fr 1fr; gap: 44px 56px; } }

/* Table */
.table-wrap { overflow-x: auto; margin-bottom: 1.2em; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-3); font-weight: 700; font-size: .92rem; }
td:nth-child(2) { font-family: var(--mono); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.ok { color: var(--teal-ink); font-weight: 800; }
.keyboards p { color: var(--ink-2); }

/* Safety */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.checks li { position: relative; padding-left: 38px; color: var(--ink-2); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .22em;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.8 3.8 7.2-8' fill='none' stroke='%230F1514' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.checks strong { color: var(--ink); }

/* Install steps (a real sequence) */
.steps { list-style: none; counter-reset: step; margin: 0 0 22px; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; min-height: 32px; color: var(--ink-2); }
.steps li strong { color: var(--ink); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -.05em;
  width: 32px; height: 32px; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; color: var(--on-teal); background: var(--teal);
  border-radius: 50%;
}
.note { color: var(--ink-2); font-size: .97rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0; }

/* FAQ */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; position: relative; font-weight: 700; font-size: 1.08rem; }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--ink-3);
}
details[open] summary::after { content: "\2212"; }
details p { color: var(--ink-2); margin: 0 0 18px; max-width: 40em; }

/* Footer */
.foot { background: var(--g-chrome); color: var(--g-muted); padding: 40px 0 48px; border-top: 1px solid var(--line); }
.foot-row { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.foot-brand { display: flex; gap: 14px; align-items: center; }
.foot-brand img { border-radius: 9px; }
.foot-brand p { margin: 0; font-size: .92rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot-links a { color: var(--g-body); text-decoration: none; font-weight: 600; }
.foot-links a:hover { color: var(--teal-hi); }
.foot :focus-visible { outline-color: var(--teal); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .key-well { transition: none; }
}
