:root {
  --bg: #f4efe7;
  --bg-2: #ece4d8;
  --paper: rgba(255, 253, 249, 0.96);
  --paper-2: rgba(245, 240, 233, 0.98);
  --text: #1b1a24;
  --muted: #615f78;
  --line: rgba(26, 20, 192, 0.14);
  --line-strong: rgba(26, 20, 192, 0.42);
  --accent: #1610d8;
  --accent-2: #3d37ff;
  --glow: rgba(22, 16, 216, 0.08);
  --max: 72rem;
  --ui: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: var(--serif);
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(22, 16, 216, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.38), rgba(0,0,0,0.02)),
    linear-gradient(0deg, rgba(22,16,216,0.03) 0, rgba(22,16,216,0.03) 1px, transparent 1px, transparent 4px),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-size: auto, auto, auto 4px, auto;
  line-height: 1.7;
}

a { color: var(--accent); }
a:hover { color: #09057c; }

.home-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.home-link:hover {
  color: inherit;
}

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

.site-header,
.site-footer {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

.site-header {
  padding: 3rem 0 1.25rem;
  text-align: center;
}

.logo-wrap {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto 1rem;
}

.logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0,
    rgba(0, 0, 0, 0.22) 1px,
    rgba(255, 255, 255, 0.12) 1px,
    rgba(255, 255, 255, 0.12) 2px
  );
  mix-blend-mode: multiply;
  opacity: 0.95;
  -webkit-mask-image: url("images/avata-lg-alpha.png");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("images/avata-lg-alpha.png");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.logo {
  width: 180px;
  margin: 0;
  display: block;
  filter:
    drop-shadow(0 0 2px rgba(22, 16, 216, 0.18))
    drop-shadow(0 0 8px rgba(22, 16, 216, 0.14))
    drop-shadow(0 6px 16px rgba(22, 16, 216, 0.08));
}

.site-title,
h2,
h3,
.button,
.contact-form span,
.site-footer,
.small {
  font-family: var(--ui);
  letter-spacing: 0.06em;
}

.site-title {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.95;
  color: var(--accent);
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.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;
}

.ascii-title {
  margin: 0.5rem auto 0;
  max-width: 100%;
  display: inline-block;
  text-align: left;
  overflow-x: auto;
  padding: 0.25rem 0.5rem;
  color: #111;
  font-family: var(--ui);
  font-size: clamp(0.24rem, 0.64vw, 0.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 0 1px rgba(22, 16, 216, 0.45),
    0 0 5px rgba(22, 16, 216, 0.36),
    0 0 12px rgba(22, 16, 216, 0.24),
    0 1px 1px rgba(0, 0, 0, 0.08);
  background: transparent;
}

.site-tagline {
  margin: 0.75rem auto 0;
  max-width: 42rem;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    0 0 0 1px rgba(255,255,255,0.45),
    0 16px 30px rgba(22, 16, 216, 0.05),
    0 0 18px var(--glow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent 18%);
}

.panel::after {
  content: "∞";
  position: absolute;
  top: 0.25rem;
  right: 0.6rem;
  color: var(--accent);
  font-family: var(--ui);
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.75;
}

.panel h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1rem;
  text-transform: uppercase;
}

.panel > h2:first-child::before {
  content: "// ";
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: white;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}

.button.secondary {
  background: rgba(22, 16, 216, 0.03);
  color: var(--accent);
}

.grid {
  display: grid;
  gap: 1rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
}

.contact-form span {
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(22, 16, 216, 0.08);
}

@media (min-width: 48rem) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.site-footer {
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.prose-layout {
  max-width: 56rem;
}

.prose-layout .panel {
  padding: 1.5rem 1.75rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc li + li {
  margin-top: 0.35rem;
}

.compendium-section h2 {
  margin-top: 0;
}

.compendium-section h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--accent);
  text-transform: uppercase;
}

.compendium-section p {
  margin: 0.75rem 0;
}

.compendium-pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(241, 241, 255, 0.58);
  font-family: var(--ui);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.compendium-table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compendium-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-family: var(--ui);
  font-size: 0.92rem;
}

.compendium-table th,
.compendium-table td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.compendium-table thead th {
  background: rgba(22, 16, 216, 0.06);
  color: var(--accent);
}

.compendium-table tbody tr:nth-child(even) {
  background: rgba(22, 16, 216, 0.025);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

code {
  font-family: var(--ui);
  color: var(--accent);
}

@media (max-width: 40rem) {
  .prose-layout .panel {
    padding: 1.25rem;
  }

  .compendium-table {
    font-size: 0.84rem;
  }

  .compendium-table th,
  .compendium-table td {
    padding: 0.5rem 0.6rem;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .panel {
    box-shadow: none;
    border-color: #ddd;
    background: white;
  }

  .actions,
  .small a {
    display: none;
  }
}
