/* Haywebs prototype — the tools: the price calculator (prices.html#calc,
   calc.js) and the domain check (domain.html and the home page's band,
   domain.js). Load after base.css and the page's own sheet. The choices are
   cards with a hairline; the chosen one lights up; the sum sits on a glass
   panel that stays in view beside the steps. The domain check is one glass
   pill — the name and «Проверить» — and a row per zone under it. */

/* ------------------------------------------------------- calculator --- */
/* A configurator: on the left a glass stage, held in view, whose sphere of
   dots grows with the sum; on the right the controls, a row each — a label,
   then a segmented choice, a slider, pills or a switch. */
.calc { padding-top: clamp(40px, 5vw, 80px); }
.calc-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(36px, 4vw, 56px); }
.calc-head .lead { max-width: 56ch; }
.calc-link { color: var(--text); text-decoration: underline 1px var(--line-strong); text-underline-offset: 5px; white-space: nowrap; }
.calc-link:hover { text-decoration-color: currentColor; }
.calc-body { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: clamp(24px, 4.4vw, 80px); align-items: start; }

/* the stage: the package, the sphere, the sum, the time, the rows, the ask */
.calc-stage { --lg-r: 28px; position: sticky; top: calc(var(--hdr) + 20px); display: grid; gap: 14px; padding: 24px 28px 28px; }
.calc-kind { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--text-2); }
.calc-kind b { font: 600 15px / 1.3 var(--sans); color: var(--text); }
.calc-orb { --k: 0.5; position: relative; height: clamp(130px, min(16vw, 24vh), 230px); }
.calc-orb-2d { position: absolute; inset: 0; display: grid; place-items: center; }
.calc-orb-2d canvas { width: min(100%, 210px); height: auto; aspect-ratio: 1; transform: scale(var(--k)); }
.calc-total { font: 400 clamp(26px, 2.3vw, 36px) / 1.12 var(--serif); letter-spacing: -0.01em; }
.calc-total span { white-space: nowrap; }
.calc-total .dram { height: 0.7em; margin-left: 0.16em; }
.calc-facts { display: grid; gap: 8px; margin: 0; }
.calc-facts div { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.calc-facts div[hidden] { display: none; }
.calc-facts dt { color: var(--text-2); }
.calc-facts dd { margin: 0; text-align: right; }
/* what makes the sum up: folded, so the stage stays within the screen */
.calc-more { border-top: 1px solid var(--line); }
.calc-more summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 2px; font-size: 14px; color: var(--text-2); cursor: pointer; list-style: none; }
.calc-more summary::-webkit-details-marker { display: none; }
.calc-more summary::after { content: ""; width: 7px; height: 7px; margin-right: 3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.calc-more[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.calc-more summary:hover { color: var(--text); }
.calc-rows { display: grid; gap: 8px; margin: 0; padding: 12px 0 0; list-style: none; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.calc-rows li { display: flex; justify-content: space-between; gap: 16px; }
.calc-rows li span:last-child { color: var(--text); white-space: nowrap; }
.calc-stage .btn { width: 100%; margin-top: 4px; }
.calc-note { font-size: 13px; line-height: 1.5; color: var(--text-3); }
.calc-noscript { margin-top: 24px; color: var(--text-2); }
:is(.calc-hint, .calc-chip, .calc-switch, .calc-rows, .calc-facts) .dram { display: inline-block; width: auto; height: 0.78em; margin-left: 0.16em; vertical-align: baseline; }

/* the controls: a row each, a hairline between */
.calc-controls { min-width: 0; }
.calc-row { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); gap: 12px 28px; padding: 24px 0; border-top: 1px solid var(--line); }
.calc-row:last-of-type { border-bottom: 1px solid var(--line); }
.calc-row[hidden] { display: none; }
.calc-label { padding-top: 11px; font: 600 15px / 1.3 var(--sans); }
.calc-ctl { display: grid; justify-items: start; gap: 12px; min-width: 0; }
.calc-hint { font-size: 14px; line-height: 1.5; color: var(--text-2); }
/* a price in a hint keeps its ֏ (a line may not break before the sign) */
.calc-price { white-space: nowrap; }
.calc-seg input, .calc-chip input, .calc-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }

/* the package: one pill split in three, the chosen part filled */
.calc-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 26px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.calc-seg label { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--r-pill); font: 600 14px / 1 var(--sans); color: var(--text-2); cursor: pointer; }
.calc-seg label:hover { color: var(--text); }
.calc-seg label:has(input:checked) { background: var(--text); color: var(--bg); }

