/* FreeCAN Studio site. Tokens are copied from web/src/styles.css (see DESIGN.md); keep them in step. */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-600-normal.woff2) format('woff2');
}

:root {
  color-scheme: light;

  --amber: #ffb547;
  --amber-hover: #f7a93a;
  --amber-pressed: #ec9c28;
  --deep-ochre: #8e5707;
  --ochre-control: #a56612;

  --selected-sidebar: #fce3b1;
  --selected-row: #fff3da;
  --changed-byte: #fce7c0;

  --warm-white: #f4f0e7;
  --paper: #ffffff;
  --plot-paper: #faf9f6;
  --alt-row: #faf8f4;
  --graphite: #20242b;
  --slate: #62666d;
  --hairline: #e0ddd6;
  --gridline: #ece9e2;
  --scrubber: #8a8d93;
  --unset-cell: #f3f1ec;
  --rust: #c2410c;
  --hover-wash: rgba(32, 36, 43, 0.05);

  --series-1: #a56612;
  --series-2: #2c6cb8;
  --series-3: #16875f;

  --heat-1: #e8a844;
  --heat-2: #d08b26;
  --heat-3: #b0700e;
  --heat-4: #8e5707;
  --heat-5: #6b4005;
  --heat-6: #4a2c03;

  --font-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;

  --gutter: 24px;
  --page-max: 1200px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--warm-white);
  color: var(--graphite);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--selected-sidebar);
}

a {
  color: var(--deep-ochre);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ochre-control);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

code,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

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

/* Header */

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--graphite);
  text-decoration: none;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 32px;
}

.brand strong {
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 24px;
  margin-right: auto;
}

.site-nav a {
  color: var(--graphite);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--deep-ochre);
  text-decoration: underline;
}

/* Buttons: one amber primary per page; everything else is outline or a text link. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper);
  color: var(--deep-ochre);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease-out;
}

.button:hover {
  background: var(--selected-row);
  text-decoration: none;
}

.button:active {
  background: var(--changed-byte);
}

.button.primary {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--graphite);
}

.button.primary:hover {
  border-color: var(--amber-hover);
  background: var(--amber-hover);
}

.button.primary:active {
  border-color: var(--amber-pressed);
  background: var(--amber-pressed);
}

.button.large {
  height: 52px;
  padding: 0 28px;
  font-size: 18px;
}

.text-link {
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Type */

