/* Oqedra — one dark page system. Typefaces are set in fonts.css.
   Signal Red marks the change: the cube facet, primary actions, evidence. Keep it rare. */

:root {
  color-scheme: dark;
  --ink: #12140f;
  --graphite: #23261f;
  --steel: #8a8d84;
  --bone: #eceae3;
  --signal: #f2443a;
  --rule: #2c2f27;

  --gutter: 16px;
  --measure: 62ch;
  --max: 1120px;
}

@media (min-width: 720px) {
  :root { --gutter: 40px; }
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--bone);
  text-decoration-color: var(--steel);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-color: var(--signal); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 12px;
  background: var(--bone);
  color: var(--ink);
}
.skip:focus { top: 8px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Frame: hairline borders left and right, rules between sections. */
.frame {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 24px var(--gutter);
  border-bottom: 1px solid var(--rule);
}

/* Wordmark: the cube stands in for the silent O, QEDRA is tracked wide. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--bone);
  text-decoration: none;
}
/* oqedra-logo.svg is the supplied mark, unedited: a 330-unit square with the
   cube (183 x 210 units) centred on an Ink background. Size the square so the
   cube matches the cap height, then cancel the padding around it. */
.cube {
  width: 1.21em;
  height: 1.21em;
  margin: 0 -0.09em 0 -0.27em;
  align-self: baseline;
  transform: translateY(0.255em);
}
.wordmark span { position: relative; } /* paint over the logo's square */

.site-nav ul {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}
.site-nav a {
  color: var(--steel);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--bone); }

main { flex: 1; }

/* Sections */
.section {
  padding: 64px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .section { padding: 96px var(--gutter); }
}
.section > * { max-width: var(--measure); }
.section > .wide { max-width: none; }

h1, h2 {
  font-family: var(--display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.04;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw + 0.5rem, 4.75rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.625rem, 2vw + 1rem, 2.375rem);
  line-height: 1.1;
  margin-bottom: 32px;
}
h2 + p { margin-top: -12px; }

p { margin: 0 0 16px; }

.lede {
  font-size: 1.3125rem;
  line-height: 1.45;
  margin-top: 32px;
}
.aside { color: var(--steel); }

/* Hero: copy on the left, evidence on the right, over an isometric grid. */
.hero {
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='69.282' height='40'%3E%3Cpath d='M0 0L69.282 40M0 40L69.282 0M0 0V40M34.641 0V40' stroke='%23eceae3' stroke-opacity='.07' fill='none'/%3E%3C/svg%3E");
  background-position: right top;
  -webkit-mask-image: linear-gradient(to left, #000 15%, transparent 75%);
  mask-image: linear-gradient(to left, #000 15%, transparent 75%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-copy > :last-child { margin-bottom: 0; }

@media (min-width: 960px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    align-items: end;
  }
  .hero > * { max-width: none; }
  .hero-copy > * { max-width: var(--measure); }
}

/* Evidence log */
.evidence {
  margin: 48px 0 0;
  background: var(--graphite);
  border: 1px solid var(--rule);
}
@media (min-width: 960px) {
  .evidence { margin: 0; }
}
.evidence pre {
  margin: 0;
  padding: 20px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78125rem;
  line-height: 1.85;
  color: var(--bone);
}
@media (min-width: 480px) {
  .evidence pre { padding: 24px; font-size: 0.8125rem; }
}
.evidence .k { color: var(--steel); }
.evidence .qed {
  color: var(--signal);
  font-size: 1.4em;
  line-height: 1;
}
.evidence figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--steel);
}
@media (min-width: 480px) {
  .evidence figcaption { padding: 12px 24px; }
}

/* Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: 40px;
}
.button {
  display: inline-block;
  padding: 14px 22px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  background: var(--signal);
  color: var(--ink);
}
.button:hover { background: #f5615a; }
.text-link { font-weight: 500; }

/* The loop: numbered list, one row on wide screens. */
.loop {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.loop li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.5ch 1fr;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.loop li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--steel);
}
@media (min-width: 960px) {
  .loop {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: 24px;
  }
  .loop li {
    display: block;
    padding: 16px 0 0;
    border-top-color: var(--steel);
  }
  .loop li::before {
    display: block;
    margin-bottom: 12px;
  }
}

/* Where other tools stop */
.compare {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.compare th,
.compare td {
  padding: 16px 16px 16px 0;
  border-top: 1px solid var(--rule);
  vertical-align: top;
  font-weight: 400;
}
.compare tr:last-child > * { border-bottom: 1px solid var(--rule); }
.compare thead th {
  padding-top: 0;
  border-top: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--steel);
}
.compare tbody td:nth-child(2) { color: var(--steel); }
.compare tbody td:last-child { font-weight: 500; }

/* Plain lists with a bold lead-in. */
.points {
  margin: 0;
  padding: 0;
  list-style: none;
}
.points li {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.points li:last-child { border-bottom: 1px solid var(--rule); }
.points strong { font-weight: 600; }

.plain-list {
  margin: 0;
  padding-left: 1.25em;
}
.plain-list li { margin-bottom: 12px; }
.plain-list li::marker { color: var(--steel); }

/* A change request. The red rule marks it as the change under test. */
.example {
  margin: 32px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--signal);
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1.4;
}
.example p { margin: 0; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 28px var(--gutter);
  font-size: 0.875rem;
  color: var(--steel);
}
.site-footer p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.site-footer .cube {
  width: 24px;
  height: 24px;
  margin: -4px -5px;
  transform: none;
}
.site-footer a { color: var(--steel); }