/* pages: − the slider + and the count */
.calc-range { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 480px; }
.calc-range button { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.07); color: var(--text); font: 500 20px / 1 var(--sans); cursor: pointer; }
.calc-range button:hover { background: rgb(255 255 255 / 0.14); }
.calc-range output { min-width: 2em; font: 600 18px / 1 var(--sans); font-variant-numeric: tabular-nums; text-align: right; }
.calc-range input { flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.calc-range input::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--text) var(--at, 14%), var(--line-strong) var(--at, 14%)); }
.calc-range input::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -9px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 6px rgb(255 255 255 / 0.1); -webkit-appearance: none; appearance: none; }
.calc-range input::-moz-range-track { height: 2px; background: var(--line-strong); }
.calc-range input::-moz-range-progress { height: 2px; background: var(--text); }
.calc-range input::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--text); }
.calc-range input:focus-visible { outline: none; }
.calc-range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }

/* languages and extras: pills with a + that fill and tick when chosen */
.calc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px 8px 13px;
  border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-strong); font: 500 14px / 1.2 var(--sans); cursor: pointer;
}
.calc-chip::before { content: "+"; flex: none; width: 12px; font-weight: 600; text-align: center; color: var(--text-2); }
.calc-chip small { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.calc-chip:hover { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.4); }
.calc-chip:has(input:checked) { background: var(--text); color: var(--bg); box-shadow: none; }
.calc-chip:has(input:checked)::before { content: ""; width: 5px; height: 9px; margin: 0 3px 3px 4px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.calc-chip:has(input:checked) small { color: rgb(8 8 10 / 0.6); }
/* included in the package: on, but quiet */
.calc-chip:has(input:disabled) { cursor: default; background: rgb(255 255 255 / 0.12); color: var(--text); }
.calc-chip:has(input:disabled)::before { border-color: var(--text); }
.calc-chip:has(input:disabled) small { color: var(--text-2); }

/* urgency and support: switches */
.calc-switch { display: inline-flex; align-items: center; gap: 14px; min-height: 40px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.calc-switch small { margin-left: 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.calc-track { position: relative; flex: none; width: 46px; height: 28px; border-radius: var(--r-pill); background: rgb(255 255 255 / 0.13); }
.calc-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); }
.calc-switch:has(input:checked) .calc-track { background: var(--accent); }
.calc-switch:has(input:checked) .calc-track::after { transform: translateX(18px); }
:is(.calc-seg label, .calc-chip):has(input:focus-visible), .calc-switch:has(input:focus-visible) .calc-track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* on a phone the stage leads, the controls follow: a bar with the sum stays
   at the screen's foot while they scroll, and leads back up to it. The
   controls' text passes under it, which the world's glass (drawn below the
   page) cannot blur: its glass is CSS, as the header's. */
.calc-bar { display: none; }
@media (max-width: 960px) {
  .calc-body { grid-template-columns: minmax(0, 1fr); }
  .calc-stage { position: static; scroll-margin-top: calc(var(--hdr) + 16px); }
  .calc-bar {
    position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 16px 0 0; padding: 8px 8px 8px 20px; border-radius: var(--r-pill); font: 400 20px / 1.2 var(--serif); white-space: nowrap;
    background: linear-gradient(160deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.03) 45%), rgb(10 11 14 / 0.78);
    box-shadow: inset 0 1px 0.5px rgb(255 255 255 / 0.45), inset 0 -1px 0.5px rgb(255 255 255 / 0.1), 0 12px 36px -10px rgb(0 0 0 / 0.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  }
  .calc-bar.is-long { font-size: 17px; }
  .calc-bar .dram { height: 0.7em; margin-left: 0.14em; }
  .calc-bar a { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font: 600 14px / 1 var(--sans); white-space: nowrap; }
}
/* a narrow phone (360 px): a smaller sum and closer spacing, so the sum and
   the link fit the bar at any sum, in either language */
@media (max-width: 380px) {
  .calc-bar { gap: 8px; padding-left: 14px; font-size: 17px; }
  .calc-bar a { padding: 0 12px; }
}
@media (max-width: 560px) {
  .calc-row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 0; }
  .calc-label { padding-top: 0; }
  .calc-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .calc-seg label { justify-content: center; padding: 0 6px; font-size: 13px; text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  :is(.calc-seg label, .calc-chip, .calc-range button) { transition: background-color var(--t-fast) var(--soft), color var(--t-fast) var(--soft), box-shadow var(--t-fast) var(--soft); }
  .calc-track, .calc-track::after { transition: background-color var(--t-fast) var(--soft), transform 0.3s var(--ease); }
  .calc-orb-2d canvas { transition: transform 0.5s var(--ease); }
}

/* ----------------------------------------------------- domain check --- */
/* the page's head as the price list's: the stepped title over two thirds,
   the eyebrow and the lead in the last */
.dom { padding-top: calc(var(--hdr) + clamp(32px, 3.9vw, 56px)); }
.dom-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: clamp(16px, 2.2vw, 32px); margin-bottom: clamp(32px, 4vw, 56px); }
.dom-head h1 { grid-column: 1 / 3; grid-row: 1 / 3; }
.dom-head .eyebrow { grid-column: 3; grid-row: 1; padding-top: 0.6em; }
.dom-head .lead { grid-column: 3; grid-row: 2; align-self: end; padding-bottom: 0.35em; }
.dom-head .ln-2 { --x: 1.9em; }

