:root {
  color-scheme: light;
  --ink: #111318;
  --muted: #5d6572;
  --line: #dfe4ea;
  --paper: #f7f8fb;
  --accent: #1f6feb;
  --accent-dark: #1158c7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--tool-focus, var(--accent));
  outline-offset: 3px;
}

.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;
}

.tool-page {
  color-scheme: dark;
  --tool-bg: #080b12;
  --tool-surface: #111722;
  --tool-panel: #121824;
  --tool-popover: #151c29;
  --tool-chrome: rgba(15, 21, 32, 0.9);
  --tool-control: rgba(255, 255, 255, 0.055);
  --tool-control-hover: rgba(255, 255, 255, 0.085);
  --tool-line: rgba(155, 170, 195, 0.18);
  --tool-text: #f3f6fb;
  --tool-muted: #a5b1c4;
  --tool-accent: #2f7df6;
  --tool-accent-strong: #1f6feb;
  --tool-accent-soft: rgba(47, 125, 246, 0.14);
  --tool-purple: var(--tool-accent);
  --tool-focus: #79b1ff;
  --panel-alpha: 0.94;
  --canvas-default: #0b111b;
  background: var(--tool-bg);
}

.tool-page.light-mode {
  color-scheme: light;
  --tool-bg: #eef2f7;
  --tool-surface: #ffffff;
  --tool-panel: #ffffff;
  --tool-popover: #ffffff;
  --tool-chrome: rgba(255, 255, 255, 0.88);
  --tool-control: rgba(20, 28, 42, 0.045);
  --tool-control-hover: rgba(20, 28, 42, 0.075);
  --tool-line: rgba(26, 39, 65, 0.13);
  --tool-text: #111827;
  --tool-muted: #526071;
  --tool-accent: #1f6feb;
  --tool-accent-strong: #1158c7;
  --tool-accent-soft: rgba(31, 111, 235, 0.12);
  --tool-purple: var(--tool-accent);
  --tool-focus: #1158c7;
  --canvas-default: #eef2f7;
}

.tool-page.dark-mode {
  color-scheme: dark;
  --tool-bg: #0b111b;
  --tool-surface: #111827;
  --tool-panel: #101724;
  --tool-popover: #121a29;
  --tool-chrome: rgba(16, 23, 36, 0.9);
  --tool-control: rgba(255, 255, 255, 0.055);
  --tool-control-hover: rgba(255, 255, 255, 0.085);
  --tool-line: rgba(211, 222, 240, 0.14);
  --tool-text: #eef4ff;
  --tool-muted: #9aa8bd;
  --tool-accent: #3b82f6;
  --tool-accent-strong: #60a5fa;
  --tool-accent-soft: rgba(59, 130, 246, 0.16);
  --tool-purple: var(--tool-accent);
  --tool-focus: #60a5fa;
  --canvas-default: #0b111b;
}

.tool-page svg,
.site-page svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--tool-bg);
}

.toolbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  background: var(--tool-chrome);
  border-bottom: 1px solid var(--tool-line);
  backdrop-filter: blur(18px) saturate(130%);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.26s ease,
    transform 0.34s cubic-bezier(0.2, 0.9, 0.22, 1);
  will-change: opacity, transform;
}

.light-mode .toolbar {
  background: var(--tool-chrome);
}

.dark-mode .toolbar {
  background: var(--tool-chrome);
}

.is-fullscreen.fullscreen-ui-hidden .toolbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.tool-brand {
  position: relative;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tool-text);
  font-size: 18px;
  font-weight: 820;
  border-radius: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: var(--tool-accent);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.tool-brand > span > span {
  color: var(--tool-accent);
}

.tool-brand:hover,
.tool-brand:focus-visible {
  color: var(--tool-text);
}

.toolbar-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.toolbar-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--tool-muted);
  font-size: 13px;
  font-weight: 760;
}

.toolbar-link:hover,
.toolbar-link:focus-visible {
  color: var(--tool-accent);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-tool,
.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: var(--tool-muted);
  background: transparent;
}

.icon-tool:hover,
.icon-button:hover,
.icon-tool:focus-visible,
.icon-button:focus-visible {
  color: var(--tool-text);
  background: var(--tool-control-hover);
}

.light-mode .icon-tool:hover,
.light-mode .icon-button:hover,
.light-mode .icon-tool:focus-visible,
.light-mode .icon-button:focus-visible {
  background: var(--tool-control-hover);
}

