/* pikmi landing page. Colors, radii and type come from tokens.css (Instrument Panel). */

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 300 16px/1.6 var(--font-sans); }
a { color: var(--link); }
[data-theme="dark"] a { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.screen :focus-visible { outline-color: var(--on-screen); }
h1, h2, h3 { font-weight: 200; }
code { font: 400 14px/1.5 "JetBrains Mono", ui-monospace, monospace; }
svg { flex: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 16px; }
.label { font: 500 var(--type-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.skip { position: absolute; left: 16px; top: -64px; background: var(--text); color: var(--page); padding: 12px 16px; border-radius: var(--radius-key); z-index: 10; }
.skip:focus { top: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* hardware (from STYLE.md) */
.panel { background: var(--panel); border-radius: var(--radius-panel); }
.key { display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border: 0; border-radius: var(--radius-key); background: var(--key);
  box-shadow: var(--key-travel) var(--key-shadow); cursor: pointer; text-align: left; font: inherit; color: var(--key-number); }
.key .k-label { align-self: flex-end; text-align: right; font: 500 var(--type-label)/1.2 var(--font-sans);
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--key-label); }
.key .k-num { font: 300 16px/1 var(--font-sans); color: var(--key-number); }
.key:active { transform: translateY(2px); box-shadow: none; }
.key[aria-pressed="true"] { background: var(--key-active); box-shadow: var(--key-travel) var(--key-active-shadow); }
.key[aria-pressed="true"] * { color: var(--key-active-ink); }
.key.alt { background: var(--key-alt); box-shadow: var(--key-travel) var(--key-alt-shadow); color: var(--key-alt-number); }
.key.alt .k-label { color: var(--key-alt-label); }
.key.alt .k-num { color: var(--key-alt-number); }
/* small keys keep their drawn size but get a 44px tap area */
.hit { position: relative; }
.hit::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }

.screen { background: var(--screen); color: var(--on-screen); border-radius: var(--radius-key); box-shadow: inset 0 0 0 2px var(--screen-bezel); }
.on-screen-label { font: 500 var(--type-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--key-alt-label); }

.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; min-height: 44px; color: var(--text); cursor: pointer; }
.switch .track { width: 44px; height: 22px; border-radius: var(--radius-key); background: var(--key); box-shadow: inset 0 0 0 1px var(--rule); position: relative; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 2px; background: var(--key-alt); }
.switch[aria-checked="true"] .track::after { left: 25px; }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rule); flex: none; }
.switch[aria-checked="true"] .led, .led.on { background: var(--led); }

.sticker { width: 96px; aspect-ratio: 1; display: grid; place-items: center; rotate: -8deg; background: var(--accent); color: var(--on-accent);
  font: 900 18px/1 var(--font-dot); text-align: center;
  clip-path: polygon(50% 0, 57.8% 10.8%, 69.1% 3.8%, 72.2% 16.7%, 85.4% 14.6%, 83.3% 27.8%, 96.2% 30.9%, 89.2% 42.2%, 100% 50%, 89.2% 57.8%, 96.2% 69.1%, 83.3% 72.2%, 85.4% 85.4%, 72.2% 83.3%, 69.1% 96.2%, 57.8% 89.2%, 50% 100%, 42.2% 89.2%, 30.9% 96.2%, 27.8% 83.3%, 14.6% 85.4%, 16.7% 72.2%, 3.8% 69.1%, 10.8% 57.8%, 0 50%, 10.8% 42.2%, 3.8% 30.9%, 16.7% 27.8%, 14.6% 14.6%, 27.8% 16.7%, 30.9% 3.8%, 42.2% 10.8%); }

.cross { position: absolute; width: 14px; height: 14px; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--text-muted); }
.cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.cross::after { top: 50%; left: 0; right: 0; height: 1px; }
.cross.tl { top: 8px; left: 8px; }
.cross.br { bottom: 8px; right: 8px; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 400 22px/1 var(--font-sans); color: var(--text); text-decoration: none; }
[data-theme="dark"] .brand { text-decoration: none; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.nav-links { display: none; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; font-size: 15px; }
.nav-links a:hover { text-decoration: underline; }
.nav-end { display: flex; align-items: center; gap: 16px; }
.icon-link { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--text-muted); }
.icon-link svg { fill: currentColor; }
.icon-link:hover { color: var(--text); }

