:root {
  --bg: #0b0c0a;
  --fg: #c9d3b8;
  --dim: #5d6650;
  --rule: #2f3527;
  --accent: #b6e07a;
  --warn: #e6c46a;
  --err: #e88b6a;

  /* syntax highlighting (highlight.js) */
  --syn-kw: #ff79c6;
  --syn-dec: #e6c46a;
  --syn-fn: #b6e07a;
  --syn-builtin: #6cd3a3;
  --syn-ty: #7cc5ff;
  --syn-const: #c8a2ff;
  --syn-num: #e6c46a;
  --syn-str: #b6e07a;
  --syn-comment: #5d6650;
  --syn-pun: #9aa388;
}

[data-scheme="phosphor"] {
  --bg: #0b0c0a;
  --fg: #c9d3b8;
  --dim: #5d6650;
  --rule: #2f3527;
  --accent: #b6e07a;
  --warn: #e6c46a;
  --err: #e88b6a;

  --syn-kw: #ff79c6;
  --syn-dec: #e6c46a;
  --syn-fn: #b6e07a;
  --syn-builtin: #6cd3a3;
  --syn-ty: #7cc5ff;
  --syn-const: #c8a2ff;
  --syn-num: #e6c46a;
  --syn-str: #b6e07a;
  --syn-comment: #5d6650;
  --syn-pun: #9aa388;
}

[data-scheme="paper"] {
  --bg: #f0ece2;
  --fg: #1a1814;
  --dim: #6e6757;
  --rule: #c4bba6;
  --accent: #1a1814;
  --warn: #8a6a1a;
  --err: #a4421a;

  --syn-kw: #a4216b;
  --syn-dec: #8a6a1a;
  --syn-fn: #2f6a18;
  --syn-builtin: #0f6a55;
  --syn-ty: #14508f;
  --syn-const: #5a2d8f;
  --syn-num: #8a6a1a;
  --syn-str: #2f6a18;
  --syn-comment: #6e6757;
  --syn-pun: #3a352b;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-variant-ligatures: none;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.012) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: screen;
}

[data-scheme="paper"] body::after {
  display: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 16px;
}

.tui {
  width: min(1320px, 100%);
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.45);
}

.titlebar {
  min-height: 39px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--dim);
  font-size: 12.5px;
}

.titlebar p {
  margin: 0;
  text-align: center;
}

.theme-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
}

.theme-swatch {
  --swatch-bg: #0b0c0a;
  --swatch-fg: #c9d3b8;
  --swatch-accent: #b6e07a;
  position: relative;
  display: block;
  width: 28px;
  height: 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}

.theme-swatch[data-theme="paper"] {
  --swatch-bg: #f0ece2;
  --swatch-fg: #1a1814;
  --swatch-accent: #1a1814;
}

.theme-swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-swatch.is-active {
  border-color: var(--accent);
}

.theme-swatch .swatch-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

.theme-swatch .swatch-bg {
  left: 0;
  background: var(--swatch-bg);
}

.theme-swatch .swatch-fg {
  right: 0;
  background: var(--swatch-fg);
}

.theme-swatch .swatch-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid var(--swatch-bg);
  border-radius: 999px;
  background: var(--swatch-accent);
  transform: translate(-50%, -50%);
}

.panes {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) 1px minmax(0, 1.6fr);
}

.pane {
  min-height: 380px;
}

.pane-copy {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 22px;
  padding: 22px;
}

.brand-line {
  margin: 0;
  color: var(--accent);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}

.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 0.95em;
  margin-left: 0.15em;
  background: var(--accent);
  transform: translateY(0.1em);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.tagline {
  max-width: 44ch;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.55;
}

.tagline p {
  margin: 0;
}

