/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(56px, 6.5vw, 92px) 0 150px; overflow: clip; }
.hero-grid {
  max-width: 1488px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(360px, 470px) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); align-items: center;
}
.hero h1 {
  font-size: clamp(56px, 6.15vw, 90px); font-weight: 700; line-height: .94; letter-spacing: -.052em;
  margin-left: -.04em;
}
.hero h1 .h1-line { display: block; white-space: nowrap; }
.hero h1 .char-mask { padding: .06em .02em .1em; margin: -.06em -.02em -.1em; }
.caret { display: inline-block; width: .055em; min-width: 3px; height: .78em; margin-left: .05em; background: var(--blue); vertical-align: -.02em; border-radius: 2px; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .lead { margin-top: 28px; max-width: 22.5em; font-size: 21px; }
.hero .lead kbd { font-size: .8em; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero .micro { margin-top: 22px; }

/* --- MacBook --- */
.stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.mac-zoom { width: min(100%, 900px); transform-origin: 50% 60%; will-change: transform; }
.mac { position: relative; width: 100%; }
.mac::after { /* мягкая тень под ноутбуком — отдельным слоем, без filter на предке стекла */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -6%; height: 16%; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, var(--mac-shadow), transparent 70%); pointer-events: none;
}
.lid-wrap { margin: 0 6.4%; perspective: 2600px; perspective-origin: 50% 160%; }
.lid {
  position: relative; aspect-ratio: 16 / 10.35; border-radius: 3.1% / 4.6%;
  background: #0A0A0B; padding: 1.55% 1.55% 2.3%; transform-origin: 50% 100%;
  box-shadow: 0 0 0 1.5px var(--silver-2), 0 0 0 4px var(--silver-1), inset 0 0 0 1px #2a2a2c;
}
.mac .screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: .9% / 1.4%;
  container-type: inline-size; background: #1E2B3A; isolation: isolate;
}
.desk { position: absolute; inset: 0; }
.wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; z-index: 0; }
.mac .notch { position: absolute; top: 0; left: 50%; width: 15%; height: 3.4%; transform: translateX(-50%); background: #0A0A0B; border-radius: 0 0 1.2cqw 1.2cqw; z-index: 6; }
.mac .base {
  position: relative; height: clamp(10px, 2.3vw, 22px); margin-top: -1px;
  background: linear-gradient(to bottom, var(--base-1) 0%, var(--base-2) 45%, var(--base-3) 100%);
  border-radius: 2px 2px 50% 50% / 2px 2px 100% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.mac .base::before { content: ""; position: absolute; left: 50%; top: 0; width: 13%; height: 42%; transform: translateX(-50%); background: linear-gradient(var(--base-3), var(--base-2)); border-radius: 0 0 10px 10px; }

.menubar {
  position: absolute; inset: 0 0 auto 0; height: 3.4%; z-index: 4; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.4cqw; color: rgba(255, 255, 255, .94); font: 500 max(4px, .95cqw)/1 var(--font-text); letter-spacing: 0;
  background: rgba(20, 34, 50, .28); -webkit-backdrop-filter: blur(1.4cqw); backdrop-filter: blur(1.4cqw);
}
.menubar .l, .menubar .r { display: flex; align-items: center; gap: 1.5cqw; }
.menubar b { font-weight: 700; }
.menubar svg { width: 1.45cqw; height: 1.45cqw; }
.menubar .app-icon { width: 1.6cqw; height: 1.6cqw; }

/* Окно «Почты» */
.mailwin {
  position: absolute; z-index: 3; left: 39%; top: 10.5%; width: 55%; height: 56%;
  font-size: max(5px, 1.05cqw);
  border-radius: 1.25em; overflow: hidden; color: #fff;
  background: rgba(26, 30, 40, .62); border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(2em) saturate(160%); backdrop-filter: blur(2em) saturate(160%);
  box-shadow: 0 2em 4.6em rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .12);
  font-family: var(--font-text); letter-spacing: 0;
}
.mailwin .tb { height: 4.2em; display: flex; align-items: center; padding: 0 1.35em; gap: .65em; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.mailwin .tb i { width: .9em; height: .9em; border-radius: 50%; background: #FF5F57; }
.mailwin .tb i:nth-child(2) { background: #FEBC2E; }
.mailwin .tb i:nth-child(3) { background: #28C840; }
.mailwin .tb .t { flex: 1; text-align: center; font-weight: 700; font-size: 1.05em; color: rgba(255, 255, 255, .9); }
.mailwin .tb .send { width: 2em; height: 2em; border-radius: 50%; background: #0A84FF; display: grid; place-items: center; }
.mailwin .tb .send svg { width: 1.05em; height: 1.05em; }
.mailwin .row { display: flex; align-items: center; gap: .6em; height: 3em; padding: 0 1.35em; color: rgba(255, 255, 255, .58); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.mailwin .row b { font-weight: 500; color: rgba(255, 255, 255, .92); }
.mailwin .chip-to { background: rgba(10, 132, 255, .35); color: #d6eaff; padding: .25em .6em; border-radius: .45em; }
.mailwin .body { padding: 1.5em 1.7em; font-size: 1.5em; line-height: 1.5; color: rgba(255, 255, 255, .95); }
.mw-caret { display: inline-block; width: .09em; min-width: 1px; height: 1.05em; background: #4DA3FF; vertical-align: -.16em; margin-left: .06em; animation: blink 1.06s steps(1) infinite; }
.mw-text .w { display: inline-block; }
.mw-text .w.in { animation: word-in .5s var(--ease-out) both; animation-delay: var(--d, 0ms); }
.mw-text .w.out, .mw-text .sel.out { animation: word-out .28s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes word-in { from { opacity: 0; filter: blur(4px); transform: translateY(.18em); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes word-out { to { opacity: 0; filter: blur(4px); transform: translateY(-.12em); } }
.mw-text .sel {
  border-radius: .15em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  background: linear-gradient(rgba(10, 132, 255, .55), rgba(10, 132, 255, .55)) no-repeat 0 0 / 0% 100%;
  transition: background-size .65s var(--ease-out);
}
.mw-text .sel.on { background-size: 100% 100%; }

/* ---------- Таблетка — как в приложении (стекло внизу экрана), но «живая» ---------- */
.pill {
  position: absolute; z-index: 5; left: 50%; bottom: 4.6cqw; font-size: max(8px, 1.28cqw);
  height: 3.1em; width: 3.1em; border-radius: 1.55em;
  transform: translate(-50%, 1em) scale(.55); opacity: 0;
  background: rgba(34, 36, 46, .52); color: #fff; overflow: hidden; contain: layout paint style;
  -webkit-backdrop-filter: blur(1.3em) saturate(180%); backdrop-filter: blur(1.3em) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .26), 0 .9em 2.2em rgba(0, 0, 0, .32);
  transition: width .7s var(--spring-l), opacity .22s var(--ease), transform .62s var(--spring-l), background-color .45s var(--ease);
}
.pill.up { opacity: 1; transform: translate(-50%, 0) scale(1); }
.pill.cmd { background: rgba(0, 92, 214, .55); }
.pill .pc {
  position: absolute; left: 50%; top: 0; height: 100%; translate: -50% 0; width: max-content;
  display: flex; align-items: center; gap: .62em; padding: 0 1.2em; white-space: nowrap; font-weight: 600; letter-spacing: 0;
}
.pill .pc.pop { animation: pop-in .42s var(--pop) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(3px) scale(.94); } to { opacity: 1; transform: none; } }
.pill .pc.leave { animation: pop-out .18s var(--ease) both; }
@keyframes pop-out { to { opacity: 0; transform: scale(.96); } }
.voice { display: flex; align-items: center; gap: .17em; height: 1.35em; flex: none; }
.voice i { width: .2em; height: 100%; border-radius: .1em; background: #fff; transform: scaleY(.3); }
.tick { width: 14.5em; overflow: hidden; display: flex; justify-content: flex-end; -webkit-mask-image: linear-gradient(to right, transparent, #000 32%); mask-image: linear-gradient(to right, transparent, #000 32%); }
.tick .track { display: flex; gap: .3em; white-space: nowrap; font-weight: 500; color: rgba(255, 255, 255, .92); }
.tick .ph { color: rgba(255, 255, 255, .5); font-weight: 500; }
.tick .tw { display: inline-block; animation: tw-in .38s var(--pop) both; }
@keyframes tw-in { from { opacity: 0; filter: blur(3px); transform: translateY(.3em); } to { opacity: 1; filter: none; transform: none; } }
.pill .tm { font-variant-numeric: tabular-nums; font-weight: 500; color: rgba(255, 255, 255, .62); min-width: 2.2em; }
.eq { display: flex; align-items: center; gap: .16em; height: 1.2em; }
.eq i { width: .2em; height: 100%; border-radius: .1em; background: #fff; animation: eq 1s ease-in-out infinite; animation-delay: calc(var(--i) * .2s); }
.eq i:nth-child(2) { height: 70%; } .eq i:nth-child(3) { height: 100%; } .eq i:nth-child(4) { height: 55%; } .eq i:nth-child(1) { height: 45%; }
@keyframes eq { 0%, 100% { opacity: .35; transform: scaleY(.55); } 50% { opacity: 1; transform: scaleY(1); } }
.shim {
  background: linear-gradient(100deg, rgba(255, 255, 255, .55) 35%, #fff 50%, rgba(255, 255, 255, .55) 65%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 1.25s linear infinite;
}
@keyframes shim { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.pill .ico { width: 1.35em; height: 1.35em; flex: none; }
.spark { color: #FFE08A; animation: spark-spin 2.4s var(--ease) infinite; }
@keyframes spark-spin { 50% { transform: rotate(90deg) scale(.86); } 100% { transform: rotate(180deg); } }
.okc circle { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s var(--ease-out) forwards; }
.okc path { transform-origin: 12px 12px; animation: check-pop .5s var(--spring-l) .22s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes check-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.pill .ico.ok { color: #7EE2A0; }
.pill .ico.warn { color: #FFC163; }

/* Режимы под макбуком */
.modes { display: flex; gap: 10px; margin-top: 30px; }
.mode {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border: 0; cursor: pointer;
  border-radius: 999px; background: var(--chip); color: var(--nav-ink); font-size: 15px; overflow: hidden;
  transition: background-color .2s, color .2s;
}
.mode[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--chip) 80%, var(--ink) 8%); }
.mode::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; }
.mode[aria-pressed="true"]::after { transform: scaleX(1); }
.mode.playing::after { animation: progress var(--dur, 5s) linear forwards; }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mode .kbd { font-size: 12px; height: 20px; }
.try { margin: 16px 0 0; font-size: 15px; color: var(--ink-3); text-align: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 7px; }
.try kbd { font-size: 13px; height: 23px; }
.hold-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 14px; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .3s var(--spring), background-color .2s, color .2s, border-color .2s;
}
.hold-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.hold-btn.down { transform: scale(.95); background: var(--btn); border-color: var(--btn); color: #fff; }
.hold-btn.down .dot { background: #fff; }
@media (pointer: coarse) { .hold-btn { height: 44px; padding: 0 16px 0 13px; font-size: 15px; } }
.try-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.kb-only { display: contents; }
@media (hover: none) and (pointer: coarse) { .kb-only { display: none; } }
/* Подробная подсказка про пробел — только на широком экране, на узком строка не растёт */
.narrow-only { display: none; }
@media (max-width: 560px) { .wide-only { display: none; } .narrow-only { display: inline; } }

@media (max-width: 980px) {
  .hero { padding-top: 48px; padding-bottom: 110px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 56px; }
  .hero h1 { margin-left: 0; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero .ctas { justify-content: center; }
  .mailwin { left: 8%; width: 84%; top: 11%; height: 58%; font-size: max(5px, 1.5cqw); }
  .pill { font-size: max(8.5px, 2cqw); }
}
@media (max-width: 560px) {
  .btn .short { display: inline; } .btn .long { display: none; }
  .ctas { flex-wrap: nowrap !important; }
  .ctas .btn { padding: 0 18px; font-size: 16px; }
  .ctas .btn-primary svg { display: none; }
  .micro .m3 { display: none; }
  .hero h1 { font-size: 56px; }
  .hero .lead { font-size: 19px; margin-top: 22px; }
  .hero .ctas { margin-top: 28px; }
  .hero .ctas .btn { flex: 1 1 auto; padding: 0 18px; }
  .menubar .l span:nth-child(n+4) { display: none; }
  .modes { margin-top: 24px; gap: 8px; }
  .mode { height: 44px; padding: 0 12px; font-size: 14px; gap: 7px; white-space: nowrap; }
  .mode .kbd { font-size: 11px; height: 19px; min-width: 22px; }
}
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .ctas { flex-wrap: wrap !important; }
  .ctas .btn, .hero .ctas .btn { flex: 1 1 100%; }
  .hero h1 { font-size: 50px; }
  .site-header .bar { gap: 10px; }
  .mode { padding: 0 9px; font-size: 13px; }
}
.static-motion .caret, .static-motion .mw-caret { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .caret, .mw-caret { animation: none !important; } }
