@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  font-family: "Inter", system-ui, sans-serif;
  /* Plugin editor (plugin-editor.html) — light */
  --editor-bg: #ffffff;
  --editor-gutter: #f6f8fa;
  --editor-line-num: #656d76;
  --editor-fg: #24292f;
  --editor-key: #0550ae;
  --editor-string: #a31515;
  --editor-number: #098658;
  --editor-comment: #116329;
  --editor-bool: #0550ae;
  --editor-bar: #f6f8fa;
  --editor-tab: #eff2f5;
  --editor-tab-active: #ffffff;
  --editor-tab-muted: #656d76;
  --editor-border: #d0d7de;
  --editor-problems-bg: #f6f8fa;
  --editor-error: #cf222e;
  --editor-error-bg: rgba(207, 34, 46, 0.08);
  --editor-filename: #24292f;
  --realmify-accent: #059669;
  --realmify-accent-hover: #047857;
  --realmify-ui-bg: #ffffff;
  --realmify-ui-border: #e5e5e5;
}

html.dark {
  /* Plugin editor — dark */
  --editor-bg: #1e1e1e;
  --editor-gutter: #252526;
  --editor-line-num: #858585;
  --editor-fg: #d4d4d4;
  --editor-key: #9cdcfe;
  --editor-string: #ce9178;
  --editor-number: #b5cea8;
  --editor-comment: #6a9955;
  --editor-bool: #569cd6;
  --editor-bar: #323233;
  --editor-tab: #2d2d2d;
  --editor-tab-active: #1e1e1e;
  --editor-tab-muted: #969696;
  --editor-border: #3c3c3c;
  --editor-problems-bg: #252526;
  --editor-error: #f14c4c;
  --editor-error-bg: rgba(241, 76, 76, 0.12);
  --editor-filename: #cccccc;
}

body {
  font-family: "Inter", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

a[href]:where(:not(:has(img)):not(.inline-flex):not(.scroll-hint)) {
  text-decoration: none;
  background-image: linear-gradient(to right, #059669, #059669);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: 0.08em;
}

a[href]:where(:not(:has(img)):not(.inline-flex):not(.scroll-hint)):hover {
  background-size: 100% 2px;
}

html.dark a[href]:where(:not(:has(img)):not(.inline-flex):not(.scroll-hint)) {
  background-image: linear-gradient(to right, #34d399, #34d399);
}

@media (prefers-reduced-motion: reduce) {
  a[href]:where(:not(:has(img)):not(.inline-flex):not(.scroll-hint)) {
    transition-duration: 0.01ms;
  }

  .nav-mobile-panel:not(.hidden) {
    animation: none;
  }
}

.nav-mobile-panel:not(.hidden) {
  animation: nav-panel-in 0.22s ease-out;
}

@keyframes nav-panel-in {
  from {
    opacity: 0;
    transform: translateY(-0.4rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-gallery {
  column-count: 1;
  column-gap: 1rem;
}

@media (min-width: 640px) {
  .info-gallery {
    column-count: 2;
    column-fill: balance;
  }
}

.info-gallery > figure {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 1rem;
  width: 100%;
}

.realm-r {
  color: #23b4fa;
}
.realm-e {
  color: #2abedb;
}
.realm-a {
  color: #30c8bd;
}
.realm-l {
  color: #37d29e;
}
.realm-m {
  color: #3ddc7f;
}
.realm-i {
  color: #44e660;
}
.realm-f {
  color: #4af042;
}
.realm-y {
  color: #51fa23;
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.faq-chevron {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .faq-panel {
    transition-duration: 0.01ms;
  }

  .faq-chevron {
    transition-duration: 0.01ms;
  }

  .scroll-hint-arrow {
    animation: none;
  }
}

@keyframes scroll-hint-nudge {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(8px);
    opacity: 0.85;
  }
}

.scroll-hint-arrow {
  animation: scroll-hint-nudge 1.6s ease-in-out infinite;
}

.scroll-hint:hover .scroll-hint-arrow {
  animation-duration: 1s;
}

@keyframes hosting-dot-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.hosting-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: none;
  animation: hosting-dot-bounce 1.5s ease-in-out infinite;
  vertical-align: middle;
}

#hosting-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#hosting-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

#hosting-overlay .hosting-overlay-panel {
  transform: translateY(1.5rem) scale(0.96);
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease;
}

#hosting-overlay.is-open .hosting-overlay-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #hosting-overlay .hosting-overlay-panel {
    transition-duration: 0.01ms;
  }

  #hosting-overlay {
    transition-duration: 0.01ms;
  }

  .hosting-dot {
    animation: none;
  }
}

/* --- Plugin editor page (plugin-editor.html); also loaded from index via this file --- */

body.editor-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #ffffff;
  color: #171717;
}

html.dark body.editor-page {
  background: #0a0a0a;
  color: #fafafa;
}

@media (prefers-color-scheme: dark) {
  body.editor-page:not(.force-light) {
    background: #0a0a0a;
    color: #fafafa;
  }

  body.editor-page:not(.force-light) .rf-site-header {
    background: #0a0a0a;
    border-bottom-color: #262626;
  }

  body.editor-page:not(.force-light) .editor-shell-sub {
    color: #a3a3a3;
  }

  body.editor-page:not(.force-light) .vscode-frame {
    border-color: #404040;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.4),
      0 8px 24px rgba(0, 0, 0, 0.35);
  }

  body.editor-page:not(.force-light) .back-link {
    color: #34d399;
  }
}

