@import url("./tool-footer.css");

:root {
  color-scheme: dark;
  --bg: #070b16;
  --card: rgba(13, 19, 35, 0.9);
  --sub: rgba(22, 30, 49, 0.92);
  --bd: rgba(148, 163, 184, 0.2);
  --tx: #f4f7ff;
  --tx2: #bac5d8;
  --mut: #8d9ab1;
  --ac: #22d3ee;
  --acf: #06121d;
  --ok: #34d399;
  --bad: #fb7185;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --tool-glow: 0 22px 65px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f7fc;
    --card: rgba(255, 255, 255, 0.94);
    --sub: #edf2f9;
    --bd: rgba(71, 85, 105, 0.18);
    --tx: #101827;
    --tx2: #43516a;
    --mut: #65738a;
    --ac: #0891b2;
    --acf: #fff;
    --ok: #047857;
    --bad: #be123c;
    --tool-glow: 0 18px 48px rgba(38, 58, 90, 0.1);
  }
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(0, 220, 255, 0.1), transparent 34rem),
    radial-gradient(ellipse at 88% 16%, rgba(190, 65, 255, 0.09), transparent 31rem),
    var(--bg);
  color: var(--tx);
  font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--ac);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #e879f9;
}

.wrap {
  box-sizing: border-box;
  width: min(1120px, 100%);
  padding-inline: clamp(1rem, 3vw, 2rem);
}

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--bd);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
}

header.top .wrap {
  min-height: 76px;
  padding-block: 0.75rem;
}

.brand {
  color: var(--tx);
  font-size: 1.05rem;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.tool-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
}

.tool-brand img {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 0.55rem;
  object-fit: cover;
}

.tool-brand .tool-brand-name {
  overflow: hidden;
  color: var(--tx);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
}

.tool-brand .tool-brand-by {
  flex: 0 0 auto;
  color: var(--mut);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
}

.brand span {
  color: var(--ac);
}

header.top nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

header.top nav a {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.48rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: var(--tx2);
  font-size: 0.82rem;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

header.top nav a:hover,
header.top nav a:focus-visible {
  border-color: var(--bd);
  background: var(--sub);
  color: var(--tx);
}

header.top nav a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}

main.wrap {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: 2rem;
}

h1 {
  max-width: 20ch;
  margin-top: 0;
  color: var(--tx);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.06;
  text-wrap: balance;
}

.lead {
  max-width: 68ch;
  margin-bottom: 2rem;
  color: var(--tx2);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.7;
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--bd);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--card) 86%, var(--sub)));
  box-shadow: var(--tool-glow);
}

.card:focus-within {
  border-color: color-mix(in srgb, var(--ac) 46%, var(--bd));
}

label {
  color: var(--tx2);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  border-color: var(--bd);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--bg) 78%, var(--card));
  color: var(--tx);
}

input::placeholder,
textarea::placeholder {
  color: var(--mut);
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ac);
  outline-color: var(--ac);
}

input[type="range"] {
  accent-color: var(--ac);
}

input[type="checkbox"] {
  accent-color: var(--ac);
}

.btn {
  min-height: 2.55rem;
  border: 1px solid color-mix(in srgb, var(--ac) 35%, var(--bd));
  border-radius: 0.72rem;
  background: linear-gradient(120deg, rgba(0, 220, 255, 0.14), rgba(190, 65, 255, 0.13));
  color: var(--tx);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--ac);
  background: linear-gradient(120deg, rgba(0, 220, 255, 0.22), rgba(190, 65, 255, 0.19));
}

.btn.alt {
  background: var(--sub);
  color: var(--tx);
}

.big,
.kv b,
table td:last-child {
  color: var(--tx);
}

.kv div {
  border: 1px solid color-mix(in srgb, var(--bd) 76%, transparent);
  background: var(--sub);
}

section.info {
  max-width: 76ch;
  margin: 3rem auto 0;
}

section.info h2 {
  margin-top: 2.2rem;
  color: var(--tx);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

section.info p,
section.info li {
  color: var(--tx2);
}

section.info code,
main.wrap code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--bd);
  border-radius: 0.4rem;
  background: var(--sub);
  color: var(--tx);
  overflow-wrap: anywhere;
}

.note,
.disc {
  color: var(--tx2);
}

.disc {
  border-color: color-mix(in srgb, var(--ac) 40%, var(--bd));
  background: var(--sub);
}

table {
  color: var(--tx2);
}

th,
td {
  border-color: var(--bd);
}

th {
  color: var(--tx);
}

footer {
  margin-top: 2rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--bd);
  color: var(--mut);
  line-height: 1.9;
}

footer a {
  display: inline-block;
  color: var(--tx2);
  text-decoration: none;
}

footer a:hover {
  color: var(--ac);
}

body > nav[aria-label="Page navigation"] {
  width: min(920px, calc(100% - 2rem));
  margin: 1.25rem auto;
  padding: 0.85rem 1rem;
  border: 1px solid var(--bd);
  border-radius: 0.9rem;
  background: var(--card);
}

body > nav[aria-label="Page navigation"] a {
  color: var(--tx2);
  text-decoration: none;
}

body > main:not(.wrap) {
  width: min(920px, calc(100% - 2rem));
  max-width: none;
  margin: 0 auto 3rem;
  padding: clamp(1.25rem, 5vw, 3rem);
  border: 1px solid var(--bd);
  border-radius: 1.25rem;
  background: var(--card);
  box-shadow: var(--tool-glow);
}

body > main:not(.wrap) h1 {
  max-width: none;
  margin-bottom: 1rem;
}

body > main:not(.wrap) h2 {
  margin-top: 2rem;
  color: var(--tx);
  font-size: 1.2rem;
}

body > main:not(.wrap) p,
body > main:not(.wrap) li {
  color: var(--tx2);
}

body > main:not(.wrap) li + li {
  margin-top: 0.55rem;
}

@media (max-width: 760px) {
  header.top .wrap {
    align-items: flex-start;
  }

  header.top nav {
    width: 100%;
    padding-bottom: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
