/* 09-extras.css — калькуляторы, галерея техники, редакция, канвасы, подсказки. */

/* ---------- канвасы ---------- */
.canvas { display: block; width: 100%; pointer-events: none; }
.canvas--soil { height: 210px; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-soft); }
.canvas--contour { height: 170px; opacity: .85; }
.canvas--particles { position: absolute; inset: 0; height: 100%; opacity: .7; }
.canvas--wave { height: 130px; }
@media (max-width: 700px) { .canvas--soil { height: 150px; } .canvas--contour { height: 120px; } .canvas--wave { height: 90px; } }

/* ---------- галерея техники ---------- */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 26px; }
.gal__item { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.gal__item img { display: block; width: 100%; height: 200px; object-fit: cover; }
.gal__cap { padding: 12px 14px; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.gal__item--wide { grid-column: span 2; }
@media (max-width: 640px) { .gal { grid-template-columns: 1fr; } .gal__item--wide { grid-column: auto; } .gal__item img { height: 180px; } }

/* ---------- калькуляторы ---------- */
.calcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; margin-top: 28px; }
.calc { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.calc__title { display: flex; align-items: center; gap: 10px; font-size: 21px; line-height: 1.3; margin: 0; }
.calc__title .icon { width: 26px; height: 26px; flex: 0 0 auto; }
.calc__sub { font-size: 16px; color: var(--ink-2); margin: 0; }
.calc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.calc__f { display: flex; flex-direction: column; gap: 5px; font-size: 15px; color: var(--ink-2); min-width: 0; }
.calc__f input, .calc__f select { width: 100%; min-width: 0; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm); }
.calc__f input:focus-visible, .calc__f select:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 1px; }
.calc__f--check { flex-direction: row; align-items: center; gap: 9px; }
.calc__f--check input { width: 20px; height: 20px; flex: 0 0 auto; }
.calc__out { margin-top: 4px; padding: 15px 16px; font-size: 17px; line-height: 1.55; background: var(--bg-alt); border-left: 4px solid var(--green-700); border-radius: var(--r-sm); min-height: 62px; }
.calc__out.is-live { animation: calcPop .35s ease; }
.calc__note { display: block; margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.calc__pick { display: inline-flex; align-items: center; gap: 7px; margin: 3px 8px 3px 0; padding: 4px 10px; font-size: 15px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.calc__pick .icon { width: 19px; height: 19px; }
.calc__tablewrap { overflow-x: auto; }
.calc__table { width: 100%; border-collapse: collapse; font-size: 15px; }
.calc__table th, .calc__table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.calc__table th:first-child, .calc__table td:first-child { text-align: left; }
.calc__table .is-best { font-weight: 700; color: var(--green-700); background: var(--bg-alt); }
.calc__table .muted { color: var(--ink-2); font-weight: 400; }
.calc__btn { align-self: flex-start; padding: 12px 22px; font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: linear-gradient(120deg, var(--blue-700), var(--green-700)); border: 0; border-radius: 999px; cursor: pointer; }
.calc__btn:hover { filter: brightness(1.07); }
@keyframes calcPop { from { transform: translateY(4px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- редакция ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 26px; }
.team__card { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.team__card img { display: block; width: 100%; height: 260px; object-fit: contain; object-position: top center; background: var(--bg-soft); }
.team__body { padding: 16px 18px 20px; }
.team__name { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
.team__role { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--green-700); }
.team__bio { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.team__link { display: inline-block; margin-top: 12px; font-size: 15px; font-weight: 600; }

/* ---------- FAQ / глоссарий ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.faq__item { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.faq__q { padding: 16px 18px; font-size: 18px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: '+'; flex: 0 0 auto; font-size: 24px; line-height: 1; color: var(--blue-700); }
.faq__item[open] .faq__q::after { content: '−'; }
.faq__a { padding: 0 18px 18px; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.faq__a p { margin: 0; }
.gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 24px; }
.gloss__row { padding: 15px 17px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--blue-500); border-radius: var(--r-sm); }
.gloss__row dt { font-weight: 700; font-size: 17px; margin-bottom: 5px; }
.gloss__row dd { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }

/* ---------- карточки-сценарии / ошибки / этапы ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 26px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.card__num { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 12px; font-size: 17px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--blue-700), var(--green-700)); border-radius: 50%; }
.card__title { margin: 0 0 8px; font-size: 20px; line-height: 1.3; }
.card__text { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.card__meta { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.card__meta b { color: var(--ink); }

/* ---------- кнопка «вверх» ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 52px; height: 52px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue-700), var(--green-700)); border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 8px 22px rgba(18,48,94,.28); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .25s, transform .25s, visibility .25s; }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top .icon { width: 24px; height: 24px; }

/* ---------- ховер-подсказки ---------- */
[data-hint] { position: relative; cursor: help; }
[data-hint]::after { content: attr(data-hint); position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px); width: max-content; max-width: min(320px, 82vw); padding: 11px 14px; font-size: 15px; font-weight: 400; line-height: 1.45; text-align: left; color: #fff; background: var(--blue-900); border-radius: var(--r-sm); box-shadow: 0 10px 24px rgba(18,48,94,.3); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; z-index: 40; pointer-events: none; }
[data-hint]:hover::after, [data-hint]:focus-visible::after, [data-hint].is-hinted::after { opacity: 1; visibility: visible; transform: translateX(-50%); }
[data-hint]::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--blue-900); opacity: 0; transition: opacity .2s; z-index: 41; }
[data-hint]:hover::before, [data-hint]:focus-visible::before, [data-hint].is-hinted::before { opacity: 1; }
/* на мобильных подсказки видимы сразу — как отдельная строка под элементом */
@media (hover: none), (max-width: 900px) {
  [data-hint]::before { display: none; }
  [data-hint]::after { position: static; transform: none; opacity: 1; visibility: visible; display: block; width: auto; max-width: none; margin-top: 7px; color: var(--ink-2); background: var(--bg-soft); border-left: 3px solid var(--blue-500); box-shadow: none; }
}

/* ---------- пасхалка ---------- */
.egg-blob { position: absolute; z-index: 5; width: 16px; height: 16px; margin: -8px 0 0 -8px; pointer-events: none; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(27,111,227,.75), rgba(15,122,70,.55) 60%, transparent 72%); animation: eggBlob 1.4s ease-out forwards; }
@keyframes eggBlob { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(9); opacity: 0; } }
.egg-tip { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 3px; max-width: min(420px, 90vw); padding: 14px 20px; color: #fff; background: var(--blue-900); border-radius: var(--r-md); box-shadow: 0 12px 30px rgba(18,48,94,.32); animation: eggTip .3s ease; }
.egg-tip b { font-size: 15px; color: var(--mint); }
.egg-tip span { font-size: 16px; line-height: 1.45; }
@keyframes eggTip { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .egg-blob { display: none; } }
