/* =========================================================
   Калькулятор + пасхалки + «режим чертежа»
   ========================================================= */
.calc { position: relative; z-index: 2; padding: 22vh var(--gutter) 10vh; }
.calc-head { max-width: 760px; margin-bottom: 56px; }
.calc-title { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(40px, 5.6vw, 92px); line-height: .95; }
.calc-title em { color: var(--accent-ink); }
.calc-sub { color: var(--muted); font-size: 18px; max-width: 520px; margin-top: 20px; }

.calc-app { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; }
.calc-controls { display: grid; gap: 22px; }
.calc-items { display: grid; gap: 10px; }

/* тумблер-карточка */
.calc-item {
  position: relative; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 18px;
  padding: 20px 22px; border-radius: 22px; cursor: pointer;
  background: color-mix(in srgb, var(--bg-2) 70%, transparent); backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .4s, background .4s, transform .5s var(--ease);
}
.calc-item:hover { transform: translateX(4px); }
.calc-item input { position: absolute; opacity: 0; pointer-events: none; }
.calc-item.is-on { box-shadow: inset 0 0 0 1.5px var(--accent), 0 20px 50px -30px color-mix(in srgb, var(--accent) 80%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--bg-2)); }
.calc-item input:focus-visible ~ .switch { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 30px; background: color-mix(in srgb, var(--fg) 12%, transparent); box-shadow: inset 0 2px 4px rgba(0,0,0,.4); transition: background .4s; }
.switch i { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(160deg, #fff, #aeb7c6 55%, #6b7487); box-shadow: 0 3px 8px rgba(0,0,0,.5); transition: transform .5s var(--ease); }
.calc-item.is-on .switch { background: var(--accent); }
.calc-item.is-on .switch i { transform: translateX(22px); }
.ci-text { display: grid; gap: 4px; }
.ci-text strong { font-size: 17px; letter-spacing: -.01em; }
.ci-text small { color: var(--muted); font-size: 13px; }
.ci-price { color: var(--muted); font-size: 10px; text-align: right; max-width: 170px; }
.calc-item.is-on .ci-price { color: var(--accent-ink); }

.calc-period { display: flex; align-items: center; gap: 16px; }
.calc-period > span { color: var(--muted); }
.calc-period .seg { flex: 1; min-width: 0; max-width: 360px; grid-template-columns: repeat(3, 1fr); }

/* протокол */
.calc-summary {
  position: sticky; top: 100px; display: grid; gap: 16px; padding: 26px; border-radius: 28px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--fg) 7%, transparent), transparent 40%), var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 color-mix(in srgb, var(--fg) 16%, transparent), 0 60px 120px -60px rgba(0,0,0,.8);
}
.calc-viz { position: relative; height: 150px; display: grid; place-items: center; }
.calc-viz svg { width: 240px; height: 150px; overflow: visible; }
.calc-viz .axis { stroke: var(--accent); stroke-width: 1.5; filter: drop-shadow(0 0 6px var(--accent)); }
.calc-viz .r { fill: none; stroke: var(--fg); stroke-opacity: .16; stroke-width: 1.2; stroke-dasharray: 3 5; transform-origin: 120px 75px; transition: stroke .5s, stroke-opacity .5s, stroke-width .5s; }
.calc-viz .r.is-on { stroke: var(--accent); stroke-opacity: 1; stroke-width: 2.4; stroke-dasharray: none; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 80%, transparent)); }
.calc-viz .r:nth-of-type(1) { animation: tilt 9s ease-in-out infinite; }
.calc-viz .r:nth-of-type(2) { animation: tilt 11s ease-in-out infinite reverse; }
.calc-viz .r:nth-of-type(3) { animation: tilt 7s ease-in-out infinite; }
.calc-viz .r:nth-of-type(4) { animation: tilt 13s ease-in-out infinite reverse; }
.calc-viz.is-pkg .r { animation-duration: 3s; }
@keyframes tilt { 50% { transform: rotate(14deg) scaleY(.85); } }
.calc-viz .core { fill: var(--accent); filter: drop-shadow(0 0 10px var(--accent)); }
.calc-stamp { position: absolute; right: -6px; top: 4px; padding: 6px 12px; border-radius: 8px; font-size: 10px; color: var(--accent-ink);
  border: 1.5px solid currentColor; transform: rotate(8deg) scale(1.6); opacity: 0; transition: transform .5s cubic-bezier(.2, 1.6, .4, 1), opacity .3s; }
