/* Self-hosted fonts. Fraunces and Public Sans: SIL Open Font License 1.1.
   IBM Plex Mono: SIL Open Font License 1.1. Downloaded from Google Fonts and
   served from this origin so no third party sees visitors' requests. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("fonts/fraunces-600-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/public-sans-400-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ==========================================================================
   Typecase — shared stylesheet
   Loaded by every page. Edit design here, not in individual pages.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  --ink-navy: #161b22;
  --slate-panel: #1f2733;
  --paper: #f1ece0;
  --brass: #c9a227;
  --oxblood: #a23b3b;
  --bone: #ede6d6;

  /* Derived tones. Each meets 4.5:1 against the surface it is used on. */
  --bone-dim: #a9a292;
  --ink-dim: #5a5348;
  --rule: #2d3745;
  --rule-soft: #262f3b;
  --brass-soft: rgba(201, 162, 39, 0.14);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "Cascadia Mono",
    Menlo, Consolas, monospace;

  --wrap: 68rem;
  --wrap-narrow: 46rem;
  --radius: 4px;
  --shadow-drawer: 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

/* --- Reset -------------------------------------------------------------- */

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

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

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

img {
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Typography --------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.85rem, 1.2rem + 2.6vw, 2.9rem);
}

h2 {
  font-size: clamp(1.35rem, 1.05rem + 1.2vw, 1.75rem);
  margin-top: 2.25em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.75em;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--bone);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.1em 0.36em;
}

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

/* --- Layout scaffolding ------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brass);
  color: var(--ink-navy);
  padding: 0.6rem 1rem;
  font-weight: 600;
  z-index: 50;
}

.skip-link:focus {
  left: 0;
}

main {
  display: block;
  padding-bottom: 4rem;
}

/* --- Header / nav ------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(var(--slate-panel), var(--ink-navy));
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bone);
  text-decoration: none;
  letter-spacing: -0.015em;
}

.brand span {
  color: var(--brass);
}

.brand-mark {
  display: inline-grid;
  grid-template: repeat(2, 7px) / repeat(3, 7px);
  gap: 2px;
  align-self: center;
}

.brand-mark i {
  background: var(--brass);
  opacity: 0.55;
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) {
  opacity: 1;
}

.brand-mark i:nth-child(5) {
  opacity: 0.28;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--bone-dim);
  text-decoration: none;
}

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

/* --- Breadcrumb --------------------------------------------------------- */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding-top: 1.75rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--rule);
  margin-right: 0.5rem;
}

.breadcrumb a {
  color: var(--bone-dim);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brass);
}

/* --- Page intro --------------------------------------------------------- */

.page-head {
  padding-top: 0.75rem;
  max-width: var(--wrap-narrow);
}

.page-head h1 {
  margin-bottom: 0.35em;
}

.lede {
  font-size: 1.15rem;
  color: var(--bone-dim);
  margin-bottom: 0;
}

/* --- The workbench (input -> proof rows -> copy) ------------------------ */

.workbench {
  margin-top: 2rem;
  background: var(--slate-panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-drawer);
  overflow: hidden;
}

.workbench-input {
  padding: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 0.55rem;
}

.workbench textarea {
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
  padding: 0.85rem 0.95rem;
  background: var(--ink-navy);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.5;
}

.workbench textarea::placeholder {
  color: #6f7887;
}

.workbench textarea:focus {
  border-color: var(--brass);
  outline: none;
  box-shadow: 0 0 0 3px var(--brass-soft);
}

/* Optional per-tool controls (intensity sliders, style pickers, toggles) */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
}

.control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--bone-dim);
}

.control select,
.control input[type="number"] {
  background: var(--ink-navy);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.control input[type="range"] {
  accent-color: var(--brass);
  width: 9rem;
}

.control input[type="checkbox"] {
  accent-color: var(--brass);
  width: 1rem;
  height: 1rem;
}

/* Segmented button group. Wraps rather than overflowing: the workbench clips
   its contents, so an unwrapped group would put later options out of reach on
   a narrow screen. */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.segmented button {
  background: var(--ink-navy);
  border: 0;
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  flex: 1 0 auto;
}

.segmented button[aria-pressed="true"] {
  background: var(--brass);
  color: var(--ink-navy);
  font-weight: 600;
}

.segmented button:hover:not([aria-pressed="true"]) {
  color: var(--bone);
}

/* --- Proof rows: the paper-toned output surfaces ------------------------ */

.proofs {
  display: flex;
  flex-direction: column;
}

.proof {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
}

.proof:last-child {
  border-bottom: 0;
}

.proof-body {
  min-width: 0;
}

.proof-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 0.4rem;
}

