/* Corsair Custom 3D - shared styles. Palette taken from the logo: purple, blue, amber, magenta. */
:root {
  --bg: #fbfaff; --surface: #ffffff; --surface-2: #f2eefc; --text: #1d1a2b; --muted: #55516b;
  --primary: #4b1d96; --primary-text: #4b1d96; --on-primary: #ffffff; --accent: #2d7be0; --amber: #f6a21e; --magenta: #c026d3;
  --border: #ddd6f0; --focus: #2d7be0; --shadow: 0 6px 24px rgba(75, 29, 150, .10);
  --jet: #4b1d96; --jet-infill: rgba(255, 255, 255, .22); --bed: #1c1830; --grid: rgba(75, 29, 150, .13);
  --maxw: 1080px; --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100d1c; --surface: #19152b; --surface-2: #221c3a; --text: #ece9f8; --muted: #aaa5c6;
    --primary: #7c4ddb; --primary-text: #b9a2ff; --on-primary: #ffffff; --accent: #6aa8ff; --amber: #f6b445; --magenta: #e07bf0;
    --border: #322a52; --focus: #8fbcff; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
    --jet: #8b5df0; --jet-infill: rgba(255, 255, 255, .20); --bed: #05040a; --grid: rgba(185, 162, 255, .14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100d1c; --surface: #19152b; --surface-2: #221c3a; --text: #ece9f8; --muted: #aaa5c6;
  --primary: #7c4ddb; --primary-text: #b9a2ff; --on-primary: #ffffff; --accent: #6aa8ff; --amber: #f6b445; --magenta: #e07bf0;
  --border: #322a52; --focus: #8fbcff; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --jet: #8b5df0; --jet-infill: rgba(255, 255, 255, .20); --bed: #05040a; --grid: rgba(185, 162, 255, .14);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* Theme-switch transition (class added briefly by JS) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease !important; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.bar { max-width: var(--maxw); margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-logo { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 3px 8px; flex: none; }
.brand-logo img { width: 112px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { color: var(--muted); font-size: .78rem; }
.bar-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; grid-area: 1/1; transition: transform .4s ease, opacity .3s ease; }
.ico-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-theme="dark"] .ico-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
:root[data-theme="dark"] .ico-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
  :root:not([data-theme="light"]) .ico-moon { opacity: 1; transform: none; }
}
.btn { display: inline-block; background: var(--primary); color: var(--on-primary); text-decoration: none; padding: 12px 22px; border-radius: 999px; font-weight: 650; border: 2px solid var(--primary); transition: transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--primary-text); border-color: var(--primary-text); }
.btn-small { padding: 8px 16px; font-size: .92rem; }
.primary { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.primary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.primary a { display: block; padding: 6px 10px; font-size: .92rem; text-decoration: none; color: var(--text); border-radius: 8px; }
.primary a:hover { background: var(--surface-2); }
.primary summary { display: none; }
@media (max-width: 860px) {
  .brand-text small { display: none; }
  .primary { padding: 0 20px 8px; }
  .primary summary { display: block; cursor: pointer; font-weight: 650; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); width: max-content; }
  .primary details:not([open]) ul { display: none; }
  .primary ul { flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; padding: 6px; }
}
@media (min-width: 861px) { .primary details > ul { display: flex !important; } }

/* Breadcrumbs */
.breadcrumbs { padding: 18px 0 0; font-size: .88rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }

/* Page structure */
.page-head { padding: 22px 0 8px; }
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); line-height: 1.12; margin: 0 0 14px; letter-spacing: -.01em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 62ch; margin: 0; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); line-height: 1.25; margin: 2.2em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.7em 0 .3em; }
.prose { max-width: 800px; }
.prose.wide, .prose-wide { max-width: none; }
.prose p, .prose li { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--amber); }
table { border-collapse: collapse; width: 100%; max-width: 100%; margin: 1.2em 0; font-size: .96rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); }
.callout { border-left: 5px solid var(--amber); background: var(--surface-2); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5em 0; max-width: 70ch; }
.callout p { margin: .3em 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 1.5em 0; max-width: none; list-style: none; padding: 0; }
.cards li, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0; max-width: none; transition: transform .25s ease, box-shadow .25s ease; }
.cards li:hover, .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cards h3 { margin-top: 0; }
.cards p { margin: .4em 0 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4em 0; }

