:root {
  --bg: #070706;
  --panel: rgba(255, 255, 255, 0.045);
  --panel2: rgba(255, 255, 255, 0.065);
  --text: #f5f0e8;
  --dim: rgba(245, 240, 232, 0.66);
  --muted: rgba(245, 240, 232, 0.38);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #e8b86d;
  --green: #8fd6b3;
  --danger: #e88d82;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body {
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(232, 184, 109, 0.26),
      transparent 30%
    ),
    radial-gradient(
      circle at 82% 8%,
      rgba(143, 214, 179, 0.18),
      transparent 28%
    ),
    linear-gradient(180deg, #070706, #0e0b08 58%, #060504);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a {
  color: inherit;
}
.mono {
  font-family: "JetBrains Mono", monospace;
}
.nav {
  min-height: 88px;
  border-bottom: 0;
  display: flex;
  align-items: center;
  background: transparent;
  position: relative;
  z-index: 50;
}
.nav-inner {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  box-shadow: none;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-links { display:inline-flex; gap:7px; padding-right:10px; border-right:1px solid var(--line); }
.lang-links a { font:500 10px/1 "JetBrains Mono",monospace; }
.nav-actions a {
  font-size: 12px;
  text-decoration: none;
  color: var(--muted);
}
.nav-actions .download {
  color: var(--bg);
  background: var(--text);
  padding: 10px 16px;
  border-radius: 0;
  font-weight: 600;
}
.intro {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.intro h1 {
  font:
    400 clamp(52px, 8vw, 92px) / 0.92 "Instrument Serif",
    serif;
  letter-spacing: -0.045em;
  margin: 16px 0 15px;
}
.intro p {
  color: var(--dim);
  font-size: 16px;
  max-width: 690px;
  line-height: 1.65;
  margin: 0;
}
.privacy-pill {
  border: 1px solid rgba(143, 214, 179, 0.28);
  color: var(--green);
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}
.playground {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 720px;
  display: grid;
  grid-template-rows: auto 1fr;
}
.toolbar {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.toolbar-group {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.tool-button {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 0;
  font:
    500 11px/1 "JetBrains Mono",
    monospace;
  cursor: pointer;
}
.tool-button:hover,
.tool-button.active {
  border-color: rgba(232, 184, 109, 0.48);
  color: var(--text);
  background: rgba(232, 184, 109, 0.09);
}
.tool-button.primary {
  background: rgba(143, 214, 179, 0.12);
  border-color: rgba(143, 214, 179, 0.3);
  color: var(--green);
}
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}
.pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pane:first-child {
  border-right: 1px solid var(--line);
}
.pane-head {
  height: 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status {
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: none;
  letter-spacing: 0;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.status.error .status-dot {
  background: var(--danger);
}
.editor {
  width: 100%;
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: #0e0f11;
  color: #d8dce2;
  padding: 24px;
  font:
    14px/1.7 "JetBrains Mono",
    monospace;
  tab-size: 2;
}
.preview-shell {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #faf9f6;
}
.preview {
  max-width: 860px;
  margin: auto;
  padding: 38px 44px 80px;
  color: #252321;
  font:
    16px/1.75 Inter,
    -apple-system,
    sans-serif;
}
.preview h1,
.preview h2,
.preview h3 {
  font-family: "Instrument Serif", serif;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #171615;
}
.preview h1 {
  font-size: 42px;
  border-bottom: 1px solid #dedbd4;
  padding-bottom: 15px;
}
.preview h2 {
  font-size: 29px;
  margin-top: 1.7em;
}
.preview h3 {
  font-size: 21px;
}
.preview a {
  color: #9b5d25;
}
.preview code {
  font-family: "JetBrains Mono", monospace;
  background: #eeeae2;
  border-radius: 4px;
  padding: 0.16em 0.38em;
  font-size: 0.88em;
}
.preview pre {
  background: #17191d;
  color: #e7e8eb;
  border-radius: 10px;
  padding: 18px;
  overflow: auto;
  line-height: 1.55;
}
.preview pre code {
  background: transparent;
  padding: 0;
}
.preview blockquote {
  margin-left: 0;
  border-left: 3px solid var(--accent);
  padding: 5px 0 5px 18px;
  color: #6e6860;
}
.preview table {
  width: 100%;
  border-collapse: collapse;
}
.preview th,
.preview td {
  border: 1px solid #d8d4cc;
  padding: 8px 11px;
  text-align: left;
}
.preview img {
  max-width: 100%;
}
.preview hr {
  border: 0;
  border-top: 1px solid #ddd8cf;
  margin: 34px 0;
}
.preview .mermaid {
  background: #fff;
  border: 1px solid #e1ddd5;
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  overflow: auto;
}
.preview mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}
.preview-empty {
  display: grid;
  place-items: center;
  min-height: 420px;
  color: #8d8982;
  text-align: center;
}
.preview-empty strong {
  display: block;
  color: #524e48;
  margin-bottom: 5px;
}
.below {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto 90px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}
.info {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
}
.info span {
  font-size: 10px;
  color: var(--accent);
}
.info h2 {
  font:
    400 26px/1.1 "Instrument Serif",
    serif;
  margin: 12px 0 8px;
}
.info p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.cta {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  border: 1px solid rgba(232, 184, 109, 0.28);
  background: linear-gradient(
    135deg,
    rgba(232, 184, 109, 0.13),
    rgba(143, 214, 179, 0.06)
  );
  padding: 30px;
}
.cta h2 {
  font:
    400 38px/1.05 "Instrument Serif",
    serif;
  margin: 0 0 8px;
}
.cta p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.cta a {
  background: var(--text);
  color: #17120d;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 0;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  color: var(--muted);
  font-size: 11px;
}
.footer-inner {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  text-decoration: none;
}
.dark-preview .preview-shell {
  background: #17191c;
}
.dark-preview .preview {
  color: #cdd1d7;
}
.dark-preview .preview h1,
.dark-preview .preview h2,
.dark-preview .preview h3 {
  color: #f4f1eb;
}
.dark-preview .preview h1 {
  border-color: #34373c;
}
.dark-preview .preview code {
  background: #282b30;
}
.dark-preview .preview blockquote {
  color: #aeb2b8;
}
.dark-preview .preview .mermaid {
  background: #202226;
  border-color: #34373c;
}
.dark-preview .preview th,
.dark-preview .preview td {
  border-color: #3b3e44;
}
.dark-preview .preview hr {
  border-color: #34373c;
}
.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;
}
@media (max-width: 900px) {
  .intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .pane:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .editor {
    min-height: 430px;
  }
  .preview-shell {
    min-height: 500px;
  }
  .below {
    grid-template-columns: 1fr;
  }
  .cta {
    grid-column: auto;
  }
  .playground {
    min-height: 0;
  }
}
@media (max-width: 600px) {
  .nav-actions a:not(.download) {
    display: none;
  }
  .intro,
  .playground,
  .below,
  .nav-inner,
  .footer-inner {
    width: calc(100% - 20px);
  }
  .intro {
    padding-top: 42px;
  }
  .intro h1 {
    font-size: 46px;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .workspace {
    display: block;
  }
  .editor {
    min-height: 370px;
  }
  .preview {
    padding: 25px 20px 60px;
  }
  .preview h1 {
    font-size: 34px;
  }
  .preview-shell {
    min-height: 440px;
  }
  .below {
    margin-bottom: 60px;
  }
  .cta {
    align-items: flex-start;
    flex-direction: column;
  }
  .footer-inner {
    flex-direction: column;
  }
  .footer-links {
    flex-wrap: wrap;
  }
}