.calc-stamp.is-on { opacity: 1; transform: rotate(8deg) scale(1); }
.calc-proto { color: var(--muted); font-size: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.calc-lines { list-style: none; display: grid; gap: 10px; }
.calc-lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; font-size: 14px; animation: stepIn .5s var(--ease) both; }
.calc-lines li i { border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.calc-lines li b { font-weight: 500; font-size: 11px; color: var(--muted); }
.calc-lines li.gift b { color: var(--accent-ink); }
.calc-lines li.empty span { color: var(--muted); }
.calc-total { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-total > span { color: var(--muted); font-size: 10px; }
.calc-total b { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -.04em; font-size: clamp(44px, 4.4vw, 64px); line-height: 1; }
.calc-total p { color: var(--muted); font-size: 13px; min-height: 1em; }
.calc-save { font-size: 14px; color: var(--accent-ink); min-height: 1em; }
.calc-save:empty { display: none; }
.calc-save b { color: var(--fg); }
.calc-note { color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .calc-app { grid-template-columns: 1fr; }
  .calc-summary { position: static; }
}
@media (max-width: 640px) {
  .calc-item { grid-template-columns: 52px 1fr; padding: 16px; gap: 14px; }
  .ci-price { grid-column: 2; text-align: left; max-width: none; }
}

/* ---------- Пасхалки ---------- */
.egg { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; font-size: 10px; line-height: 1; color: inherit; opacity: .35; pointer-events: auto; cursor: pointer; transition: opacity .3s, color .3s, transform .5s var(--ease); }
.egg:hover { opacity: 1; color: var(--accent-ink); transform: rotate(90deg) scale(1.3); }
.egg.is-found { opacity: 1; color: var(--accent-ink); text-shadow: 0 0 10px var(--accent); }
.egg-spark { position: fixed; z-index: 400; pointer-events: none; color: var(--accent); font-size: 14px; text-shadow: 0 0 10px var(--accent); transform: translate(-50%, -50%); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 350; padding: 12px 18px; border-radius: 100px; font-size: 11px; color: var(--fg);
  background: color-mix(in srgb, var(--bg-2) 85%, transparent); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -20px rgba(0,0,0,.7);
  transform: translate(-50%, 30px); opacity: 0; transition: transform .6s var(--ease), opacity .4s; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast b { color: var(--accent-ink); font-weight: 500; }

.egg-modal { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 16px; }
.egg-bg { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(14px); opacity: 0; transition: opacity .5s; }
.egg-card { position: relative; width: min(520px, 100%); padding: 34px; border-radius: 30px; text-align: center; display: grid; gap: 16px; justify-items: center;
  background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), var(--bg-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent), 0 60px 140px -40px rgba(0,0,0,.8);
  transform: translateY(40px) scale(.94); opacity: 0; transition: transform .8s var(--ease), opacity .5s; }
.egg-modal.is-on .egg-bg { opacity: 1; }
.egg-modal.is-on .egg-card { transform: none; opacity: 1; }
.egg-card > p.mono { color: var(--accent-ink); font-size: 10px; }
.egg-card h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(30px, 4.4vw, 44px); line-height: 1; }
.egg-card h3 em { display: block; color: var(--accent-ink); }
.egg-text, .egg-note { color: var(--muted); }
.egg-note { font-size: 9px; }
.egg-code { display: grid; gap: 4px; padding: 16px 28px; border-radius: 16px; font-size: 26px; letter-spacing: .14em; color: var(--fg); border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); transition: transform .4s var(--ease); }
.egg-code:hover { transform: scale(1.04); }
.egg-code small { font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.egg-reward { font-weight: 600; }
.egg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lab-promo { color: var(--accent-ink); font-size: 10px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---------- Режим чертежа (Konami) ---------- */
html.blueprint body::before { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent) 1px, transparent 1px);
  background-size: 40px 40px; }
