/* site.css - layout and components. Every colour resolves from tokens.css; no literals here. */

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

/* An author display value (.btn is inline-flex) would otherwise beat the UA's [hidden]. */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* No italics anywhere: the brand forbids them in UI and none of the faces ship one. */
i,
em,
cite,
dfn,
address {
  font-style: normal;
}

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

a {
  color: var(--interactive);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

:focus:not(:focus-visible) {
  outline: none;
}

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

code {
  font-size: 0.9em;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--interactive);
  color: var(--interactive-text);
  font-family: var(--font-sans);
  font-size: var(--step-n1);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

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

/* ---------- type ---------- */

h1,
h2,
h3 {
  font-family: var(--font-sans);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-weight: 700;
  font-size: var(--step-3);
  letter-spacing: var(--track-display);
  line-height: 1.04;
}

h2 {
  font-weight: 600;
  font-size: var(--step-2);
  letter-spacing: var(--track-heading);
  line-height: 1.18;
}

h3 {
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: 0.005em;
  line-height: 1.35;
}

p {
  margin: 0;
  max-width: var(--measure);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--step-n2);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-subtle);
}

.note {
  font-family: var(--font-sans);
  font-size: var(--step-n1);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: var(--measure);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* The masthead rule: a short seal bar over a page title. One per page. */
.masthead-rule {
  display: block;
  width: 40px;
  height: 0;
  border: 0;
  border-top: 2px solid var(--accent-seal);
  margin: 0;
}

/* ---------- the mark ---------- */

.mark-tile {
  fill: var(--accent-seal);
}

.mark-glyph {
  fill: var(--bg-page);
}

.mark-shoulder {
  fill: none;
  stroke: var(--bg-page);
  stroke-width: 8.5;
  stroke-linecap: round;
}

/* ---------- site header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 16px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.lockup:hover {
  text-decoration: none;
}

.lockup svg {
  display: block;
  flex: none;
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wordmark .tld {
  color: var(--text-subtle);
  font-weight: 500;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--step-n1);
  font-weight: 500;
}

.site-nav a {
  display: inline-block;
  padding-block: 6px;
  text-decoration: none;
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding-inline: 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--step-n1);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) ease, border-color var(--dur) ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--interactive);
  border-color: var(--interactive);
  color: var(--interactive-text);
}

.btn-primary:hover {
  background: var(--interactive-hover);
  border-color: var(--interactive-hover);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-control);
  color: var(--text);
  min-height: 34px;
  padding-inline: 14px;
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn[aria-disabled="true"] {
  color: var(--text-disabled);
  border-color: var(--border);
  background: transparent;
  cursor: default;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  padding-block: 56px 64px;
  align-items: start;
}

@media (min-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 48px;
    padding-block: 72px 80px;
  }
}

.hero-demo {
  min-width: 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 1000px) {
  .hero-copy {
    padding-top: 12px;
  }
}

.hero-sub {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 36ch;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 6px;
}

.cta .note {
  max-width: 32ch;
}

/* ---------- the encrypt terminal ---------- */

.term {
  background: var(--term-bg);
  border: 1px solid var(--term-rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-term);
  min-width: 0;
}

.term .mark-tile {
  fill: var(--term-sigil);
}

.term .mark-glyph {
  fill: var(--term-bg);
}

.term .mark-shoulder {
  stroke: var(--term-bg);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--term-chrome);
  border-bottom: 1px solid var(--term-rule);
  padding: 9px 12px;
}

.term-bar svg {
  display: block;
  flex: none;
}

.term-path {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--term-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-state {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--term-dim);
  white-space: nowrap;
}

.term-state[data-state="running"] {
  color: var(--term-fg);
}

.term-state[data-state="done"] {
  color: var(--term-ok);
}

.term-body {
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 0.42rem + 0.72vw, 0.8rem);
  line-height: 1.72;
  color: var(--term-fg);
  padding: 18px 16px 20px;
  overflow-x: auto;
  min-height: 19em;
}

