/* What hdru's Style has no words for, in the design of hd-lang's site ("Orbit",
   website/assets/style.css): hover, focus and active states, single borders,
   pseudo-elements, media queries and syntax colors. The shell's surfaces and
   text colors are its own Style, from its Palette, in the same colors. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light dark;
  --bg: light-dark(#f7fafa, #0b0f14);
  --bg-soft: light-dark(#edf3f3, #121920);
  --bg-raised: light-dark(#ffffff, #10161d);
  --border: light-dark(#dfe8e8, #1a232c);
  --border-strong: light-dark(#c6d4d4, #2a3742);
  --text: light-dark(#18222b, #dbe6e8);
  --heading: light-dark(#0b141b, #f4fbfb);
  --text-soft: light-dark(#53636b, #8d9ea5);
  --accent: light-dark(#087f75, #2ee6d4);
  --accent-soft: light-dark(#dff3f0, rgb(46 230 212 / 0.1));
  --mint: #2ee6d4;
  --rose: light-dark(#c2457f, #ffb1d3);
  --logo-rose: light-dark(#d9689a, #ffb1d3);
  --glow: light-dark(rgb(28 196 182 / 0.18), rgb(46 230 212 / 0.28));
  --button-bg: light-dark(#1cc4b6, #2ee6d4);
  --button-bg-hover: light-dark(#2ee6d4, #7ff3e6);
  --button-text: #04211e;
  --error: light-dark(#c4302b, #ff7b72);
  --error-soft: light-dark(#fbe9e8, rgb(255 123 114 / 0.1));
  --warning: light-dark(#9a6700, #e3b341);
  --ok: light-dark(#1f7a3a, #5fd58a);
  --mark: url("./mark-light.svg");
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] { --mark: url("./mark.svg"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --mark: url("./mark.svg"); }
}
html, body, #app { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* The top bar. */
.topbar {
  /* Above the panels, so the current example's rule can sit on its hairline. */
  position: relative; z-index: 1;
  min-height: 52px; padding: 7px 20px; border-bottom: 1px solid var(--border);
  background: light-dark(rgb(247 250 250 / 0.82), rgb(11 15 20 / 0.78));
  backdrop-filter: saturate(1.6) blur(14px);
}
.brand-mark { flex: none; width: 46px; height: 30px; background: var(--mark) center / contain no-repeat; }
.brand { color: var(--heading); font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-soft); font-family: var(--font-display); font-size: 15px; margin-left: -2px; margin-right: 18px; }
.btn {
  height: 34px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--bg-raised);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600; padding: 0 16px 0 13px;
  color: var(--button-text); background: var(--button-bg); border-color: var(--button-bg);
  box-shadow: 0 8px 28px -10px var(--glow);
}
.btn-primary::before {
  content: ""; width: 10px; height: 12px; background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.btn-primary:hover { background: var(--button-bg-hover); border-color: var(--button-bg-hover); box-shadow: 0 10px 34px -8px var(--glow); }
/* The examples read as the site's top navigation. */
.tabs { gap: 2px; margin-left: 14px; }
.tab {
  position: relative; padding: 6px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--text-soft); font-weight: 500; transition: color 0.15s;
}
.tab:hover { color: var(--heading); }
.tab[aria-pressed="true"] { color: var(--heading); }
.tab[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -10px; height: 2px;
  background: linear-gradient(90deg, var(--mint), var(--logo-rose)); border-radius: 2px;
  box-shadow: 0 0 12px var(--glow);
}
/* The site's hero chip. */
.status {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; white-space: nowrap;
  padding: 4px 12px; border-radius: 999px; font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-state="checking"] { color: var(--text-soft); background: none; border-color: var(--border-strong); }
.status[data-state="problems"] { color: var(--error); background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 35%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-grid !important; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-soft); }
.btn-icon:hover { color: var(--text); background: var(--bg-soft); }
.theme-toggle::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  /* Lucide's moon. */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.theme-toggle[aria-label="Switch to light theme"]::before {
  /* Lucide's sun. */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E") center / contain no-repeat;
}

