/* =========================================================
   Papai's Audit Report — Stylesheet
   ========================================================= */

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

/* ---------- Theme tokens ---------- */
:root {
  /* brand */
  --red: #E8220A;
  --red-soft: rgba(232, 34, 10, 0.14);
  --green: #22c55e;
  --bad: #ff4444;

  /* dark (default) */
  --bg: #0a0a0a;
  --surface: #111;
  --card: #181818;
  --border: #252525;
  --border-strong: #333;
  --muted: #5a5a5a;
  --text: #e6e6e6;
  --text-strong: #ffffff;
  --label: #888;

  --shadow-img: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-img-hover: 0 10px 32px rgba(0, 0, 0, 0.6);

  --nav-w: 268px;
  --r: 10px;

  --head: 'Bricolage Grotesque', sans-serif;
  --body: 'Nunito', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

[data-theme="light"] {
  --bg: #fafaf9;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #e9e7e3;
  --border-strong: #d4d2cd;
  --muted: #8a8680;
  --text: #232220;
  --text-strong: #0c0c0b;
  --label: #555049;

  --shadow-img: 0 4px 16px rgba(20, 18, 12, 0.08);
  --shadow-img-hover: 0 10px 28px rgba(20, 18, 12, 0.14);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

#content {
    max-width: 900px;
    margin: auto;
}

a { color: var(--red); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; text-decoration: underline; }
.eyebrow a, .hero-p a, #foot a { color: inherit; border-bottom: 1px solid var(--red); }
.eyebrow a { color: var(--red); }
.hero-p a:hover, #foot a:hover { opacity: 0.75; }
/* ---------- Scroll progress ---------- */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--red);
  z-index: 999;
  width: 0%;
  transition: width 0.08s linear;
}

/* ---------- Sidebar ---------- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: none;
  transition: background 0.25s ease, border-color 0.25s ease;
}
#sidebar::-webkit-scrollbar { display: none; }

.sb-top {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sb-logo img {
  height: 30px;
  width: auto;

  display: block;

}
[data-theme="light"] .sb-logo img { filter: none; }

.sb-logo-fb {
  display: none;
  font-family: var(--head);
  font-weight: 800;
  font-size: 20px;
  color: var(--text-strong);
  letter-spacing: -0.3px;
}
.sb-logo-fb span { color: var(--red); }

.sb-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

.lang-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 14px;
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: transparent;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.lang-btn.active { background: var(--red); color: #fff; }
.lang-btn:hover:not(.active) { color: var(--text); }

/* ---------- Theme toggle ---------- */
.theme-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.theme-btn:hover {
  border-color: var(--red);
  color: var(--red);
}
.theme-btn svg { transition: opacity 0.2s ease, transform 0.3s ease; }
.theme-btn .ic-sun  { display: none; }
.theme-btn .ic-moon { display: block; }
[data-theme="light"] .theme-btn .ic-sun  { display: block; }
[data-theme="light"] .theme-btn .ic-moon { display: none; }

.sb-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-group { padding: 14px 0 6px; }
.nav-group-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 0 20px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 20px;
  color: var(--label);
  text-decoration: none;
  font-size: 13px;
  font-family: var(--body);
  transition: all 0.12s;
  border-left: 2px solid transparent;
}
.nav-link:hover,
.nav-link.active {
  color: var(--text-strong);
  background: rgba(127, 127, 127, 0.06);
  border-left-color: var(--red);
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
  transition: background 0.12s;
}
.nav-link:hover .nav-dot,
.nav-link.active .nav-dot { background: var(--red); }

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-family: var(--mono);
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--border);
  color: var(--muted);
}
.nav-badge.t { background: rgba(232, 34, 10, 0.18); color: #ff8070; }
.nav-badge.u { background: rgba(34, 197, 94, 0.14); color: #22a558; }
[data-theme="light"] .nav-badge.t { color: #c01a07; }
[data-theme="light"] .nav-badge.u { color: #128a3e; }

/* ---------- Main ---------- */
#main {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
}

#hero {
  padding: 68px 60px 52px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
#hero::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -60px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(232, 34, 10, 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

#hero h1 {
  font-family: var(--head);
  font-size: clamp(38px, 4.5vw, 62px);
  font-weight: 800;
  line-height: 1.0;
  color: var(--text-strong);
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}
#hero h1 em { color: var(--red); font-style: normal; }

.hero-credit {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 18px;
}
.hero-credit a {
  color: rgb(1, 127, 255);
  font-weight: 600;
  border-bottom: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kt-logo {
  height: 14px;
  width: auto;
  vertical-align: middle;
}

.hero-p {
  max-width: 560px;
  color: var(--label);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.stat { text-align: left; }
.stat-n {
  font-family: var(--head);
  font-size: 38px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-n em { color: var(--red); font-style: normal; }
.stat-l {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.section-block {
  padding: 52px 60px;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.sec-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.sec-icon.t { background: rgba(232, 34, 10, 0.14); }
.sec-icon.u { background: rgba(34, 197, 94, 0.1); }

.sec-title {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.4px;
}

.sec-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 3px 11px;
  border-radius: 99px;
}

/* ---------- Summary table ---------- */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
}

table.stbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.stbl th {
  text-align: left;
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.04);
}
.stbl td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.stbl tr:last-child td { border-bottom: none; }
.stbl tr:hover td { background: rgba(127, 127, 127, 0.04); }

.id-chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.cpill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
}
.cpill.t { background: rgba(232, 34, 10, 0.14); color: #ff8070; }
.cpill.u { background: rgba(34, 197, 94, 0.12); color: #22a558; }
.cpill.s { background: rgba(99, 179, 237, 0.12); color: #2b7fb8; }
[data-theme="light"] .cpill.t { color: #c01a07; }

/* ---------- Issue cards ---------- */
.issue-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 24px;
  overflow: hidden;
  transition: border-color 0.18s, background 0.25s ease;
}
.issue-card:hover { border-color: var(--border-strong); }

.ic-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 16px;
  cursor: pointer;
  user-select: none;
}

.ic-num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  background: var(--border);
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 3px;
}

.ic-tw { flex: 1; }
.ic-title {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}
.ic-sub { font-size: 13px; color: var(--muted); }

.ic-tags {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  font-family: var(--mono);
}
.tag.b { background: rgba(255, 68, 68, 0.13); color: #ff8080; border: 1px solid rgba(255, 68, 68, 0.22); }
.tag.g { background: rgba(34, 197, 94, 0.12); color: #22a558; border: 1px solid rgba(34, 197, 94, 0.22); }
.tag.i { background: rgba(99, 179, 237, 0.12); color: #2b7fb8; border: 1px solid rgba(99, 179, 237, 0.22); }
[data-theme="light"] .tag.b { color: #c01a07; }

.ic-arrow {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.22s, background 0.18s;
}
.issue-card.open .ic-arrow {
  transform: rotate(180deg);
  background: rgba(232, 34, 10, 0.18);
  color: var(--red);
}

.ic-body {
  display: none;
  padding: 0 22px 22px;
}
.issue-card.open .ic-body { display: block; }

.ic-desc {
  background: rgba(127, 127, 127, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--label);
  line-height: 1.7;
}
.ic-desc strong { color: var(--text); }
.ic-desc code,
.resolution code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(127, 127, 127, 0.12);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text);
}

/* ---------- Modern Before / After comparison ---------- */
.cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 22px;
}
.cmp-grid.single { grid-template-columns: 1fr; max-width: 760px; }

.cmp-panel {
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmp-lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent !important;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.cmp-lbl .cmp-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.cmp-lbl.b .cmp-tag { color: #ff5a5a; }
.cmp-lbl.g .cmp-tag { color: #22a558; }
.cmp-lbl.f .cmp-tag { color: #2b7fb8; }
[data-theme="light"] .cmp-lbl.b .cmp-tag { color: #d11a05; }

.cmp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cmp-lbl.b {
    color :#ff4444;
}

.cmp-lbl.g {
    color :#22c55e;
}

.cmp-lbl.f {
    color :#63b3ed;
}
.cmp-lbl.b .cmp-dot { background: #ff4444; box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.16); }

.cmp-lbl.g .cmp-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); }
.cmp-lbl.f .cmp-dot { background: #63b3ed; box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.16); }

.cmp-img {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
  box-shadow: var(--shadow-img);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cmp-img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-img-hover);
}

/* ---------- Resolution callout ---------- */
.resolution {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 8px;
  padding: 15px 18px;
}
.res-title {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  color: #22a558;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.resolution p {
  font-size: 13.5px;
  color: var(--label);
  line-height: 1.65;
}
.resolution p + p { margin-top: 6px; }
.resolution em { color: var(--text); font-style: italic; }
.resolution strong { color: var(--text); }

/* ---------- Hamburger ---------- */
#ham {
  display: none;
  position: fixed;
  top: 13px;
  left: 13px;
  z-index: 200;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
#ham span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-strong);
  border-radius: 2px;
}

/* ---------- Footer ---------- */
#foot {
  padding: 36px 60px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
#foot strong { color: var(--red); }
.foot-sub-line { margin-top: 7px; font-size: 12px; }

.foot-credit {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.3px;
  color: var(--muted);
}
.foot-credit a { color: var(--text); border-bottom: none; display: inline-flex; align-items: center; gap: 5px; }
.foot-credit a:hover { color: rgb(1, 127, 255); }
.foot-credit a:hover { opacity: 0.8; }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  cursor: zoom-out;
}
[data-theme="light"] #lightbox { background: rgba(20, 18, 12, 0.85); }
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
#lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s, background 0.25s ease;
  }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
  #ham { display: flex; }
  .section-block, #hero {
    padding-left: 22px;
    padding-right: 22px;
  }
  #foot { padding: 28px 22px; }
  .cmp-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-stats { gap: 22px; }
}

:target { scroll-margin-top: 20px; }