html.blueprint main *:not(canvas):not(svg *) { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -1px; }

/* пасхалка №3 в ядре калькулятора: видна только при Максимальном комплексе */
.calc-egg { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; font-size: 18px; color: var(--accent-ink); text-shadow: 0 0 12px var(--accent); }
.egg.calc-egg:not(.is-armed) { opacity: 0; pointer-events: none; transform: scale(.2) rotate(-90deg); }
.calc-egg.is-armed { opacity: 1; pointer-events: auto; transform: none; animation: eggPulse 1.8s ease-in-out infinite; }
.calc-egg.is-armed:hover { transform: rotate(90deg) scale(1.4); animation: none; }
@keyframes eggPulse { 50% { transform: scale(1.25); text-shadow: 0 0 22px var(--accent); } }

/* ---------- Калькулятор: вид «3D-сборка» ----------
   Сцена (.calc-viz) - прозрачное окно: сквозь него виден большой гироскоп,
   который встаёт в её центр и собирается из колец выбранных услуг. */
.calc-mode { max-width: 300px; grid-template-columns: 1fr 1fr; }
.calc-app.is-3d { grid-template-columns: 1fr 1.05fr; }
.calc-app.is-3d .calc-summary { background: none; box-shadow: none; padding: 0; gap: 14px; top: 84px; }
.calc-app.is-3d .calc-viz { height: min(56vh, 560px); }
.calc-app.is-3d .calc-viz svg, .calc-app.is-3d .calc-proto, .calc-app.is-3d .calc-lines { display: none; }
.calc-app.is-3d .calc-stamp { right: 0; top: 0; font-size: 12px; padding: 8px 14px; }
.calc-app.is-3d .calc-total { justify-items: center; text-align: center; border-top: 0; padding-top: 0; }
.calc-app.is-3d .calc-total b { font-size: clamp(52px, 5.4vw, 84px); }
.calc-app.is-3d .calc-save, .calc-app.is-3d .calc-note { text-align: center; }

/* цена «барабанами» */
.odo { display: inline-flex; align-items: flex-start; height: 1em; overflow: hidden; }
.odo-d { display: inline-block; height: 1em; overflow: hidden; }
.odo-r { display: flex; flex-direction: column; transition: transform 1.1s cubic-bezier(.2, .9, .15, 1); will-change: transform; }
.odo-r span, .odo-c { display: block; height: 1em; line-height: 1; }

@media (max-width: 1000px) {
  /* телефон/планшет: сцена над услугами, итог - под ними */
  .calc-app.is-3d { grid-template-columns: 1fr; gap: 18px; }
  .calc-app.is-3d .calc-summary { display: contents; }
  .calc-app.is-3d .calc-viz { order: -1; height: 40vh; }
  .calc-app.is-3d .calc-items { grid-template-columns: 1fr 1fr; gap: 8px; }
  .calc-app.is-3d .calc-item { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
  .calc-app.is-3d .calc-item .ci-text small { display: none; }
  .calc-app.is-3d .calc-item .ci-text strong { font-size: 14px; }
  .calc-app.is-3d .calc-item .ci-price { grid-column: 1; text-align: left; }
}
@media (max-width: 640px) { .calc-period { gap: 10px; } .calc-period .seg span { white-space: nowrap; font-size: 14px; } }
