/* ============================================================
   CheaterWatch — design system (white / grey / red)
   ============================================================ */
:root {
  --red: #e8383d;
  --red-600: #cf2a2f;
  --red-100: #fdeced;
  --ink: #131418;
  --charcoal: #17181c;
  --charcoal-2: #1f2126;
  --grey-800: #2b2d33;
  --grey-600: #6b6d73;
  --grey-500: #8a8c93;
  --grey-300: #d8dadf;
  --grey-200: #e7e8ec;
  --grey-100: #f3f4f6;
  --grey-50: #f9fafb;
  --white: #fff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(19, 20, 24, 0.06), 0 1px 3px rgba(19, 20, 24, 0.05);
  --shadow: 0 10px 30px -10px rgba(19, 20, 24, 0.18);
  --shadow-lg: 0 30px 60px -20px rgba(19, 20, 24, 0.28);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--white);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--red); color: #fff; }

.container { width: min(1180px, 100% - 48px); margin-inline: auto; }
.section { padding: 110px 0; position: relative; }
.section.alt { background: var(--grey-100); }
.section.dark { background: var(--charcoal); color: #fff; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 26px; height: 2px; background: currentColor; }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; }
.section-head p { color: var(--grey-600); font-size: 1.1rem; }
.dark .section-head p { color: var(--grey-300); }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--red); --fg: #fff; --bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 10px; font: 600 0.95rem var(--font); cursor: pointer;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
  position: relative; overflow: hidden; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(232, 56, 61, 0.55); }
.btn:active { transform: translateY(0); }
.btn::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn.ghost { --bg: transparent; --fg: #fff; --bd: rgba(255,255,255,.28); }
.btn.ghost:hover { --bg: rgba(255,255,255,.08); box-shadow: none; }
.btn.light { --bg: var(--white); --fg: var(--ink); --bd: var(--grey-300); }
.btn.light:hover { box-shadow: var(--shadow); }
.btn.dark { --bg: var(--charcoal); --fg: #fff; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(23, 24, 28, 0.86);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,.07); color: #fff;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font: 700 1.15rem var(--display); letter-spacing: -0.01em; }
.brand img { height: 42px; width: auto; }
.brand b { color: var(--red); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px; font-size: 0.92rem; font-weight: 500; color: #c9cbd1; position: relative;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--red); border-radius: 2px;
  animation: grow .4s var(--ease);
}
.nav-cta { display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; }
.menu-btn svg { width: 26px; height: 26px; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 960px) {
  .menu-btn { display: block; }
  .nav-links, .nav-cta { display: none; }
  .site-header.open .nav { flex-wrap: wrap; height: auto; padding: 14px 0 20px; }
  .site-header.open .nav-links, .site-header.open .nav-cta { display: flex; width: 100%; }
  .site-header.open .nav-links { flex-direction: column; align-items: stretch; }
  .site-header.open .nav-cta .btn { flex: 1; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; background: var(--charcoal); color: #fff; overflow: hidden; isolation: isolate;
  padding: 90px 0 120px;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.9; }
.hero::before {
  content: ''; position: absolute; z-index: -1; width: 760px; height: 760px; right: -180px; top: -200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,56,61,.32), transparent 65%); animation: drift 14s ease-in-out infinite alternate;
}
.hero::after {
  content: ''; position: absolute; z-index: -1; inset: auto 0 0 0; height: 160px;
  background: linear-gradient(to top, var(--charcoal), transparent);
}
@keyframes drift { to { transform: translate(-80px, 60px) scale(1.15); } }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--red); position: relative; white-space: nowrap; }
.hero .lead { font-size: 1.2rem; color: #c3c5cb; max-width: 560px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); font-size: 0.82rem; color: #d4d6db; margin-bottom: 26px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: relative; }
.pulse-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--red); animation: ping 2s infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }

