:root {
  --bg: #e9e4d8;
  --bg-2: #d9d2c1;
  --ink: #1d2433;
  --muted: #5b6272;
  --body: #1d2433;
  --body-2: #2c3547;
  --body-edge: #121722;
  --key: #3a4459;
  --key-top: #4a566f;
  --key-ink: #e8ecf3;
  --accent: #f2a541;
  --lcd-bg: #c7f0d8;
  --lcd-fg: #43523d;
  --link: #b4570f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151d;
    --bg-2: #171d28;
    --ink: #e7e9ee;
    --muted: #9aa3b5;
    --link: #f2a541;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, var(--bg-2), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Golos Text", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ---------- Телефон ---------- */

.phone {
  position: sticky;
  top: 24px;
  background: linear-gradient(160deg, var(--body-2), var(--body) 60%);
  border-radius: 46px 46px 64px 64px;
  padding: 22px 22px 30px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .08),
    inset 0 -6px 0 var(--body-edge),
    0 30px 60px -20px rgba(16, 20, 30, .55);
  user-select: none;
  touch-action: manipulation;
}

.phone-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.speaker {
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--body-edge) 0 6px, transparent 6px 10px);
}

.brand {
  font: 500 11px/1 "Unbounded", sans-serif;
  letter-spacing: .3em;
  color: #8f9ab0;
}

.screen {
  position: relative;
  container-type: inline-size;
  background: var(--lcd-bg);
  border-radius: 10px;
  border: 10px solid #0e121a;
  box-shadow: inset 0 0 18px rgba(67, 82, 61, .35);
  overflow: hidden;
}

#lcd {
  display: block;
  width: 100%;
  aspect-ratio: 128 / 80;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Лёгкая сетка пикселей поверх экрана, как у настоящего ЖК */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(67, 82, 61, .07) 1px, transparent 1px) 0 0 / calc(100% / 128) 100%,
    linear-gradient(rgba(67, 82, 61, .07) 1px, transparent 1px) 0 0 / 100% calc(100% / 80);
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.2cqw;
  padding: 4cqw;
  color: var(--lcd-fg);
  font-family: "Press Start 2P", monospace;
  text-align: center;
  background: var(--lcd-bg);
}

.overlay.show { display: flex; }
.overlay.dim { background: rgba(199, 240, 216, .9); }
.overlay p { margin: 0; line-height: 1.35; }
.overlay .big { font-size: 5.2cqw; }
.overlay .sel { font-size: 3.4cqw; white-space: pre; }
.overlay .small { font-size: 3cqw; }
.overlay .blink { font-size: 3cqw; animation: blink 1s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.softkeys {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
  margin: 18px 6px 14px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 12px;
  padding: 0 6px;
}

.key {
  appearance: none;
  border: 0;
  border-radius: 16px 16px 20px 20px;
  background: linear-gradient(var(--key-top), var(--key));
  color: var(--key-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 0 var(--body-edge);
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  touch-action: none;
  transition: transform .05s, box-shadow .05s;
}

.key b { font: 700 18px/1 "Unbounded", sans-serif; }
.key small { font-size: 10px; line-height: 1; color: #aab4c8; letter-spacing: .04em; }
.key.accent b { color: var(--accent); }
.key.soft { height: 38px; border-radius: 12px; font: 700 16px/1 "Unbounded", sans-serif; }
.key.nav {
  height: 38px;
  border-radius: 20px;
  font: 700 13px/1 "Unbounded", sans-serif;
  background: linear-gradient(#f6b85a, var(--accent));
  color: #2a1a05;
}

.key:active, .key.down {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 0 var(--body-edge);
}

.key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Текст ---------- */

.eyebrow {
  margin: 8px 0 6px;
  font: 500 12px/1 "Unbounded", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--link);
}

h1 {
  margin: 0 0 16px;
  font: 700 clamp(34px, 5vw, 52px)/1.05 "Unbounded", sans-serif;
  letter-spacing: -.02em;
}

h2 {
  margin: 0 0 12px;
  font: 500 15px/1.2 "Unbounded", sans-serif;
}

.lead { margin: 0 0 32px; font-size: 18px; color: var(--muted); max-width: 52ch; }

.controls, .records {
  border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  padding-top: 22px;
  margin-bottom: 28px;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
  margin: 0;
}

dt { white-space: nowrap; }
dd { margin: 0; color: var(--muted); }

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-bottom-width: 2px;
  font: 500 13px/1.2 "Golos Text", sans-serif;
  text-align: center;
}

.hint { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.records ol { margin: 0; padding: 0; list-style: none; counter-reset: lvl; }
.records li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--ink) 14%, transparent);
  counter-increment: lvl;
}
.records li span::before { content: counter(lvl) ". "; color: var(--muted); }
.records b { font-family: "Press Start 2P", monospace; font-size: 11px; font-weight: 400; align-self: center; }

.links { font-size: 14px; color: var(--muted); }
.links a { color: var(--link); }

/* ---------- Узкие экраны ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding: 16px 16px 40px; }
  .phone { position: static; max-width: 420px; width: 100%; margin: 0 auto; padding: 18px 16px 24px; border-radius: 36px 36px 52px 52px; }
  .about { max-width: 560px; margin: 0 auto; }
}

@media (max-width: 400px) {
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 8px; }
  .key { height: 48px; }
}

.demo-tag {
  position: absolute;
  left: 50%;
  bottom: 3cqw;
  transform: translateX(-50%);
  padding: 1.4cqw 2.4cqw;
  background: var(--lcd-bg);
  border: 0.6cqw solid var(--lcd-fg);
  color: var(--lcd-fg);
  font: 2.6cqw/1 "Press Start 2P", monospace;
  white-space: nowrap;
  animation: blink 1.2s steps(1) infinite;
}

.demo-tag[hidden] { display: none; }
