:root {
  --ink: #1a1a1a;
  --muted: #555;
  --line: #e3e3e3;
  --link: #0b57d0;
  --bg: #fff;
  --code-bg: #f6f8fa;
  --maxw: 46rem;
}

* { box-sizing: border-box; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--link); }

/* header / footer */
.site-header {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.brand { font-weight: 600; text-decoration: none; color: var(--ink); }
.site-header nav a { margin-left: 1.1rem; text-decoration: none; color: var(--link); }
.site-header nav a[aria-current="page"] { font-weight: 700; }

.site-footer {
  margin-top: 4rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

/* content */
main.wrap { padding-top: 2.5rem; padding-bottom: 1rem; }

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 2.2rem 0 .6rem; }
.lead { color: var(--muted); margin: 0 0 2rem; }

/* cipher form */
.tool { margin: 1.5rem 0 2.5rem; }
.tool label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin: 1rem 0 .35rem;
}
.tool textarea,
.tool select {
  width: 100%;
  font: .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: .6rem;
  border: 1px solid #999;
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
}
.tool textarea { resize: vertical; min-height: 8.5rem; }
.tool select { font-family: inherit; }
#result { background: var(--code-bg); }
.result-label { font-weight: 600; font-size: .95rem; margin: 1rem 0 .35rem; }

/* prose bits */
table.rot13 { border-collapse: collapse; margin: .5rem 0; }
table.rot13 th, table.rot13 td {
  border: 1px solid var(--line);
  padding: .3rem .8rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
table.rot13 td:last-child { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

pre.code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.note { color: var(--muted); font-size: .9rem; }