.hero-logo { display: grid; place-items: center; position: relative; }
.hero-logo img { width: min(440px, 90%); filter: drop-shadow(0 30px 50px rgba(0,0,0,.5)); animation: float 6s ease-in-out infinite, logoIn 1.2s var(--ease) both; }
.hero-logo::before, .hero-logo::after {
  content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); width: 78%; aspect-ratio: 1; animation: spin 40s linear infinite;
}
.hero-logo::after { width: 100%; border-style: dashed; border-color: rgba(232,56,61,.25); animation-duration: 70s; animation-direction: reverse; }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes logoIn { from { opacity: 0; transform: scale(.85) rotate(-4deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); overflow: hidden; margin-top: 80px; }
.stat { background: rgba(23,24,28,.85); padding: 26px 28px; }
.stat b { display: block; font: 700 2.3rem var(--display); letter-spacing: -0.03em; }
.stat span { color: var(--grey-500); font-size: 0.88rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-logo { order: -1; }
  .hero-logo img { width: 260px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; position: relative; counter-reset: step; }
.pipeline::before {
  content: ''; position: absolute; top: 34px; left: 6%; right: 6%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--grey-300) 0 8px, transparent 8px 16px);
}
.pipeline::after {
  content: ''; position: absolute; top: 34px; left: 6%; height: 2px; width: 0; background: var(--red);
  transition: width 2.2s var(--ease) .3s;
}
.pipeline.in::after { width: 88%; }
.p-step { text-align: center; position: relative; padding: 0 6px; }
.p-node {
  width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 18px; background: var(--white); border: 1px solid var(--grey-300);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); position: relative; z-index: 1;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.p-node svg { width: 28px; height: 28px; color: var(--grey-600); transition: color .3s; }
.p-step:hover .p-node { transform: translateY(-6px); border-color: var(--red); box-shadow: var(--shadow); }
.p-step:hover .p-node svg { color: var(--red); }
.p-step h4 { font-size: 0.95rem; margin-bottom: 4px; }
.p-step p { font-size: 0.78rem; color: var(--grey-600); margin: 0; line-height: 1.4; }
.pipeline .p-step { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.pipeline.in .p-step { opacity: 1; transform: none; }
.pipeline.in .p-step:nth-child(1) { transition-delay: .05s; } .pipeline.in .p-step:nth-child(2) { transition-delay: .2s; }
.pipeline.in .p-step:nth-child(3) { transition-delay: .35s; } .pipeline.in .p-step:nth-child(4) { transition-delay: .5s; }
.pipeline.in .p-step:nth-child(5) { transition-delay: .65s; } .pipeline.in .p-step:nth-child(6) { transition-delay: .8s; }
.pipeline.in .p-step:nth-child(7) { transition-delay: .95s; } .pipeline.in .p-step:nth-child(8) { transition-delay: 1.1s; }
@media (max-width: 960px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); gap: 30px 10px; }
  .pipeline::before, .pipeline::after { display: none; }
}

