/* Aroken — первый экран курса JavaScript: сцена «Браузер + DevTools». Подключается только на javascript.html.
   Слева текст на графите, справа окно браузера: Todo из дипломного проекта и консоль, в которую пишет каждое действие.
   Лайм — только у Primary-кнопки, акцент курса — кобальт. */

.hero--js .hjs {
  --hjs-pad: 56px;                          /* поле текста от левого края сцены */
  --hjs-top: 48px;                          /* верх бейджа и верх окна браузера — на одной линии */
  --hjs-inset: 40px;                        /* окно браузера от правого края сцены */
  --hjs-cube: clamp(168px, 13.2vw, 236px);  /* куб JS */
  --hjs-console-r: 150px;                   /* справа в консоли место под куб */
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 41fr) minmax(0, 59fr);
  min-height: clamp(584px, 40vw, 680px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(52% 62% at 80% 104%, rgba(247, 223, 30, .15), rgba(247, 223, 30, 0) 72%),
    radial-gradient(42% 52% at 0% 0%, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 70%),
    var(--graphite);
}
.hjs :focus-visible { outline-color: var(--yellow); }

/* ---------- Текст ---------- */
.hjs__copy { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; padding: var(--hjs-top) 32px var(--hjs-top) var(--hjs-pad); }
.hjs__status { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; }
.hjs__badge { height: 40px; padding: 0 18px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); font-size: 15px; color: #fff; }
.hjs__badge .badge__dot { background: var(--yellow); box-shadow: 0 0 10px rgba(247, 223, 30, .6); }
.hjs__start { font-size: 15px; color: var(--muted); }
.hjs__title { margin-top: 28px; font-size: clamp(44px, 3.65vw, 56px); line-height: 1.18; font-weight: 700; letter-spacing: -.025em; color: #fff; }
.hjs__text { margin-top: 24px; max-width: 460px; font-size: 17.5px; line-height: 26px; color: var(--muted-2); }
.hjs__bottom { margin-top: auto; padding-top: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; }
.hjs__proof { display: flex; align-items: center; gap: 12px; }
.hjs__proof .avatars img { border-color: var(--graphite); }
.hjs__proof-text { font-size: 15px; line-height: 19px; color: #fff; }

/* ---------- Окно браузера ---------- */
/* В две колонки окно не растит сцену: высоту задают текст и min-height, новые задачи прокручиваются внутри списка */
.hjs__stage { position: relative; min-width: 0; }
.hjs__window {
  position: absolute; z-index: 1; top: var(--hjs-top); right: var(--hjs-inset); bottom: 0; left: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12); border-bottom: 0; border-radius: 16px 16px 0 0;
  background: #1B1D22;
  box-shadow: 0 -24px 80px -40px rgba(247, 223, 30, .35), 0 40px 90px -30px rgba(0, 0, 0, .7);
}

.hjs__bar { flex: none; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #202227; border-bottom: 1px solid rgba(0, 0, 0, .4); color: rgba(255, 255, 255, .5); }
.hjs__dots { flex: none; display: flex; gap: 7px; margin-right: 6px; }
.hjs__dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.hjs__arrows { flex: none; display: flex; gap: 4px; }
.hjs__arrows svg + svg { opacity: .45; }
.hjs__reload { flex: none; width: 30px; height: 30px; margin-left: -4px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: rgba(255, 255, 255, .72); cursor: pointer; transition: background .2s, color .2s; }
.hjs__reload:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hjs__reload.is-spinning svg { animation: hjs-spin .6s var(--ease); }
@keyframes hjs-spin { to { transform: rotate(360deg); } }
.hjs__url { flex: 1 1 auto; min-width: 0; height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; background: #121317; font-size: 13px; color: rgba(255, 255, 255, .45); white-space: nowrap; overflow: hidden; }
.hjs__url svg { flex: none; }
.hjs__address { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hjs__host { color: rgba(255, 255, 255, .88); }

/* ---------- Страница: Todo на бумаге ---------- */
.hjs__page { position: relative; flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; overflow: hidden; background: linear-gradient(160deg, var(--paper-1) 0%, var(--paper-2) 58%, var(--paper-3) 100%); color: var(--ink); transition: opacity .28s var(--ease); }
.hjs__page.is-reloading { opacity: 0; }
.hjs__page :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hjs__app { width: min(100%, 540px); min-height: 0; display: flex; flex-direction: column; padding: 24px 28px 16px; }
.hjs__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hjs__app-title { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.02em; }
.hjs__count { font: 500 12.5px/18px var(--mono); color: rgba(23, 24, 28, .64); white-space: nowrap; }
.hjs__form { flex: none; margin-top: 14px; display: flex; gap: 8px; }
.hjs__input { flex: 1 1 auto; min-width: 0; height: 42px; margin: 0; padding: 0 14px; border: 1px solid rgba(23, 24, 28, .16); border-radius: 10px; background: #fff; font: 400 15px/20px var(--font); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.hjs__input::placeholder { color: rgba(23, 24, 28, .42); }
.hjs__page .hjs__input:focus, .hjs__page .hjs__input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(247, 223, 30, .5); }
.hjs__input:disabled { background: rgba(255, 255, 255, .55); }
.hjs__add { flex: none; height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; cursor: pointer; transition: background .2s, transform .2s var(--ease); }
.hjs__add:hover { background: #2B2D34; }
.hjs__add:active { transform: translateY(1px); }
.hjs__add:disabled { opacity: .35; cursor: default; transform: none; }

.hjs__list { flex: 0 1 auto; min-height: 0; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(23, 24, 28, .22) transparent; }
/* Задач больше, чем влезает: нижний край списка мягко тает — видно, что его можно прокрутить */
.hjs__list.is-overflow { --fade-t: 0px; --fade-b: 28px; -webkit-mask-image: linear-gradient(transparent, #000 var(--fade-t), #000 calc(100% - var(--fade-b)), transparent); mask-image: linear-gradient(transparent, #000 var(--fade-t), #000 calc(100% - var(--fade-b)), transparent); }
.hjs__list.is-overflow:not(.is-start) { --fade-t: 20px; }
.hjs__list.is-overflow.is-end { --fade-b: 0px; }
.hjs__task { flex: none; display: flex; align-items: center; min-height: 42px; border-radius: 10px; background: rgba(255, 255, 255, .74); border: 1px solid rgba(23, 24, 28, .08); }
.hjs__task { transition: background .2s, border-color .2s; }
.hjs__task:hover { background: #fff; border-color: rgba(23, 24, 28, .14); }
.hjs__label { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 4px 9px 12px; cursor: pointer; }
/* Чекбокс задачи: сам input — невидимая зона нажатия 44×44 (тап-цель), квадратик 20×20 рисует ::before, галочку — ::after */
.hjs__check { flex: none; appearance: none; -webkit-appearance: none; width: 44px; height: 44px; margin: -12px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; }
.hjs__check::before { content: ""; grid-area: 1 / 1; width: 20px; height: 20px; border: 1.5px solid rgba(23, 24, 28, .34); border-radius: 6px; background: #fff; transition: background .2s, border-color .2s; }
.hjs__check::after { content: ""; grid-area: 1 / 1; width: 10px; height: 5px; margin-top: -2px; border: solid var(--ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transition: transform .22s var(--spring); }
.hjs__check:checked::before { background: var(--yellow); border-color: rgba(23, 24, 28, .6); }
.hjs__check:checked::after { transform: rotate(-45deg) scale(1); }
.hjs__check:focus-visible { outline: none; }
.hjs__check:focus-visible::before { outline: 2px solid var(--ink); outline-offset: 2px; }
.hjs__task-text { min-width: 0; font-size: 15px; line-height: 20px; overflow-wrap: anywhere; transition: color .2s; }
.hjs__task.is-done .hjs__task-text { color: rgba(23, 24, 28, .52); text-decoration: line-through; text-decoration-color: rgba(23, 24, 28, .32); }
.hjs__del { flex: none; width: 36px; height: 36px; margin-right: 3px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: rgba(23, 24, 28, .38); cursor: pointer; transition: color .2s, background .2s; }
.hjs__del:hover { color: var(--ink); background: rgba(23, 24, 28, .06); }
.hjs__empty { padding: 10px 2px; font-size: 14px; line-height: 20px; color: rgba(23, 24, 28, .5); }
.hjs__hint { flex: none; margin-top: auto; padding-top: 12px; font: 400 11.5px/16px var(--mono); color: rgba(23, 24, 28, .62); } /* 4.5:1 на бумаге */

/* ---------- DevTools → Console ---------- */
.hjs__devtools { flex: none; height: clamp(168px, 33%, 216px); display: flex; flex-direction: column; background: #111216; border-top: 1px solid rgba(255, 255, 255, .14); }
.hjs__tabs { flex: none; height: 32px; display: flex; align-items: stretch; padding: 0 6px; background: #1B1D22; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: rgba(255, 255, 255, .48); overflow: hidden; }
.hjs__tabs span { display: flex; align-items: center; padding: 0 11px; white-space: nowrap; }
.hjs__tabs .is-active { color: #fff; box-shadow: inset 0 -2px 0 var(--yellow); }
.hjs__console { flex: 1 1 auto; min-height: 0; padding: 2px 0 6px; overflow-y: auto; overscroll-behavior: contain; font: 400 12.5px/19px var(--mono); color: #E6E8EC; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.hjs__console:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; border-radius: 0; }
.hjs__line, .hjs__prompt { position: relative; padding: 2px var(--hjs-console-r) 2px 30px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hjs__line { border-bottom: 1px solid rgba(255, 255, 255, .05); }
.hjs__line--in::before, .hjs__line--out::before, .hjs__prompt::before, .hjs__line--warn::before { position: absolute; left: 13px; top: 2px; }
.hjs__line--in::before, .hjs__prompt::before { content: "›"; color: rgba(247, 223, 30, .85); }
.hjs__line--out::before { content: "‹"; color: rgba(255, 255, 255, .34); }
.hjs__line--out { color: rgba(255, 255, 255, .74); }
.hjs__line--ev { color: rgba(255, 255, 255, .5); }
.hjs__line--nav { color: rgba(247, 223, 30, .7); }
.hjs__line--warn { color: #FFD0CD; background: rgba(255, 102, 97, .08); border-bottom-color: rgba(255, 102, 97, .18); }
.hjs__line--warn::before { content: "!"; left: 14px; font-weight: 700; color: var(--coral); }
.hjs__prompt { min-height: 23px; }
.hjs__caret { display: inline-block; width: 1.5px; height: 15px; margin-left: 1px; vertical-align: -3px; background: var(--yellow); }
.hjs__fn, .hjs__ev { color: var(--yellow); }
.hjs__str { color: var(--coral); }
.hjs__num, .hjs__kw { color: var(--violet); }
.hjs__dim, .hjs__sel { color: rgba(255, 255, 255, .5); }
.hjs__link { text-decoration: underline; text-decoration-color: rgba(247, 223, 30, .35); text-underline-offset: 2px; }
.hjs__short { display: none; }

/* ---------- Куб JS: выходит за угол окна и сцены, слегка следует за мышью ---------- */
.hjs__cube {
  position: absolute; z-index: 2; right: -26px; bottom: -52px;
  width: var(--hjs-cube); aspect-ratio: 1; pointer-events: none;
  transform: translate3d(calc(var(--mx, 0) * -14px), calc(var(--my, 0) * -10px), 0) rotate(calc(var(--mx, 0) * -3deg));
}
.hjs__cube img { width: 100%; height: 100%; transform: rotate(-8deg); filter: drop-shadow(0 28px 32px rgba(0, 0, 0, .55)); }
.hjs.is-visible .hjs__cube img { animation: hjs-cube-in 1.1s var(--spring) .35s both; }
@keyframes hjs-cube-in {
  from { opacity: 0; transform: translateY(36px) rotate(-18deg) scale(.9); }
  to { opacity: 1; transform: rotate(-8deg); }
}

/* ---------- Широкие мониторы: те же поля, что у .container ---------- */
@media (min-width: 1800px) {
  .hero--js .hjs { --hjs-pad: 64px; --hjs-top: 56px; --hjs-inset: 48px; --hjs-console-r: 180px; min-height: 660px; }
  .hjs__text { max-width: 480px; }
  .hjs__app { width: min(100%, 600px); padding: 30px 32px 20px; }
  .hjs__app-title { font-size: 24px; line-height: 30px; }
  .hjs__form { margin-top: 18px; gap: 10px; }
  .hjs__input, .hjs__add { height: 46px; }
  .hjs__list { margin-top: 14px; gap: 8px; }
  .hjs__task { min-height: 48px; }
  .hjs__task-text { font-size: 16px; }
  .hjs__console { font-size: 13px; line-height: 20px; }
}

/* ---------- 1280–1439: текстовой колонке шире, чтобы кнопка и «10 000+ учеников» стояли в строку ---------- */
@media (max-width: 1439px) {
  .hero--js .hjs { grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); }
}

/* ---------- 1024–1279: две колонки, окно ужато ---------- */
@media (max-width: 1279px) {
  .hero--js .hjs { --hjs-pad: 40px; --hjs-top: 36px; --hjs-inset: 32px; --hjs-cube: 148px; --hjs-console-r: 104px; min-height: 572px; }
  .hjs__copy { padding-right: 28px; }
  .hjs__status { gap: 10px 20px; }
  .hjs__title { margin-top: 24px; font-size: 40px; }
  .hjs__text { margin-top: 20px; font-size: 16px; line-height: 24px; }
  .hjs__cube { right: -22px; bottom: -44px; }
  .hjs__app { padding: 20px 20px 14px; }
  .hjs__app-title { font-size: 20px; }
  .hjs__tabs span:nth-child(n+4) { display: none; }
  .hjs__console { font-size: 12px; line-height: 18px; }
  .hjs__long { display: none; }
  .hjs__short { display: inline; }
}

/* ---------- < 1024: колонкой — текст сверху, браузер ниже, куб над правым углом окна ---------- */
@media (max-width: 1023px) {
  .hero--js .hjs { --hjs-cube: 150px; --hjs-console-r: 16px; grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hjs__copy { padding: 40px 40px 0; }
  .hjs__title { margin-top: 28px; font-size: 52px; }
  .hjs__text { max-width: 540px; font-size: 17px; line-height: 26px; }
  .hjs__bottom { margin-top: 0; padding-top: 32px; }
  .hjs__stage { display: flex; padding: 56px 24px 0; }
  .hjs__window { position: relative; inset: auto; flex: 1 1 auto; min-width: 0; height: 540px; }
  .hjs__cube { top: -44px; right: -14px; bottom: auto; }
  .hjs__tabs span:nth-child(n+4) { display: flex; }
  .hjs__long { display: inline; }
  .hjs__short { display: none; }
}

/* ---------- Мобильный ---------- */
@media (max-width: 767px) {
  .hero--js .hjs { --hjs-cube: 104px; --hjs-console-r: 12px; border-radius: 20px; }
  .hjs__copy { padding: 24px 20px 0; }
  .hjs__status { gap: 8px 12px; }
  .hjs__badge { height: 36px; padding: 0 12px; gap: 8px; font-size: 14px; }
  .hjs__start { font-size: 14px; }
  .hjs__title { margin-top: 22px; font-size: 40px; }
  .hjs__text { margin-top: 16px; font-size: 16px; line-height: 24px; }
  .hjs__bottom { padding-top: 28px; gap: 20px; }
  .hjs__stage { padding: 60px 10px 0; }
  .hjs__window { height: auto; border-radius: 14px 14px 0 0; }
  .hjs__cube { top: 2px; right: -6px; }
  .hjs__bar { height: 40px; gap: 6px; padding: 0 10px; }
  .hjs__dots { gap: 5px; margin-right: 2px; }
  .hjs__dots i { width: 9px; height: 9px; }
  .hjs__arrows { display: none; }
  .hjs__reload { width: 36px; height: 36px; margin-left: 0; }
  .hjs__url { height: 28px; padding: 0 10px; gap: 6px; font-size: 12px; }
  .hjs__app { padding: 18px 14px 14px; }
  .hjs__app-title { font-size: 19px; line-height: 24px; }
  .hjs__count { font-size: 11.5px; }
  .hjs__input { height: 44px; font-size: 16px; } /* 16 px — iOS не зумит страницу при фокусе */
  .hjs__add { height: 44px; padding: 0 14px; font-size: 14px; }
  .hjs__list { overflow: visible; }
  .hjs__task { min-height: 48px; }
  .hjs__del { width: 44px; height: 44px; margin-right: 2px; }
  .hjs__hint { font-size: 10.5px; line-height: 15px; }
  .hjs__devtools { height: auto; }
  .hjs__tabs { height: 30px; font-size: 11px; }
  .hjs__tabs span { padding: 0 9px; }
  .hjs__tabs span:nth-child(n+4) { display: none; }
  .hjs__console { height: 96px; flex: none; font-size: 11px; line-height: 16px; }
  .hjs__line, .hjs__prompt { padding-left: 24px; }
  .hjs__line--in::before, .hjs__line--out::before, .hjs__prompt::before { left: 10px; }
  .hjs__line--warn::before { left: 11px; }
  .hjs__prompt { min-height: 20px; }
  .hjs__caret { height: 13px; }
  .hjs__long { display: none; }
  .hjs__short { display: inline; }
}
@media (max-width: 479px) {
  .hjs__title { font-size: clamp(30px, 9.4vw, 36px); }
}
/* 320–359: куб меньше и без точек окна — адрес localhost не прячется под кубом */
@media (max-width: 359px) {
  .hero--js .hjs { --hjs-cube: 84px; }
  .hjs__stage { padding-top: 48px; }
  .hjs__dots { display: none; }
  .hjs__app { padding-inline: 12px; }
  .hjs__add { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hjs__cube { transform: none; }
  .hjs.is-visible .hjs__cube img { animation: none; }
  .hjs__page { transition: none; }
}