.rf-site-header {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
}

html.dark .rf-site-header {
  border-bottom-color: #262626;
  background: #0a0a0a;
}

.rf-header-inner {
  box-sizing: border-box;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

@media (min-width: 768px) {
  .rf-header-inner {
    padding: 2rem 2rem;
  }
}

.rf-brand-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.rf-brand-link:hover .rf-editor-headline-suffix {
  color: #059669;
}

html.dark .rf-brand-link:hover .rf-editor-headline-suffix {
  color: #34d399;
}

.rf-brand-logo {
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.375rem;
  object-fit: cover;
}

@media (min-width: 768px) {
  .rf-brand-logo {
    height: 3rem;
    width: 3rem;
  }
}

.rf-editor-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .rf-editor-headline {
    font-size: 1.5rem;
  }
}

.rf-editor-headline-suffix {
  font-weight: 600;
  color: #171717;
  letter-spacing: -0.025em;
}

html.dark .rf-editor-headline-suffix {
  color: #fafafa;
}

.editor-shell {
  box-sizing: border-box;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
}

@media (min-width: 768px) {
  .editor-shell {
    padding: 1.75rem 2rem 3rem;
  }
}

.editor-shell-sub {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #737373;
}

.editor-shell-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125em;
  padding: 0.12em 0.4em;
  border-radius: 0.25rem;
  background: #f5f5f5;
  color: #404040;
}

html.dark .editor-shell-code {
  background: #262626;
  color: #e5e5e5;
}

@media (prefers-color-scheme: dark) {
  body.editor-page:not(.force-light) .editor-shell-code {
    background: #262626;
    color: #e5e5e5;
  }
}

html.dark .editor-shell-sub {
  color: #a3a3a3;
}

.vscode-frame {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--realmify-ui-border);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.06);
}

html.dark .vscode-frame {
  border-color: #404040;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.vscode-titlebar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--editor-bar);
  border-bottom: 1px solid var(--editor-border);
}

.vscode-titlebar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.vscode-dots {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.vscode-dots span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 9999px;
  background: #5c5c5c;
}

.vscode-dots span:nth-child(1) {
  background: #ff5f57;
}
.vscode-dots span:nth-child(2) {
  background: #febc2e;
}
.vscode-dots span:nth-child(3) {
  background: #28c840;
}

.vscode-filename {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--editor-filename);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .editor-save-row {
    margin-top: 1.25rem;
  }
}

.btn-save {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--realmify-accent);
  border: none;
  border-radius: 0.5rem;
  cursor: default;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
  min-width: 7.5rem;
}

.btn-save:hover {
  background: var(--realmify-accent-hover);
}

.btn-save:focus-visible {
  outline: 2px solid var(--realmify-accent);
  outline-offset: 2px;
}

.vscode-tabstrip {
  display: flex;
  align-items: flex-end;
  background: var(--editor-tab);
  border-bottom: 1px solid var(--editor-border);
  padding: 0 0.25rem;
}

.vscode-tab {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  color: var(--editor-tab-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: default;
  margin-bottom: -1px;
}

.vscode-tab.is-active {
  color: var(--editor-fg);
  background: var(--editor-tab-active);
  border-bottom-color: var(--realmify-accent);
  border-radius: 0.25rem 0.25rem 0 0;
}

.editor-main {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 14rem;
  background: var(--editor-bg);
}

@media (min-width: 640px) {
  .editor-main {
    min-height: 18rem;
  }
}

.line-gutter {
  padding: 0.75rem 0.75rem 0.75rem 0.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--editor-line-num);
  text-align: right;
  user-select: none;
  background: var(--editor-gutter);
  border-right: 1px solid var(--editor-border);
}

.line-gutter-inner {
  display: flex;
  flex-direction: column;
}

.code-pane {
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--editor-fg);
  tab-size: 2;
}

.code-pane code {
  display: block;
  white-space: pre;
  font-family: inherit;
}

.yaml-key {
  color: var(--editor-key);
}

.yaml-fg {
  color: var(--editor-fg);
}

.yaml-bool {
  color: var(--editor-bool);
}

.yaml-string {
  color: var(--editor-string);
}

.yaml-num {
  color: var(--editor-number);
}

.yaml-comment {
  color: var(--editor-comment);
  font-style: italic;
}

.line-error {
  display: block;
  background: var(--editor-error-bg);
  margin: 0 -1rem 0 -0.75rem;
  padding: 0 1rem 0 0.75rem;
  border-left: 3px solid var(--editor-error);
}

.problems-panel {
  border-top: 1px solid var(--editor-border);
  background: var(--editor-problems-bg);
}

.problems-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--editor-tab-muted);
  border-bottom: 1px solid var(--editor-border);
}

html.dark .problems-header {
  color: #cccccc;
}

.problems-header svg {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--editor-error);
  flex-shrink: 0;
}

.problem-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 8rem;
  overflow-y: auto;
}

.problem-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--editor-fg);
  border-bottom: 1px solid var(--editor-border);
}

html.dark .problem-item {
  color: #cccccc;
}

.problem-item:last-child {
  border-bottom: none;
}

.problem-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  color: var(--editor-error);
}

.problem-meta {
  flex: 1;
  min-width: 0;
}

.problem-msg {
  color: #f14c4c;
  font-weight: 500;
}

.problem-loc {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: var(--editor-line-num);
}

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--realmify-accent);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

html.dark .back-link {
  color: #34d399;
}
