:root {
  color-scheme: dark;

  --line: #5c2f94;
  --line-faint: rgba(92, 47, 148, 0.45);
  --line-light: #a985db;
  --panel: #141518;
  --page: #0a0b0c;
  --bar: #000;
  --text: #ececec;
  --text-2: #b8ad98;
  --on-line: #fff;
  --teal: #4fd1c5;
  --hover: rgba(92, 47, 148, 0.14);
  --selected: rgba(92, 47, 148, 0.26);

  --cut: 14px;
  --border: 2px;
  --radius: 2px;
  --gap: 16px;
  --bar-h: 64px;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

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

html { scroll-padding-top: calc(var(--bar-h) + 16px); }

/* set by i18n.js until the header is in place, avoids a flash of English text */
html[data-pending] body { visibility: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}

main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: var(--line-light); text-underline-offset: 3px; }
a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--line-light); outline-offset: 2px; }
::selection { background: var(--line); color: var(--on-line); }

* { scrollbar-color: color-mix(in srgb, var(--line) 55%, transparent) #000; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--line) 55%, transparent); }
::-webkit-scrollbar-track { background: #000; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--text-2); }
.mono { font-family: var(--mono); }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--line);
  color: var(--on-line);
}
.skip-link:focus { top: 8px; }

.noscript-bar {
  padding: 8px 16px;
  background: var(--line);
  color: var(--on-line);
  text-align: center;
}


/* Panel with cut corners. A border can't follow clip-path, so the outline is
   ::before and the fill is ::after, inset by the border width. */
.frame {
  --inner-cut: calc(var(--cut) - var(--border) * 0.5858);
  position: relative;
  isolation: isolate;
  padding: 16px;
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.frame::before {
  inset: 0;
  background: var(--line);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.frame::after {
  inset: var(--border);
  background: var(--panel);
  clip-path: polygon(0 0, calc(100% - var(--inner-cut)) 0, 100% var(--inner-cut), 100% 100%, var(--inner-cut) 100%, 0 calc(100% - var(--inner-cut)));
}
.frame--lg { --cut: 18px; }

@media (min-width: 900px) {
  .frame { padding: 20px; }
}


/* Buttons & chips */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn-primary { background: var(--line); color: var(--on-line); }
.btn-primary:hover { background: #6d3aad; color: var(--on-line); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--line-light);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip--free { border-color: var(--teal); color: var(--teal); }


/* Header */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  border-bottom: 2px solid var(--line);
}
.app-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--bar-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand img { width: 38px; height: auto; }
.brand-name {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}
.brand-name span { color: var(--text-2); font-weight: 400; }

.nav { display: flex; align-items: center; gap: 16px; }
.nav ul { margin: 0; padding: 0; list-style: none; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-list > li { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.active { background: var(--selected); box-shadow: inset 0 -3px 0 var(--line); }
.nav-link .chevron { width: 12px; height: 12px; transition: transform 0.15s; }
.nav-link[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  padding: 6px 0 !important;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dropdown.open { display: block; }
.dropdown a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
}
.dropdown a:hover { background: var(--hover); }
.dropdown a.active { background: var(--selected); box-shadow: inset 3px 0 0 var(--line); }
.dropdown strong { display: block; }
.dropdown small { display: block; color: var(--text-2); font-size: 0.85rem; line-height: 1.4; }
.dropdown hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line-faint); }

.lang {
  display: flex;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius);
}
.lang button {
  min-width: 40px;
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line-faint); }
.lang button:hover { background: var(--hover); color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--line); color: var(--on-line); }

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; margin: auto; }

@media (max-width: 899px) {
  .menu-btn { display: block; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-height: calc(100vh - var(--bar-h));
    overflow-y: auto;
    padding: 12px 16px 16px;
    background: var(--bar);
    border-bottom: 2px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-link { width: 100%; justify-content: space-between; }
  .nav-link.active { box-shadow: inset 3px 0 0 var(--line); }
  .dropdown { position: static; min-width: 0; margin: 4px 0 4px 12px; }
  .lang { align-self: flex-start; }
}


/* Page layout */

.page { padding: 32px 0 56px; }
.section { margin-top: 48px; }
.section:first-child { margin-top: 0; }
.section-title::before { content: "> "; color: var(--line-light); }

.page-header { margin-bottom: 32px; }
.page-header .lead { max-width: 70ch; color: var(--text-2); font-size: 1.1rem; }

.breadcrumb {
  margin: 0 0 16px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }

.grid { display: grid; gap: var(--gap); }

.split { display: grid; gap: var(--gap); }

@media (min-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .page { padding: 48px 0 72px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; }
}


/* Hero */

.hero { display: grid; gap: 24px; align-items: center; }
.hero h1 { margin-bottom: 8px; }
.hero .lead { max-width: 60ch; font-size: 1.1rem; }
.hero-img { justify-self: center; width: min(100%, 300px); }
.hero-img.wide { width: 100%; max-width: 460px; }

.kicker {
  margin-bottom: 12px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tagline {
  margin-bottom: 16px;
  color: var(--line-light);
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
}

.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 40px; padding: 40px; }
  .hero-img.wide { width: 420px; }
}