.display {
  font-size: clamp(38px, 6.2vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.display-l {
  font-size: clamp(32px, 5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h2,
.h2 {
  font-size: clamp(24px, 3.4vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 20px;
  line-height: 28px;
}

.lead {
  color: var(--slate);
  font-size: clamp(18px, 2.2vw, 20px);
  line-height: 1.5;
}

.small {
  color: var(--slate);
  font-size: 14px;
  line-height: 22px;
}

.eyebrow {
  color: var(--slate);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.tag {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  vertical-align: middle;
}

/* Hero */

.hero {
  padding: 40px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 24px;
  justify-items: start;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 8px;
}

.trust {
  font-size: 20px;
  line-height: 30px;
  color: var(--slate);
}

.privacy-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--slate);
  font-size: 14px;
  line-height: 22px;
}

.privacy-line svg {
  flex: none;
  margin-top: 3px;
  color: var(--graphite);
}

/* Product illustration: a static, simplified drawing of the Trace view with the demo log. */

.product {
  margin: 0;
  min-width: 0;
}

.product figcaption {
  margin-top: 10px;
  color: var(--slate);
  font-size: 13px;
  line-height: 18px;
}

.pw {
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
  font-size: 13px;
  line-height: 18px;
}

.pw-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
}

.pw-doc {
  display: grid;
  min-width: 0;
}

.pw-doc strong {
  font-weight: 600;
  font-size: 14px;
}

.pw-doc span {
  color: var(--slate);
  font-size: 12px;
  white-space: nowrap;
}

.pw-switch {
  display: flex;
  margin-left: auto;
  padding: 2px;
  border-radius: 8px;
  background: var(--unset-cell);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.pw-switch span {
  padding: 2px 10px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pw-switch .on {
  border-radius: 6px;
  background: var(--paper);
  color: var(--graphite);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(32, 36, 43, 0.06), 0 0 0 1px var(--hairline), inset 0 -2px 0 var(--ochre-control);
}

.pw-body {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
}

.pw-sidebar {
  padding: 10px 8px;
  border-right: 1px solid var(--hairline);
  background: var(--warm-white);
}

.pw-group {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
}

.pw-group span {
  color: var(--slate);
  font-weight: 400;
}

.pw-id {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
}

.pw-id.wide {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.pw-id .mono {
  font-size: 11px;
}

.pw-id .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pw-id .period {
  color: var(--slate);
  font-size: 11px;
}

.pw-id.on {
  background: var(--selected-sidebar);
}

.unknown {
  color: var(--slate);
}

.unknown::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--rust);
  vertical-align: 1px;
}

.pw-main {
  min-width: 0;
}

.pw-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pw-table th {
  padding: 3px 10px;
  border-bottom: 1px solid var(--hairline);
  color: var(--slate);
  font-family: var(--font-ui);
  font-weight: 500;
  text-align: left;
}

.pw-table td {
  padding: 0 10px;
}

.pw-table tbody tr:nth-child(even) {
  background: var(--alt-row);
}

.pw-table tbody tr.on {
  background: var(--selected-row);
}

.pw-plot {
  margin: 10px 12px 12px;
  padding: 6px 12px 10px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--plot-paper);
}

.lane-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
}

.lane-head .unit {
  color: var(--slate);
  font-weight: 400;
}

.lane-head .readout {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.dot.s1 {
  background: var(--series-1);
}

.dot.s2 {
  background: var(--series-2);
}

.dot.s3 {
  background: var(--series-3);
}

.lane {
  width: 100%;
  height: 40px;
  border-bottom: 1px solid var(--gridline);
}

.lane path {
  fill: none;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.lane .cursor {
  stroke: var(--scrubber);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.line-1 {
  stroke: var(--series-1);
}

.line-2 {
  stroke: var(--series-2);
}

.line-3 {
  stroke: var(--series-3);
}

/* Sections */

.section {
  padding: 64px 0;
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin-bottom: 32px;
}

.card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
}

.privacy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  padding: 40px;
}

.privacy-copy {
  display: grid;
  gap: 16px;
  align-content: start;
}

.privacy-claim {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 20px;
  line-height: 30px;
  font-weight: 500;
}

.privacy-claim svg {
  flex: none;
  color: var(--deep-ochre);
}

.check {
  display: grid;
  gap: 12px;
  align-content: start;
}

.code {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--plot-paper);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.formats {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}

.format-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 24px;
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.format-list li {
  display: grid;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper);
  line-height: 20px;
}

.format-list strong {
  font-weight: 600;
}

.format-list span {
  color: var(--slate);
  font-size: 13px;
  line-height: 18px;
}

/* Feature rows */

.features {
  display: grid;
  gap: 24px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 32px;
}

.feature-copy {
  display: grid;
  gap: 12px;
}

.feature-copy ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.feature-visual {
  min-width: 0;
}

.decode-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 20px;
}

.decode-table caption {
  padding-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
}

.decode-table caption span {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--changed-byte);
}

.decode-table th,
.decode-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
}

.decode-table th {
  color: var(--slate);
  font-size: 12px;
  font-weight: 500;
}

.decode-table td.mono {
  color: var(--slate);
  font-size: 12px;
}

.decode-table td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.decode-table th.num {
  text-align: right;
}

.plot-visual {
  padding: 8px 16px 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--plot-paper);
}

.bit-visual {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.bit-grid {
  display: grid;
  grid-template-columns: 20px repeat(8, 22px);
  grid-auto-rows: 22px;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 22px;
  color: var(--slate);
  text-align: center;
  position: relative;
}

.bit-grid .cell {
  border-radius: 4px;
  background: var(--unset-cell);
}

.bit-grid .h1 {
  background: var(--heat-1);
}

.bit-grid .h2 {
  background: var(--heat-2);
}

.bit-grid .h3 {
  background: var(--heat-3);
}

.bit-grid .h4 {
  background: var(--heat-4);
}

.bit-grid .h5 {
  background: var(--heat-5);
}

.bit-grid .h6 {
  background: var(--heat-6);
}

.bit-grid .selection {
  grid-row: 8 / 9;
  grid-column: 3 / 7;
  position: absolute;
  inset: -3px;
  border: 2px dashed var(--graphite);
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--paper);
}