/* ---------- cards ---------- */
.grid { display: grid; gap: 22px; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.c3, .grid.c2 { grid-template-columns: 1fr; } }
.card {
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 30px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--grey-300); }
.card:hover::before { transform: scaleX(1); }
.card .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--red-100); color: var(--red); display: grid; place-items: center; margin-bottom: 20px; }
.card .icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.card p { color: var(--grey-600); margin: 0; font-size: 0.97rem; }
.card.dark { background: var(--charcoal-2); border-color: rgba(255,255,255,.08); color: #fff; }
.card.dark p { color: var(--grey-300); }

/* ---------- partners ---------- */
.card.partner { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.card.partner h3 { margin: 4px 0 0; }
.p-logo { width: 64px; height: 64px; border-radius: 16px; background: var(--charcoal); color: #fff; display: grid; place-items: center; font: 700 1.6rem var(--display); position: relative; overflow: hidden; }
.p-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--white); }

/* ---------- evidence media ---------- */
.evidence-grid { display: grid; gap: 22px; margin-top: 20px; }
.evidence-fig { margin: 0; background: var(--charcoal); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.evidence-fig video, .evidence-fig img { width: 100%; max-height: 70vh; display: block; background: #000; object-fit: contain; }
.evidence-fig figcaption { padding: 12px 18px; color: #c3c5cb; font-size: .9rem; }
.file-ev { margin: 10px 0; border: 1px solid var(--grey-200); border-radius: 12px; overflow: hidden; }
.file-ev video, .file-ev img { width: 100%; max-height: 300px; display: block; background: #000; object-fit: contain; }
.file-ev .meta { padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.file-ev .meta .grow { flex: 1; min-width: 160px; }
.drop { border: 2px dashed var(--grey-300); border-radius: 12px; padding: 20px; text-align: center; color: var(--grey-600); font-size: .92rem; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-100); }
.drop input { display: none; }
.progress { height: 6px; background: var(--grey-200); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .25s; }
.up-item { font-size: .88rem; margin-top: 12px; }

/* ---------- policy ---------- */
.policy { display: grid; grid-template-columns: 220px 1fr; gap: 56px; }
.policy nav { position: sticky; top: 100px; align-self: start; }
.policy nav a { display: block; padding: 7px 14px; border-left: 2px solid var(--grey-200); color: var(--grey-600); font-size: .92rem; transition: all .2s; }
.policy nav a:hover { color: var(--red); border-color: var(--red); }
.policy article { max-width: 760px; }
.policy h2 { font-size: 1.6rem; margin: 48px 0 14px; scroll-margin-top: 100px; }
.policy h2:first-of-type { margin-top: 0; }
.policy p, .policy li { color: var(--grey-800); }
.policy ul, .policy ol { padding-left: 1.2em; margin: 0 0 1em; }
.policy li { margin-bottom: .5em; }
.policy .updated { color: var(--grey-500); font-size: .88rem; margin-bottom: 28px; }
@media (max-width: 900px) { .policy { grid-template-columns: 1fr; } .policy nav { display: none; } }

/* ---------- code block ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.code {
  background: #0f1013; border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  font-family: var(--mono); font-size: 0.85rem; color: #d7d9de;
}
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #17181c; border-bottom: 1px solid rgba(255,255,255,.06); color: var(--grey-500); font-size: .78rem; }
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3c43; }
.code-bar i:first-child { background: var(--red); }
.code-bar span { margin-left: auto; }
.code pre { margin: 0; padding: 20px 22px; overflow-x: auto; line-height: 1.75; }
.code .k { color: #ff6b70; } .code .s { color: #f0c987; } .code .c { color: #6d7078; } .code .n { color: #9fb8d8; } .code .g { color: #8fd19e; }

/* ---------- CTA ---------- */
.cta-band { background: var(--red); color: #fff; padding: 80px 0; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 26px); animation: slide 20s linear infinite; }
@keyframes slide { to { background-position: 400px 0; } }
.cta-inner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.cta-inner h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); max-width: 600px; }

/* ---------- footer ---------- */
.site-footer { background: var(--charcoal); color: #b6b8be; padding: 70px 0 30px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 46px; border-bottom: 1px solid rgba(255,255,255,.08); }
.foot-grid h5 { color: #fff; font: 600 0.85rem var(--font); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 16px; }
.foot-grid a { display: block; padding: 5px 0; font-size: .93rem; transition: color .2s, transform .2s; }
.foot-grid a:hover { color: #fff; transform: translateX(3px); }
.foot-grid p { font-size: .93rem; max-width: 320px; }
.foot-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 26px; font-size: .84rem; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- inner page hero ---------- */
.page-hero { background: var(--charcoal); color: #fff; padding: 76px 0 70px; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; right: -120px; top: -160px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(232,56,61,.28), transparent 65%); }
.page-hero::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--red), transparent 60%); transform-origin: left; animation: grow 1.2s var(--ease); }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 14px; }
.page-hero p { color: #c3c5cb; font-size: 1.12rem; max-width: 620px; margin: 0; }
.page-hero .container { position: relative; }

/* ---------- forms ---------- */
.form-card { background: var(--white); border: 1px solid var(--grey-200); border-radius: 18px; padding: 38px; box-shadow: var(--shadow); }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--grey-800); }
.field .hint { font-weight: 400; color: var(--grey-500); }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--grey-300); border-radius: 10px; font: 400 .97rem var(--font);
  background: var(--white); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(232,56,61,.13); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } .form-card { padding: 24px; } }
