/* Shared SCAD Re-Event chrome: tokens, buttons, window frame, sticky header, breadcrumb, page flow, title-block footer. */

:root {
  /* Brand */
  --crimson: #a60321;
  --crimson-hi: #d3132f;      /* crimson on dark grounds */
  --crimson-deep: #590212;
  --navy: #03324b;
  --navy-700: #052538;
  --navy-900: #04141e;
  --ink: #0a1218;

  /* Grounds */
  --paper: #f3f1ec;
  --paper-2: #e8e5de;
  --white: #fff;

  /* Text */
  --text: #111a20;
  --text-2: #4d5961;
  --text-inv: #eef2f4;
  --text-inv-2: #9fb0bb;

  /* Lines */
  --line: rgba(10, 18, 24, .14);
  --line-strong: rgba(10, 18, 24, .32);
  --line-inv: rgba(238, 242, 244, .12);
  --line-inv-strong: rgba(238, 242, 244, .28);
  --cad-cyan: #7cc6ec;         /* stage-light tint, used only for CAD annotations on dark */

  /* Type */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* Space */
  --wrap: 1240px;
  --bar-height: 72px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 4px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-padding-top: 88px; }

:focus-visible { outline: 2px solid var(--crimson-hi); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: 0; }
.muted { color: var(--text-2); }

.label {
  display: block;
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-2);
}
.on-dark .label { color: var(--text-inv-2); }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: #fff; --bd: var(--ink);
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 22px 15px 24px;
  font-family: var(--font); font-size: .88rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  font-variation-settings: "wdth" 110;
  color: var(--fg); background: var(--bg); border: 1px solid var(--bd); border-radius: var(--radius);
  cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn::after { content: "→"; font-family: var(--mono); font-weight: 500; transition: transform .2s var(--ease); }