/* hero */
.hero { text-align: center; padding-block: 56px 48px; }
.tech { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.kana { color: var(--accent); font: 500 12px/1.3 var(--font-sans); letter-spacing: 1px; }
.hero h1 { font-weight: 300; font-size: clamp(64px, 12vw, var(--type-display)); line-height: 1; letter-spacing: -2px; margin: 20px 0 12px; }
.tagline { font-weight: 200; font-size: clamp(32px, 6vw, 52px); line-height: 1.2; letter-spacing: -1px; color: var(--text-muted); margin: 0; }
.lede { color: var(--text-muted); max-width: 520px; margin: 20px auto 0; font-size: var(--type-lead); line-height: 1.55; }
.cta-row { display: flex; justify-content: center; align-items: center; gap: 8px 24px; margin-top: 28px; flex-wrap: wrap; }
.cta { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: var(--radius-control);
  background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--key-active-shadow);
  font: 500 16px/1 var(--font-sans); text-decoration: none; }
[data-theme="dark"] .cta { text-decoration: none; }
.cta svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.cta:active { transform: translateY(3px); box-shadow: none; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
[data-theme="dark"] .text-link { text-decoration: underline; }

/* the picker device */
#picker { display: grid; gap: 32px; }
.device { position: relative; display: grid; gap: 16px; padding: 28px 12px; }
.device-top { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; padding-inline: 4px; padding-right: 96px; }
.device .sticker { position: absolute; top: -36px; right: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.device-screen { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-width: 0; }
.readout { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.readout .value { font: 900 40px/1 var(--font-dot); }
.readout .unit { font: 700 20px/1 var(--font-dot); color: var(--accent); margin-left: 4px; }
.readout-name { font: 200 22px/1.1 var(--font-sans); text-transform: lowercase; text-align: right; }
.viewport { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 2px; background: var(--screen-bezel); }
.viewport iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: var(--card); }
/* on touch screens the page scrolls past the preview instead of inside it */
@media (pointer: coarse) { .viewport iframe { pointer-events: none; } }
.screen-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center; background: var(--screen); }
.screen-msg[hidden] { display: none; }
.msg-big { font: 900 32px/1.1 var(--font-dot); }
.msg-small { font: 300 15px/1.5 var(--font-sans); max-width: 40ch; }
.readout-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.screen-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--on-screen); font-size: 15px; text-decoration: none; }
.screen-link:hover { text-decoration: underline; }
.screen-link svg { fill: none; stroke: currentColor; stroke-width: 1.3; }

.browser { display: grid; gap: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.search { position: relative; display: flex; align-items: center; min-height: 44px; flex: 1 1 100%; cursor: text; }
.search svg { position: absolute; margin-left: 14px; fill: none; stroke: var(--text-muted); stroke-width: 1.6; pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 14px 0 36px; border: 1px solid var(--rule); border-radius: var(--radius-pill);
  background: var(--card); color: var(--text); font: 300 13px/1 var(--font-sans); }
.search input::placeholder { color: var(--text-muted); }
.search input:focus-visible { outline-offset: 1px; }
.filters { display: flex; gap: 6px; }
.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--rule);
  border-radius: var(--radius-pill); background: var(--card); color: var(--text); font: 400 13px/1 var(--font-sans); cursor: pointer; }
.pill::after { content: ""; position: absolute; inset: -4px 0; }
.pill .count { font: 500 11px/1 var(--font-sans); color: var(--text-muted); }
.pill[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--page); }
.pill[aria-pressed="true"] .count { color: var(--rule); }
.result { margin-left: auto; }

.key-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skey { gap: 2px; min-height: 56px; padding: 10px 12px; }
.skey-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 500 11px/1.3 var(--font-sans); letter-spacing: 1px; text-transform: uppercase; color: var(--key-label); }
.skey-name { font: 300 15px/1.4 var(--font-sans); text-transform: lowercase; }
.key.alt .skey-top { color: var(--key-alt-label); }
.grid-msg { grid-column: 1 / -1; margin: 0; padding: 16px 4px; color: var(--text-muted); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 16px; box-shadow: -1px -1px 0 var(--rule); }
.stat-num { font: 900 40px/1 var(--font-dot); color: var(--accent); }
.stat .label { line-height: 1.5; }
.stat-sub { display: block; }

/* sections */
.section { padding-top: 88px; }
.section h2 { font-size: var(--type-h2); line-height: 1.1; margin: 0 0 8px; }
.section-lede { color: var(--text-muted); max-width: 60ch; margin: 0 0 28px; }