.github-link::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  /* The GitHub mark, as on hd-lang's site. */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* The panels: hairlines, and the site's eyebrow labels. */
.half-left { border-right: 1px solid var(--border); }
.panel-head { padding: 7px 16px; border-bottom: 1px solid var(--border); flex: none; }
.panel-title { color: var(--accent); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.panel-note { color: var(--text-soft); font-family: var(--font-mono); font-size: 11px; }
.dock { border-top: 1px solid var(--border); flex: none; }
.pane { overflow: auto; }
.empty { padding: 8px 16px; color: var(--text-soft); font-size: 13px; }
.problem { padding: 5px 16px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; overflow-wrap: anywhere; transition: background-color 0.15s; }
.problem:hover { background: var(--bg-soft); }
.problem:focus-visible { outline-offset: -2px; }
[data-severity="error"] { color: var(--error); }
[data-severity="warning"] { color: var(--warning); }

.stage { position: relative; border-bottom: 1px solid var(--border); }
.stage-note { position: absolute; inset: 0; align-items: center; justify-content: center; gap: 14px; color: var(--text-soft); text-align: center; padding: 16px; }
.stage-note::before { content: ""; width: 92px; height: 60px; opacity: 0.55; background: var(--mark) center / contain no-repeat; filter: drop-shadow(0 0 18px var(--glow)); }
.stage-frame { position: absolute; inset: 0; pointer-events: none; }
.stage-frame iframe { pointer-events: auto; }

.log { padding: 10px 16px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft); }
::highlight(log-head) { color: var(--accent); }
::highlight(log-event) { color: var(--rose); }

/* The editor: a gutter, and two layers that must lay out their text alike. */
.editor { position: relative; overflow: hidden; --gutter: 48px; }
.editor-gutter {
  position: absolute; top: 0; bottom: 0; left: 0; width: var(--gutter); overflow: hidden;
  padding: 12px 10px 12px 0; text-align: right; font-family: var(--font-mono); line-height: 1.55; white-space: pre;
  color: var(--muted); opacity: 0.65; border-right: 1px solid var(--line); pointer-events: none; user-select: none;
}
.editor-gutter span { display: block; }
.editor-back, .editor-input {
  position: absolute; top: 0; left: var(--gutter); margin: 0; border: 0; outline: 0;
  font-family: var(--font-mono); line-height: 1.55; white-space: pre; tab-size: 4; letter-spacing: 0; font-variant-ligatures: none;
}
.editor-back { right: 0; bottom: 0; overflow: hidden; pointer-events: none; }
.editor-back span { display: block; width: max-content; will-change: transform; }
.editor-input {
  width: calc(100% - var(--gutter)); height: 100%; resize: none; overflow: auto; background: transparent;
  color: transparent; caret-color: var(--accent);
}
.editor-input::selection { background: var(--accent-soft); color: transparent; }

/* hd-lang's syntax colors (website/assets/style.css). */
::highlight(hd-keyword) { color: light-dark(#b4387a, #ff9fcc); }
::highlight(hd-literal) { color: light-dark(#a15a0a, #ffc27d); }
::highlight(hd-type) { color: light-dark(#087f75, #5eeedf); }
::highlight(hd-function) { color: light-dark(#1f66c2, #86bfff); }
::highlight(hd-number) { color: light-dark(#a15a0a, #ffc27d); }
::highlight(hd-string) { color: light-dark(#3b7a1e, #b7e58a); }
::highlight(hd-interpolation) { color: light-dark(#2a5a14, #d8f5b8); }
::highlight(hd-comment) { color: light-dark(#6a7880, #66777f); }
::highlight(hd-operator) { color: light-dark(#4f5d66, #a3b3ba); }
::highlight(hd-error) { text-decoration: underline wavy var(--error); text-decoration-skip-ink: none; }
::highlight(hd-warning) { text-decoration: underline wavy var(--warning); text-decoration-skip-ink: none; }

@media (max-width: 820px) {
  .workspace { flex-direction: column !important; }
  .half { width: 100% !important; height: 0; flex: 1 1 0; }
  .half-left { border-right: 0; border-bottom: 1px solid var(--border); }
  .tab[aria-pressed="true"]::after { bottom: 0; }
}
@media (pointer: coarse) {
  .btn, .tab { min-height: 40px; }
  .btn-icon { width: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
