/* Truscale Labs */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-variable.woff2") format("woff2-variations"), url("../fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cyc: #e6e7e9;       /* studio backdrop grey: the page */
  --sheet: #f4f5f6;     /* raised surfaces */
  --paper: #ffffff;
  --graphite: #212328;  /* text and primary actions */
  --steel: #565c65;     /* secondary text */
  --rule: #c6c9ce;      /* lines */
  --rule-soft: #d8dadd;
  --tape: #ffcc1f;      /* tape-measure yellow: measurements and focus only */
  --pass: #1b7849;
  --fail: #bf3328;
  --warn: #946000;
  --term: #1d2025;

  --shell: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --r-stage: 20px;
  --r-panel: 14px;
  --r-control: 8px;
  --r-tag: 3px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cyc);
  color: var(--graphite);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-stretch: 100%;
  font-weight: 420;
  font-size: 17px;
  line-height: 1.62;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
code, pre, kbd { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; border-radius: 4px; }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--graphite); color: #fff; padding: 10px 14px; border-radius: var(--r-control); z-index: 10; }
.skip:focus { top: 12px; }

/* Type */

.display {
  font-stretch: 125%;
  font-weight: 790;
  font-size: clamp(2.35rem, 1rem + 4.3vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: -0.018em;
  margin: 0;
  max-width: 14.5em;
  text-wrap: balance;
}
h2 {
  font-stretch: 118%;
  font-weight: 740;
  font-size: clamp(1.85rem, 1.2rem + 2.2vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
  text-wrap: balance;
}
h3 { font-stretch: 100%; font-weight: 660; font-size: 1.125rem; line-height: 1.3; margin: 0 0 6px; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.06rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; color: var(--steel); max-width: 38em; }
.muted { color: var(--steel); }
.small { font-size: 0.875rem; line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; }

/* Header and footer */

.site-head .shell { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-stretch: 112%; font-weight: 760; font-size: 1.05rem; letter-spacing: -0.005em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.site-nav { display: flex; gap: clamp(14px, 2.4vw, 28px); font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--steel); padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--graphite); }

.site-foot { border-top: 1px solid var(--rule); margin-top: clamp(64px, 9vw, 120px); padding: 36px 0 44px; font-size: 0.9rem; color: var(--steel); }
.site-foot .shell { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; }
.site-foot strong { color: var(--graphite); font-stretch: 112%; font-weight: 740; }
.site-foot p { margin: 0 0 6px; }

/* Buttons and controls */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-control); border: 1.5px solid var(--graphite);
  background: var(--graphite); color: #fff; font-weight: 640; font-stretch: 104%; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #33363d; border-color: #33363d; text-decoration: none; }
.btn.quiet { background: transparent; color: var(--graphite); border-color: var(--rule); }
.btn.quiet:hover { border-color: var(--graphite); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.92rem; }
.status-note { font-size: 0.95rem; color: var(--steel); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--rule-soft); gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; cursor: pointer;
  font-weight: 600; font-size: 0.93rem; color: var(--steel); min-height: 36px;
}
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--graphite); box-shadow: 0 1px 2px rgba(33, 35, 40, 0.16); }

/* Hero */

.hero { padding-top: clamp(28px, 5vw, 64px); }
.hero-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; margin-top: clamp(20px, 3vw, 32px); }
.hero-text .lead { margin: 0; }
.hero-text .actions { margin-top: 0; justify-content: flex-end; }

.stage {
  position: relative; margin-top: clamp(28px, 4vw, 44px);
  background: var(--sheet); border-radius: var(--r-stage); overflow: hidden;
}
.stage model-viewer {
  display: block; width: 100%; height: clamp(400px, 50vw, 620px);
  background-color: transparent; --poster-color: transparent;
  --progress-bar-color: var(--graphite); --progress-bar-height: 2px;
}
.stage-bar {
  position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px clamp(14px, 2vw, 22px); pointer-events: none;
}
.stage-bar > * { pointer-events: auto; }
.stage-hint { font-size: 0.9rem; color: var(--steel); }
.ar-btn {
  border: 1.5px solid var(--graphite); background: var(--paper); color: var(--graphite); border-radius: var(--r-control);
  min-height: 40px; padding: 0 14px; font-weight: 640; cursor: pointer;
}
model-viewer .ar-btn { position: absolute; right: clamp(14px, 2vw, 22px); bottom: 14px; }

