/* Trace Systems — marketing preview
   Navy #0a0f22 · Coral #ff5a4d
   Light logo (dark mark) on pale backgrounds.
   No prices or AI-kit detail on public marketing pages.
*/

:root {
  color-scheme: light;
  --navy: #0a0f22;
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --line: rgba(10, 15, 34, 0.10);
  --line-strong: rgba(10, 15, 34, 0.18);
  --text: #0a0f22;
  --muted: #5a6478;
  --muted-soft: #7a8498;
  --accent: #ff5a4d;
  --accent-soft: rgba(255, 90, 77, 0.12);
  --accent-line: rgba(255, 90, 77, 0.40);
  --danger: #dc2626;
  --radius: 12px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 68px;
  --max: 1120px;
  --page-gutter: clamp(1rem, 4vw, 2.5rem);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f22;
  --bg-elev: #12182c;
  --bg-card: #12182c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --muted: #9aa3b5;
  --muted-soft: #7a8498;
  --accent: #ff5a4d;
  --accent-soft: rgba(255, 90, 77, 0.16);
  --accent-line: rgba(255, 90, 77, 0.45);
  --danger: #f87171;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -40px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}
.skip-link:focus { top: 0.75rem; }

.section-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.section-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
}
.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
}
.lede {
  margin: 1.25rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.7rem var(--page-gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(12px);
}
.brand, .brand__logo, .footer-logo {
  background: transparent;
  box-shadow: none;
  border: 0;
}
.brand__logo,
.footer-logo {
  height: 40px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.footer-logo { height: 36px; max-width: 200px; }
img[hidden] { display: none !important; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}
.nav a { color: var(--muted); font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav__cta {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
}
.nav__cta:hover { filter: brightness(0.95); text-decoration: none; }

.theme-toggle,
.nav-toggle {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle { width: 2.4rem; height: 2.4rem; padding: 0; display: grid; place-items: center; }
.theme-toggle__icon {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--text);
  box-shadow: inset -0.28rem -0.1rem 0 0 var(--bg-elev);
}
html[data-theme="dark"] .theme-toggle__icon {
  box-shadow: none;
  background: #f5d76e;
}
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    right: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 220px;
    padding: 0.5rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(10, 15, 34, 0.12);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.65rem 0.75rem; border-radius: 8px; }
  .nav a:hover { background: var(--accent-soft); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(0.95); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.btn[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
html[data-theme="dark"] .btn[aria-pressed="true"] {
  background: #eef1f8;
  color: #0a0f22;
  border-color: #eef1f8;
}

.hero {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4rem);
  display: grid;
  gap: 1.75rem;
}
.hero__copy { max-width: 40rem; }
.hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero__sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.hero__actions--left { justify-content: flex-start; margin-top: 1rem; }
.hero__hint {
  margin: 0.9rem 0 0;
  color: var(--muted-soft);
  font-size: 0.85rem;
}

.demo-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0.9rem;
  align-items: start;
  width: 100%;
}
.demo-stage .parts-panel {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  align-self: start;
}
.viewer-shell {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #eef0f6;
  overflow: hidden;
  min-height: 420px;
  aspect-ratio: 16 / 11;
}
html[data-theme="dark"] .viewer-shell { background: #12182c; }
#viewer {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: pointer;
}
.viewer-status {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  border: 1px solid var(--line);
  color: var(--muted-soft);
  font-size: 0.72rem;
  font-family: var(--mono);
  pointer-events: none;
}
.viewer-status.is-error { color: var(--danger); }
.demo__controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: flex;
  gap: 0.4rem;
}
.demo__controls .btn { padding: 0.4rem 0.8rem; font-size: 0.82rem; }

.parts-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  min-height: 420px;
  max-height: min(62vh, 560px);
}
.parts-panel__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
}
.parts-search input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.parts-search input:focus {
  outline: 2px solid var(--accent-line);
  border-color: var(--accent);
}
.parts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.parts-list__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.parts-list__item:last-child { border-bottom: 0; }
.parts-list__item:hover,
.parts-list__item.is-active { background: var(--accent-soft); }
.parts-list__item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.parts-list__title { display: block; font-weight: 600; font-size: 0.88rem; }
.parts-list__no {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}
.part-detail { border-top: 1px solid var(--line); padding-top: 0.7rem; }
.part-detail__label {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}
.part-detail__title {
  margin: 0.3rem 0 0.2rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
}
.part-detail__no {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.part-detail__hint { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }
.parts-empty { margin: 0; font-size: 0.85rem; color: var(--muted); }

.proof {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--line);
}
.proof .section-title { margin-bottom: 1.5rem; }
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.proof-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.15rem 1.3rem;
  display: flex;
  flex-direction: column;
}
.proof-card:hover { border-color: var(--accent-line); }
.proof-card__num {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.proof-card h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.proof-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.proof-card--addon {
  margin-top: 0.9rem;
  flex-direction: row;
  gap: 1.25rem;
  align-items: flex-start;
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-card));
}
.proof-card--addon .proof-card__num { margin-bottom: 0; min-width: 4.5rem; }

.next {
  padding: clamp(2.5rem, 6vw, 4rem) 0 4rem;
  border-top: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--page-gutter) 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .section-inner.footer-inner {
  width: min(var(--max), 100%);
  max-width: var(--max);
  margin: 0; /* left-align with header brand, not centred */
  padding: 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}
.footer-logo {
  display: block;
  margin: 0;
  align-self: flex-start;
}
.footer-legal { margin: 0; font-size: 0.8rem; max-width: 40rem; line-height: 1.45; text-align: left; }
.footer-meta { margin: 0; text-align: left; }
.footer-meta a { color: var(--muted); }
.footer-meta a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .demo-stage { grid-template-columns: 1fr; }
  .demo-stage .parts-panel { position: static; }
  .viewer-shell { min-height: 360px; aspect-ratio: 4 / 5; }
  .parts-panel { max-height: none; min-height: 280px; }
}
@media (max-width: 860px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-card--addon { flex-direction: column; gap: 0.35rem; }
}
@media (max-width: 520px) {
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

.hero__trust {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent, #ff6538);
}