.legend {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--slate);
  font-size: 12px;
}

.legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend .swatch.h0 {
  background: var(--unset-cell);
}

.legend .never {
  margin-right: 12px;
}

.legend .swatch.h1 {
  background: var(--heat-1);
}

.legend .swatch.h2 {
  background: var(--heat-2);
}

.legend .swatch.h3 {
  background: var(--heat-3);
}

.legend .swatch.h4 {
  background: var(--heat-4);
}

.legend .swatch.h5 {
  background: var(--heat-5);
}

.legend .swatch.h6 {
  background: var(--heat-6);
}

.pro-teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 24px 32px;
}

.pro-teaser p {
  margin-right: auto;
}

/* Content pages */

.page-hero {
  padding: 40px 0 56px;
}

.page-hero .wrap {
  display: grid;
  gap: 20px;
  justify-items: start;
}

.page-hero .lead {
  max-width: 720px;
}

.page-hero .button-note {
  color: var(--slate);
  font-size: 14px;
  line-height: 22px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 24px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--warm-white);
  font-family: var(--font-mono);
  font-weight: 600;
}

.prose {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.prose ul {
  margin: 0;
  padding-left: 20px;
}

.faq {
  display: grid;
  gap: 0;
  max-width: 820px;
  padding: 8px 32px;
}

.faq-item {
  display: grid;
  gap: 8px;
  padding: 24px 0;
}

.faq-item + .faq-item {
  border-top: 1px solid var(--hairline);
}

.guide-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-links a {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 20px 24px;
  color: var(--graphite);
  text-decoration: none;
}

.guide-links a:hover {
  background: var(--selected-row);
}

.guide-links strong {
  color: var(--deep-ochre);
  font-weight: 600;
}

.guide-links span {
  color: var(--slate);
  font-size: 14px;
  line-height: 22px;
}

.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 32px;
}

.closing p {
  margin-right: auto;
}

.planned-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.planned-list li {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 24px;
}

.planned-list h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Footer */

.site-footer {
  margin-top: 32px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  line-height: 22px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.footer-grid h2 {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 22px;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li + li {
  margin-top: 4px;
}

.footer-brand {
  display: grid;
  gap: 12px;
  justify-items: start;
  color: var(--slate);
}

.footer-legal {
  display: grid;
  gap: 4px;
  margin-top: 32px;
  color: var(--slate);
  font-size: 13px;
  line-height: 20px;
}

/* Beside the hero copy the drawing is too narrow for every Trace column. */
@media (min-width: 1101px) {
  .pw-table .bus,
  .pw-table .len {
    display: none;
  }

  .pw-table th,
  .pw-table td {
    padding-right: 6px;
    padding-left: 6px;
  }
}

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    max-width: 720px;
  }
}

@media (max-width: 860px) {
  .privacy,
  .formats,
  .feature,
  .steps,
  .planned-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature,
  .privacy {
    gap: 24px;
    padding: 24px;
  }

  .faq {
    padding: 8px 24px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .pw-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .pw-sidebar,
  .pw-switch span:not(.on) {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .site-header .wrap {
    gap: 16px;
    min-height: 64px;
  }

  .site-header .wrap {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 1;
    width: 100%;
    gap: 20px;
    padding-bottom: 12px;
    margin-right: 0;
  }

  .brand {
    margin-right: auto;
  }

  .hero,
  .page-hero {
    padding: 24px 0 40px;
  }

  .section {
    padding: 40px 0;
  }

  .pro-teaser,
  .closing,
  .steps li,
  .format-card {
    padding: 20px;
  }

  .faq {
    padding: 4px 20px;
  }

  .button.large {
    width: 100%;
  }

  .pw-table .bus,
  .pw-table .len,
  .pw-table .name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