.btn:hover::after { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }
.btn--primary { --bg: var(--crimson); --bd: var(--crimson); }
.btn--primary:hover { --bg: #8a021b; --bd: #8a021b; }
.btn--ghost { --bg: transparent; --fg: var(--text); --bd: var(--line-strong); }
.btn--ghost:hover { --bd: var(--text); }
.on-dark .btn--ghost { --fg: #fff; --bd: var(--line-inv-strong); }
.on-dark .btn--ghost:hover { --bd: #fff; }
.btn--sm { padding: 10px 14px 10px 16px; font-size: .78rem; }
.btn--sm::after { display: none; }
.btn--lg { padding: 17px 26px 17px 28px; font-size: .96rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn[href^="mailto:"] { text-transform: none; letter-spacing: .02em; }

.link-arrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow::after { content: "→"; font-family: var(--mono); transition: transform .2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- App window frame for product screenshots ---------- */
.window {
  position: relative; margin: 0; background: #1d2126; border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 80px -40px rgba(4, 20, 30, .7), 0 0 0 1px rgba(10, 18, 24, .5);
}
.window__bar { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 5px 12px; background: #2a2f35; border-bottom: 1px solid #111; }
.window__bar i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #4a5058; }
.window__bar span { margin-left: 8px; font-family: var(--mono); font-size: .7rem; color: #a7b0b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window img, .window video { display: block; width: 100%; height: auto; }
.figure-caption { display: flex; gap: 14px; align-items: baseline; margin-top: 14px; font-family: var(--mono); font-size: .76rem; color: var(--text-2); }
.figure-caption b { flex: none; white-space: nowrap; color: var(--crimson); font-weight: 600; }
.figure-caption > :not(b) { min-width: 0; }
.on-dark .figure-caption { color: var(--text-inv-2); }
.on-dark .figure-caption b { color: var(--cad-cyan); }
@media (max-width: 640px) { .window__bar span { white-space: normal; } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__bar { display: flex; align-items: center; gap: 10px; height: var(--bar-height); }
.brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand img { display: block; width: 184px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.site-nav > ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav > ul > li { display: flex; }
.site-nav > ul > li > a, .site-nav__sub-toggle {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 10px;
  font: 600 .9rem/1.25 var(--font); white-space: nowrap; text-decoration: none; color: var(--text);
  background: none; border: 0; cursor: pointer; border-radius: var(--radius);
}
.site-nav > ul > li > a:hover, .site-nav__sub-toggle:hover { color: var(--crimson); }
.site-nav > ul > li > a[aria-current="page"], .site-nav__sub-toggle[data-active] { color: var(--crimson); background: rgba(166, 3, 33, .06); }
.site-nav__sub [aria-current="page"] { box-shadow: none; background: var(--paper); }
.site-nav__cta { min-height: 44px; padding: 0 16px; font: 650 .9rem/1.25 var(--font); letter-spacing: normal; text-transform: none; white-space: nowrap; }
.site-nav__cta[aria-current="page"] { --bg: var(--crimson-deep); --bd: var(--crimson-deep); box-shadow: none; border-radius: var(--radius); color: #fff; }
.site-nav__sub-toggle::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.has-sub { position: relative; }
.site-nav__sub {
  position: absolute; top: calc(100% + 8px); left: -8px; min-width: 290px; margin: 0; padding: 8px; list-style: none;
  background: var(--white); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 40px -18px rgba(10, 18, 24, .35);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s, transform .18s, visibility .18s;
}
.site-nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* hover bridge over the gap */
.has-sub.is-open .site-nav__sub { opacity: 1; visibility: visible; transform: none; }
.has-sub.is-open .site-nav__sub-toggle::after { transform: translateY(1px) rotate(225deg); }
.site-nav__sub a { display: grid; gap: 1px; padding: 10px 12px; text-decoration: none; border-radius: 4px; color: var(--text); }
.site-nav__sub a:hover { background: var(--paper); }
.site-nav__sub span { font-weight: 600; }
.site-nav__sub small { font-size: .8rem; color: var(--text-2); }
.site-nav__sub i { font-style: normal; color: var(--text-2); }

.lang-switch {
  flex: none; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px;
  font-family: var(--mono); font-size: .8rem; font-weight: 600; letter-spacing: .08em; line-height: 1;
  color: var(--text-2); background: transparent; text-decoration: none; border: 0; border-radius: var(--radius);
  cursor: pointer; transition: color .2s, border-color .2s;
}
.lang-switch:hover { color: var(--crimson); background: var(--paper-2); }

.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 1.5px; margin: auto; background: var(--text); transition: transform .2s; }
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Without JavaScript the header scrolls away, and the sub-menu opens on hover and focus. */
.no-js .site-header { position: static; }
.no-js .has-sub:hover .site-nav__sub, .no-js .has-sub:focus-within .site-nav__sub { opacity: 1; visibility: visible; transform: none; }

@media (min-width: 1140px) {
  .site-nav { flex: 1; }
  .site-nav > ul { margin-inline: auto; }
}

@media (max-width: 1139px) {
  :root { --bar-height: 64px; }
  .brand img { width: 164px; }
  .nav-toggle { display: block; margin-left: auto; }
  .site-nav {
    position: fixed; inset: calc(var(--bar-height) + 1px) 0 0; flex-direction: column; align-items: stretch; gap: 24px; padding: 12px var(--gutter) 32px;
    background: var(--paper); overflow-y: auto; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-open .site-nav { visibility: visible; opacity: 1; transform: none; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav > ul > li { display: block; border-bottom: 1px solid var(--line); }
  .site-nav > ul > li > a, .site-nav__sub-toggle { width: 100%; justify-content: space-between; padding: 16px 0; font-size: 1.25rem; font-variation-settings: "wdth" 112; }
  .site-nav > ul > li > a[aria-current="page"], .site-nav__sub-toggle[data-active] { background: none; }
  .site-nav__sub { position: static; display: none; min-width: 0; margin: 0 0 12px; padding: 0; border: 0; box-shadow: none; background: none; opacity: 1; visibility: visible; transform: none; }
  .has-sub.is-open .site-nav__sub { display: block; }
  .has-sub:hover .site-nav__sub { transform: none; }
  .site-nav__cta { justify-content: center; padding: 16px; font-size: .95rem; }
  .nav-open { overflow: hidden; }
  .no-js .nav-toggle { display: none; }
  .no-js .site-header__bar { height: auto; flex-wrap: wrap; padding-block: 12px; }
  .no-js .site-nav { position: static; visibility: visible; opacity: 1; transform: none; width: 100%; padding: 0; overflow: visible; }
  .no-js .site-nav__sub { display: block; }
}

/* ---------- Breadcrumb bar (utility pages) ---------- */
.location-path {
  display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; padding-block: 14px 0;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
}
.location-path a { color: inherit; text-decoration: underline; text-underline-offset: .25em; }
.location-path a:hover { color: var(--crimson); }
.location-path [aria-hidden] { color: #857c70; }
.location-path [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- Page flow (prev / next progression) ---------- */
.page-flow { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.page-flow--white { background: var(--white); }
.page-flow--paper { background: var(--paper); }
.page-flow__inner { display: grid; grid-template-columns: 1fr 1fr; }
.page-flow__link { display: grid; gap: 4px; padding: 28px 0; text-decoration: none; transition: color .2s var(--ease); }
.page-flow__link--prev { padding-right: 24px; }
.page-flow__link--next { text-align: right; justify-items: end; padding-left: 24px; border-left: 1px solid var(--line); }
.page-flow__dir { font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.page-flow__title { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 800; font-variation-settings: "wdth" 112; color: var(--text); transition: color .2s var(--ease); }
.page-flow__link:hover .page-flow__title { color: var(--crimson); }
@media (max-width: 640px) {
  .page-flow__inner { grid-template-columns: 1fr; }
  .page-flow__link { padding: 20px 0; }
  .page-flow__link--prev { padding-right: 0; }
  .page-flow__link--next { text-align: left; justify-items: start; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Footer: drawing title block ---------- */
.site-footer { padding: 64px 0 28px; background: var(--paper); border-top: 1px solid var(--line); }
.titleblock { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr .7fr; border: 1.5px solid var(--text); }
.titleblock__cell { display: grid; align-content: start; gap: 6px; padding: 18px 20px 22px; font-size: .92rem; border-left: 1px solid var(--line-strong); }
.titleblock__cell:first-child { border-left: 0; }
.titleblock__cell .label { margin-bottom: 6px; }
.titleblock__cell a { text-decoration: none; }
.titleblock__cell a:hover { color: var(--crimson); }
.titleblock__cell address { font-style: normal; color: var(--text-2); line-height: 1.5; }
.titleblock__product { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 120; line-height: 1; color: var(--crimson); }
.titleblock__cell--brand > span:nth-of-type(2) { color: var(--text-2); max-width: 26ch; }
.titleblock__mods { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--text); }
.titleblock__mods a:hover { color: var(--crimson); }
.titleblock__logo { width: 110px; margin-bottom: 4px; }
.titleblock__index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; }
.titleblock__index li { margin-bottom: 4px; }
.titleblock__cell--meta { grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 12px; }
.titleblock__cell--meta .label { margin: 0; }
.site-footer__legal { margin: 18px 0 0; font-size: .8rem; color: var(--text-2); }
@media (min-width: 561px) and (max-width: 1080px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock__cell { border-left: 0; border-top: 1px solid var(--line-strong); }
  .titleblock__cell--brand { grid-column: 1 / -1; border-top: 0; }
  .titleblock__cell--brand + .titleblock__cell { border-left: 0; }
  .titleblock__cell:nth-child(n+2):nth-child(odd) { border-left: 1px solid var(--line-strong); }
  .titleblock__cell:nth-child(2) { border-left: 0; }
}
@media (max-width: 560px) {
  .titleblock { grid-template-columns: 1fr; }
  .titleblock__cell, .titleblock__cell:nth-child(n) { border-left: 0; border-top: 1px solid var(--line-strong); }
  .titleblock__cell:first-child { border-top: 0; }
}