.dom-form { --lg-r: 999px; display: flex; align-items: center; gap: 8px; max-width: 760px; padding: 8px 8px 8px 26px; }
.dom-form input { flex: 1; min-width: 0; height: 52px; padding: 0; border: 0; background: transparent; color: var(--text); font: 500 18px / 1 var(--sans); outline: 0; }
.dom-form input::placeholder { color: var(--text-3); opacity: 1; }
.dom-form:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.dom-try { margin-top: 16px; font-size: 14px; color: var(--text-2); }
.dom-try button { margin: 4px 0 0 4px; padding: 7px 12px; border: 0; border-radius: var(--r-pill); background: rgb(255 255 255 / 0.07); color: var(--text); font: 500 14px / 1 var(--sans); cursor: pointer; }
.dom-try button:hover { background: rgb(255 255 255 / 0.13); }

/* a row per zone: the name, its state behind a dot, what to do with it */
.dom-results { display: grid; max-width: 760px; margin: clamp(28px, 3vw, 40px) 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.dom-results[hidden] { display: none; }
.dom-row { display: grid; grid-template-columns: minmax(0, 1fr) 11em auto; align-items: center; gap: 16px; min-height: 64px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dom-name { font: 600 18px / 1.3 var(--sans); overflow-wrap: anywhere; }
.dom-name b { font-weight: 600; color: var(--text-2); }
.dom-state { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; color: var(--text-2); }
.dom-state::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dom-row[data-state="free"] .dom-state { color: var(--text); }
.dom-row[data-state="free"] .dom-state::before { background: var(--accent); box-shadow: 0 0 0 4px rgb(79 201 138 / 0.18); }
.dom-row[data-state="taken"] .dom-state::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.dom-row[data-state="skip"] .dom-name, .dom-row[data-state="skip"] .dom-state { color: var(--text-3); }
.dom-row[data-state="skip"] .dom-state::before { background: transparent; }
.dom-act { justify-self: end; }
.btn.lg.dom-want { height: 40px; padding: 0 18px; font-size: 14px; }
.dom-open { font: 600 14px / 1 var(--sans); text-decoration: underline 1px var(--line-strong); text-underline-offset: 5px; }
.dom-open:hover { text-decoration-color: currentColor; }
.dom-note { max-width: 760px; margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--text-3); }

.dom-next-title { max-width: 16ch; margin-bottom: clamp(28px, 3vw, 44px); }
.dom-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 36px); margin: 0 0 clamp(32px, 3.4vw, 48px); padding: 0; list-style: none; }
.dom-points li { padding-top: 18px; border-top: 1px solid var(--line-strong); }
.dom-points h3 { font: 600 clamp(17px, 1.35vw, 20px) / 1.3 var(--sans); letter-spacing: -0.01em; }
.dom-points p { margin-top: 10px; max-width: 34ch; font-size: 15px; line-height: 1.55; color: var(--text-2); }

@media (max-width: 860px) {
  .dom-head { display: block; }
  .dom-head .eyebrow { padding-top: 0; margin-bottom: 22px; }
  .dom-head .lead { margin-top: 22px; padding-bottom: 0; }
  .dom-points { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .dom-form { padding-left: 18px; }
  .dom-form .btn { padding: 0 18px; }
  .dom-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .dom-act { grid-column: 1 / -1; justify-self: start; }
  .dom-act:empty { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .dom-row[data-state="wait"] .dom-state::before { animation: dom-wait 0.8s var(--soft) infinite alternate; }
  .dom-try button { transition: background-color var(--t-fast) var(--soft); }
}
@keyframes dom-wait { to { opacity: 0.25; } }

/* touch targets on a phone (see base.css) */
@media (max-width: 760px) {
  .calc-seg label { height: 44px; }
  .calc-chip { min-height: 44px; }
  .calc-range button { width: 44px; height: 44px; }
  .dom-try button { min-height: 44px; padding: 0 16px; }
  .calc-switch { min-height: 44px; }
  .calc-bar a { height: 44px; }
}