.proof-out {
  display: block;
  background: var(--paper);
  color: var(--ink-navy);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.5;
  min-height: 2.9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.proof-out:empty::before {
  content: attr(data-empty);
  color: var(--ink-dim);
}

/* ASCII banner output needs to hold its columns, so it scrolls instead. */
.proof-out.is-block {
  white-space: pre;
  overflow-x: auto;
  font-size: 0.7rem;
  line-height: 1.05;
  letter-spacing: 0;
  tab-size: 4;
}

.copy-btn {
  align-self: end;
  background: transparent;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.copy-btn:hover {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: var(--bone);
}

.copy-btn.is-copied {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink-navy);
  font-weight: 600;
}

.copy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Visually hidden but announced by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Compartment grid (homepage + related tools) ----------------------- */

.compartments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-drawer);
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.compartment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--slate-panel);
  padding: 1.15rem 1.15rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.compartment:hover,
.compartment:focus-visible {
  background: #26303e;
  color: inherit;
}

.compartment:hover .compartment-name {
  color: var(--brass);
}

.compartment-sample {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.compartment-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bone);
  transition: color 0.15s ease;
}

.compartment-note {
  font-size: 0.9rem;
  color: var(--bone-dim);
  margin: 0;
}

/* --- Prose sections ----------------------------------------------------- */

.prose {
  max-width: var(--wrap-narrow);
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose li::marker {
  color: var(--brass);
}

.section-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0 0;
}

/* Little brass-ruled note used for platform caveats. */
.note {
  border-left: 3px solid var(--brass);
  background: rgba(201, 162, 39, 0.07);
  padding: 0.85rem 1rem;
  margin: 0 0 1.2em;
  font-size: 0.98rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note strong {
  color: var(--brass);
}

/* --- FAQ ---------------------------------------------------------------- */

.faq {
  max-width: var(--wrap-narrow);
  margin-top: 1.25rem;
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+";
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1.4;
  flex: none;
}

.faq details[open] summary::before {
  content: "\2013";
}

.faq details > p {
  margin: 0 0 1rem 1.4rem;
  color: var(--bone-dim);
}

/* --- Tables (Discord cheat sheet, character-support tables) ------------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

thead th {
  background: var(--slate-panel);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-dim);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

/* --- Guides ------------------------------------------------------------- */

.guide-body {
  max-width: var(--wrap-narrow);
}

.guide-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 1.5rem;
}

.guide-body h2 {
  margin-top: 2em;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--slate-panel);
  padding-block: 2.25rem;
  font-size: 0.94rem;
  color: var(--bone-dim);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.75rem;
}

.site-footer h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0 0 0.7rem;
  font-weight: 500;
}

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

.site-footer li {
  margin-bottom: 0.35rem;
}

.site-footer a {
  color: var(--bone-dim);
  text-decoration: none;
}

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

.footer-base {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
}

.footer-base p {
  margin: 0;
}

/* --- Ad slots ----------------------------------------------------------- */
/* Empty until AdSense units are pasted in post-approval; collapsed so the
   live site shows no gaps in the meantime. */

.ad-slot {
  margin: 2rem auto;
  max-width: var(--wrap);
  padding-inline: 1.25rem;
  text-align: center;
}

.ad-slot:empty {
  display: none;
}

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

.notfound {
  text-align: center;
  padding-block: 4rem 2rem;
  max-width: var(--wrap-narrow);
  margin-inline: auto;
}

.notfound .glyph {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 12vw, 5.5rem);
  color: var(--brass);
  line-height: 1;
  margin-bottom: 1rem;
}

/* --- Small screens ------------------------------------------------------ */

@media (max-width: 34rem) {
  body {
    font-size: 1rem;
  }

  .site-header .wrap {
    padding-block: 0.75rem;
  }

  .site-nav {
    margin-left: 0;
    width: 100%;
  }

  .site-nav ul {
    gap: 0.25rem 1rem;
    font-size: 0.9rem;
  }

  .proof {
    grid-template-columns: 1fr;
    padding-inline: 1rem;
  }

  .copy-btn {
    justify-self: stretch;
    text-align: center;
  }

  .workbench-input {
    padding: 1rem;
  }

  .compartments {
    grid-template-columns: 1fr;
  }
}

/* --- Print -------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .copy-btn,
  .ad-slot,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
