/* ==========================================================================
   Главная (index.html): ОДИН экран, без прокрутки — 1440×900 и 390×844.
   Шапка/подвал/сетка .app живут в site.css; здесь только содержимое .screen.home.
   Раскладка: hero (1fr — забирает всё свободное) | 3 плитки | полоса маховика.
   Высоты заданы через clamp() от vh, чтобы низкие окна сжимались, а не обрезались.
   ========================================================================== */

.home-grid {
  height: 100%;
  max-width: 1440px;
  margin-inline: auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: clamp(10px, 2vh, 20px);
  padding: clamp(10px, 2vh, 22px) var(--gutter) clamp(12px, 2.4vh, 24px);
}

/* ───────────── hero ───────────── */
.hero { position: relative; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(16px, 3vw, 48px); }
.hero-copy { position: relative; z-index: 2; min-width: 0; display: grid; gap: clamp(8px, 1.8vh, 16px); justify-items: start; align-content: center; }
.hero-title { font-size: clamp(56px, min(11vw, 13.4vh), 132px); line-height: .86; letter-spacing: -.02em; text-transform: uppercase; display: grid; }
.hero-title span { display: block; --ext: var(--text-2); text-shadow: 0 .012em 0 var(--ext), 0 .024em 0 var(--ext), 0 .036em 0 var(--ext), 0 .048em 0 var(--ext), 0 .06em 0 var(--ext), 0 .072em 0 var(--ext), 0 .084em 0 var(--ext), 0 .096em 0 var(--ext); }
.hero-title .l1 { color: var(--text); --ext: #D9BE8C; }
.hero-title .l2 { color: var(--gold); --ext: var(--gold-dark); }
.hero-tag { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, min(2.7vw, 4.2vh), 38px); line-height: 1.12; color: var(--text); }
.hero-tag em { font-style: normal; color: var(--gold); }
.hero-sub { max-width: 56ch; font-size: clamp(14px, 1.9vh, 17px); line-height: 1.45; color: var(--text-3); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 4px; }

/* сцена с монетой: размер = меньшая из сторон свободной клетки */
.stage-wrap { min-width: 0; min-height: 0; height: 100%; display: grid; place-items: center; container-type: size; overflow: clip; }
.stage { --c: clamp(24px, 8cqw, 58px); position: relative; width: min(100%, 420px); aspect-ratio: 1; width: min(100cqw, 100cqh); container-type: inline-size; }
.stage-ring { position: absolute; border-radius: 50%; border: 2px dashed var(--border-strong); }
.stage-ring--outer { inset: calc(var(--c) / 2 + 2px); }
.stage-ring--inner { inset: 19%; border-style: solid; border-color: var(--border); background: var(--surface); }
.stage-core { position: absolute; inset: 27%; animation: bob 5s ease-in-out infinite; }
.stage-shadow { position: absolute; inset: 0; border-radius: 50%; background: var(--gold-deep); transform: translate(6%, 7%); }
.stage-core .coin { --s: 100%; position: relative; border: 0; box-shadow: 0 0 0 3px var(--ink); }
.stage-orbit { position: absolute; inset: 0; animation: spin 90s linear infinite; }
.stage-orbit .o { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateY(calc(var(--c) / 2 + 2px - 50cqw)); }
.stage-orbit .o-in { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) rotate(calc(var(--a) * -1)); }
.stage-orbit .coin { --s: var(--c); animation: spin 90s linear infinite reverse; border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--border-strong); }
.stage .sparkle { position: absolute; animation: twinkle 3.2s ease-in-out infinite; }
.stage .sp1 { --s: 34px; left: 4%; top: 10%; }
.stage .sp2 { --s: 18px; right: 8%; top: 22%; animation-delay: .9s; --c: var(--gold-hi); }
.stage .sp3 { --s: 24px; right: 2%; bottom: 14%; animation-delay: 1.8s; }
.stage .sp4 { --s: 14px; left: 14%; bottom: 8%; animation-delay: 2.4s; --c: var(--gold); }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }

/* ───────────── плитки ───────────── */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); }
.tiles .stat { gap: 4px; padding: clamp(10px, 1.8vh, 16px) 18px; }
.tiles .stat-label { font-size: 12px; }
.tiles .stat-value { font-size: clamp(28px, min(3.4vw, 5.2vh), 46px); }
.tiles .stat-sub { min-height: 0; font-size: 13px; }
.tiles .stat.is-soon .stat-value { font-size: clamp(20px, min(2vw, 3.4vh), 28px); line-height: 1.15; color: var(--text-3); padding-block: .1em; }
.tiles .stat.is-soon .unit { display: none; }
.tile-refresh { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 10px; color: var(--text-3); }
.tile-refresh:disabled { opacity: .5; }
.tile-refresh.is-spinning .icon { animation: spin .8s linear infinite; }