@media (hover: hover) and (pointer: fine) {
  [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    z-index: 120;
    min-width: max-content;
    padding: 6px 8px;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    color: var(--tool-text);
    background: var(--tool-popover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    font-weight: 720;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
  }

  [data-tooltip]:hover::after,
  [data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.icon-tool:active,
.icon-button:active {
  transform: translateY(1px);
}

.import-button {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: white;
  background: var(--tool-accent);
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
}

.import-button:hover,
.import-button:focus-within {
  background: var(--tool-accent-strong);
  filter: none;
}

.import-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.import-button:focus-within {
  outline: 3px solid var(--tool-focus);
  outline-offset: 3px;
}

.primary-action,
.secondary-action {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 760;
  white-space: nowrap;
}

.primary-action {
  padding: 0 22px;
  color: white;
  background: var(--accent);
}

.secondary-action {
  padding: 0 20px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.coming-soon-action {
  color: var(--muted);
  cursor: default;
}

.coming-soon-action:hover,
.coming-soon-action:focus-visible {
  color: var(--muted);
  border-color: var(--line);
  background: white;
}

.redirect-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.landing-page .redirect-page {
  background-color: var(--paper);
  background-image:
    linear-gradient(45deg, rgba(17, 19, 24, 0.028) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 19, 24, 0.028) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(17, 19, 24, 0.028) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(17, 19, 24, 0.028) 75%);
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  background-size: 22px 22px;
}

.redirect-page h1 {
  max-width: 780px;
  margin: 0 auto;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 0.96;
  letter-spacing: 0;
}

.redirect-page p {
  color: var(--muted);
}

.landing-eyebrow {
  color: var(--accent) !important;
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.landing-lead {
  max-width: 700px;
  margin: 4px auto 0;
  color: var(--ink) !important;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 650;
  line-height: 1.35;
}

.landing-subcopy {
  max-width: 640px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.docs-page,
.landing-page {
  background: var(--paper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, 0.88);
  backdrop-filter: blur(16px);
}

.site-brand {
  font-size: 18px;
  font-weight: 840;
}

.site-brand:hover,
.site-brand:focus-visible {
  color: var(--ink);
}

.site-brand span {
  color: var(--accent);
}

.site-nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.site-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.site-menu-button:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.site-menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.site-nav-toggle:focus-visible + .site-menu-button {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 3px;
}

.site-nav-toggle:checked + .site-menu-button {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.16);
}

.site-nav-toggle:checked + .site-menu-button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav-toggle:checked + .site-menu-button span:nth-child(2) {
  opacity: 0;
}

.site-nav-toggle:checked + .site-menu-button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.site-header nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav a[aria-current="page"] {
  color: var(--accent);
}

.site-footer {
  display: grid;
  place-items: center;
  padding: 26px 24px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
  text-align: center;
}

.docs-shell {
  width: min(1060px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.docs-hero {
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.docs-hero h1 {
  margin-top: 12px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.docs-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.docs-hero-actions {
  justify-content: flex-start;
  margin-top: 4px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 44px;
}

.docs-section {
  margin-top: 56px;
}

.docs-section > div:first-child {
  max-width: 680px;
}

.docs-section h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.docs-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.05);
}

.docs-feature-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 11px;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.docs-feature-icon svg {
  width: 18px;
  height: 18px;
}

.docs-grid .docs-wide {
  grid-column: 1 / -1;
}

.docs-grid h2 {
  font-size: 18px;
  line-height: 1.2;
}

.docs-grid h3 {
  font-size: 16px;
  line-height: 1.25;
}

.docs-grid h3 + ul {
  margin-top: 10px;
}

.docs-grid ul + h3 {
  margin-top: 20px;
}

.changelog-meta {
  margin-bottom: 10px;
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 860;
  text-transform: uppercase;
}

.docs-grid p,
.docs-grid li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.docs-grid p,
.docs-grid ol,
.docs-grid ul {
  margin-top: 12px;
}

.docs-grid ol,
.docs-grid ul {
  padding-left: 18px;
}

.docs-grid kbd {
  min-width: 24px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 7px;
  padding: 0 7px 1px;
  border: 1px solid var(--line);
  border-bottom-color: #b8c1cd;
  border-radius: 7px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #f3f5f8);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #d6dce4;
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 700px) {
  .toolbar {
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    padding: 12px;
  }

  .tool-brand {
    font-size: 16px;
  }

  .import-button span {
    display: none;
  }

  .site-header {
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
  }

  .site-menu-button {
    display: inline-flex;
    margin-left: auto;
  }

  .site-header nav {
    width: 100%;
    margin-left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: 8px 0 4px;
  }

  .site-nav-toggle:checked ~ nav {
    display: flex;
  }

  .site-header nav a {
    min-height: 40px;
    justify-content: flex-start;
  }

  .docs-shell {
    width: min(100vw - 28px, 1060px);
    padding-top: 34px;
  }

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

@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;
  }
}
