/*
  /workflows/solidworks-drawing-automation/ · the page's sections, each under its own class (.dw-hero, .dw-how,
  .dw-try, .dw-faq), on the site's frame (/marketing/shared/site/site.css: the container, the type scale, the section head, the
  buttons). Tokens: /shared/adam-v1.css, so every colour here flips with dark mode.

  The drawing itself (.dw-sheet, written into the page by tools/drawing/build.mjs) is set in millimetres: its viewBox
  is its paper, so a stroke of .35 is a 0.35 mm line and its lettering is 2.5 mm high. The same rules print the
  reference PDF, where build.mjs names the tokens as ink.
*/

/* ---------------------------------------------------------------- the drawing: line weights and lettering */
.dw-sheet {
  --dw-thick: .35; --dw-fine: .18;                   /* ISO 128's pair: outlines, and everything else */
  display: block; overflow: visible;
  font-family: var(--font-mono); font-size: 3.5px; font-weight: 400; font-feature-settings: var(--mono-features, normal);
}
.dw-sheet path { fill: none; stroke: var(--ink); stroke-width: var(--dw-fine); stroke-linecap: round; stroke-linejoin: round; }
.dw-sheet text { fill: var(--ink); white-space: pre; }
.dw-sheet :is(.dw-visible, .dw-outline) { stroke-width: var(--dw-thick); }
.dw-sheet .dw-hidden { stroke-dasharray: 2 1.1; stroke-linecap: butt; }
.dw-sheet .dw-centre { stroke: var(--muted); stroke-dasharray: 6 1 1 1; stroke-linecap: butt; }
.dw-sheet .dw-centre--s { stroke-dasharray: 3.2 .8 .8 .8; }
/* what Adam adds to the views is in the accent: the dimensions, their arrows and their figures */
.dw-sheet .dw-dim path { stroke: var(--accent); }
.dw-sheet .dw-dim text { fill: var(--accent); }
.dw-sheet .dw-dim .dw-head { fill: var(--accent); stroke-width: .08; stroke-linejoin: miter; }
.dw-sheet .dw-dim .dw-sym { stroke-width: .3; stroke-linecap: butt; stroke-linejoin: miter; }
.dw-sheet .dw-label { font-size: 2.1px; letter-spacing: .06em; fill: var(--muted); }
.dw-sheet .dw-notes text:not(.dw-label) { font-size: 2.5px; }
.dw-sheet .dw-brand { font-family: var(--font-display); font-size: 6.4px; font-weight: 500; letter-spacing: -.03em; }
/* the isometric is drawn at a scale of its own, so its outline is set back to the sheet's weight */
.dw-sheet .dw-iso .dw-visible { stroke-width: calc(var(--dw-thick) * 1.3); transition: stroke-width .6s ease; }
/* and seen close, as the 3D view, it is a hairline drawing again */
.dw-stage[data-cam="iso"] .dw-iso .dw-visible { stroke-width: calc(var(--dw-thick) * .8); }
.dw-sheet .dw-hit { fill: transparent; stroke: none; }
/* its label holds for the isometric only: not while the part is turned from it, nor in the 3D view */
.dw-sheet .dw-iso .dw-label { transition: opacity .3s ease; }
.dw-sheet .dw-iso[data-turned] .dw-label, .dw-stage[data-cam="iso"] .dw-iso .dw-label { opacity: 0; }

