/* DeSoware shared primitives. The page builds on these; site.css only
   adds page specific layout and sections. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 10px); }
body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
h1, h2, h3, h4 { margin: 0 0 var(--sp-3); line-height: 1.18; color: var(--ink); font-family: var(--display); }
h1 { font-size: var(--fs-hero); font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent); }
small, .muted { color: var(--ink-3); font-size: var(--fs-sm); }
.mono { font-family: var(--mono); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* focus ring, one look everywhere */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* reduced motion kill switch: covers every current and future animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  html { scroll-behavior: auto; }
}

/* thin themed scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ── layout ── */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--sp-5); }
.grid { display: grid; gap: var(--sp-4); }
.row { display: flex; gap: var(--sp-3); align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.right { margin-left: auto; }
.num { font-variant-numeric: tabular-nums; }

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.topbar .wrap { display: flex; align-items: center; gap: var(--sp-4); height: var(--header-h); }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.brand-mark { display: block; width: 44px; height: 44px; flex: none; margin: -4px 0; }
/* One flex item so the name never gets pulled apart by the flex gap. The D and
   the S are the emblem's own letterforms dropped into the word, so people can
   see where the mark comes from; the remaining letters carry a brushed metal
   gradient to match. Darkest band of each gradient stays above 6:1 on --bg. */
.brand-name { white-space: nowrap; display: inline-flex; align-items: baseline; }
.brand-name .glyph {
  /* cap height of Space Grotesk, so the artwork letters sit level with the
     typeset ones; align-self baseline puts their feet on the text baseline */
  height: .72em; width: auto; align-self: baseline;
  margin: 0 .03em;
}
.brand-name .lit {
  background-clip: text; -webkit-background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.brand-name .lit.silver {
  background-image: linear-gradient(172deg, #ffffff 0%, #d3d9e1 30%, #9aa3af 50%, #f2f5f8 68%, #c2c9d3 100%);
}
.brand-name .lit.gold {
  background-image: linear-gradient(172deg, #fff6d8 0%, #ecd482 30%, #c9a227 50%, #fbeab4 68%, #d9b64e 100%);
}
/* if background-clip:text is unsupported the text would vanish, so paint it */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .brand-name .lit { color: var(--silver); -webkit-text-fill-color: var(--silver); }
  .brand-name .lit.gold { color: var(--gold); -webkit-text-fill-color: var(--gold); }
}
@keyframes caret { 50% { opacity: 0; } }
.topbar nav { display: flex; gap: var(--sp-1); margin-left: var(--sp-4); }
.topbar nav a {
  color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600;
}
.topbar nav a:hover { color: var(--ink); background: var(--card-2); }
.topbar nav a.active { color: var(--ink); background: var(--card-2); }

/* language toggle */
.lang-toggle { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.lang-toggle button {
  background: none; border: 0; color: var(--ink-2); padding: 5px 10px; cursor: pointer;
  font-size: var(--fs-xs); font-weight: 700; font-family: var(--font);
}
.lang-toggle button.active { background: var(--accent); color: var(--ink-inv); }

/* ── cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 20px; font-size: var(--fs-sm); font-weight: 700; font-family: var(--font);
  cursor: pointer; text-decoration: none; transition: background var(--speed), border-color var(--speed), transform var(--speed);
}
.btn:hover { background: var(--card-hover); border-color: var(--line); }
.btn.primary {
  background: var(--accent); color: var(--ink-inv); border-color: transparent;
}
.btn.primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn.sm { padding: 6px 12px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── forms ── */
.fld { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.fld > span { display: block; margin-bottom: 5px; }
/* option rows inside a field read as content, not as field labels */
.fld .row { font-weight: 400; color: var(--ink); font-size: var(--fs-sm); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--font); font-size: var(--fs-md); color: var(--ink); background: var(--card-2);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type="range"] { padding: 0; accent-color: var(--accent); background: none; border: 0; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.fld-row { display: grid; gap: var(--sp-3); }
@media (min-width: 720px) { .fld-row.c2 { grid-template-columns: 1fr 1fr; } .fld-row.c3 { grid-template-columns: 1fr 1fr 1fr; } }

/* segmented control */
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2);
  transition: background var(--speed), color var(--speed);
}
.seg button.active { background: var(--accent); color: var(--ink-inv); }

/* ── tables ── */
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th button.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.tbl-scroll { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-md); }

/* ── price breakdown ── */
.qlines { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.qlines td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
.qlines td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qlines .total td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; font-size: var(--fs-md); padding-top: 10px; color: var(--ink); }
.qlines .total td.num { color: var(--accent); }

/* ── chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.neutral { color: var(--ink-2); background: var(--card-2); }
.chip.ok      { color: var(--ok);   background: color-mix(in srgb, var(--ok) 14%, transparent); }
.chip.warn    { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip.bad     { color: var(--bad);  background: color-mix(in srgb, var(--bad) 14%, transparent); }
.chip.sample  { color: var(--accent-b); background: color-mix(in srgb, var(--accent-b) 13%, transparent); }

/* ── misc ── */
.empty { text-align: center; color: var(--ink-3); padding: var(--sp-6); font-size: var(--fs-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: 8px; top: 8px; z-index: 200;
  background: var(--accent); color: var(--ink-inv); font-weight: 700;
  padding: 10px 16px; border-radius: var(--r-md); text-decoration: none;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }
.divider { height: 1px; background: var(--line-2); margin: var(--sp-4) 0; }
.skeleton { background: linear-gradient(90deg, var(--card-2) 25%, var(--card-hover) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: sk 1.1s infinite; border-radius: var(--r-sm); min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── mobile nav drawer ── */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 8px; flex: none;
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--ink-2); transition: transform .2s, opacity .2s; }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 95; background: rgba(4, 8, 12, .6);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .topbar nav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 96;
    width: min(290px, 82vw);
    margin: 0; padding: 84px var(--sp-4) var(--sp-5);
    display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
    background: var(--card); border-right: 1px solid var(--line-2); box-shadow: var(--shadow-3);
    transform: translateX(-102%);
    /* visibility keeps the closed drawer out of the tab order; the delay
       lets the slide out finish before it hides */
    visibility: hidden; transition: transform .22s ease-out, visibility 0s .22s;
  }
  body.nav-open .topbar nav { transform: none; visibility: visible; transition: transform .22s ease-out; }
  .topbar nav a { font-size: var(--fs-md); padding: 12px 14px; border-radius: var(--r-md); }
  .topbar { z-index: 97; }
}
@media (max-width: 719px) {
  .brand { font-size: 1rem; gap: 8px; }
  .brand-mark { width: 38px; height: 38px; }
}
