/* Ledra — ledra.xyz
   Single dark theme, deliberately: the product lives inside Discord's dark
   chrome, and the mark's gradient carries the colour so the page doesn't
   have to. No webfonts, no JavaScript, no external requests of any kind. */

:root {
  --void:    #0a0c11;
  --surface: #11141b;
  --raised:  #161a23;
  --edge:    #1e2330;
  --edge-hi: #2b3242;
  --text:    #e9ebf1;
  --muted:   #868fa1;
  --dim:     #5d6675;
  --indigo:  #5865f2;
  --violet:  #a06bff;
  --green:   #57f287;
  --amber:   #fee75c;
  --red:     #ed4245;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --measure: 74rem;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--indigo); color: #fff; padding: .7rem 1.1rem;
  font-weight: 600;
}
.skip:focus { left: .75rem; top: .75rem; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------------- nav ---------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 12, 17, 0.88);
  border-bottom: 1px solid var(--edge);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

/* The mark stands alone - no wordmark beside it - so it carries the whole
   brand at this spot and is sized accordingly. The crest is taller than wide
   (100 x 116), so only the width is set and the height follows. */
.brand {
  display: flex; align-items: center;
  text-decoration: none;
  flex: none;
}
.brand svg { width: 40px; height: auto; display: block; }
footer .brand svg { width: 46px; }

.nav-links {
  display: flex; align-items: center; gap: 1.5rem;
  margin-left: auto;
  list-style: none; margin-block: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); }

.ext::after {
  content: "↗";
  font-size: .78em;
  margin-left: .28em;
  color: var(--dim);
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .68rem 1.2rem;
  font: inherit; font-size: .93rem; font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(120deg, var(--indigo), var(--violet));
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  border-color: var(--edge-hi);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }

/* ---------------- section rhythm ---------------- */

section { border-top: 1px solid var(--edge); }
section > .wrap { padding-block: clamp(3.5rem, 8vw, 6rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -.028em;
  line-height: 1.15;
  margin: 0 0 1rem;
  text-wrap: balance;
  max-width: 22ch;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0;
}
/* Spacing lives in the stylesheet, never in a style="" attribute — that is
   what lets the shipped CSP forbid inline styles outright. */
.lede + .lede { margin-top: 1rem; }
#safety .lede { margin-bottom: 2.5rem; }

/* ---------------- hero ---------------- */

.hero > .wrap {
  padding-block: clamp(3.5rem, 9vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4rem);
  font-weight: 800;
  letter-spacing: -.038em;
  line-height: 1.03;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.hero .lede { font-size: 1.12rem; }

.hero-actions {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin-top: 2rem;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin: 2.25rem 0 0;
  padding: 0; list-style: none;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--dim);
}
.hero-meta b {
  display: block;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* ---------------- case transcript ---------------- */

.transcript {
  background: var(--surface);
  border: 1px solid var(--edge);
  font-size: .88rem;
}

.transcript-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--dim);
}
.transcript-bar .hash { color: var(--dim); font-size: 1rem; line-height: 1; }

.transcript-body { padding: 1.1rem .9rem; display: grid; gap: 1.1rem; }

.msg { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .7rem; }

.msg .who {
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  border-radius: 50%;
  background: var(--edge);
  color: var(--muted);
}
/* The avatar disc is the mark's own ground, so it carries the brand
   gradient directly rather than the interface accent tokens. */
.msg .who.bot { background: linear-gradient(135deg, #0b1d67, #802acd); }
.msg .who.bot svg { width: 15px; height: 15px; display: block; }

.msg .line { min-width: 0; }
.msg .name { font-weight: 650; font-size: .86rem; }
.msg .name span {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--indigo);
  color: #fff;
  padding: .1rem .3rem;
  margin-left: .4rem;
  vertical-align: .1em;
}
.msg .cmd {
  font-family: var(--mono);
  color: var(--muted);
  margin-top: .15rem;
  overflow-wrap: anywhere;
}
.msg .cmd b { color: var(--violet); font-weight: 500; }

.embed {
  margin-top: .45rem;
  border-left: 3px solid var(--indigo);
  background: var(--raised);
  padding: .65rem .8rem;
}
.embed.warn { border-left-color: var(--amber); }
.embed .title { font-weight: 650; font-size: .84rem; }
.embed .row {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  margin-top: .3rem;
  font-variant-numeric: tabular-nums;
}
.embed .row em { color: var(--text); font-style: normal; }

/* ---------------- thesis split ---------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.ledger {
  border: 1px solid var(--edge);
  background: var(--surface);
}
.ledger-head, .ledger tr > * { font-variant-numeric: tabular-nums; }
.ledger table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ledger th, .ledger td {
  text-align: left;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--edge);
}
.ledger th {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
}
.ledger tr:last-child td { border-bottom: 0; }
.ledger td.case { font-family: var(--mono); color: var(--violet); }
.ledger .tag {
  font-family: var(--mono);
  font-size: .68rem;
  padding: .1rem .4rem;
  border: 1px solid var(--edge-hi);
  color: var(--muted);
}
.table-scroll { overflow-x: auto; }

/* ---------------- feature grid ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  margin-top: 2.75rem;
}
.cell {
  background: var(--void);
  padding: 1.6rem 1.5rem 1.75rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.cell h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
.cell p { margin: 0; color: var(--muted); font-size: .91rem; }
.cell .cmds {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--dim);
  margin-top: auto;
  padding-top: .9rem;
  overflow-wrap: anywhere;
}

/* ---------------- safety ---------------- */

.levels { display: grid; gap: 1px; background: var(--edge); border: 1px solid var(--edge); }
.level {
  background: var(--void);
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 12rem) minmax(0, 1fr);
  gap: 1rem;
  padding: .95rem 1.2rem;
  align-items: baseline;
}
.level .n {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.level .t { font-weight: 650; font-size: .95rem; }
.level .d { color: var(--muted); font-size: .89rem; }

.guards { list-style: none; margin: 2.25rem 0 0; padding: 0; display: grid; gap: .8rem; }
.guards li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: .7rem;
  color: var(--muted);
  font-size: .93rem;
}
.guards .k { color: var(--green); font-family: var(--mono); font-weight: 700; }
.guards b { color: var(--text); font-weight: 600; }

