/* Сторінка «Матеріали», варіант D «Термокамера + порівняння» (redesign-2026-10/materials, build.py → d-lab.html).
   Згенеровано docs/plans/materials-port.py — правити там або тут разом з макетом. Спільне: кольори пластиків, таблиця порівняння, примітки, FAQ, статті, заклик, міста. Токени — ../blog/base.css */
:root { --pla: #F0560F; --petg: #109C92; --metal: #A39C91; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pla: #FF6A24; --petg: #2BC4B8; --metal: #6E675D; } }
:root[data-theme="dark"] { --pla: #FF6A24; --petg: #2BC4B8; --metal: #6E675D; }
html { scroll-padding-top: 6rem; }
.skip { position: fixed; left: 0.75rem; top: -3.75rem; z-index: 50; padding: 0.625rem 1rem; border-radius: 0.625rem; background: var(--ink); color: var(--bg); text-decoration: none; }
.skip:focus { top: 0.75rem; }
.nw { white-space: nowrap; } /* «3D-друку» не розривається на дефісі */
.lead { margin: 0; max-width: 34em; font-size: 1.1875rem; line-height: 1.6; color: var(--muted); }
.sec-t { margin: 0 0 0.875rem; font: 800 clamp(1.625rem, 3vw, 2.5rem)/1.1 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.more-link { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; text-decoration: none; }
.more-link::after { content: "→"; color: var(--accent); transition: translate .2s; }
.more-link:hover::after { translate: 0.25rem 0; }

/* Таблиця порівняння */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp { width: 100%; min-width: 32.5rem; border-collapse: collapse; font-size: 1rem; }
.cmp th, .cmp td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp thead th { font: 800 1.25rem/1.2 var(--display); border-bottom: 1.5px solid var(--ink); }
.cmp thead th:first-child { font: 600 0.8125rem/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); vertical-align: bottom; }
.cmp tbody th { width: 34%; font-weight: 400; color: var(--muted); }
.cmp td { font-weight: 600; }
.cmp tr.diff th { color: var(--ink); font-weight: 600; } /* рядки, де PLA і PETG відрізняються */
.dot { display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.5rem; border-radius: 0.25rem; vertical-align: 1px; }
.dot--pla { background: var(--pla); } .dot--petg { background: var(--petg); }

/* Примітки: TPU, колір, вартість */
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.875rem; margin: clamp(2.5rem, 6vw, 5rem) 0; }
.note { display: grid; align-content: start; gap: 0.625rem; padding: clamp(1.25rem, 2.6vw, 1.875rem); border-radius: 1.375rem; background: var(--paper); }
.note h3 { margin: 0; font: 800 1.375rem/1.15 var(--display); letter-spacing: -.02em; }
.note p { margin: 0; color: var(--muted); }

/* FAQ + статті поруч */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.875rem, 5vw, 5rem); align-items: start; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1.5px solid var(--ink); }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: 1.125rem 0; cursor: pointer; font: 600 1.125rem/1.35 var(--display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.625rem; line-height: .9; color: var(--accent); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.125rem; color: var(--muted); }
.arts ul { display: grid; gap: 0.625rem; margin: 0 0 1.125rem; padding: 0; list-style: none; }
.art { display: grid; grid-template-columns: 7rem minmax(0, 1fr); grid-template-rows: auto auto; gap: 0.125rem 1rem; align-items: center; padding: 0.5rem; border-radius: 1.125rem; text-decoration: none; transition: background-color .2s; }
.art:hover { background: var(--paper); }
.art img { grid-row: 1 / 3; width: 7rem; height: 4.375rem; object-fit: cover; border-radius: 0.75rem; background: var(--paper); }
.art__t { align-self: end; font-weight: 600; line-height: 1.3; }
.art small { align-self: start; font-size: 0.8125rem; color: var(--muted); }

/* Заклик (база — .cta з base.css) */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.cta__p { margin: 0; grid-column: 1; color: color-mix(in srgb, var(--bg) 72%, transparent); }
.cta__b { grid-column: 2; grid-row: 1 / 3; display: flex; flex-wrap: wrap; gap: 0.625rem; }


@media (max-width: 900px) { .notes, .duo { grid-template-columns: minmax(0, 1fr); } .cta { grid-template-columns: minmax(0, 1fr); } .cta__b { grid-column: 1; grid-row: auto; } }
@media (max-width: 520px) { .art { grid-template-columns: 5.5rem minmax(0, 1fr); } .art img { width: 5.5rem; height: 3.4375rem; } }



