@font-face {
  font-family: "PT Serif";
  src: url("./assets/pt-serif.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Rubik;
  src: url("./assets/rubik.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./assets/bricolage.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0d090a;
  --panel: #171012;
  --panel-raised: #201619;
  --input-bg: #100b0c;
  --line: #41292a;
  --text: #fff2e7;
  --muted: #cab8b7;
  --gold: #e2bb8b;
  --red: #982224;
  --red-line: #c04e44;
  --success: #8edab0;
  --error: #ff9a91;
  --text-font: Rubik, system-ui, sans-serif;
  --display-font: "Bricolage Grotesque", var(--text-font);
  --section-font: "PT Serif", Georgia, serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf2e9;
  --panel: #fffbf7;
  --panel-raised: #f5e6df;
  --input-bg: #fffaf5;
  --line: #dfc1b6;
  --text: #2d1a1d;
  --muted: #624448;
  --gold: #8c352e;
  --red: #8e1d24;
  --red-line: #b24542;
  --success: #196e49;
  --error: #9a2728;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 82px; }
body {
  margin: 0;
  background: radial-gradient(ellipse at top right, #49121b35, transparent 44rem), var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--text-font);
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, .actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-raised);
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
}
button:hover:not(:disabled), .actions a:hover { border-color: var(--gold); }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button.primary, .actions .primary {
  background: var(--red);
  border-color: var(--red-line);
  color: #fff7ed;
}
button.primary:hover, .actions .primary:hover { background: #a82e2b; border-color: #ea8d76; }
[hidden] { display: none !important; }

.top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 10px clamp(14px, 4vw, 58px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font: 800 clamp(15px, 2.15vw, 22px)/1 var(--display-font);
  letter-spacing: .028em;
}
.brand img { object-fit: contain; flex: none; }
.brand span { color: var(--gold); font: 700 11px/1 var(--text-font); letter-spacing: .12em; }
.top-actions { white-space: nowrap; display: flex; gap: 8px; font-size: 14px; }
.top-actions button { min-height: 39px; }
#floating-count { color: var(--gold); font-weight: 750; }
.layout {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  max-width: 1500px;
  margin: auto;
  padding: 26px clamp(14px, 4vw, 58px) 35px;
}
.rail nav { position: sticky; top: 84px; display: grid; gap: 3px; max-height: calc(100dvh - 96px); overflow: auto; padding: 11px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); scrollbar-width: thin; }
.nav-group { margin: 13px 0 3px 10px; color: var(--gold); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.nav-group:first-child { margin-top: 5px; }
nav a { color: var(--muted); text-decoration: none; padding: 7px 10px; border-left: 2px solid transparent; border-radius: 0 7px 7px 0; font-size: 13px; }
nav a:hover, nav a[aria-current="location"] { color: var(--text); border-color: var(--gold); background: var(--panel-raised); }

.intro {
  --hero-text: #fff2e7;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(322px, 30vw, 450px);
  overflow: hidden;
  border: 1px solid #805044;
  border-radius: 18px;
  background: #140708;
  color: var(--hero-text);
  box-shadow: 0 24px 65px -40px #a3372c85;
}
.intro-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; }
.intro::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #120608f2 0%, #120608c9 23%, #1206082e 52%, transparent 70%), linear-gradient(0deg, #13060875, transparent 30%); }
.intro-copy { padding: clamp(26px, 4.1vw, 66px); width: min(100%, 510px); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #efcba7; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #f96b57; box-shadow: 0 0 12px #f34b3d90; }
.intro h1 { margin: 8px 0 12px; font: 800 clamp(65px, 8.2vw, 116px)/.94 var(--display-font); letter-spacing: -.06em; white-space: nowrap; }
.intro .accent { color: #efbe91; margin-left: .035em; }
.intro-description { color: #ead5ce; font-size: clamp(17px, 1.7vw, 22px); line-height: 1.25; max-width: 24ch; }
.actions, .btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.intro .actions { margin-top: 23px; }
.intro .actions a { min-height: 48px; gap: 12px; color: var(--hero-text); }
.intro .actions a:not(.primary) { background: #200f13de; border-color: #976655; }

.test-directory { display: grid; gap: clamp(28px, 4vw, 47px); margin-top: clamp(23px, 3vw, 39px); }
.check-group > h2 {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 14px; color: var(--text);
  font: 400 clamp(24px, 3.2vw, 38px)/1.12 var(--section-font);
  letter-spacing: -.035em;
}
.check-group > h2::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--line) 40%, transparent);
  opacity: .54;
}
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.check-group-quick .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-group-quick .qa-section:last-child, .check-group-links .qa-section { grid-column: 1 / -1; }
.qa-section {
  min-width: 0;
  border: 1px solid var(--line); border-radius: 13px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--gold) 6%, var(--panel)), var(--panel) 56%);
}
.qa-section:hover { border-color: color-mix(in srgb, var(--gold) 46%, var(--line)); }
.qa-section[open] { border-color: color-mix(in srgb, var(--gold) 32%, var(--line)); }
.feature-check {
  background: radial-gradient(ellipse at top left, color-mix(in srgb, var(--red) 30%, transparent), transparent 70%), var(--panel);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gold) 22%, transparent);
}
summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; text-align: center; color: var(--gold); font-size: 17px; line-height: 1; }
details[open] summary::after { content: "−"; }
summary h3 { font-size: clamp(15px, 1.7vw, 20px); line-height: 1.2; font-weight: 560; letter-spacing: -.025em; }
.feature-check summary h3 { font-weight: 620; }
.tool-icon {
  display: grid; place-items: center; width: 37px; height: 37px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: 9px;
  background: color-mix(in srgb, var(--red) 20%, var(--panel-raised)); color: var(--gold);
  font: 500 18px/1 system-ui, sans-serif;
}
.content { display: grid; gap: 13px; min-width: 0; margin-inline: 16px; padding: 13px 0 17px; border-top: 1px solid var(--line); }
.content p, label, .status-line, .inline-msg { color: var(--muted); }
.sec-desc { font-size: 14px; line-height: 1.62; }
.btn-row button { min-height: 45px; }
.field, label { display: grid; gap: 4px; }
label, .status-line { font-size: 13px; }
label { font-weight: 500; }
.status-line { padding: 8px 10px; border-radius: 7px; background: var(--input-bg); }
input:not([type="file"], [type="range"], [type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
}
input[type="checkbox"], input[type="range"] { accent-color: var(--red); }
input[type="range"] { max-width: 245px; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; }
.inline-msg, .preview-item, dd, #logger-list { overflow-wrap: anywhere; }
.inline-msg.success, .log-success { color: var(--success); }
.inline-msg.error, .log-error { color: var(--error); }
.drop-zone { padding: 11px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; color: var(--muted); }
.drop-zone.dragover { border-color: var(--gold); color: var(--gold); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 150px)); gap: 9px; }
.preview-grid:empty { display: none; }
.preview-item { padding: 7px; border: 1px solid var(--line); border-radius: 8px; }
.preview-item img { display: block; width: 100%; height: 96px; object-fit: cover; margin-bottom: 6px; border-radius: 5px; }
video { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; background: #080609; }
dl { margin: 0; display: grid; grid-template-columns: minmax(92px, 1fr) minmax(0, 2.6fr); gap: 5px 10px; }
dt { color: var(--muted); }
dd { margin: 0; }
.info-grid > .row { display: contents; }
iframe { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 8px; }
.test-iframe:not(.show) { display: none; }
dialog { width: min(600px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: #0a0508bd; }
.kb-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.offers-list { display: grid; gap: 9px; }
.offer-row { display: flex; flex-wrap: wrap; gap: 8px; }
.logger { position: fixed; inset: auto 14px 14px auto; z-index: 4; width: min(620px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 14px 54px #0008; }
.log-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.log-head h2 { margin-right: auto; font: 400 20px/1.2 var(--section-font); }
#logger-list { list-style: none; margin: 0; padding: 10px 12px; max-height: min(38dvh, 330px); overflow: auto; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
#logger-list li { display: grid; grid-template-columns: 7.5ch auto 1fr; align-items: start; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
#logger-list li .ts { opacity: .8; }
#logger-list li .tag { padding: 0 5px; border-radius: 4px; background: var(--panel-raised); font-size: 11px; font-weight: 650; }
.kb-open .logger { display: none; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding: 15px 0 0; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .brand { font-size: 14px; }
.site-footer > a:last-child { text-underline-offset: 4px; }
.target-page { max-width: 640px; padding: 24px 15px; margin: 8vh auto; }
.target-page .content { margin: 0; padding: clamp(20px, 5vw, 35px); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.target-page h1 { font: 400 clamp(26px, 6vw, 42px)/1.05 var(--section-font); letter-spacing: -.04em; }

@media (max-width: 820px) {
  .layout { display: block; padding-top: 12px; }
  .rail nav { position: static; display: flex; gap: 5px; overflow-x: auto; white-space: nowrap; padding: 3px 3px 7px; margin-bottom: 10px; border: 0; background: transparent; }
  .nav-group { display: none; }
  nav a { border-left: 0; border-bottom: 2px solid transparent; border-radius: 7px; background: var(--panel); }
}
@media (max-width: 600px) {
  .top { min-height: 56px; padding-block: 8px; }
  .brand img { width: 27px; height: 30px; }
  .brand span { display: none; }
  .top-actions { font-size: 13px; gap: 5px; }
  .top-actions button { min-height: 35px; padding-inline: 8px; }
  .intro { min-height: 365px; align-items: end; border-radius: 14px; }
  .intro-art { height: 90%; object-position: right top; }
  .intro::after { background: linear-gradient(0deg, #120608 4%, #120608f0 23%, #1206086b 60%, transparent 84%), linear-gradient(90deg, #120608c0, transparent 76%); }
  .intro-copy { padding: 20px; }
  .intro h1 { font-size: clamp(50px, 15vw, 78px); margin-block: 5px 9px; }
  .intro-description { max-width: 29ch; font-size: 16px; }
  .intro .actions { margin-top: 15px; }
  .intro .actions a { flex: 1 1 auto; min-height: 44px; padding-inline: 9px; font-size: 15px; }
  .check-grid, .check-group-quick .check-grid { grid-template-columns: 1fr; gap: 9px; }
  .check-group > h2 { margin-bottom: 10px; }
  summary { padding: 12px; }
  .content { margin-inline: 12px; padding-bottom: 14px; }
}
@media (max-width: 355px) {
  .top { gap: 5px; }
  .brand { gap: 5px; font-size: 13px; }
  .top-actions button { padding-inline: 6px; }
  #theme { min-width: 35px; font-size: 0; }
  #theme::after { content: "☀"; font-size: 17px; }
  #theme[aria-pressed="true"]::after { content: "☾"; }
}