/* ---------------------------------------------------------------- the hero: the words, and the sheet beside them */
.dw-hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto 1fr; grid-template-areas: "copy fig" "facts fig";
  column-gap: clamp(32px, 4.4vw, 64px); row-gap: 40px; align-items: start;
  padding-top: clamp(32px, 4.4vw, 64px); padding-bottom: var(--sec-gap);
}
.dw-copy { grid-area: copy; display: grid; justify-items: start; gap: 28px; min-width: 0; }
.dw-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.dw-eyebrow i, .dw-brief-k i { flex: none; width: 6px; height: 6px; background: var(--accent); }
/* two lines beside the figure: "to 2D drawing" is the longer, 6.1 em at this tracking */
.dw-hero .dw-h1 { font-size: clamp(44px, 5.3vw, 76px); }
.dw-copy .site-lead { max-width: 520px; font-size: clamp(17px, 1.39vw, 20px); }
.dw-copy .site-btn { min-width: 0; }
/* the phone's hand-off: a quiet line under the pair (drawing.js shows it on touch screens) */
.dw-desk { display: grid; gap: 10px; justify-items: start; max-width: 100%; margin-top: -8px; }
.dw-desk[hidden] { display: none; }
.dw-desk-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2);
  font: 400 15px/1.4 var(--font-body); text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; cursor: pointer;
}
.dw-desk-btn .ic { flex: none; width: 16px; height: 16px; }
.dw-desk-btn:focus-visible { outline: var(--focus-ring, 2px solid var(--focus)); outline-offset: 2px; }
.dw-desk-url { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--ink); font: 400 13px/1 var(--font-mono); }
.dw-desk-say { margin: 0; font: 400 14px/1.4 var(--font-body); color: var(--muted); }
.dw-desk-say:empty { display: none; }

