:root {
  color-scheme: dark;
  --ink: #f4f1e8;
  --muted: #8d918d;
  --line: #2c302f;
  --panel: #181b1a;
  --panel-2: #202422;
  --ground: #101211;
  --lime: #c8f560;
  --lime-dark: #1d2a08;
  --amber: #ffbd66;
  --red: #ff786f;
  --blue: #7cc7ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); min-height: 100vh; }
button, select, input, textarea { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
.topbar { height: 72px; padding: 0 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(16,18,17,.94); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px); }
.brand { color: inherit; text-decoration: none; display: flex; gap: 11px; align-items: center; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #101510; background: var(--lime); border-radius: 8px; font-family: ui-monospace, monospace; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }.brand small { font-size: 10px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .12em; }
.top-actions, .playback-controls { display: flex; align-items: center; gap: 8px; }
button, select { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.quiet-button, .run-button { min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 10px; }
#world-button { display: none; }
.quiet-button:hover, .playback-controls button:hover, .outline-button:hover { border-color: #5b625e; }
kbd { font: 10px ui-monospace, monospace; color: var(--muted); border: 1px solid #3b403e; padding: 2px 4px; border-radius: 4px; }
.run-button { background: var(--lime); color: #11170d; font-weight: 750; border-color: var(--lime); }
.run-button:hover { background: #d7ff78; }.run-button.running { background: var(--red); border-color: var(--red); }.run-icon { font-size: 10px; }
.workspace { display: block; max-width: 1680px; margin: 0 auto; }
.editor-panel, .trace-panel { min-width: 0; }
.editor-panel { min-height: min(560px, calc(58vh - 36px)); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.trace-panel { padding: 28px 32px 40px; }
.panel-heading, .trace-header { padding: 22px 24px 16px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.panel-heading h1, .panel-heading h2, .trace-header h2, .dialog-header h2 { font-size: 20px; margin: 2px 0 0; letter-spacing: -.03em; }
.eyebrow { color: var(--lime); font: 700 10px ui-monospace, monospace; letter-spacing: .16em; margin: 0; }
.editor-actions { display: flex; align-items: center; gap: 12px; }.sample-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; }.sample-label select { padding: 7px 28px 7px 9px; }
.code-shell { display: grid; grid-template-columns: 44px 1fr; flex: 1; background: #131615; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.line-numbers, #source-editor { font: 15px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", monospace; padding-top: 20px; }
.line-numbers { color: #555b57; text-align: right; padding-right: 12px; border-right: 1px solid #242826; user-select: none; white-space: pre; }
#source-editor { width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: #eef5e6; padding-left: 18px; tab-size: 2; }
.editor-footer { min-height: 42px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }.compact-limits { display: flex; gap: 14px; }.compact-limits label { display: flex; align-items: center; gap: 6px; }.compact-limits input { width: 78px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.output-heading { border-bottom: 1px solid var(--line); }.status-pill { font: 700 10px ui-monospace, monospace; text-transform: uppercase; padding: 6px 9px; border-radius: 99px; }.status-pill.ready { color: var(--muted); background: #252826; }.status-pill.normal { color: var(--lime); background: var(--lime-dark); }.status-pill.trap { color: var(--red); background: #351918; }.status-pill.limit { color: var(--amber); background: #342718; }.status-pill.running { color: var(--blue); background: #162d3b; }
.trace-header { padding: 0 0 20px; align-items: center; }.playback-controls button { width: 38px; height: 34px; font-size: 18px; }.playback-controls .play-button { width: 44px; background: var(--lime); color: #11170d; border-color: var(--lime); font-size: 13px; }.playback-controls .play-button.running { background: var(--red); border-color: var(--red); }.speed-label { color: var(--muted); font-size: 10px; display: flex; align-items: center; gap: 7px; margin-left: 6px; }.speed-label select { padding: 7px; }
.stage { --stage-padding: 42px; height: clamp(430px, 48vh, 560px); min-height: 0; border: 1px solid var(--line); border-radius: 14px; background-color: #141716; background-image: radial-gradient(#313632 1px, transparent 1px); background-size: 22px 22px; display: flex; align-items: safe center; justify-content: flex-start; overflow: auto; scrollbar-gutter: stable; padding: var(--stage-padding); position: relative; }
.stage-scroll-gutter { flex: 0 0 max(0px, calc(50% - var(--stage-padding))); height: 1px; }
.stage:has(.term-stage[hidden]) .stage-scroll-gutter { display: none; }
.stage-placeholder { color: var(--muted); font-size: 12px; text-align: center; }.orbit { display: flex; gap: 9px; justify-content: center; }.orbit span { width: 9px; height: 9px; border: 1px solid #59605b; border-radius: 50%; }.orbit span:nth-child(2) { border-color: var(--lime); }
.term-stage { display: flex; align-items: baseline; gap: clamp(16px, 2.4vw, 34px); min-width: max-content; position: relative; margin-inline: auto; transition: transform var(--layout-motion-duration, .34s) cubic-bezier(.2,.8,.2,1); }.term-card { padding: 12px 2px; color: var(--lime); transition: opacity var(--fade-motion-duration, .28s), transform var(--layout-motion-duration, .34s) cubic-bezier(.2,.8,.2,1), filter var(--fade-motion-duration, .28s); will-change: transform, opacity; }.term-card.entering { opacity: 0; filter: blur(5px); }.term-card.leaving { position: absolute; z-index: 0; pointer-events: none; opacity: 1; filter: none; }.term-card.leaving.handoff-source { opacity: 0; transition: none; }.term-card[data-kind="state"] { color: var(--blue); }.term-source { font: 760 clamp(30px, 4.2vw, 68px)/1.12 ui-monospace, monospace; letter-spacing: -.055em; white-space: nowrap; }
.term-stage.instant, .term-stage.instant *, .term-stage.instant *::before, .term-stage.instant *::after { transition: none !important; animation: none !important; }
.term-stage.nested { flex-direction: column; align-items: flex-start; gap: 20px; }.nested-context-row, .nested-child-row { display: flex; align-items: baseline; gap: clamp(16px, 2.4vw, 34px); min-width: max-content; min-height: 1.2em; }.nested-child-row[data-separator="comma"] { gap: clamp(22px, 3vw, 42px); }.nested-child-row[data-separator="comma"] > .term-card:not(:last-child)::after { content: ","; margin-left: .16em; color: currentColor; font: 760 clamp(30px, 4.2vw, 68px)/1.12 ui-monospace, monospace; }.term-card.nested-child.leaving { opacity: 0; filter: blur(5px); transition: opacity var(--fade-motion-duration, .24s), filter var(--fade-motion-duration, .24s); }
.term-card.trapped, .term-card[data-kind="state"].trapped { color: var(--red); text-shadow: 0 0 30px rgba(255,120,111,.62); animation: trap-shake .46s cubic-bezier(.36,.07,.19,.97) both; }
.term-fragment, .term-state-head, .state-brace, .group-boundary, .payload-separator { display: inline-block; }.term-fragment.morph-target { opacity: .12; }.morph-ghost { position: absolute; z-index: 30; pointer-events: none; transform-origin: top left; font: 760 clamp(30px, 4.2vw, 68px)/1.12 ui-monospace, monospace; letter-spacing: -.055em; white-space: nowrap; }
@keyframes trap-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
.timeline-row { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; }.timeline-row input { flex: 1; accent-color: var(--lime); }.timeline-row span { min-width: 62px; color: var(--muted); font: 10px ui-monospace, monospace; text-align: right; }
.event-detail { min-height: 42px; padding: 11px 14px; border-left: 2px solid var(--lime); background: #181b1a; color: #c3c8c3; font: 12px/1.55 ui-monospace, monospace; }
.event-log { margin-top: 12px; border-top: 1px solid var(--line); }.event-log summary { padding: 14px 0; cursor: pointer; color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; }.event-log summary::-webkit-details-marker { display: none; }.event-log summary:hover { color: var(--ink); }.event-log-toggle { min-width: 72px; padding: 6px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--ink); font-size: 10px; }.event-log-toggle b { width: 10px; height: 10px; position: relative; }.event-log-toggle b::before, .event-log-toggle b::after { content: ""; width: 10px; height: 1px; position: absolute; top: 5px; left: 0; background: currentColor; transform: rotate(45deg); }.event-log-toggle b::after { transform: rotate(-45deg); }.event-log .closed-label { display: none; }.event-log:not([open]) .open-label { display: none; }.event-log:not([open]) .closed-label { display: inline; }.event-log:not([open]) .event-log-toggle b::before { transform: translateY(-2px) rotate(45deg); }.event-log:not([open]) .event-log-toggle b::after { transform: translateY(2px) rotate(-45deg); }.event-log ol { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow: auto; }.event-log li { display: grid; grid-template-columns: 48px 140px 1fr; gap: 12px; padding: 8px 10px; color: #aeb3af; font: 11px/1.5 ui-monospace, monospace; border-radius: 6px; }.event-log li.current { background: #262c25; color: var(--ink); }.event-index { color: #59605b; }.event-kind { color: var(--lime); }
dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); background: var(--panel); border: 1px solid #454b47; border-radius: 14px; box-shadow: 0 30px 90px #000; } dialog::backdrop { background: rgba(4,5,5,.76); backdrop-filter: blur(4px); }.dialog-shell { padding: 24px; overflow: auto; }.dialog-header { display: flex; align-items: center; justify-content: space-between; }.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 26px; }.dialog-copy { color: var(--muted); font-size: 12px; line-height: 1.5; }.file-list { display: grid; gap: 12px; margin: 22px 0 12px; }.file-card { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }.file-card-head { display: flex; gap: 8px; padding: 9px; background: #222624; }.file-card-head input { flex: 1; color: var(--ink); background: #171a18; border: 1px solid #363b38; border-radius: 5px; padding: 7px 9px; font: 12px ui-monospace, monospace; }.remove-file { color: var(--red); background: transparent; border: 0; }.file-card textarea, .directory-label textarea { width: 100%; resize: vertical; color: var(--ink); background: #141715; border: 0; border-top: 1px solid var(--line); padding: 12px; font: 12px/1.55 ui-monospace, monospace; }.outline-button { background: transparent; border-style: dashed; padding: 9px 12px; color: var(--muted); }.directory-label { display: grid; gap: 6px; margin-top: 22px; font-size: 12px; }.directory-label small { color: var(--muted); }.directory-label textarea { border: 1px solid var(--line); border-radius: 8px; }.dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 20px; }.dialog-spacer { flex: 1; }.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border: 1px solid #4e554f; border-radius: 8px; background: #242925; color: var(--ink); font-size: 12px; transition: .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.learn-section { padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 72px) 80px; border-top: 1px solid var(--line); background: #111412; }.learn-intro { max-width: 720px; margin-bottom: 30px; }.learn-intro h2 { margin: 7px 0 12px; font-size: clamp(28px, 4vw, 48px); letter-spacing: -.04em; }.learn-intro > p:last-child { max-width: 620px; color: var(--muted); font-size: 14px; line-height: 1.7; }.example-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }.example-card { min-width: 0; padding: 18px; display: grid; gap: 10px; text-align: left; border-color: var(--line); background: var(--panel); transition: transform .2s, border-color .2s, background .2s; }.example-card:hover { transform: translateY(-3px); border-color: #586159; background: var(--panel-2); }.example-card span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }.example-card code { overflow: hidden; color: var(--lime); font: 650 13px/1.5 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }.example-card small { color: #7f8781; font-size: 11px; line-height: 1.45; }.syntax-strip { margin-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }.syntax-strip div { min-width: 0; padding: 17px 18px; display: grid; gap: 7px; background: #171a18; border-right: 1px solid var(--line); }.syntax-strip div:last-child { border-right: 0; }.syntax-strip code { color: var(--blue); font: 650 13px ui-monospace, monospace; }.syntax-strip span { color: var(--muted); font-size: 10px; }
@media (max-width: 1050px) { .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.syntax-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }.syntax-strip div:nth-child(2) { border-right: 0; }.syntax-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 850px) { .editor-panel { min-height: 520px; }.trace-panel { padding: 24px 16px; }.trace-header { align-items: flex-start; flex-direction: column; }.topbar { padding: 0 14px; }.quiet-button kbd, .run-button kbd, #share-button { display: none; }.panel-heading { padding-inline: 16px; flex-wrap: wrap; align-items: flex-start; }.editor-actions { width: 100%; justify-content: space-between; }.sample-label { flex: 1; justify-content: flex-end; }.sample-label select { min-width: 0; max-width: 70%; }.editor-footer { align-items: flex-start; padding-block: 9px; flex-direction: column; }.compact-limits { width: 100%; }.stage { --stage-padding: 24px; height: 360px; min-height: 0; }.term-source { font-size: 26px; }.dialog-actions { flex-wrap: wrap; }.dialog-spacer { display: none; width: 100%; }.event-log li { grid-template-columns: 40px 110px 1fr; }}
@media (max-width: 580px) { .learn-section { padding-inline: 16px; }.example-grid, .syntax-strip { grid-template-columns: 1fr; }.syntax-strip div, .syntax-strip div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }.syntax-strip div:last-child { border-bottom: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }
