:root {
  --bg: #1f231c;
  --bg-deep: #151812;
  --paper: #f3ead6;
  --paper-2: #e9dcc3;
  --ink: #1b1713;
  --ink-soft: #5e5549;
  --rule: #cbbda4;
  --accent: #c45c1a;
  --accent-ink: #fff8ee;
  --vuln: #b13228;
  --patched: #2c6b4a;
  --unknown: #4f5b66;
  --eol: #8a5a12;
  --nophp: #3d4a3f;
  --error: #6b2c4a;
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 92, 26, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(44, 107, 74, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: linear-gradient(rgba(243, 234, 214, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 234, 214, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}

.wrap {
  position: relative;
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 36px;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 28px;
}

.mast-aside {
  display: grid;
  gap: 12px;
  justify-items: end;
  align-self: start;
}

.brand-mark,
.footer-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 16px;
  padding: 8px 12px;
  line-height: 0;
}

.brand-mark img,
.footer-logo img {
  display: block;
  width: auto;
  height: 52px;
  max-width: 180px;
  object-fit: contain;
}

.kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d7c7a6;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.lede {
  margin: 10px 0 0;
  max-width: 42ch;
  color: #d9ccb4;
  font-size: 1.02rem;
}

.badge {
  align-self: start;
  border: 1px solid rgba(243, 234, 214, 0.28);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f3ead6;
}

.sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: #9d2a22;
}

.sheet + .sheet {
  margin-top: 22px;
}

.sheet-inner {
  padding: 28px 28px 28px 38px;
}

.sheet h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.muted {
  color: var(--ink-soft);
  margin: 0 0 18px;
  line-height: 1.5;
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input[type="url"],
input[type="text"] {
  width: 100%;
  border: 1px solid #b9aa90;
  background: #fffaf0;
  color: var(--ink);
  font: 1rem/1.3 var(--font-mono);
  padding: 14px;
  border-radius: 2px;
}

input[type="url"]:focus,
input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0 22px;
  cursor: pointer;
  min-height: 50px;
}

button:hover,
button:focus-visible {
  background: #a34b14;
}

.limits {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
}

.limits li {
  list-style: none;
  padding-left: 1.1rem;
  position: relative;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.limits li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.alert {
  background: #f4d7d2;
  color: #6f1d18;
  padding: 14px 16px;
  margin: 0 0 18px;
  font-weight: 600;
}

.verdict {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}

.stamp {
  border: 4px solid currentColor;
  color: var(--unknown);
  text-align: center;
  padding: 16px 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  background: rgba(255, 255, 255, 0.35);
}

.stamp small {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 0.65rem;
}

.verdict.vulnerable .stamp { color: var(--vuln); }
.verdict.ok .stamp { color: var(--patched); }
.verdict.eol .stamp { color: var(--eol); }
.verdict.unknown .stamp { color: var(--unknown); }
.verdict.no_php .stamp { color: var(--nophp); }
.verdict.error .stamp { color: var(--error); }

.summary {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
}

.meta-grid,
.evidence {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 0.92rem;
}

.meta-grid th,
.evidence th,
.meta-grid td,
.evidence td {
  border-top: 1px solid var(--rule);
  text-align: left;
  padding: 8px 8px 8px 0;
  vertical-align: top;
}

.meta-grid th,
.evidence th {
  width: 34%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  word-break: break-word;
}

.download {
  margin: 16px 0 0;
}

.download a {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.legend div {
  border-top: 2px solid var(--ink);
  padding-top: 8px;
}

.legend strong {
  display: block;
  font-family: var(--font-display);
  margin-bottom: 4px;
}

.legend span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-head h2 {
  margin: 0;
}

.history-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.history-sheet {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 22px;
}

.history-ticker {
  container-type: inline-size;
  overflow: hidden;
  margin: 4px -18px 8px -10px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

.history-track {
  display: flex;
  width: max-content;
  animation: history-marquee var(--history-duration, 48s) linear infinite;
}

.history-seq {
  display: flex;
  gap: 8px;
  padding-right: 8px;
}

.history-chip {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: calc(100cqw / var(--chip-count, 20) - 8px);
  min-width: 0;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  background: #fffaf0;
  color: var(--ink);
  text-decoration: none;
}

.history-chip:hover,
.history-chip:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.history-chip-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.history-ticker:hover .history-track,
.history-ticker:focus-within .history-track {
  animation-play-state: paused;
}

@keyframes history-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .history-track {
    animation: none;
  }

  .history-ticker {
    overflow-x: auto;
    mask-image: none;
  }

  .history-seq[aria-hidden="true"] {
    display: none;
  }
}

.history-acc {
  margin-top: 10px;
}

.history-acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.history-acc summary::-webkit-details-marker {
  display: none;
}

.history-acc summary::after {
  content: "▾";
  color: var(--accent);
  font-size: 0.9rem;
}

.history-acc[open] summary::after {
  content: "▴";
}

.history-acc .muted {
  margin-top: 14px;
}

.history-list {
  margin: 14px 0 0;
  padding: 0;
  max-height: 420px;
  overflow: auto;
}

.history-list li {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 14px;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding: 10px 0;
  font-size: 0.88rem;
}

.history-url {
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-url:hover,
.history-url:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.history-list time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.history-status {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--unknown);
}

.history-status.vulnerable { color: var(--vuln); }
.history-status.ok { color: var(--patched); }
.history-status.eol { color: var(--eol); }
.history-status.unknown { color: var(--unknown); }
.history-status.no_php { color: var(--nophp); }
.history-status.error { color: var(--error); }

.site-footer {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto 40px;
  border-top: 1px solid rgba(243, 234, 214, 0.18);
  padding-top: 22px;
  color: #cfc3ad;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
}

.footer-logo img {
  height: 58px;
  max-width: 200px;
}

.footer-contacts,
.footer-note {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.footer-contacts a {
  color: #f3ead6;
}

.footer-contacts a:hover,
.footer-contacts a:focus-visible {
  color: #fff;
}

.footer-note {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: #b7aa93;
}

@media (max-width: 720px) {
  .masthead,
  .verdict,
  .row,
  .legend,
  .footer-inner,
  .history-list li {
    grid-template-columns: 1fr;
  }

  .mast-aside {
    justify-items: start;
  }

  button {
    width: 100%;
    min-height: 48px;
  }

  .stamp {
    transform: none;
    width: min(260px, 100%);
  }
}