/* in, out, then: three rows on hairlines, their last rule level with the figure's foot */
.dw-facts { grid-area: facts; align-self: end; margin: 0; border-top: 1px solid var(--line); }
.dw-facts div { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 16px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.dw-facts dt { font: 400 12px/18px var(--font-mono); font-feature-settings: var(--mono-features, normal); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dw-facts dd { margin: 0; font: 400 15px/1.45 var(--font-body); color: var(--ink-2); text-wrap: pretty; }

/* the figure: the sheet in a hairline frame, the views to look at under it, then what the view shows */
.dw-fig { grid-area: fig; min-width: 0; margin: 0; border: 1px solid var(--line); background: var(--bg); }
.dw-stage { position: relative; aspect-ratio: 200 / 181; overflow: hidden; container-type: inline-size; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.dw-stage .dw-sheet { position: absolute; inset: 0; width: 100%; height: 100%; }
/* a phone's stage is half the width: the lines keep their weight on the screen, not on the paper */
@container (max-width: 520px) { .dw-sheet { --dw-thick: .5; --dw-fine: .27; } }
/* a click on a view goes to it, a click on a view being read goes back to the sheet (drawing.js) */
.dw-stage[data-ready][data-cam="sheet"] { cursor: zoom-in; }
.dw-stage[data-ready]:is([data-cam="front"], [data-cam="top"], [data-cam="right"]) { cursor: zoom-out; }
.dw-stage[data-turns] .dw-iso { cursor: grab; }
.dw-stage[data-turns][data-cam="iso"] { cursor: grab; }
.dw-stage[data-turning], .dw-stage[data-turning] .dw-iso { cursor: grabbing; }
/* the dial: a hairline along the stage's foot, with a pink tick for where the part is */
.dw-dial { position: absolute; left: 14px; right: 14px; bottom: 8px; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.dw-dial[hidden] { display: none; }
.dw-stage[data-turns][data-cam="iso"] .dw-dial { opacity: 1; visibility: visible; transition: opacity .3s ease .2s; }
.dw-dial input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 0; background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; cursor: ew-resize; touch-action: none; }
.dw-dial input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 2px; height: 14px; border: 0; border-radius: 0; background: var(--active, var(--accent)); }
.dw-dial input::-moz-range-thumb { width: 2px; height: 14px; border: 0; border-radius: 0; background: var(--active, var(--accent)); }
.dw-dial input::-moz-range-track { height: 1px; background: transparent; }
.dw-dial input:focus-visible { outline: var(--focus-ring, 2px solid var(--focus)); outline-offset: 2px; }

.dw-bar { display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.dw-views { display: flex; min-width: 0; }
.dw-views button, .dw-files a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 clamp(10px, 1.1vw, 16px); border: 0; border-radius: 0; background: none; color: var(--muted);
  font: 400 12px/1 var(--font-mono); font-feature-settings: var(--mono-features, normal); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color .2s ease;
}
.dw-views button { border-right: 1px solid var(--line); }
/* the current view: ink, and the 2 px bar (--active) */
.dw-views button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 calc(-1 * var(--active-weight, 2px)) var(--active, var(--accent)); }
.dw-files { display: flex; margin: 0; }
.dw-files a { border-left: 1px solid var(--line); color: var(--ink); }
.dw-files .ic { width: 14px; height: 14px; }
@media (hover: hover) { .dw-views button:hover { color: var(--ink); } .dw-files a:hover { color: var(--accent); } }
:is(.dw-views button, .dw-files a):focus-visible { outline: var(--focus-ring, 2px solid var(--focus)); outline-offset: -2px; }
.dw-says { display: grid; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.dw-says p { grid-area: 1 / 1; margin: 0; font: 400 15px/1.5 var(--font-body); color: var(--ink-2); text-wrap: pretty; visibility: hidden; opacity: 0; transition: opacity .25s ease, visibility 0s linear .25s; }
.dw-says p[data-on] { visibility: visible; opacity: 1; transition: opacity .25s ease .08s; }

/* the intro (drawing.js): with scripting, the sheet waits unseen for the script to stand the part up alone; if the
   script never arrives, it shows itself after 3 s. While the part stands alone, the rest of the sheet isn't drawn yet. */
html.dw-intro .dw-stage:not([data-ready]) .dw-sheet { visibility: hidden; animation: dw-arrive 0s linear 3s forwards; }
@keyframes dw-arrive { to { visibility: visible; } }
.dw-stage[data-phase="part"] :is(.dw-frame, .dw-notes, .dw-view:not(.dw-iso), .dw-iso .dw-label) { opacity: 0; }

@media (max-width: 1023px) {
  .dw-hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "copy" "fig" "facts"; row-gap: 40px; }
  .dw-copy .site-lead { max-width: 600px; }
}
@media (max-width: 767px) {
  .dw-hero { row-gap: 32px; padding-top: 32px; }
  .dw-copy { gap: 24px; }
  .dw-copy .site-btns { width: 100%; }
  .dw-copy .site-btns .site-btn { flex: 1 1 100%; }
  /* the five views share the bar; the files move under the line that says what the view shows */
  .dw-bar { display: block; }
  .dw-views button { flex: 1 1 0; justify-content: center; padding: 0 4px; }
  .dw-views button:last-child { border-right: 0; }
  .dw-files { border-top: 1px solid var(--line); }
  .dw-files a { flex: 1 1 0; justify-content: space-between; padding: 0 16px; }
  .dw-files a:first-child { border-left: 0; }
  .dw-says { padding: 12px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { .dw-says p, .dw-says p[data-on], .dw-dial, .dw-views button, .dw-files a, .dw-sheet .dw-iso :is(.dw-visible, .dw-label) { transition: none; } }

/* ---------------------------------------------------------------- 01 · how it works: the brief beside its four steps */
.dw-how-side { grid-column: 1 / span 5; align-self: start; position: sticky; top: 96px; display: grid; gap: 40px; min-width: 0; }
.dw-how .dw-steps { grid-column: 7 / -1; margin: 0; padding: 0; list-style: none; }
/* the brief: what the reader would type, in the mono, on a hairline card */
.dw-brief { display: grid; gap: 16px; padding: 20px 20px 16px; border: 1px solid var(--line); }
.dw-brief-k { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.dw-brief-text { margin: 0; font: 400 15px/1.7 var(--font-mono); font-feature-settings: var(--mono-features, normal); letter-spacing: -.01em; color: var(--ink); text-wrap: pretty; }
/* its sentences: all ink until one is being read; then that one keeps its ink and takes the bar, the rest step back */
.dw-brief-text mark {
  background: linear-gradient(var(--active, var(--accent)), var(--active, var(--accent))) left 100% / 0 var(--active-weight, 2px) no-repeat; color: inherit;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-bottom: 2px; transition: color .35s ease, background-size .45s cubic-bezier(.22, 1, .36, 1);
}
.dw-brief[data-on] mark { color: var(--muted); }
.dw-brief[data-on="0"] mark[data-k="0"], .dw-brief[data-on="1"] mark[data-k="1"], .dw-brief[data-on="2"] mark[data-k="2"], .dw-brief[data-on="3"] mark[data-k="3"] { color: var(--ink); background-size: 100% var(--active-weight, 2px); }
.dw-brief-copy {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 36px; margin-left: -2px; padding: 0 2px; border: 0; background: none; color: var(--muted); cursor: pointer;
  font-feature-settings: var(--mono-features, normal); transition: color .2s ease;
}
.dw-brief-copy .ic { width: 14px; height: 14px; }
.dw-brief-copy:hover, .dw-brief-copy[data-done] { color: var(--ink); }
.dw-brief-copy:focus-visible { outline: var(--focus-ring, 2px solid var(--focus)); outline-offset: 2px; }
/* a step: its number and its words; the rule over the one being read is ink and its number pink (as /migrations/) */
.dw-step { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 24px; padding: 24px 0 56px; border-top: 1px solid var(--line); transition: border-color .35s cubic-bezier(.22, 1, .36, 1); }
.dw-step:last-child { padding-bottom: 0; }
.dw-step-n { grid-row: 1 / span 2; padding-top: 6px; font: 400 12px/18px var(--font-mono); letter-spacing: .04em; color: var(--muted); transition: color .35s ease; }
.dw-step h3 { margin: 0 0 16px; font-family: var(--font-display); font-weight: var(--k-weight, 400); font-size: clamp(26px, 2.2vw, 32px); line-height: 1.1; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.dw-step p { margin: 0; max-width: 540px; font: 400 17px/1.6 var(--font-body); color: var(--ink-2); text-wrap: pretty; }
.dw-steps[data-watch] .dw-step[data-on] { border-top-color: var(--ink); }
.dw-steps[data-watch] .dw-step[data-on] .dw-step-n { color: var(--accent); }
@media (max-width: 1023px) {
  .dw-how-side { grid-column: 1 / -1; position: static; gap: 32px; }
  .dw-how-side .site-h2 { max-width: 640px; }
  .dw-brief { max-width: 640px; }
  .dw-how .dw-steps { grid-column: 1 / -1; margin-top: 16px; }
  .dw-step { padding-bottom: 44px; }
}
@media (max-width: 767px) {
  .dw-brief { padding: 16px 16px 12px; }
  .dw-brief-text { font-size: 14px; }
  .dw-step { grid-template-columns: minmax(0, 1fr); padding: 18px 0 36px; }
  .dw-step-n { grid-row: auto; padding: 0 0 12px; }
  .dw-step h3 { margin-bottom: 12px; }
  .dw-step p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .dw-brief-text mark, .dw-brief-copy, .dw-step, .dw-step-n { transition: none; } }

/* ---------------------------------------------------------------- 02 · try it: the example's files, and what a desk needs */
.dw-try-side { grid-column: 1 / span 5; align-self: start; display: grid; gap: 28px; justify-items: start; min-width: 0; }
.dw-try-side .site-body { max-width: 460px; margin: 0; }
.dw-try-lists { grid-column: 7 / -1; display: grid; gap: 48px; min-width: 0; }
.dw-list h3 { margin: 0 0 12px; color: var(--muted); font-weight: 400; }
.dw-list ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.dw-list li { border-bottom: 1px solid var(--line); }
.dw-list li > * { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 16px; column-gap: 16px; align-items: baseline; margin: 0; padding: 16px 0; color: inherit; text-decoration: none; }
.dw-row-t { font-family: var(--font-display); font-size: clamp(17px, 1.32vw, 19px); line-height: 26px; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.dw-row-d { font: 400 15px/24px var(--font-body); color: var(--muted); text-wrap: pretty; }
.dw-list .ic { align-self: center; width: 16px; height: 16px; color: var(--ink); transition: color .2s ease, transform .3s cubic-bezier(.22, 1, .36, 1); }
/* a row that goes somewhere: its name takes the pink underline, its arrow the accent */
.dw-list a .dw-row-t { justify-self: start; background: linear-gradient(var(--link-hover-line, var(--accent)), var(--link-hover-line, var(--accent))) left 100% / 0 var(--link-hover-thickness, 2px) no-repeat; transition: background-size .32s cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) { .dw-list a:hover .dw-row-t { background-size: 100% var(--link-hover-thickness, 2px); } .dw-list a:hover .ic { color: var(--accent); } }
.dw-list a:focus-visible { outline: var(--focus-ring, 2px solid var(--focus)); outline-offset: 2px; }
@media (max-width: 1023px) {
  .dw-try-side, .dw-try-lists { grid-column: 1 / -1; }
  .dw-try-lists { margin-top: 16px; }
}
@media (max-width: 767px) {
  .dw-try-side .site-btns { width: 100%; }
  .dw-try-side .site-btn { flex: 1 1 100%; }
  .dw-try-lists { gap: 40px; }
  .dw-list li > * { grid-template-columns: minmax(0, 1fr) 16px; padding: 14px 0; }
  .dw-row-d { grid-column: 1; grid-row: 2; }
  .dw-list .ic { grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) { .dw-list .ic, .dw-list a .dw-row-t { transition: none; } }

/* ---------------------------------------------------------------- 03 · questions: the site's numbered accordion (as /migrations/) */
.dw-faq .dw-faq-h2 { grid-column: 1 / span 4; align-self: start; }
.dw-fq { grid-column: 5 / -1; border-top: 1px solid var(--line); }
.dw-fq-item { border-bottom: 1px solid var(--line); }
.dw-fq-item h3 { margin: 0; font: inherit; }
.dw-fq-btn { display: grid; grid-template-columns: 36px 1fr 16px; gap: 16px; align-items: start; width: 100%; padding: 20px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dw-fq-btn:focus-visible { outline: var(--focus-ring, 2px solid var(--focus)); outline-offset: 2px; }
.dw-fq-n { padding-top: 4px; font: 400 12px/18px var(--font-mono); letter-spacing: .04em; color: var(--muted); }
.dw-fq-q { font-family: var(--font-display); font-weight: 400; font-size: clamp(17px, 1.32vw, 19px); line-height: 26px; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.dw-fq-pm { position: relative; width: 16px; height: 16px; margin-top: 4px; color: var(--ink); transition: color .3s ease; }
.dw-fq-pm i { position: absolute; left: 3px; right: 3px; top: 7.5px; height: 1px; background: currentColor; transition: transform .45s cubic-bezier(.65, 0, .35, 1); }
.dw-fq-pm i + i { transform: rotate(90deg); }
.dw-fq-btn:hover .dw-fq-pm, .dw-fq-item.is-open .dw-fq-pm { color: var(--accent); }
.dw-fq-item.is-open .dw-fq-pm i + i { transform: rotate(0deg); }
/* an answer is shut only once the script that opens it is there (mountFaq sets data-folds); until then, and without
   scripting, all four are read straight down the page */
.dw-fq-a { display: grid; }
.dw-fq[data-folds] .dw-fq-a { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .45s cubic-bezier(.65, 0, .35, 1), visibility 0s linear .45s; }
.dw-fq:not([data-folds]) .dw-fq-pm { visibility: hidden; }
.dw-fq-a > div { min-height: 0; overflow: hidden; }
.dw-fq-a p { max-width: 780px; margin: 0; padding: 0 48px 26px 52px; font-size: 16px; line-height: 24px; color: var(--muted); text-wrap: pretty; }
.dw-fq[data-folds] .dw-fq-item.is-open .dw-fq-a { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .45s cubic-bezier(.65, 0, .35, 1), visibility 0s; }
@media (max-width: 767px) {
  .dw-faq .dw-faq-h2, .dw-fq { grid-column: 1 / -1; }
  .dw-fq-btn { grid-template-columns: 24px 1fr 16px; gap: 12px; padding: 18px 0; }
  .dw-fq-q { line-height: 24px; }
  .dw-fq-n { padding-top: 3px; }
  .dw-fq-a p { padding: 0 8px 22px 36px; font-size: 15px; line-height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .dw-fq[data-folds] .dw-fq-a, .dw-fq[data-folds] .dw-fq-item.is-open .dw-fq-a, .dw-fq-pm, .dw-fq-pm i { transition: none; } }
