/* =====================================================================
   CNC Technik – Download Center
   Graphite & machine orange. Barlow Semi Condensed (machine-plate
   headlines) + IBM Plex Sans (body) + IBM Plex Mono (passwords).
   ===================================================================== */

@font-face { font-family: "Barlow SC"; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --graphite:   #1b1f24;
  --graphite-2: #161a1e;
  --steel:      #232a31;
  --steel-2:    #2a323a;
  --swarf:      #3a434d;
  --aluminium:  #e6eaee;
  --muted:      #9aa4ae;
  --logo-grey:  #8a8d90;
  --orange:     #f28a2e;
  --orange-hi:  #ff9d47;
  --orange-ink: #1b1f24;
  --ok:         #4cc38a;
  --danger:     #ff7a6b;
  --warn:       #f2c14e;

  --font-display: "Barlow SC", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-mono: "Plex Mono", ui-monospace, Consolas, Menlo, monospace;

  --r-panel: 14px;
  --r-item: 8px;
  --r-control: 6px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 400 1rem/1.6 var(--font-body);
  color: var(--aluminium);
  background-color: var(--graphite);
  /* faint drawing-sheet grid, fading out towards the bottom */
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(242, 138, 46, .10), transparent 60%),
    linear-gradient(to bottom, transparent 0, var(--graphite) 720px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--orange); text-underline-offset: 3px; }
a:hover { color: var(--orange-hi); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--orange); color: var(--orange-ink); }

.visually-hidden, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .6rem 1rem; background: var(--orange); color: var(--orange-ink); border-radius: var(--r-control); }
.skip-link:focus { top: 1rem; }

.shell { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.5rem); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid rgba(255,255,255,.06); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; }
.brand img { width: 36px; height: 36px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font: 700 1.25rem/1.1 var(--font-display); letter-spacing: .01em; color: var(--aluminium); }
.brand__sub { font-size: .8rem; color: var(--muted); }
.site-nav { display: flex; gap: .25rem; }
.site-header__right { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.lang-switch { display: flex; padding: 3px; border: 1px solid var(--swarf); border-radius: var(--r-control); background: var(--graphite-2); }
.lang-switch a {
  font: 600 .8rem/1 var(--font-body); letter-spacing: .04em; color: var(--muted); text-decoration: none;
  padding: .4rem .55rem; border-radius: 4px; transition: color .15s ease, background-color .15s ease;
}
.lang-switch a:hover { color: var(--aluminium); }
.lang-switch a[aria-current="true"] { background: var(--steel-2); color: var(--orange); }
@media (max-width: 600px) {
  /* Logo + language switch on the first row, navigation below */
  .site-header__inner { padding-top: .75rem; padding-bottom: .25rem; gap: .5rem 1rem; }
  .site-header__right { display: contents; }
  .lang-switch { order: 1; margin-left: auto; }
  .site-nav { order: 2; width: 100%; }
  .site-nav a { padding: .55rem .5rem; font-size: .92rem; }
}
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; padding: .45rem .8rem; border-radius: var(--r-control); }
.site-nav a:hover { color: var(--aluminium); background: rgba(255,255,255,.05); }
.site-nav a[aria-current="page"] { color: var(--aluminium); box-shadow: inset 0 -2px 0 var(--orange); border-radius: 0; }

/* ---------- Layout ---------- */
.site-main { flex: 1; padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.split--narrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split, .split--narrow { grid-template-columns: 1fr; } }

/* ---------- Intro column ---------- */
.intro { padding-top: .5rem; }
.intro__title {
  font: 600 clamp(2.3rem, 2.2vw + 1.6rem, 3.5rem)/1.04 var(--font-display);
  letter-spacing: -.005em;
  margin: 0 0 1.1rem;
  max-width: 14ch;
  text-wrap: balance;
}
.intro__lead { font-size: 1.125rem; color: #c6cdd4; max-width: 44ch; margin: 0 0 1.5rem; }
.intro__help { color: var(--muted); font-size: .95rem; max-width: 44ch; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; max-width: 44ch; }
.facts li { position: relative; padding-left: 1.4rem; color: #c6cdd4; }
.facts li::before { content: ""; position: absolute; left: 0; top: .62em; width: .55rem; height: 2px; background: var(--orange); }

/* ---------- Hero drawing: logo as CAM toolpath ---------- */
.toolpath { margin: 0 0 1.25rem; max-width: 460px; }
@media (max-width: 900px) { .toolpath { display: none; } .intro__help { display: none; } }
.toolpath svg { width: 100%; height: auto; overflow: visible; }
.toolpath__grid line { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.toolpath__stock path { fill: rgba(242,138,46,.04); stroke: var(--swarf); stroke-width: 1; stroke-dasharray: 6 5; }
.toolpath__inner { fill: none; stroke: var(--logo-grey); stroke-width: 18; stroke-linecap: butt; opacity: .55; }
.toolpath__path {
  fill: none; stroke: var(--orange); stroke-width: 2.2; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: cut 3.2s cubic-bezier(.45,.05,.3,1) .3s forwards;
  filter: drop-shadow(0 0 6px rgba(242,138,46,.45));
}
.toolpath__tool { fill: var(--graphite); stroke: var(--aluminium); stroke-width: 2; opacity: 0; animation: tool-in .4s ease 3.4s forwards; }
.toolpath__dims line { stroke: var(--muted); stroke-width: 1; }
.toolpath__dims circle { fill: var(--muted); }
.toolpath__dims text { fill: var(--muted); font: 500 13px var(--font-mono); }
@keyframes cut { to { stroke-dashoffset: 0; } }
@keyframes tool-in { to { opacity: 1; } }

/* ---------- Panel ---------- */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 120px), var(--steel);
  border: 1px solid var(--swarf);
  border-radius: var(--r-panel);
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04);
}
.panel--compact { max-width: 520px; }
.panel__title { font: 600 1.6rem/1.2 var(--font-display); margin: 0 0 1.25rem; }