/* ───────────── полоса маховика ───────────── */
.strip { display: grid; gap: clamp(8px, 1.6vh, 14px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2vw, 28px); }
.step { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "num title ico" "text text text"; align-items: center; column-gap: 10px; row-gap: 6px; padding: clamp(8px, 1.6vh, 14px) 14px; background: var(--surface); border: 2px solid var(--border); border-radius: 16px; }
.step-top { display: contents; }
.step-num { grid-area: num; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--gold-deep); font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1; }
.step-ico { grid-area: ico; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); color: var(--gold); border: 2px solid var(--border-strong); }
.step-title { grid-area: title; font-size: clamp(15px, 1.35vw, 19px); line-height: 1.1; }
.step-title .pct { color: var(--gold); }
.step-text { grid-area: text; font-size: 13px; line-height: 1.4; color: var(--text-3); }
.step--hot { border-color: var(--gold-dark); }
.step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: calc(clamp(18px, 2vw, 28px) / -2 - 9px); width: 18px; height: 18px; transform: translateY(-50%); background: var(--gold); -webkit-mask: var(--chev-right) center / contain no-repeat; mask: var(--chev-right) center / contain no-repeat; }

:root {
  --chev-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

.split-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 22px; }
.split-bar { display: flex; height: clamp(36px, 5vh, 44px); border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 2px var(--border-strong); }
.split-bar > span { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 0 10px; color: var(--ink); white-space: nowrap; overflow: hidden; }
.split-bar b { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2.4vh, 22px); line-height: 1; }
.split-bar i { font-style: normal; font-weight: 800; font-size: 13px; letter-spacing: .02em; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.split-bar .s-self { background: var(--gold); }
.split-bar .s-meta { background: var(--text-2); border-left: 3px solid var(--ink); }
.cycle { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.cycle-l { display: inline-flex; align-items: center; gap: 8px; }
.cycle-l .icon { color: var(--gold); }
.cycle-count { font-family: var(--font-mono); font-weight: 600; font-size: 20px; color: var(--gold); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ───────────── низкие окна (ноутбуки 1366×768 и ниже) ───────────── */
@media (min-width: 801px) and (max-height: 820px) {
  .hero-sub { display: none; }
  .step-text { display: none; }
}
@media (min-width: 801px) and (max-height: 700px) {
  .tiles .stat-sub { display: none; }
  .hero-cta .btn-lg { min-height: 48px; font-size: 18px; }
}

/* ───────────── планшет и телефон ───────────── */
@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: clamp(6px, 1.4vh, 14px); align-items: center; }
  .stage-wrap { grid-row: 1; }
  .hero-copy { grid-row: 2; justify-items: center; text-align: center; }
  .hero-title { font-size: clamp(54px, min(18vw, 9vh), 96px); }
  .hero-tag { font-size: clamp(20px, min(6vw, 3.2vh), 30px); }
  .hero-tag span { display: block; }
  .hero-sub { display: none; }
  .hero-cta { justify-content: center; flex-wrap: nowrap; }
  .hero-cta .btn-lg { min-height: 50px; padding: 10px 22px; font-size: 19px; }
  .tiles .stat-value { font-size: clamp(24px, 3.4vh, 34px); }
  .step-text { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .step { padding: 8px 10px; row-gap: 0; }
  .step:not(:last-child)::after { display: none; }
  .step-ico { display: none; }
  .step { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num title"; }
  .step-title { font-size: 14px; }
  .step-num { width: 26px; height: 26px; font-size: 15px; }
  .cycle { display: none; }
  .split-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .tiles { gap: 8px; }
  .tiles .stat { padding: 9px 10px 10px; gap: 3px; border-radius: 14px; }
  .tiles .stat-label { font-size: 10.5px; letter-spacing: .06em; line-height: 1.2; min-height: 2.4em; align-items: flex-start; }
  .tiles .stat-label .icon { display: none; }
  .tiles .stat-value { font-size: 23px; }
  .tiles .stat-value .unit { display: none; }
  .tiles .stat-sub { font-size: 11px; }
  .tiles .stat-sub span:last-child { display: none; }
  .tiles #s-burned, .tiles #s-sol { display: none; }
  .tiles .stat.is-soon .stat-value { font-size: 13px; line-height: 1.2; }
  .tiles .badge { top: 6px; right: 6px; padding: 3px 6px; font-size: 9px; }
  .tile-refresh { top: auto; bottom: 3px; right: 3px; width: 30px; height: 30px; }
  .split-bar > span { padding: 0 6px; gap: 5px; }
  .split-bar b { font-size: 18px; }
  .split-bar i { font-size: 11px; letter-spacing: 0; }
}
@media (max-width: 800px) and (max-height: 700px) {
  .stage-wrap { display: none; }
  .hero { grid-template-rows: minmax(0, 1fr); }
  .hero-copy { grid-row: 1; }
}
/* совсем низкие телефоны (SE, 320×568 / 360×640): шаги маховика уходят на вкладку Flywheel */
@media (max-width: 800px) and (max-height: 660px) {
  .hero-title { font-size: clamp(44px, 9.5vh, 58px); }
  .hero-tag { font-size: 18px; }
  .hero-cta .btn-lg { min-height: 44px; padding: 8px 16px; font-size: 17px; }
  .steps { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-core, .stage-orbit, .stage-orbit .coin, .stage .sparkle { animation: none; }
}
