/* kodare.app — the app's own tokens (src/styles/theme.css in the app) and its dialog-card look. */
:root {
  --bg: #0b1017;
  --panel: #111923;
  --panel-2: #0d151e;
  --border: #263443;
  --text: #e8edf3;
  --muted: #8795a6;
  --accent: #4ea1ff;
  --accent-2: #77b9ff;
  --success: #39d98a;
  --danger: #ff626d;
  --warning: #f4b740;

  --font-ui: Inter, "Adwaita Sans", Cantarell, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
  --radius: 6px;
  --container: 1120px;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-2);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.3em;
}

[hidden] {
  display: none !important;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 4px;
  font-weight: 600;
}

.skip-link:focus {
  top: 8px;
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
}

.site-nav__link {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav__link:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .site-nav__link--wide {
    display: none;
  }
}

/* ---- buttons (the dialog card's) ---- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 40px;
  padding: 8px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.button--success {
  color: var(--bg);
  background: var(--success);
  border-color: var(--success);
}

.button--success:hover {
  color: var(--bg);
  background: color-mix(in srgb, var(--success) 85%, white);
}

.button--neutral {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

.button--neutral:hover {
  color: var(--text);
  border-color: var(--muted);
}

.button--disabled {
  color: var(--muted);
  background: var(--panel-2);
  border-color: var(--border);
  cursor: default;
  font-weight: 500;
  font-size: 14px;
}

/* ---- hero ---- */
.hero {
  padding: 56px 0 24px;
  background: radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__logo {
  border-radius: 14px;
}

.hero__title {
  margin: 16px 0 0;
  font-size: clamp(36px, 7vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero__pitch {
  margin: 10px 0 0;
  font-size: clamp(20px, 3.4vw, 28px);
  font-weight: 600;
  color: var(--accent-2);
}

.hero__lead {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero__actions {
  justify-content: center;
  margin-top: 26px;
}

.hero__meta {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---- screenshots ---- */
.shot {
  margin: 0;
}

.shot--hero {
  margin-top: 40px;
}

.shot__link {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 40px rgb(0 0 0 / 45%);
  background: var(--panel-2);
}

.shot__link:hover {
  border-color: var(--accent);
}

.shot figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.lightbox {
  width: min(96vw, 1600px);
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 75%);
}

.lightbox__bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px;
}

.lightbox__close {
  min-height: 32px;
  padding: 4px 14px;
  font-size: 14px;
}

.lightbox__img {
  width: 100%;
  height: auto;
}

/* ---- sections ---- */
.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--panel-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__title {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.2;
}

.section__lead {
  max-width: 720px;
  margin: 12px 0 32px;
  color: var(--muted);
}

/* ---- cards (the app's dialog card: tone border, left bar, tint) ---- */
.card {
  --tone: var(--border);
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--tone) 55%, var(--border));
  border-left: 4px solid var(--tone);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.card--accent,
.features .card {
  --tone: var(--accent);
  background: color-mix(in srgb, var(--tone) 6%, var(--panel));
}

.card--success {
  --tone: var(--success);
  background: color-mix(in srgb, var(--tone) 8%, var(--panel));
}

.card--danger {
  --tone: var(--danger);
  background: color-mix(in srgb, var(--tone) 8%, var(--panel));
}

.card--warning {
  --tone: var(--warning);
  background: color-mix(in srgb, var(--tone) 10%, var(--panel));
}

.card__title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
}

.card--success > .card__title {
  color: var(--success);
}

.card--danger > .card__title {
  color: var(--danger);
}

.card--warning > .card__title {
  color: var(--warning);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.features,
.reqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.reqs {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: middle;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.badge--warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
}

/* ---- downloads ---- */
.hint {
  margin: -16px 0 24px;
  font-size: 14px;
  color: var(--muted);
}

.release-status {
  margin: 0 0 24px;
}

.release-status p a,
.release-status a {
  color: var(--accent-2);
}

.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tabs__tab {
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.tabs__tab:hover {
  color: var(--text);
}

.tabs__tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tabs__panel + .tabs__panel {
  margin-top: 32px;
}

.tabs[data-ready] .tabs__panel + .tabs__panel {
  margin-top: 0;
}

.tabs[data-ready] .tabs__heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tabs__heading {
  margin: 0 0 4px;
  font-size: 20px;
}

.tabs__covers,
.tabs__note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.tabs__note {
  margin-top: 12px;
}

.packages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 16px;
}

.package {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.package--mine {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}

.package__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.package__label {
  font-weight: 600;
}

.package__mine {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
}

.package__file {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cmd {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  min-width: 0;
}

.cmd + .cmd {
  margin-top: 8px;
}

.cmd__text {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  background: none;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.cmd__copy {
  flex: none;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.cmd__copy:hover {
  background: var(--border);
}

.cmd__copy[data-state="ok"] {
  color: var(--success);
}

.cmd__copy[data-state="error"] {
  color: var(--danger);
}

.extra {
  margin-top: 20px;
}

.extra p,
.source p {
  margin-bottom: 12px;
}

.extra .cmd-label {
  margin: 14px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

.source {
  margin-top: 40px;
}

/* ---- licence ---- */
.license {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text);
}

.checklist li {
  position: relative;
  padding-left: 26px;
  margin-top: 6px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  font-weight: 700;
  color: var(--success);
}

.checklist--no li::before {
  content: "✕";
  color: var(--danger);
}

.fineprint {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.fineprint strong {
  color: var(--text);
}

/* ---- FAQ ---- */
.faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px;
}

.faq__item {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.faq__q {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.faq__a {
  margin: 0;
  color: var(--muted);
}

/* ---- share menu: <details> (a list of links without JS); site.js adds the Web Share API and Copy link ---- */
.share {
  position: relative;
  display: inline-block;
}

.share__toggle {
  gap: 8px;
  list-style: none;
  user-select: none;
}

.share__toggle::-webkit-details-marker {
  display: none;
}

.share__icon {
  flex: none;
}

.share[open] > .share__toggle {
  border-color: var(--muted);
}

.share__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 30px rgb(0 0 0 / 50%);
  text-align: left;
}

.share__item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.share__item:hover,
.share__item:focus-visible {
  color: var(--text);
  background: var(--border);
}

.share__item[data-state="ok"] {
  color: var(--success);
}

.share__item[data-state="error"] {
  color: var(--danger);
}

/* ---- call to action ---- */
.section--cta {
  border-top: 1px solid var(--border);
}

.cta {
  text-align: center;
}

.cta p {
  margin: 10px 0 24px;
  color: var(--muted);
}

.cta .actions {
  justify-content: center;
}

/* ---- footer ---- */
.site-footer {
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 14px;
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.site-footer__links a {
  color: var(--muted);
}

.site-footer__links a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0;
}

.site-footer__author {
  color: var(--text);
}

.site-footer__note {
  font-size: 13px;
}

/* ---- 404 ---- */
.notfound {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 64px 0;
}

.notfound .card {
  max-width: 560px;
  margin: 0 auto;
}

.notfound .actions {
  margin-top: 16px;
}

/* ---- manual (/manual) ---- */
.manual {
  padding: 40px 0 64px;
}

.manual__title {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
}

.manual__version {
  margin: 10px 0 20px;
  color: var(--muted);
}

.manual__version strong {
  color: var(--text);
}

.manual__changes {
  max-width: 760px;
  margin-bottom: 32px;
}

.manual__body {
  display: grid;
  gap: 32px;
}

@media (min-width: 1000px) {
  .manual__body {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }

  .manual__toc {
    position: sticky;
    top: 72px;
  }
}

.manual__toc {
  font-size: 14px;
}

.manual__toc-title {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
}

.manual__toc ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.manual__toc li {
  margin: 4px 0;
}

.manual__toc a {
  color: var(--muted);
}

.manual__toc a:hover {
  color: var(--text);
}

.manual__content {
  max-width: 820px;
  min-width: 0;
}

.manual__content section {
  padding-top: 8px;
  margin-bottom: 40px;
  scroll-margin-top: 72px;
}

.manual__content h2 {
  margin: 0 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 26px;
  line-height: 1.25;
}

.manual__content h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.manual__content p,
.manual__content li,
.manual__content dd {
  line-height: 1.6;
}

.manual__content li + li {
  margin-top: 6px;
}

.manual__content .shot {
  margin: 20px 0 24px;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--text);
}

.mtable {
  width: 100%;
  margin: 12px 0 20px;
  border-collapse: collapse;
  font-size: 15px;
}

.mtable th,
.mtable td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.mtable th {
  background: var(--panel);
  color: var(--text);
}

.mtable td:first-child {
  white-space: normal;
}

@media (max-width: 640px) {
  .mtable {
    display: block;
    overflow-x: auto;
  }
}

.mlist dt {
  margin-top: 16px;
  font-weight: 600;
  color: var(--text);
}

.mlist dd {
  margin: 4px 0 0 0;
  color: var(--muted);
}

/* "New in …" / "Changed in …" marks of the manual (one per changed section, for two releases) */
.vbadge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.vbadge--new {
  border: 1px solid color-mix(in srgb, var(--success) 60%, var(--border));
  background: color-mix(in srgb, var(--success) 14%, var(--panel));
  color: var(--success);
}

.vbadge--changed {
  border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent-2);
}