.notice { background: var(--grey-100); border-left: 3px solid var(--red); padding: 14px 18px; border-radius: 8px; font-size: .9rem; color: var(--grey-800); margin-bottom: 26px; }
.form-msg { margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: .92rem; display: none; }
.form-msg.show { display: block; animation: fadeUp .4s var(--ease); }
.form-msg.err { background: var(--red-100); color: var(--red-600); border: 1px solid #f7c9cb; }
.form-msg.ok { background: #eef8f0; color: #1d6b32; border: 1px solid #c6e7cf; }
.narrow { max-width: 780px; margin-inline: auto; }

/* ---------- tables / lists ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar .input { flex: 1 1 260px; }
.toolbar .select { flex: 0 0 200px; }
.table-wrap { background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th { text-align: left; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--grey-500); padding: 14px 20px; background: var(--grey-50); border-bottom: 1px solid var(--grey-200); }
.tbl td { padding: 16px 20px; border-bottom: 1px solid var(--grey-100); font-size: .93rem; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .2s; animation: fadeUp .5s var(--ease) both; }
.tbl tbody tr:hover { background: var(--grey-50); }
.tbl tr.click { cursor: pointer; }
.player { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--charcoal); color: #fff; display: grid; place-items: center; font: 700 .95rem var(--display); flex: none; }
.player b { display: block; line-height: 1.2; }
.player small { color: var(--grey-500); font-family: var(--mono); font-size: .75rem; }
.mono { font-family: var(--mono); font-size: .82rem; color: var(--grey-600); }
.empty { text-align: center; padding: 60px 20px; color: var(--grey-500); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--grey-300); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 24px; font-size: .9rem; color: var(--grey-600); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* ---------- chips & rank badges ---------- */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--grey-100); color: var(--grey-800); border: 1px solid var(--grey-200); text-transform: capitalize; white-space: nowrap; }
.chip.red { background: var(--red-100); color: var(--red-600); border-color: #f7c9cb; }
.chip.green { background: #eef8f0; color: #1d6b32; border-color: #c6e7cf; }
.chip.amber { background: #fff6e5; color: #8a5a00; border-color: #f5dfae; }
.chip.dark { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

.rank { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.rank::before { content: ''; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); }
.rank.r-staff { background: var(--grey-100); color: var(--grey-600); border: 1px solid var(--grey-200); }
.rank.r-senior-staff { background: var(--grey-200); color: var(--grey-800); }
.rank.r-management { background: var(--grey-800); color: #fff; }
.rank.r-warden { background: #8f1d21; color: #fff; }
.rank.r-creator { background: var(--red); color: #fff; box-shadow: 0 0 0 0 rgba(232,56,61,.5); animation: glow 2.6s infinite; }
@keyframes glow { 70% { box-shadow: 0 0 0 8px rgba(232,56,61,0); } 100% { box-shadow: 0 0 0 0 rgba(232,56,61,0); } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 56px; }
.docs nav { position: sticky; top: 100px; align-self: start; }
.docs nav a { display: block; padding: 7px 14px; border-left: 2px solid var(--grey-200); color: var(--grey-600); font-size: .92rem; transition: all .2s; }
.docs nav a:hover { color: var(--red); border-color: var(--red); }
.docs h2 { font-size: 1.7rem; margin: 52px 0 14px; scroll-margin-top: 100px; }
.docs h2:first-child { margin-top: 0; }
.docs p, .docs li { color: var(--grey-800); }
.docs .code { margin: 18px 0 26px; box-shadow: var(--shadow); }
.method { display: inline-flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: .9rem; background: var(--grey-100); border: 1px solid var(--grey-200); padding: 8px 14px; border-radius: 8px; margin-bottom: 14px; }
.method b { color: var(--red); }
.tag-preview { background: var(--red-100); color: var(--red-600); border: 1px solid #f7c9cb; padding: 2px 9px; border-radius: 999px; font: 700 .7rem var(--font); letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; margin-left: 8px; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; } .docs nav { display: none; } }

/* ---------- status ---------- */
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--grey-100); gap: 16px; }
.status-row:last-child { border-bottom: 0; }
.status-ok { display: inline-flex; align-items: center; gap: 8px; color: #1d6b32; font-weight: 600; font-size: .9rem; }
.status-ok i { width: 9px; height: 9px; border-radius: 50%; background: #2fb457; box-shadow: 0 0 0 0 rgba(47,180,87,.5); animation: okping 2s infinite; }
.status-down { color: var(--red-600); font-weight: 600; }
.status-soon { color: var(--grey-500); font-weight: 600; font-size: .9rem; }
@keyframes okping { 70% { box-shadow: 0 0 0 8px rgba(47,180,87,0); } 100% { box-shadow: 0 0 0 0 rgba(47,180,87,0); } }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 200; background: var(--charcoal); color: #fff; padding: 14px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); border-left: 3px solid var(--red); font-size: .92rem; animation: fadeUp .4s var(--ease); max-width: 360px; }
.toast.ok { border-left-color: #2fb457; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--charcoal); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px; isolation: isolate; }
.auth-side canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.auth-side::before { content: ''; position: absolute; z-index: -1; width: 620px; height: 620px; left: -160px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(232,56,61,.32), transparent 65%); }
.auth-side > img { width: 300px; margin: auto; animation: float 6s ease-in-out infinite, logoIn 1.2s var(--ease) both; }
.auth-side h2 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-side p { color: #b6b8be; margin: 0; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--grey-50); }
.auth-box { width: min(430px, 100%); }
.auth-box h1 { font-size: 2rem; margin-bottom: 8px; }
.auth-box > p { color: var(--grey-600); margin-bottom: 28px; }
.auth-box .alt-link { text-align: center; margin-top: 22px; font-size: .92rem; color: var(--grey-600); }
.auth-box .alt-link a { color: var(--red); font-weight: 600; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: var(--grey-50); }
.side { background: var(--charcoal); color: #c3c5cb; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 4px 10px 22px; }
.side .brand img { height: 36px; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; border: 0; background: none; color: inherit;
  font: 500 .93rem var(--font); cursor: pointer; text-align: left; position: relative; transition: background .2s, color .2s;
}
.side nav button svg { width: 19px; height: 19px; flex: none; }
.side nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav button.on { background: rgba(232,56,61,.16); color: #fff; }
.side nav button.on::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.side nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .72rem; font-weight: 700; }
.side .me { border-top: 1px solid rgba(255,255,255,.08); padding-top: 16px; margin-top: 16px; }
.side .me b { display: block; color: #fff; margin-bottom: 6px; }
.side .me .btn { width: 100%; margin-top: 14px; }
.dash-main { padding: 34px 40px 60px; min-width: 0; }
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.dash-top h1 { font-size: 1.9rem; }
.dash-top p { color: var(--grey-600); margin: 4px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 30px; }
.kpi { background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); animation: fadeUp .5s var(--ease) both; }
.kpi b { display: block; font: 700 2.2rem var(--display); letter-spacing: -.03em; }
.kpi span { color: var(--grey-600); font-size: .88rem; }
.kpi.hot b { color: var(--red); }
.panel { background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.panel h3 { font-size: 1.15rem; margin-bottom: 16px; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 90; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .dash.menu .side { transform: none; }
  .dash-main { padding: 20px 18px 50px; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
  .mobile-bar button { background: var(--charcoal); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer; }
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 0 12px 22px; border-left: 2px solid var(--grey-200); position: relative; font-size: .9rem; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--white); border: 2px solid var(--red); }
.timeline small { color: var(--grey-500); display: block; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(19,20,24,.62); backdrop-filter: blur(4px); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fade .2s; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: min(680px, 100%); max-height: 92vh; overflow-y: auto; padding: 32px; box-shadow: var(--shadow-lg); animation: pop .35s var(--ease); margin: auto; }
.modal h2 { font-size: 1.5rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.ev-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; margin-bottom: 10px; }
.ev-row .rm { background: none; border: 0; color: var(--grey-500); cursor: pointer; font-size: 1.3rem; }
.ev-row .rm:hover { color: var(--red); }
@media (max-width: 600px) { .ev-row { grid-template-columns: 1fr; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: .92rem; margin-bottom: 18px; }
.kv dt { color: var(--grey-500); } .kv dd { margin: 0; word-break: break-word; }
.reveal-id { background: var(--charcoal); color: #fff; border-radius: 12px; padding: 22px; text-align: center; margin-top: 8px; }
.reveal-id code { display: block; font: 700 1.5rem var(--mono); letter-spacing: .06em; color: var(--red); margin: 10px 0; word-break: break-all; user-select: all; }
.reveal-id small { color: var(--grey-500); }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .pipeline .p-step { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