/* Figures */
.figure { margin: 1.6em 0; max-width: none; }
.figure img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; background: var(--surface-2); }
.figure figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; max-width: 70ch; }
.figure-portrait { max-width: 420px; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; margin: 1.5em 0; max-width: none; }
.fig-row .figure { margin: 0; max-width: none; }
.gallery-grid { columns: 3 260px; column-gap: 16px; margin: 1.5em 0; max-width: none; }
.gallery-grid .figure { break-inside: avoid; margin: 0 0 16px; max-width: none; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; padding: 26px 0 8px; }
.hero h1 { margin-bottom: 14px; }
.hero-art { background: linear-gradient(160deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: 22px; padding: 12px; box-shadow: var(--shadow); aspect-ratio: 640 / 340; }
.hero-art svg { width: 100%; height: 100%; display: block; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; list-style: none; margin: 18px 0 0; color: var(--muted); font-size: .95rem; }
.trust li::before { content: "\2713\00a0"; color: var(--primary-text); font-weight: 800; }

/* Hero print animation */
.hero-print .hp-grid line { stroke: var(--grid); stroke-width: 1; }
.hero-print .hp-ghost { fill: none; stroke: var(--primary-text); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 5 6; }
.hero-print .hp-jet { fill: var(--jet); stroke: var(--primary-text); stroke-width: 1; }
.hero-print .hp-infill-line { stroke: var(--jet-infill); stroke-width: 2; }
.hero-print .hp-wing { fill: color-mix(in srgb, var(--jet) 70%, #000); }
.hero-print .hp-canopy { fill: var(--amber); opacity: .92; }
.hero-print .hp-rail { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; opacity: .6; }
.hero-print .hp-toolpath { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 4 7; opacity: .75; }
.hero-print .hp-carriage { fill: var(--accent); }
.hero-print .hp-nozzle { fill: var(--amber); }
.hero-print .hp-bed { fill: var(--bed); }
.hero-print .hp-bed-base { fill: var(--muted); opacity: .45; }
.hero-print .hp-sweep { transform: translateX(300px); }
.hero-print .hp-gantry { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .hero-print .hp-rise-rect { animation: hp-rise 11s steps(23, end) infinite; }
  .hero-print .hp-gantry { animation: hp-rise 11s steps(23, end) infinite; }
  .hero-print .hp-jetwrap { animation: hp-fade 11s linear infinite; }
  .hero-print .hp-sweep { animation: hp-sweep 1.6s ease-in-out infinite alternate; transform: translateX(100px); }
  .hero-print .hp-toolpath { animation: hp-dash 1s linear infinite; }
}
@keyframes hp-rise { 0% { transform: translateY(230px); } 78% { transform: translateY(0); } 100% { transform: translateY(0); } }
@keyframes hp-fade { 0%, 90% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes hp-sweep { from { transform: translateX(95px); } to { transform: translateX(545px); } }
@keyframes hp-dash { to { stroke-dashoffset: -22; } }

/* Section dividers: toolpath lines that draw on */
.divider { height: 28px; margin: 2.4em 0 .4em; max-width: none; }
.divider svg { width: 100%; height: 100%; display: block; overflow: visible; }
.divider path { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dv-ghost { stroke: var(--border); }
.dv-draw { stroke: var(--primary-text); stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .divider .dv-draw { stroke-dashoffset: 1; }
.js .divider.in .dv-draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s cubic-bezier(.4, .1, .2, 1); }

/* Scroll reveal (progressive enhancement: content is visible without JS) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal:not(.divider) { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal:not(.divider).in { opacity: 1; transform: none; }
}

/* Mesh (printer repair) */
.mesh-wrap { background: linear-gradient(160deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: 18px; padding: 10px; margin: 1.6em 0; max-width: 560px; }
.mesh { width: 100%; height: auto; display: block; aspect-ratio: 600 / 340; }
.mesh path { stroke: var(--primary-text); stroke-width: 1.7; }
.mesh-dots circle { fill: var(--amber); }

/* Stepper (webcam mount versions) */
.stepper { margin: 1.6em 0; max-width: none; }
.stepper-tabs { display: none; }
.js .stepper-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; margin-bottom: 16px; }
.stepper-tabs::before { content: ""; position: absolute; left: 6%; right: 6%; top: 21px; height: 3px; background: var(--border); border-radius: 2px; }
.stepper-tabs::after { content: ""; position: absolute; left: 6%; top: 21px; height: 3px; width: calc(88% * var(--p, 0)); background: var(--amber); border-radius: 2px; transition: width .5s ease; }
.step-btn { position: relative; z-index: 1; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-align: center; padding: 0; }
.step-btn .dot { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); font-weight: 750; color: var(--text); transition: all .3s ease; }
.step-btn[aria-selected="true"] .dot { background: var(--primary); border-color: var(--amber); color: var(--on-primary); transform: scale(1.08); }
.step-btn[aria-selected="true"] { color: var(--text); font-weight: 650; }
.step-btn small { display: block; font-size: .82rem; }
.stepper-stage { display: block; }
.js .stepper-stage { display: grid; }
.js .step-panel { grid-area: 1 / 1; transition: opacity .45s ease, transform .45s ease, visibility .45s; }
.js .step-panel.is-off { opacity: 0; visibility: hidden; transform: translateX(16px); pointer-events: none; }
.step-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.js .step-panel { margin: 0; }
.step-panel h3 { margin-top: 4px; }
.step-panel .figure { margin: 0 0 12px; }
.step-panel .figure img { max-height: 340px; object-fit: contain; }
.step-panel .fig-row { margin: 0 0 12px; }
.step-panel h4 { margin: 1.2em 0 .2em; font-size: 1.02rem; }
@media (prefers-reduced-motion: reduce) { .js .step-panel, .stepper-tabs::after { transition: none; } }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 10px 0; padding: 0 16px; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 1.3rem; line-height: 1; color: var(--primary-text); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 14px; }
.faq details > div p { margin: .3em 0; }

/* Related + footer */
.related { margin: 3em 0 1em; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.related a { display: block; height: 100%; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.related a:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary-text); }
.related strong { display: block; color: var(--primary-text); }
.related span { display: block; font-size: .9rem; color: var(--muted); margin-top: 4px; }
.site-footer { margin-top: 3.5em; border-top: 1px solid var(--border); background: var(--surface-2); padding: 34px 0 10px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 4px 0; }
.footer-name { font-weight: 750; font-size: 1.1rem; margin: 0 0 6px; }
.footer-h { font-weight: 700; margin: 0 0 6px; }
.footer-base { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 14px; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } body { font-size: 16.5px; } .brand-logo img { width: 72px; } .brand-text strong { font-size: .92rem; white-space: nowrap; } .bar-actions .btn-small { display: none; } .bar { gap: 8px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .btn:hover, .cards li:hover, .card:hover, .related a:hover { transform: none; }
}
@media print { .site-header, .site-footer, .hero-art, .divider { display: none; } body { background: #fff; color: #000; } }
.mesh-wrap figcaption{font-size:.85rem;color:var(--muted);padding:6px 8px 2px}
.note{font-size:.88rem;color:var(--muted);max-width:70ch}