/* Cards */

.card { display: flex; flex-direction: column; }
.card h3 { margin-top: 4px; }
.card p { color: var(--text-2); }
.card .icon { width: 36px; height: 36px; margin-bottom: 12px; color: var(--line-light); }
.card-footer { margin-top: auto; padding-top: 16px; }
.card.dashed { padding: 20px; border: 1px dashed var(--line-faint); }

.product { gap: 4px; }
.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card h2 { font-size: 1.4rem; }
.product h2,
.product h3 { margin: 0; font-size: 1.4rem; }
.product h2 a { color: var(--text); text-decoration: none; }
.product h2 a:hover { color: var(--line-light); }
.product .card-tagline { color: var(--text); font-weight: 600; }

.more { font-weight: 600; text-decoration: none; }
.more::after { content: " →"; }
.more:hover { text-decoration: underline; }

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cta h2 { margin-bottom: 4px; }
.cta p { color: var(--text-2); }

.note {
  padding: 12px 16px;
  background: var(--selected);
  box-shadow: inset 3px 0 0 var(--line);
}

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  min-height: 36px;
  padding-left: 52px;
  counter-increment: step;
}
.steps li + li { margin-top: 18px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--line);
  color: var(--on-line);
  font-family: var(--mono);
  font-weight: 700;
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--text-2); }

.kv { width: 100%; border-collapse: collapse; }
.kv th,
.kv td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-faint);
  text-align: left;
  vertical-align: top;
}
.kv th { width: 40%; padding-right: 16px; color: var(--text-2); font-weight: 400; }
.kv tr:last-child > * { border-bottom: 0; }

@media (min-width: 640px) {
  .kv th { width: 30%; }
}

.contact-card { max-width: 640px; }


/* Wirescape plan drawing */

.plan .grid-line { stroke: var(--line-faint); stroke-width: 0.5; opacity: 0.6; }
.plan .wall { fill: none; stroke: var(--text-2); stroke-width: 3; opacity: 0.55; }
.plan .run { fill: none; stroke: var(--line-light); stroke-width: 3; stroke-linejoin: round; }
.plan .node { fill: var(--panel); stroke: var(--line-light); stroke-width: 2; }
.plan .box,
.plan .label-bg { fill: var(--line); }
.plan .label { fill: var(--on-line); font: 700 13px var(--mono); }
.plan .dim { stroke: var(--teal); stroke-width: 1; }
.plan .dim-text {
  fill: var(--teal);
  font: 11px var(--mono);
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
}


/* Screenshots + lightbox */

.shot { margin: 0; }
.shot a {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: zoom-in;
}
.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 306;
  object-fit: cover;
  transition: opacity 0.15s;
}
.shot a::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  background: var(--line) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M15 15l5 5M10 7v6M7 10h6' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0;
  transition: opacity 0.15s;
}
.shot a:hover,
.shot a:focus-visible { border-color: var(--line-light); }
.shot a:hover img { opacity: 0.85; }
.shot a:hover::after,
.shot a:focus-visible::after { opacity: 1; }
.shot figcaption { margin-top: 8px; color: var(--text-2); font-size: 0.9rem; }

html.no-scroll { overflow: hidden; }

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: none;
  color: var(--text);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.lightbox .frame {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(1600px, 100%);
  max-height: 100%;
}
.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
}
.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  border: 1px solid var(--line-faint);
}
.lb-caption { margin: 0; color: var(--text-2); text-align: center; }

.lb-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.lb-btn:hover { background: var(--line); color: var(--on-line); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-btn[hidden] { display: none; }
.lb-prev,
.lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }


/* Footer */

.footer {
  border-top: 2px solid var(--line);
  background: var(--bar);
  color: var(--text-2);
  font-size: 0.92rem;
}
.footer-cols {
  display: grid;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 32px;
}
.footer-brand { display: flex; align-items: flex-start; gap: 12px; }
.footer-brand img { flex-shrink: 0; width: 44px; height: auto; }
.footer-brand strong { display: block; color: var(--text); font-family: var(--mono); }
.footer h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin-bottom: 4px; }
.footer li a { color: var(--text-2); text-decoration: none; }
.footer li a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line-faint);
}

@media (min-width: 760px) {
  .footer-cols { grid-template-columns: 1.4fr 1fr 1fr; }
}


/* Storage notice */

.consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 90;
  max-width: 560px;
  margin-left: auto;
}
.consent[hidden] { display: none; }
.consent h2 { font-size: 1.05rem; }
.consent p { color: var(--text-2); font-size: 0.92rem; }
.consent .btn-row { margin-top: 16px; }