/* ——— D: термокамера, порівняння «метеликом» з «на практиці», докладно про матеріали ——— */
/* Термокамера: сцена three.js (гачки під вантажем), підписи над гачками, температура за скролом ~1,7 екрана */
.b-lab { position: relative; height: 170vh; }
.b-stage { position: sticky; top: calc(4.5rem + 1px); height: calc(100svh - 4.5rem - 1px); min-height: 35rem; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0 clamp(1.25rem, 3vw, 3rem);
  background: color-mix(in srgb, #FF6A24 calc(var(--heat, 0) * 15%), var(--bg)); border-radius: 0 0 2rem 2rem; overflow: hidden; padding: 0 var(--gutter); }
.b-copy { align-self: center; padding: 1.25rem 0; }
.b-copy h1 { margin: 0.875rem 0 1rem; font: 900 clamp(2.5rem, 5.6vw, 5.75rem)/.92 var(--display); letter-spacing: -.055em; text-wrap: balance; }
.b-scene { position: relative; min-height: 0; margin: 0; }
.b-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.b-scene svg { position: absolute; inset: 16% 4% 4%; width: 92%; height: 80%; }
.b-scene.is-3d svg { display: none; }
.b-scene .h-bent, .b-scene[data-pla="bent"] [data-svg="pla"] .h-ok, .b-scene[data-petg="bent"] [data-svg="petg"] .h-ok { display: none; }
.b-scene[data-pla="bent"] [data-svg="pla"] .h-bent, .b-scene[data-petg="bent"] [data-svg="petg"] .h-bent { display: inline; }
.b-scene figcaption { position: absolute; left: 0; right: 0; bottom: 0.5rem; text-align: center; font-size: 0.875rem; color: var(--muted); }
.b-scene.is-3d figcaption { display: none; }
.hook-tags { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.hook-tags li { position: absolute; left: var(--x, 26%); top: var(--y, 20%); translate: -50% calc(-100% - 0.75rem); display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.875rem 0.5rem 0.6875rem; border-radius: 62.4375rem; background: var(--paper); box-shadow: 0 0.5rem 1.5rem -0.625rem rgba(0, 0, 0, .3); font-size: 0.875rem; white-space: nowrap; transition: background-color .3s; }
.hook-tags li[data-v="petg"] { --x: 72%; }
.hook-tags li::after { content: ""; position: absolute; left: 50%; top: 100%; width: 0.125rem; height: 0.75rem; translate: -50% 0; background: var(--m); opacity: .6; } /* «ніжка» до кріплення гачка */
.hook-tags b { font-weight: 800; color: var(--m); }
.hook-tags i { width: 0.5625rem; height: 0.5625rem; flex: none; border-radius: 50%; background: #2FB36A; transition: background-color .3s; }
.hook-tags li.is-soft i { background: #F2C200; } .hook-tags li.is-bent i { background: #D7262E; }
.hook-tags li.is-bent { background: color-mix(in srgb, #D7262E 12%, var(--paper)); }
.thermo { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "hint hint" "track out"; gap: 0.25rem 1.75rem; align-items: end; padding: 0.875rem 0 1.125rem; border-top: 1px solid var(--line); }
.thermo__hint { grid-area: hint; margin: 0; display: flex; align-items: center; gap: 0.75rem; min-height: 2rem; font: 700 clamp(1rem, 1.4vw, 1.1875rem)/1.3 var(--display); }
.thermo__hint .arrow { display: inline-grid; place-items: center; width: 1.875rem; height: 1.875rem; flex: none; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 1rem; animation: nudge 1.8s ease-in-out infinite; }
.thermo__hint[data-mode="live"] .arrow { visibility: hidden; animation: none; }
@keyframes nudge { 50% { translate: 0 0.25rem; } }
.thermo__track { grid-area: track; position: relative; padding: 1.875rem 0 1.375rem; }
.thermo__scen { position: absolute; left: 0.875rem; right: 0.875rem; top: 0; height: 1.875rem; }
.thermo__scen span { position: absolute; bottom: 0; translate: -50% 0; display: grid; justify-items: center; gap: 0.1875rem; font-size: 0.75rem; color: var(--muted); white-space: nowrap; transition: color .25s; }
.thermo__scen em { font-style: normal; }
.thermo__scen i { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: currentColor; }
.thermo__scen span.is-on { color: var(--ink); font-weight: 600; }
.thermo input { width: 100%; height: 2.125rem; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.thermo input::-webkit-slider-runnable-track { height: 0.625rem; border-radius: 0.3125rem; background: linear-gradient(90deg, #6BA8FF, #F2C200 45%, #FF6A24 70%, #D7262E); }
.thermo input::-moz-range-track { height: 0.625rem; border-radius: 0.3125rem; background: linear-gradient(90deg, #6BA8FF, #F2C200 45%, #FF6A24 70%, #D7262E); }
.thermo input::-webkit-slider-thumb { -webkit-appearance: none; width: 1.875rem; height: 1.875rem; margin-top: -0.625rem; border-radius: 50%; background: var(--paper); border: 0.1875rem solid var(--ink); box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, .2); }
.thermo input::-moz-range-thumb { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--paper); border: 0.1875rem solid var(--ink); }
.thermo__marks { position: absolute; left: 0.875rem; right: 0.875rem; bottom: 0; height: 1.25rem; font: 600 0.75rem/1 var(--mono); color: var(--muted); }
.thermo__marks span { position: absolute; translate: -50% 0; white-space: nowrap; }
.thermo__marks span::before { content: ""; position: absolute; left: 50%; top: -0.875rem; width: 0.125rem; height: 0.5rem; background: currentColor; }
.thermo__marks .m-pla { color: var(--pla); } .thermo__marks .m-petg { color: var(--petg); }
.thermo__marks b { font-weight: 600; }
.thermo output { grid-area: out; display: grid; justify-items: end; gap: 0.125rem; padding-bottom: 0.875rem; }
.thermo output b { font: 800 clamp(1.875rem, 3vw, 2.75rem)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: right; }
.thermo output small { min-height: 1.3em; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 900px) {
  .b-lab { height: 165vh; }
  .b-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
  .b-copy { padding: 0.875rem 0 0; } .b-copy .lead { font-size: 0.9375rem; line-height: 1.5; } .b-copy .crumbs { display: none; }
  .b-copy h1 { font-size: clamp(2.125rem, 9vw, 3rem); margin: 0.375rem 0 0.5rem; }
  .thermo { gap: 0.125rem 0.875rem; padding: 0.625rem 0 0.75rem; } .thermo__hint { font-size: 0.9375rem; } .thermo__hint .arrow { width: 1.625rem; height: 1.625rem; }
  .thermo__scen em, .thermo__marks b { display: none; } .thermo__track { padding-top: 1rem; } .thermo__scen { height: 0.875rem; }
  .hook-tags li { font-size: 0.75rem; padding: 0.375rem 0.625rem 0.375rem 0.5rem; gap: 0.375rem; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) { /* телефон боком: текст ліворуч, сцена праворуч */
  .b-stage { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); grid-template-rows: minmax(0, 1fr) auto; }
  .b-copy { align-self: center; padding: 0.5rem 0 0; } .b-copy .lead { display: none; } .b-copy h1 { font-size: 1.875rem; margin: 0; }
  .thermo { padding: 0.375rem 0 0.5rem; } .thermo__hint { font-size: 0.875rem; min-height: 1.625rem; } .thermo output { padding-bottom: 0.375rem; }
}
@media (prefers-reduced-motion: reduce) { .b-lab { height: auto; } .b-stage { position: relative; top: 0; height: auto; min-height: 40rem; } .thermo__hint .arrow { animation: none; } }
/* «Коли обирати», порівняння «метеликом», докладно про матеріали — спільне для C і D */
.when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.875rem; margin: 0 0 clamp(2.5rem, 6vw, 5rem); }
.when section { padding: clamp(1.25rem, 3vw, 2.125rem); border-radius: 1.625rem; background: var(--paper); border-top: 0.375rem solid var(--m); }
.when h2 { margin: 0 0 0.875rem; font: 800 clamp(1.5rem, 2.6vw, 2.125rem)/1.1 var(--display); letter-spacing: -.03em; }
.when .uses { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.when .uses li { padding: 0.625rem 0.875rem; border-radius: 0.875rem; background: var(--bg); }
.fly-wrap { padding: clamp(0.625rem, 2vw, 1.25rem) 0 clamp(2.5rem, 6vw, 5rem); }
.fly-wrap .sec-t { margin-bottom: 1.125rem; text-align: center; }
.fly { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fly th, .fly td { padding: 0.75rem 0.625rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fly thead th { font: 900 clamp(1.625rem, 3vw, 2.625rem)/1 var(--display); letter-spacing: -.04em; border-bottom: 1.5px solid var(--ink); }
.fly thead th:first-child, .fly td:first-child { text-align: right; } .fly thead th:last-child, .fly td:last-child { text-align: left; }
.fly thead th:nth-child(2) { font: 600 0.8125rem/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fly tbody th { width: 28%; text-align: center; font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.fly td { font-weight: 600; }
.fly .bar { display: block; height: 0.75rem; margin-top: 0.5rem; border-radius: 0.375rem; background: var(--m); width: var(--w); transform-origin: var(--o); }
.fly td:first-child .bar { margin-left: auto; --o: right; } .fly td:last-child .bar { --o: left; }
.c-mats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.75rem); padding: clamp(2.5rem, 6vw, 5rem) 0; border-top: 1.5px solid var(--ink); }
.c-mats h2 { margin: 0 0 0.5rem; font: 900 clamp(2rem, 4vw, 3.75rem)/.95 var(--display); letter-spacing: -.05em; }
.c-mats h2::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .2em; border-radius: .14em; background: var(--m); vertical-align: .08em; }
.c-mats .tag { margin: 0 0 0.875rem; font: 600 clamp(1.125rem, 1.6vw, 1.375rem)/1.3 var(--display); }
.c-mats dl { margin: 1.125rem 0 0; display: grid; }
.c-mats dl div { display: grid; grid-template-columns: minmax(8.125rem, 42%) minmax(0, 1fr); gap: 0.75rem; padding: 0.5625rem 0; border-top: 1px solid var(--line); }
.c-mats dt { color: var(--muted); font-size: 0.9375rem; } .c-mats dd { margin: 0; font-weight: 600; }
@media (max-width: 900px) { .when, .c-mats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .fly th, .fly td { padding: 0.625rem 0.25rem; font-size: 0.875rem; } .fly tbody th { font-size: 0.75rem; width: 30%; } }
/* D: живі рядки порівняння — кнопка в назві характеристики розкриває «на практиці» зі схемами PLA і PETG */
.fly-hint { margin: -0.375rem 0 1.125rem; text-align: center; color: var(--muted); }
.x-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4375rem 0.875rem; border: 1.5px solid var(--line); border-radius: 62.4375rem; background: transparent; color: var(--ink); font: 600 0.9375rem/1.2 var(--display); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.x-btn:hover { border-color: var(--ink); }
.x-btn i { width: 0.5rem; height: 0.5rem; border-right: 0.125rem solid currentColor; border-bottom: 0.125rem solid currentColor; rotate: 45deg; translate: 0 -0.125rem; transition: rotate .3s, translate .3s; }
.x-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.x-btn[aria-expanded="true"] i { rotate: 225deg; translate: 0 0.125rem; }
.fly tr.has-x td, .fly tr.has-x th { border-bottom-color: transparent; }
.fly tr.has-x:not(.is-open) + tr.x td { border-bottom: 1px solid var(--line); }
.fly tr.x td { padding: 0; }
.fly tr.x.is-open td { border-bottom: 1px solid var(--line); }
.x__in { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.3, .7, .2, 1); }
.x__in > div { overflow: hidden; min-height: 0; }
.fly tr.x.is-open .x__in { grid-template-rows: 1fr; }
.x__grid { display: grid; grid-template-columns: minmax(0, 36fr) minmax(0, 28fr) minmax(0, 36fr); align-items: start; padding: 0.25rem 0 1.375rem; }
.x__pla, .x__petg, .x__one { display: grid; gap: 0.5rem; }
.x__pla { justify-items: end; text-align: right; padding-right: 0.625rem; } .x__petg { justify-items: start; text-align: left; padding-left: 0.625rem; }
.x__one { grid-column: 1 / -1; justify-items: center; text-align: center; }
.x__mid { display: grid; justify-items: center; padding-top: 2.125rem; font-size: 0.75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.x__heat { min-height: 2.5rem; padding: 0 1rem; font-size: 0.875rem; text-transform: none; letter-spacing: 0; }
.fly tr.x p { margin: 0; max-width: 28em; font-size: 0.9375rem; font-weight: 400; line-height: 1.5; color: var(--muted); }
.demo { width: 10rem; max-width: 100%; height: auto; overflow: visible; }
.demo .t { font: 600 0.625rem var(--mono); fill: var(--muted); }
.c-mats h3 { margin: 1.375rem 0 0.625rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.c-mats .uses { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.c-mats .uses li { padding: 0.5rem 0.875rem; border-radius: 62.4375rem; background: var(--paper); font-size: 0.9375rem; }
@media (max-width: 640px) {
  .x__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem 0.625rem; } .x__mid { grid-column: 1 / -1; grid-row: 2; padding-top: 0; } .x__mid span { display: none; }
  .x__pla, .x__petg { padding: 0; } .fly tr.x p { font-size: 0.8125rem; } .x-btn { padding: 0.375rem 0.625rem; font-size: 0.8125rem; gap: 0.375rem; }
  .fly thead th:nth-child(2) { font-size: 0; } /* «Характеристика» не влазить між PLA і PETG — лишається для читачів екрана */
}
@media (prefers-reduced-motion: reduce) { .x__in { transition: none; } }

/* WP: плаваюча кнопка Telegram (inc/seo-fixes.php) перекриває показ температури в куті термокамери — ховається, поки камера на екрані (materials.js) */
.rd-materials .msg-float { transition: opacity .2s, visibility .2s; }
.rd-materials .msg-float.is-away { opacity: 0; visibility: hidden; pointer-events: none; }