/* how it works: three panels, each with a small screen, joined by arrows */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.step { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.step + .step::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px; background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M6 1v14m-5-5l5 5 5-5' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / 12px 16px no-repeat; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: var(--page); font: 500 13px/1 var(--font-sans); }
.step h3 { margin: 0; font-size: 24px; font-weight: 300; line-height: 1.2; }
.step-text { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }

/* the small screens are drawn hardware, so they keep their own dark palette in both editions */
.lcd { --lcd: #000000; --lcd-bezel: #2a2930; --lcd-rule: #1f1f24; --lcd-dim: #7a7a82; --lcd-quiet: #5a5a62; --lcd-blue: #3d8bff;
  flex: 1; display: flex; min-height: 208px; padding: 6px; border-radius: 10px; background: var(--lcd-bezel); box-shadow: inset 0 1px 3px #00000080; }
.lcd-screen { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 5px;
  background: var(--lcd); color: var(--on-screen); font: 400 12px/1.3 "JetBrains Mono", ui-monospace, monospace; }
.lcd-screen p { margin: 0; }
.lcd-bar, .lcd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--lcd-dim); }
.lcd-bar { padding-bottom: 10px; border-bottom: 1px solid var(--lcd-rule); }
.lcd-state { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.lcd-state::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lcd-line, .lcd-option { display: flex; align-items: center; gap: 10px; }
.lcd-num { font-size: 11px; color: var(--lcd-dim); }
.lcd-blue { color: var(--lcd-blue); }
.lcd-orange { color: var(--accent); }
.wave { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 40px; }
.wave span { width: 3px; border-radius: 1px; background: var(--lcd-blue); }
.wave span.quiet { background: var(--lcd-quiet); }
.lcd-option { padding: 5px 6px; border-radius: 3px; }
.lcd-option.on { background: var(--accent); color: var(--on-accent); }
.lcd-option.on .lcd-num { color: var(--on-accent); }
.lcd-cursor { margin-left: auto; font-size: 11px; }
.lcd-foot { margin-top: auto; display: grid; gap: 6px; }
.meter { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.meter span { flex: 1; background: var(--accent); }
.meter span.off { background: var(--lcd-rule); }
.lcd-key { min-width: 6ch; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--lcd-blue); }
.lcd-ok { margin-left: auto; font-size: 11px; color: var(--led); }
.lcd-marker { color: var(--led); letter-spacing: 0.5px; text-transform: none; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tiles span { display: grid; place-items: center; height: 26px; border: 1px solid var(--lcd-bezel); border-radius: 3px;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--lcd-dim); }
.tiles span.on { background: var(--led); border-color: var(--led); color: var(--on-accent); }

.style-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.scard { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 196px; }
.scard-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.num-key { padding: 5px 8px; font: 300 14px/1 var(--font-sans); }
.palette { display: inline-flex; gap: 4px; }
.palette span { width: 16px; height: 16px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--rule); }
.scard h3 { margin: 0; font-size: 20px; line-height: 1.2; text-transform: lowercase; }
.scard p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.scard-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.themes { display: inline-flex; gap: 12px; }
.theme { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.theme .led { width: 7px; height: 7px; }
.theme.off { color: var(--text-muted); }
.scard-link { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-block: -12px; color: var(--text); font-size: 13px; }
.scard-link svg { fill: none; stroke: currentColor; stroke-width: 1.3; }
.random-card { position: relative; background: var(--screen); color: var(--on-screen); justify-content: space-between; }
[data-theme="dark"] .random-card { box-shadow: inset 0 0 0 1px var(--rule); }
.random-card .on-screen-label { margin: 0; }
.random-card h3 { margin-top: auto; }
.shuffle { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; padding: 0; border: 0; background: none;
  color: var(--accent); font: 400 13px/1 var(--font-sans); cursor: pointer; }
.shuffle::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.list-msg { padding: 24px 0; color: var(--text-muted); grid-column: 1 / -1; }

.cmds { display: grid; gap: 12px; }
.cmd { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 16px; }
.cmd code { overflow-wrap: anywhere; }
.cmd .copy { flex-direction: row; align-items: center; gap: 6px; height: 28px; padding: 0 12px; flex: none; }
.cmd .copy .k-label { align-self: auto; font-size: 10px; }
.cmd .copy .k-num { font-size: 13px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-block: 56px 32px; color: var(--text-muted); font-size: 15px; }
.foot-end { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.foot-end:hover { text-decoration: underline; }

@media (min-width: 640px) {
  .wrap { padding-inline: 24px; }
  .device { padding: 32px 16px 28px; }
  .viewport { aspect-ratio: 16 / 10; }
  .search { flex: 0 1 320px; }
  .key-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { flex-direction: row; align-items: center; gap: 14px; }
  .style-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .hero { padding-block: 74px 56px; }
  .device { padding: 36px 20px 28px; }
  .device .sticker { top: -46px; right: -2px; }
  .viewport { aspect-ratio: 1088 / 445; }
  .key-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stat { padding: 20px 24px; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step + .step::before { left: -40px; right: auto; top: 0; bottom: 0; width: 40px; height: auto;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M1 6h14m-5-5l5 5-5 5' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
    mask-size: 16px 12px; }
  .style-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .switch .track::after { transition: left 80ms linear; }
}