.roles {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.roles li {
  font-size: 13px;
}

.points {
  display: grid;
  align-self: start;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  color: var(--fg);
  font-size: 13.5px;
}

.points .num {
  color: var(--accent);
  font-weight: 500;
}

.cta-line {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
  font-size: 13.5px;
}

.cta-primary {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 14px 22px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.cta-primary:hover,
.cta-primary:focus-visible {
  background: var(--accent);
  color: var(--bg);
}

.cta-primary:focus-visible,
.email:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cta-primary span:first-child,
.cta-primary span:nth-child(3) {
  opacity: 0.55;
}

.cta-alt {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.email {
  width: max-content;
  max-width: 100%;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  font-weight: 400;
  text-decoration: none;
  transition: opacity 140ms ease;
}

.email:hover {
  opacity: 0.65;
}

.pane-divider {
  background: var(--rule);
}

.pane-code {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
}

.filebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
  font-size: 11.5px;
  text-align: center;
}

.filebar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codeblock {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  overflow: hidden;
  font-size: 12px;
  line-height: 1.55;
}

.line-numbers {
  padding: 14px 10px 14px 6px;
  border-right: 1px solid var(--rule);
  color: var(--rule);
  text-align: right;
  user-select: none;
}

.line-numbers span {
  display: block;
}

.codeblock pre {
  margin: 0;
  padding: 14px 18px;
  overflow-x: auto;
  color: var(--fg);
  font-family: inherit;
  white-space: pre;
}

/* highlight.js theme — mapped onto the site palette so it tracks the scheme */
.hljs {
  color: var(--fg);
  background: transparent;
}

.hljs-keyword,
.hljs-meta .hljs-keyword {
  color: var(--syn-kw);
}

.hljs-meta {
  color: var(--syn-dec);
}

.hljs-title,
.hljs-title.function_,
.hljs-section,
.hljs-name {
  color: var(--syn-fn);
}

.hljs-title.class_,
.hljs-type {
  color: var(--syn-ty);
}

.hljs-built_in {
  color: var(--syn-builtin);
}

.hljs-literal {
  color: var(--syn-const);
}

.hljs-number {
  color: var(--syn-num);
}

.hljs-string,
.hljs-meta .hljs-string {
  color: var(--syn-str);
}

.hljs-comment {
  color: var(--syn-comment);
  font-style: italic;
}

.hljs-params,
.hljs-attr,
.hljs-variable {
  color: var(--fg);
}

.hljs-operator,
.hljs-punctuation {
  color: var(--syn-pun);
}

.runline {
  display: grid;
  gap: 3px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--rule);
  color: var(--fg);
  font-size: 12px;
}

.runline p {
  margin: 0;
}

.prompt,
.ok {
  color: var(--accent);
}

.fail {
  color: var(--err);
}

/* carousel */
.carousel-nav {
  appearance: none;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

.carousel-nav:hover,
.carousel-nav:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.carousel-nav:focus-visible,
.carousel-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carousel-track {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.slide[hidden] {
  display: none;
}

.carousel .codeblock {
  min-height: 0;
  overflow-y: auto;
}

.carousel .runline {
  min-height: 5em;
  align-content: start;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border-top: 1px solid var(--rule);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid var(--dim);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.carousel-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

.titlebar a {
  color: inherit;
  text-decoration: none;
}

.titlebar a:hover,
.titlebar a:focus-visible {
  color: var(--accent);
}

.devconf-shell {
  place-items: start center;
}

.devconf-page {
  max-width: 960px;
  min-height: 0;
}

.devconf-content {
  display: grid;
  gap: 24px;
  padding: 42px;
}

.devconf-hero,
.next-steps,
.devconf-section {
  display: grid;
  gap: 12px;
}

.devconf-hero {
  padding-bottom: 8px;
}

.next-steps {
  padding-top: 8px;
}

.eyebrow,
.section-number,
.resource-number {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.devconf-page h1,
.devconf-page h2,
.devconf-page h3,
.devconf-page p {
  margin: 0;
}

.devconf-page h1 {
  max-width: 30ch;
  color: var(--accent);
  font-size: clamp(26px, 4.5vw, 44px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.nowrap,
.single-line-title {
  white-space: nowrap;
}

.single-line-title {
  max-width: none;
}

.devconf-page h2 {
  color: var(--fg);
  font-size: 20px;
  font-weight: 500;
}

.devconf-page h3 {
  color: var(--fg);
  font-size: 16px;
  font-weight: 500;
}

.devconf-page p,
.devconf-page li {
  max-width: 76ch;
}

.hint {
  color: var(--dim);
}

.devconf-page a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  text-decoration: none;
  transition: opacity 140ms ease, border-color 140ms ease;
}

.devconf-page .titlebar a {
  border-bottom: 0;
}

.devconf-page a:hover {
  opacity: 0.7;
}

.devconf-page a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.devconf-panel {
  padding: 22px;
  border: 1px solid var(--rule);
}

.resource-list {
  counter-reset: resource-item;
  list-style: none;
}

.resource-list li {
  counter-increment: resource-item;
  display: grid;
  gap: 6px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.resource-list li:first-child {
  padding-top: 4px;
  border-top: 0;
}

.resource-list li:last-child {
  padding-bottom: 0;
}

.resource-list h3::before {
  content: counter(resource-item, decimal-leading-zero) ". ";
  color: var(--dim);
}

.resource-list a {
  display: inline-block;
  width: max-content;
  max-width: 100%;
}

.devconf-footer a::after {
  content: " ->";
}

.devconf-section ol,
.devconf-section ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 4ch;
}

.devconf-section .resource-list {
  gap: 0;
  padding-left: 0;
}

.devconf-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 4px;
  color: var(--dim);
  font-size: 12px;
}

.devconf-footer span {
  color: var(--fg);
}

@media (max-width: 860px) {
  .shell {
    display: block;
    min-height: 100vh;
    padding: 16px;
  }

  .tui {
    min-height: 0;
  }

  .titlebar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .theme-switcher {
    justify-content: center;
  }

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

  .carousel .codeblock {
    overflow-y: visible;
  }

  .pane-divider {
    height: 1px;
  }

  .pane-copy {
    min-height: auto;
  }

  .devconf-content {
    padding: 28px;
  }

}

@media (max-width: 540px) {
  body {
    font-size: 13px;
  }

  .shell {
    padding: 10px;
  }

  .titlebar {
    padding: 8px 10px;
    font-size: 11.5px;
  }

  .pane-copy {
    gap: 18px;
    padding: 18px;
  }

  .brand-line {
    font-size: 24px;
  }

  .cta-primary {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    font-size: 16px;
  }

  .codeblock {
    font-size: 11px;
  }

  .devconf-content {
    gap: 28px;
    padding: 22px 18px;
  }

  .devconf-page h1 {
    letter-spacing: -0.04em;
  }

  .devconf-panel {
    padding: 16px;
  }
}

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

  .cursor {
    animation: none;
  }
}
