[hidden] { display: none !important; }
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #efebe4;
  --ink: #1d2325;
  --ink-2: #4a5457;
  --muted: #7a8487;
  --line: #ddd7cd;
  --brand: #1f3a3d;
  --brand-ink: #ffffff;
  --accent: #d9822b;
  --accent-soft: #fbeedd;
  --ok: #2f7a4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 35, 37, .06), 0 6px 24px rgba(29, 35, 37, .06);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141819; --surface: #1c2224; --surface-2: #232a2c; --ink: #eef1f1; --ink-2: #c3cbcc; --muted: #8c9698;
    --line: #2f3739; --brand: #7fb7ad; --brand-ink: #0f1515; --accent: #f0a050; --accent-soft: #3a2a18; --ok: #6cc18b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* header */
.top { background: var(--brand); color: var(--brand-ink); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 19px; letter-spacing: -.01em; }
.logo b { color: var(--accent); font-weight: 800; }
.logo__mark { font: 700 13px/1 var(--mono); border: 2px solid currentColor; border-radius: 6px; padding: 5px 6px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: inherit; text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--accent); }
.nav__soon { opacity: .55; cursor: default; }

/* page head */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-2); }
.pagehead { margin: 18px 0 22px; }
h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25; letter-spacing: -.01em; margin: 44px 0 14px; }
h3 { font-size: 18px; margin: 22px 0 8px; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 760px; margin: 0; }
.answer { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 0 10px 10px 0; max-width: 760px; margin: 0 0 22px; }
.answer b { font-family: var(--mono); }

/* calculator */
.calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { margin-top: 0; font-size: 19px; }
.fields { display: grid; gap: 14px; }
.field label, .field .lbl { display: block; font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unit { position: relative; }
.unit input { padding-right: 38px; }
.unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
input[type=number], select { width: 100%; font: 600 17px/1.2 var(--sans); color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; appearance: none; -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus, select:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 600 14px var(--sans); border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.result { position: sticky; top: 12px; }
.big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.big output { font: 800 clamp(38px, 6vw, 52px)/1 var(--mono); letter-spacing: -.03em; color: var(--brand); }
.big span { font-weight: 700; color: var(--ink-2); }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; font-family: var(--mono); }
.bags { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.bag { background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; }
.bag output { display: block; font: 800 24px/1.1 var(--mono); }
.bag small { color: var(--muted); font-size: 12px; }
.diagram { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.diagram text { font: 600 12px var(--mono); fill: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { font: 650 14px var(--sans); border: 1.5px solid var(--brand); color: var(--brand); background: transparent; border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; }
.btn--solid { background: var(--brand); color: var(--brand-ink); }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* lists, tables */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
a.tile:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--ink); }
.tile h3 { margin: 0 0 4px; font-size: 17px; }
.tile p { margin: 0; color: var(--ink-2); font-size: 14px; }
.tile__ico { font: 700 12px var(--mono); color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.tile--soon { opacity: .6; box-shadow: none; }
.tile--soon .tile__ico::after { content: " · soon"; color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
td.num { font-family: var(--mono); }
tr:last-child td { border-bottom: 0; }
.formula { font-family: var(--mono); background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.prose { max-width: 760px; }
.prose li { margin: 4px 0; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0; max-width: 760px; }
summary { font-weight: 650; cursor: pointer; }
.src { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; padding-top: 14px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: center; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }

/* footer */
.foot { margin-top: 64px; background: var(--surface-2); border-top: 1px solid var(--line); }
.foot__in { padding: 22px 16px 28px; color: var(--ink-2); font-size: 14px; }
.foot__small { color: var(--muted); font-size: 13px; }

@media print { .top, .foot, .actions, .nav { display: none; } body { background: #fff; } .card { box-shadow: none; } }
.foot__links a { color: var(--ink-2); margin-right: 2px; }

/* ---------- Анимации cubicyardpro (CSS + inline SVG; первая отрисовка статична; выкл. при prefers-reduced-motion) ---------- */
.ci { display: block; width: 36px; height: 36px; margin-bottom: 8px; fill: var(--brand); }
.tile--soon .ci { fill: var(--muted); opacity: .6; }
.ci path, .ci rect, .ci circle, .ci g { transform-box: fill-box; transform-origin: center; }
a.tile:hover .ci-bag .bag { animation: tip .6s ease; } a.tile:hover .ci-bag .pour { animation: drop .6s ease; fill: var(--accent); }
.tile:hover .ci-gravel circle { animation: bounce .5s ease; } .tile:hover .ci-gravel .s2 { animation-delay: .05s; } .tile:hover .ci-gravel .s3 { animation-delay: .1s; }
.tile:hover .ci-gravel .s4 { animation-delay: .15s; } .tile:hover .ci-gravel .s5 { animation-delay: .2s; }
.tile:hover .ci-mulch .sprout { animation: grow .6s ease; } .tile:hover .ci-soil .shovel { animation: dig .6s ease; }
.tile:hover .ci-sand rect { animation: bounce .45s ease; } .tile:hover .ci-sand .p3 { animation-delay: .1s; }
.tile:hover .ci-convert .arrow { animation: nudge .6s ease; }
.ci-convert .arrow { stroke: var(--accent); fill: none; } .tile--soon .ci-convert .arrow { stroke: var(--muted); }
.seg .ci-shape { display: inline-block; width: 30px; height: 17px; margin: 0 6px -3px 0; fill: currentColor; }
.seg .ci-shape .side { opacity: .55; } .seg button:hover .ci-shape { animation: bounce .45s ease; }
@keyframes tip { 40% { transform: rotate(-14deg); } } @keyframes drop { from { transform: translateY(-8px); opacity: 0; } }
@keyframes bounce { 40% { transform: translateY(-4px); } } @keyframes grow { from { transform: scale(.2); } }
@keyframes dig { 40% { transform: translate(-3px, 4px) rotate(-12deg); } } @keyframes nudge { 50% { transform: translateX(4px); } }

.cube-art { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.cube-art .cube-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.cube-art .fill-front { fill: #b9b2a6; } .cube-art .fill-side { fill: #9c958a; }
.cube-art .cube-fill rect { transform-box: fill-box; transform-origin: bottom; }
.cube-art .mark { stroke: var(--accent); stroke-width: 2; fill: none; } .cube-art .mark-t { font: 700 13px var(--mono); fill: var(--accent); }
.cube-art .bag path:first-child { fill: var(--accent); } .cube-art .stream { stroke: #b9b2a6; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 0; }
.anim .cube-art .cube-fill rect { animation: fill-up 6s ease-in-out infinite both; }
.anim .cube-art .stream { animation: stream 6s linear infinite; }
.anim .cube-art .bag { animation: bag 6s ease-in-out infinite; transform-box: fill-box; transform-origin: 20% 100%; }
@keyframes fill-up { 0%, 8% { transform: scaleY(0); } 70%, 90% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes stream { 0%, 8% { stroke-dashoffset: 60; } 15%, 68% { stroke-dashoffset: 0; } 75%, 100% { stroke-dashoffset: -60; } }
@keyframes bag { 0%, 5% { transform: rotate(0); } 12%, 68% { transform: rotate(-28deg); } 78%, 100% { transform: rotate(0); } }

.diagram .pour { fill: #b9b2a6; opacity: .55; transform-box: fill-box; transform-origin: bottom; }
.pouring .pour { animation: pour .6s ease-out; } @keyframes pour { from { transform: scaleY(0); opacity: .9; } }
.bump { animation: bump .3s ease; } @keyframes bump { 50% { transform: scale(1.08); } }
.big output { display: inline-block; transform-origin: left bottom; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