/* ---------------- behaviour table ---------------- */

.behaviour { width: 100%; border-collapse: collapse; margin-top: 2.5rem; font-size: .92rem; }
.behaviour th, .behaviour td {
  text-align: left; padding: .85rem .9rem;
  border-bottom: 1px solid var(--edge);
  vertical-align: top;
}
.behaviour thead th {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  white-space: nowrap;
}
.behaviour tbody th { font-weight: 650; white-space: nowrap; }
.behaviour td { color: var(--muted); }

/* ---------------- price ---------------- */

.price-line {
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  margin: 0 0 1rem;
}
.price-line .amount {
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.badge {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid var(--green);
  padding: .2rem .5rem;
}

/* ---------------- cta ---------------- */

.cta > .wrap { text-align: left; }
.cta h2 { max-width: 26ch; }
.cta .lede { margin-bottom: 2rem; }
.cta .hero-actions { margin-top: 0; }

/* ---------------- legal pages ---------------- */

.legal > .wrap { padding-block: clamp(2.5rem, 6vw, 4.5rem) 5rem; }

.legal h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.12;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.legal-meta {
  display: grid;
  gap: .3rem;
  margin: 0 0 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--edge);
  background: var(--surface);
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
}
.legal-meta b { color: var(--text); font-weight: 600; }

.lang-switch {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin: 0 0 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--edge);
}
.lang-switch a {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--edge-hi);
  padding: .35rem .7rem;
}
.lang-switch a:hover { color: var(--text); border-color: var(--muted); }

.prose { max-width: 68ch; }

.prose h1 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 750;
  letter-spacing: -.025em;
  margin: 4rem 0 1.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--edge-hi);
}
.prose h1:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.prose h2 {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -.008em;
  margin: 2.5rem 0 .75rem;
  max-width: none;
}

.prose h3 { font-size: .98rem; font-weight: 650; margin: 1.75rem 0 .5rem; }

.prose p, .prose ul, .prose ol { margin: 0 0 1.05rem; color: var(--muted); }
.prose li { margin: .3rem 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--violet); }

.prose hr {
  border: 0;
  border-top: 1px solid var(--edge);
  margin: 2.5rem 0;
}

.prose code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface);
  border: 1px solid var(--edge);
  padding: .1em .35em;
  color: var(--text);
}

.prose blockquote {
  margin: 0 0 1.05rem;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--edge-hi);
  color: var(--dim);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  margin: 0 0 1.5rem;
}
.prose th, .prose td {
  text-align: left;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--edge);
  vertical-align: top;
  color: var(--muted);
}
.prose th {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
}

.prose .todo {
  border: 1px solid var(--amber);
  color: var(--amber);
  background: rgba(254, 231, 92, .06);
  padding: .9rem 1.1rem;
  margin: 0 0 1.5rem;
  font-size: .9rem;
}
.prose .todo b { color: var(--amber); }

/* ---------------- footer ---------------- */

footer { border-top: 1px solid var(--edge); }
footer .wrap {
  padding-block: 2.5rem 3.5rem;
  display: flex; flex-wrap: wrap; gap: 2rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}
footer nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  font-size: .9rem;
}
footer .brand { margin-bottom: .8rem; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }
footer .fine {
  color: var(--dim);
  font-size: .82rem;
  font-family: var(--mono);
}

/* ---------------- responsive ---------------- */

@media (max-width: 62rem) {
  .hero > .wrap { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
  .nav .wrap { min-height: 3.5rem; gap: .75rem 1rem; }
  .nav-links { gap: 1.1rem; order: 3; width: 100%; margin-left: 0; padding-bottom: .7rem; }
  .nav .btn { margin-left: auto; }
  .level { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .level .d { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