/* ---------- Stepper ---------- */
.stepper { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; }
.stepper__item:not(:last-child) { flex: 1; }
.stepper__item { position: relative; display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .92rem; font-weight: 500; }
.stepper__item:not(:last-child)::after {
  content: ""; flex: 1; height: 2px; margin: 0 .75rem 0 .1rem; background: var(--swarf); border-radius: 2px;
  transition: background .3s ease;
}
.stepper__num {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font: 600 .95rem/1 var(--font-display); border: 2px solid var(--swarf); color: var(--muted);
  transition: all .25s ease;
}
.stepper__item.is-current { color: var(--aluminium); }
.stepper__item.is-current .stepper__num { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 0 4px rgba(242,138,46,.15); }
.stepper__item.is-done .stepper__num { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); }
.stepper__item.is-done::after { background: var(--orange); }
@media (max-width: 520px) {
  .stepper__label { display: none; }
  .stepper__item.is-current .stepper__label { display: inline; white-space: nowrap; }
}

/* ---------- Steps ---------- */
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step[hidden] { display: none; }
.step:not([hidden]) { animation: step-in .28s ease; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } }
.step__title { font: 600 1.55rem/1.2 var(--font-display); padding: 0; margin: 0 0 .25rem; }
.step__hint { color: var(--muted); margin: 0 0 1.25rem; font-size: .95rem; }