@media (min-width: 1000px) {
  .term-body {
    font-size: 0.78rem;
  }
}

.term-body pre {
  margin: 0;
  font: inherit;
  white-space: pre;
}

.term-body:focus-visible {
  outline-color: var(--term-fg);
  outline-offset: -3px;
}

.ln {
  display: block;
  min-height: 1.72em;
}

.t-sigil {
  color: var(--term-sigil);
}

.t-dim {
  color: var(--term-dim);
}

.t-ok {
  color: var(--term-ok);
}

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--term-fg);
  margin-left: 1px;
}

/* Four blinks, then it rests visible: nothing on the page blinks past five seconds. */
.cursor.blink {
  animation: blink 1.06s steps(1, end) 4;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.term-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  margin-top: 14px;
}

.term-foot .note {
  flex: 1 1 300px;
}

/* ---------- spec-sheet sections ---------- */

.sheet {
  border-top: 1px solid var(--border);
  padding-block: 52px;
}

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

@media (min-width: 860px) {
  .sheet-grid {
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 12px 40px;
  }

  .sheet-grid > .label {
    position: sticky;
    top: 20px;
    align-self: start;
    padding-top: 6px;
  }
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.sheet-body > h3 {
  margin-top: 14px;
}

/* ---------- code ---------- */

.code {
  margin: 0;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: var(--step-n1);
  line-height: 1.7;
  color: var(--text);
  max-width: 100%;
}

.code .c {
  color: var(--text-muted);
}

.code-pair {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-pair .label {
  color: var(--text-muted);
}

/* A request line is case-sensitive, so it is never uppercased like a label. */
.code-pair .path {
  font-family: var(--font-mono);
  font-size: var(--step-n1);
  color: var(--text-muted);
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
  max-width: var(--measure);
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  gap: 4px 12px;
  padding-block: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--step-n1);
  line-height: 1.55;
  color: var(--text-muted);
}

.steps li:last-child {
  border-bottom: 1px solid var(--border);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step-n2);
  font-weight: 500;
  letter-spacing: var(--track-label);
  color: var(--text-subtle);
  padding-top: 2px;
}

.steps strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: var(--step-0);
}

/* ---------- lists ---------- */

.list {
  margin: 0;
  padding-left: 1.15em;
  max-width: var(--measure);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
}

.list li + li {
  margin-top: 12px;
}

.list li::marker {
  color: var(--text-subtle);
}

.list strong {
  font-family: var(--font-sans);
  font-weight: 600;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.table-wrap:focus-visible {
  outline-offset: 4px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-family: var(--font-sans);
  font-size: var(--step-n1);
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

thead th {
  font-family: var(--font-mono);
  font-size: var(--step-n2);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-subtle);
  border-bottom-color: var(--border-strong);
}

tbody th {
  font-weight: 600;
  color: var(--text);
}

td {
  color: var(--text-muted);
}

td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}

.wire {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step-n2);
  font-weight: 400;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Brass marks a paid tier: a hairline, never a fill, never decoration. */
tr.paid th {
  box-shadow: inset 2px 0 0 var(--paid-brass);
  padding-left: 12px;
}

tr.free th {
  padding-left: 12px;
}

/* ---------- closing call ---------- */

.closing {
  border-top: 1px solid var(--border);
  padding-block: 56px 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}

.closing h2 {
  font-size: var(--step-2);
}

/* ---------- page header (inner pages) ---------- */

.page-head {
  padding-block: 56px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-head .lede {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 52ch;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--text);
  margin-top: 8px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 28px 44px;
  font-family: var(--font-mono);
  font-size: var(--step-n2);
  line-height: 1.8;
  color: var(--text-subtle);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- 404 ---------- */

.lost {
  padding-block: 80px 96px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .cursor.blink {
    animation: none;
  }

  .btn {
    transition: none;
  }
}