/* Dimension lines over the model */
.dims { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.dims line { stroke: var(--graphite); stroke-width: 1.25; }
.dims line.hide { display: none; }
.dims.drawing line { stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400); animation: draw 700ms cubic-bezier(.2, .7, .2, 1) forwards; }
.dims.drawing line:nth-of-type(2) { animation-delay: 120ms; }
.dims.drawing line:nth-of-type(3) { animation-delay: 240ms; }
.dims.drawing line:nth-of-type(4) { animation-delay: 360ms; }
.dims.drawing line:nth-of-type(5) { animation-delay: 480ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.dot { display: none; }
.dim {
  background: var(--tape); color: var(--graphite); border: 0; border-radius: var(--r-tag);
  font-stretch: 78%; font-weight: 660; font-size: 0.95rem; line-height: 1; padding: 6px 8px 5px;
  font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 1px 0 rgba(33, 35, 40, 0.28);
  pointer-events: none; opacity: 0; transition: opacity 260ms ease 520ms;
}
.dim::before { content: attr(data-axis); font-weight: 500; margin-right: 5px; opacity: 0.72; }
.measured .dim { opacity: 1; }
.dim.hide { visibility: hidden; }

.stage-facts {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 16px 0 0; padding: 0; list-style: none;
  font-size: 0.93rem; color: var(--steel);
}
.stage-facts b { color: var(--graphite); font-weight: 620; }
.ar-note { margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; background: #f3e6cc; color: #5c3c00; font-size: 0.93rem; max-width: 46rem; }
.ar-note[hidden] { display: none; }
.units { position: absolute; left: clamp(14px, 2vw, 22px); top: clamp(14px, 2vw, 20px); z-index: 2; }

/* Sections */

.section { padding-top: clamp(72px, 10vw, 136px); }
.section-head { max-width: 46rem; margin-bottom: clamp(24px, 3vw, 36px); }
.section-head p { color: var(--steel); }

/* Before and after */

.compare { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.compare-figure { margin: 0; background: var(--sheet); border-radius: var(--r-panel); overflow: hidden; position: sticky; top: 24px; aspect-ratio: 1120 / 1040; }
.compare-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 320ms ease; }
.compare-figure img.off { opacity: 0; }
.compare-figure figcaption { position: absolute; left: 14px; top: 14px; }
.compare-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 640; font-size: 0.95rem; padding: 6px 12px; border-radius: 999px; }
.verdict.fail { background: #f6dedb; color: #9c271d; }
.verdict.warn { background: #f3e6cc; color: #7a4f00; }
.verdict.pass { background: #d9ecdf; color: var(--pass); }

.checks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.checks li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule-soft); font-size: 0.94rem; line-height: 1.4;
}
.checks .val { color: var(--steel); text-align: right; font-variant-numeric: tabular-nums; font-size: 0.88rem; max-width: 18em; overflow-wrap: anywhere; }
.checks .msg { grid-column: 2 / -1; color: var(--steel); font-size: 0.86rem; }
.checks li.changed .val { color: var(--graphite); }
.checks li.flash { animation: flash 900ms ease; }
@keyframes flash { from { background: rgba(255, 204, 31, 0.45); } to { background: transparent; } }

.mark { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; transform: translateY(3px); }
.mark svg { width: 12px; height: 12px; }
.mark.pass { background: var(--pass); }
.mark.fail { background: var(--fail); }
.mark.warn { background: var(--warn); }
.compare-note { margin-top: 14px; font-size: 0.88rem; color: var(--steel); }
.same { margin-top: 4px; font-size: 0.94rem; }
.same summary { cursor: pointer; padding: 10px 0; color: var(--steel); font-weight: 600; }
.same .checks { border-top: 0; }

/* Checker */

.checker { background: var(--sheet); border-radius: var(--r-stage); padding: clamp(18px, 3vw, 36px); }
.checker-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.checker-top p { margin: 0; color: var(--steel); font-size: 0.95rem; }
.drop {
  position: relative; border: 1.5px dashed var(--rule); border-radius: var(--r-panel); background: var(--paper);
  padding: clamp(28px, 5vw, 56px) 20px; text-align: center; transition: border-color 160ms, background-color 160ms;
}
.drop.over { border-color: var(--graphite); border-style: solid; background: #fffbea; }
.drop p { margin: 0; }
.drop .big { font-stretch: 112%; font-weight: 700; font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); margin-bottom: 14px; }
.drop .alt { margin-top: 18px; color: var(--steel); font-size: 0.95rem; }
.linklike { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; color: var(--graphite); }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.result { margin-top: 26px; }
.result[hidden] { display: none; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.result-head h3 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.facts div { background: var(--paper); padding: 12px 14px; }
.facts dt { font-size: 0.82rem; color: var(--steel); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.remedy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.remedy div { border-top: 3px solid var(--rule); padding-top: 10px; }
.remedy .auto { border-color: var(--pass); }
.remedy .setting { border-color: var(--tape); }
.remedy .manual { border-color: var(--steel); }
.remedy b { display: block; font-stretch: 112%; font-weight: 760; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.remedy span { font-size: 0.9rem; color: var(--steel); }

.rtable { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.rtable th { text-align: left; font-weight: 600; font-size: 0.82rem; color: var(--steel); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.rtable td { padding: 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.rtable td:first-child { width: 30px; padding-right: 0; }
.rtable .how { font-size: 0.85rem; white-space: nowrap; }
.how.auto { color: var(--pass); }
.how.setting { color: #7a5a00; }
.how.partial { color: var(--warn); }
.how.manual { color: var(--steel); }
.rtable .sub { display: block; color: var(--steel); font-size: 0.85rem; margin-top: 2px; overflow-wrap: anywhere; }
.passed { margin-top: 16px; }
.passed summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.result-error { background: #f6dedb; color: #6d1d16; border-radius: 12px; padding: 16px 18px; margin-top: 22px; }
.result-error[hidden] { display: none; }
.checker-foot { margin-top: 18px; font-size: 0.86rem; color: var(--steel); }

/* What it fixes */

.fixes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 44px); margin: 0; }
.fixes div { border-top: 1px solid var(--rule); padding: 18px 0 26px; }
.fixes dt { font-stretch: 108%; font-weight: 700; font-size: 1.08rem; margin-bottom: 6px; }
.fixes dd { margin: 0; color: var(--steel); font-size: 0.97rem; }

/* Batch */

.batch { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.term { background: var(--term); color: #d3d7dd; border-radius: var(--r-panel); padding: 18px 20px; overflow-x: auto; font-size: 0.82rem; line-height: 1.75; margin: 0; font-variant-ligatures: none; }
.term .cmd { color: #fff; }
.term .p { color: #8ad9a7; }
.term .ok { color: #7fd69f; font-weight: 700; }
.term .w { color: #f0c36a; font-weight: 700; }
.sizes { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.sizes th { text-align: left; font-weight: 600; font-size: 0.82rem; color: var(--steel); padding: 8px 8px; border-bottom: 1px solid var(--rule); }
.sizes td { padding: 9px 8px; border-bottom: 1px solid var(--rule-soft); font-variant-numeric: tabular-nums; }
.sizes td:first-child { overflow-wrap: anywhere; }
.sizes .to { font-weight: 640; }
.batch-note { font-size: 0.88rem; color: var(--steel); margin-top: 12px; }

/* Report */

.report { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 48px); align-items: start; }
.report ul { padding-left: 1.1em; color: var(--steel); }
.report li { margin-bottom: 6px; }
.frame { border: 1px solid var(--rule); border-radius: var(--r-panel); overflow: hidden; background: var(--paper); }
.frame iframe { width: 100%; height: 640px; border: 0; }
.frame-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--rule-soft); font-size: 0.85rem; color: var(--steel); background: var(--sheet); }

/* FAQ */

.faq { max-width: 52rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-weight: 620; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: linear-gradient(var(--graphite), var(--graphite)) center / 12px 1.5px no-repeat, linear-gradient(var(--graphite), var(--graphite)) center / 1.5px 12px no-repeat; transition: transform 200ms; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 18px; color: var(--steel); max-width: 44rem; }

.closing { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; border-top: 1px solid var(--rule); padding-top: clamp(28px, 4vw, 44px); }
.closing h2 { margin-bottom: 10px; }
.closing p { margin: 0; color: var(--steel); max-width: 38rem; }

/* Docs */

.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); padding-top: clamp(28px, 4vw, 56px); }
.toc { position: sticky; top: 24px; align-self: start; font-size: 0.93rem; }
.toc p { font-weight: 700; margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--steel); }
.toc a:hover { color: var(--graphite); border-left-color: var(--graphite); }
.prose { max-width: 46rem; }
.prose h1 { font-stretch: 122%; font-weight: 780; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); line-height: 1; letter-spacing: -0.015em; margin: 0 0 16px; }
.prose h2 { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--rule); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); }
.prose h3 { margin-top: 30px; font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose p code, .prose li code, .prose td code { font-size: 0.86em; background: var(--rule-soft); padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { background: var(--term); color: #d3d7dd; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: 0.84rem; line-height: 1.7; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 10px 0 20px; }
.prose th { text-align: left; font-weight: 600; color: var(--steel); border-bottom: 1px solid var(--rule); padding: 8px 10px; white-space: nowrap; }
.prose td { border-bottom: 1px solid var(--rule-soft); padding: 8px 10px; vertical-align: top; }
.prose details { border-bottom: 1px solid var(--rule); }
.prose summary { cursor: pointer; padding: 14px 0; font-weight: 620; }
.prose details > :not(summary) { color: var(--steel); }
.sev { font-size: 0.82rem; font-weight: 640; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sev.fail { background: #f6dedb; color: #9c271d; }
.sev.warn { background: #f3e6cc; color: #7a4f00; }

.not-found { padding: clamp(64px, 12vw, 160px) 0; }

/* Responsive */

@media (max-width: 980px) {
  .hero-text { grid-template-columns: 1fr; }
  .hero-text .actions { justify-content: flex-start; }
  .compare, .batch, .report { grid-template-columns: 1fr; }
  .compare-figure { position: relative; top: 0; }
  .fixes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { columns: 2; }
  .site-foot .shell { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav a.opt { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .remedy { grid-template-columns: 1fr; gap: 8px; }
  .remedy div { display: flex; align-items: baseline; gap: 10px; }
  .remedy b { font-size: 1.25rem; }
  .fixes { grid-template-columns: 1fr; }
  .stage model-viewer { height: 440px; }
  .dim { font-size: 0.82rem; padding: 5px 6px 4px; }
  .stage-hint { display: none; }
  .rtable thead { display: none; }
  .rtable tr { display: grid; grid-template-columns: 26px minmax(0, 1fr); padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
  .rtable td { border: 0; padding: 2px 0; }
  .rtable td:first-child { grid-row: span 4; }
  .rtable td.req::before { content: "Requirement: "; color: var(--steel); }
  .rtable td.num::before { content: "Found: "; color: var(--steel); }
  .rtable td:empty, .rtable td.req:empty { display: none; }
  .rtable .how { white-space: normal; }
  .toc ol { columns: 1; }
  .prose table { display: block; overflow-x: auto; }
  .site-foot .shell { grid-template-columns: 1fr; }
  .frame iframe { height: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