/* ---------- Product picker ---------- */
.products { display: grid; gap: .65rem; }
.product {
  position: relative; display: grid; grid-template-columns: 2.75rem 1fr 1.5rem; gap: 1rem; align-items: start;
  padding: 1rem 1.1rem; border: 1px solid var(--swarf); border-radius: var(--r-item);
  background: var(--graphite-2); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.product:hover { border-color: #56616d; }
.product input { position: absolute; opacity: 0; pointer-events: none; }
.product:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.product:has(input:checked) { border-color: var(--orange); background: linear-gradient(90deg, rgba(242,138,46,.10), rgba(242,138,46,.03)); }
.product__icon { width: 2.75rem; height: 2.75rem; border-radius: var(--r-control); display: grid; place-items: center; background: var(--steel-2); color: var(--orange); }
.product__icon .icon { width: 1.5rem; height: 1.5rem; }
.product__body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.product__title { font: 600 1.2rem/1.2 var(--font-display); color: var(--aluminium); }
.product__tag { display: inline-block; font: 500 .85rem var(--font-body); color: var(--muted); margin-left: .35rem; }
.product__desc { color: #b5bec6; font-size: .92rem; line-height: 1.5; }
.product__check {
  width: 1.5rem; height: 1.5rem; margin-top: .1rem; border-radius: 5px; border: 2px solid #56616d;
  display: grid; place-items: center; transition: all .15s ease;
}
.product__check svg { width: 1rem; height: 1rem; fill: none; stroke: var(--orange-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .2s ease .05s; }
.product:has(input:checked) .product__check { background: var(--orange); border-color: var(--orange); }
.product:has(input:checked) .product__check svg { stroke-dashoffset: 0; }

/* ---------- Fields ---------- */
.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem 1rem; }
.field { grid-column: span 3; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field--wide { grid-column: span 6; }
.field--zip { grid-column: span 2; }
.field--city { grid-column: span 4; }
@media (max-width: 560px) { .field, .field--zip, .field--city { grid-column: span 6; } }
.field label, .token-label { font-size: .9rem; font-weight: 500; color: #c6cdd4; }

input[type="text"], input[type="email"], input[type="tel"], input[type="search"], select {
  width: 100%; font: inherit; color: var(--aluminium);
  background: var(--graphite-2); border: 1px solid var(--swarf); border-radius: var(--r-control);
  padding: .72rem .85rem; transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #6b7580; }
input:hover, select:hover { border-color: #56616d; }
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,138,46,.2); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255,122,107,.2); }

.field-error { margin: 0; min-height: 0; color: var(--danger); font-size: .86rem; }
.field-error:empty { display: none; }
.step > .field-error { margin-top: .75rem; }

/* ---------- Summary + consent ---------- */
.summary { margin: 1rem 0 1.5rem; display: grid; gap: 0; border: 1px solid var(--swarf); border-radius: var(--r-item); overflow: hidden; }
.summary > div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .85rem 1.1rem; background: var(--graphite-2); }
.summary > div + div { border-top: 1px solid var(--swarf); }
.summary dt { color: var(--muted); font-size: .9rem; }
.summary dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 480px) { .summary > div { grid-template-columns: 1fr; gap: .15rem; } }

.consent { display: grid; grid-template-columns: 1.25rem 1fr; gap: .75rem; align-items: start; font-size: .92rem; color: #c6cdd4; cursor: pointer; }
.consent input { appearance: none; width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; border: 2px solid #56616d; border-radius: 4px; background: var(--graphite-2); display: grid; place-items: center; cursor: pointer; }
.consent input::after { content: ""; width: .6rem; height: .35rem; border: solid var(--orange-ink); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.consent input:checked { background: var(--orange); border-color: var(--orange); }
.consent input:checked::after { opacity: 1; }
.consent input[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Buttons ---------- */
.actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.75rem; flex-wrap: wrap; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font: 600 1rem/1 var(--font-body); padding: .95rem 1.4rem; border-radius: var(--r-control);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--orange); color: var(--orange-ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.btn--primary:hover { background: var(--orange-hi); color: var(--orange-ink); }
.btn--ghost { background: transparent; color: var(--aluminium); border-color: var(--swarf); }
.btn--ghost:hover { border-color: #66717d; background: rgba(255,255,255,.04); color: var(--aluminium); }
.btn--block { width: 100%; }
.btn[disabled] { cursor: progress; opacity: .85; }
.btn__spinner { display: none; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-busy .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .actions .btn { flex: 1 1 auto; } }

/* ---------- Notices ---------- */
.notice { margin: 0 0 1.25rem; padding: .85rem 1rem; border-radius: var(--r-control); border: 1px solid; font-size: .95rem; }
.notice--error { color: #ffd1cb; background: rgba(255,122,107,.08); border-color: rgba(255,122,107,.45); }
.notice--warn  { color: #f8e2a8; background: rgba(242,193,78,.08); border-color: rgba(242,193,78,.45); }
.step .notice { margin: 1.25rem 0 0; }

/* ---------- Done state ---------- */
.done { text-align: left; padding: .5rem 0; outline: none; }
.done[hidden] { display: none; }
.done__mark { width: 64px; height: 64px; margin-bottom: 1.25rem; }
.done__mark circle { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 183; stroke-dashoffset: 183; animation: draw .6s ease forwards; }
.done__mark path { fill: none; stroke: var(--orange); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s ease .5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__title { font: 600 1.9rem/1.15 var(--font-display); margin: 0 0 .75rem; }
.done p { color: #c6cdd4; max-width: 52ch; }
.done__hint { font-size: .92rem; color: var(--muted) !important; margin-bottom: 1.5rem; }

/* ---------- Download center ---------- */
.token-input {
  font-family: var(--font-mono) !important; font-weight: 500; font-size: 1.15rem !important;
  letter-spacing: .04em; padding: 1rem 1rem !important; margin: .4rem 0 .5rem;
}
.download-form .btn { margin-top: 1rem; }
.download-note { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }

/* ---------- Internal page ---------- */
.intern-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.intern-head__title { font: 600 2.4rem/1.1 var(--font-display); margin: 0; }
.intern-tools { display: flex; gap: .6rem; flex-wrap: wrap; }
.intern-tools input { width: 280px; max-width: 100%; }
.intern-tools select { width: auto; }
.intern-section { margin-bottom: 2.5rem; }
.intern-section__title { font: 600 1.3rem var(--font-display); margin: 0 0 .9rem; color: var(--muted); }
.intern-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--swarf); border-radius: var(--r-item); overflow: hidden; background: var(--steel); }
.intern-list:empty { display: none; }
.intern-row { display: grid; grid-template-columns: 1fr auto auto; gap: 1.25rem; align-items: center; padding: .8rem 1.1rem; }
.intern-row + .intern-row { border-top: 1px solid var(--swarf); }
.intern-row:hover { background: rgba(255,255,255,.025); }
.intern-row__name { font-weight: 500; overflow-wrap: anywhere; }
.intern-row__meta { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.intern-row .btn { padding: .55rem .9rem; font-size: .9rem; }
.intern-empty { color: var(--muted); }
@media (max-width: 600px) { .intern-row { grid-template-columns: 1fr auto; } .intern-row__meta { grid-column: 1; grid-row: 2; } }

/* ---------- Error page ---------- */
.error-page { max-width: 640px; }
.error-page__code { font: 700 5rem/1 var(--font-display); color: var(--orange); margin: 0; }
.error-page__title { font: 600 2.2rem/1.15 var(--font-display); margin: .5rem 0 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid rgba(255,255,255,.06); background: var(--graphite-2); color: var(--muted); font-size: .88rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; justify-content: space-between; padding-top: 1.75rem; padding-bottom: 1.75rem; line-height: 1.7; }
.site-footer strong { color: #c6cdd4; font-weight: 500; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.site-footer__legal { display: flex; gap: 1.25rem; align-items: start; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
