:root {
  color-scheme: dark;
  --ink: #f7f4ef;
  --muted: #9d9791;
  --paper: #050303;
  --panel: rgba(15, 12, 12, 0.82);
  --panel-strong: rgba(20, 14, 15, 0.94);
  --line: rgba(225, 218, 205, 0.16);
  --red: #d8d6d0;
  --blood: #1a1a1a;
  --chrome: #d8d6d0;
  --amber: #ffb35a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.68);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(216, 214, 208, 0.12), transparent 24rem),
    radial-gradient(circle at 84% 16%, rgba(216, 214, 208, 0.08), transparent 22rem),
    linear-gradient(135deg, #101010, #050505 52%, #0c0c0c);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.rain-canvas,
.atmosphere,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.rain-canvas {
  z-index: 0;
  opacity: 0.48;
}

.atmosphere {
  z-index: 0;
  background:
    linear-gradient(100deg, transparent 0 18%, rgba(216, 214, 208, 0.055) 28%, transparent 44%),
    radial-gradient(circle at 50% 120%, rgba(216, 214, 208, 0.11), transparent 36rem);
  filter: blur(1px);
  animation: fog-drift 14s ease-in-out infinite alternate;
}

.scanlines {
  z-index: 1;
  opacity: 0.11;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.18) 0,
    rgba(255, 255, 255, 0.18) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

@keyframes fog-drift {
  from {
    transform: translate3d(-2%, 0, 0);
  }
  to {
    transform: translate3d(2%, -1%, 0);
  }
}

main {
  position: relative;
  z-index: 2;
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto 28px;
}

.hero {
  min-height: min(760px, 92vh);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 72px 0 44px;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  width: min(760px, 86vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 214, 208, 0.82), var(--chrome), transparent);
  box-shadow: 0 0 38px rgba(216, 214, 208, 0.42);
}

.hero-kicker,
.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(216, 214, 208, 0.36);
}

.brand-glitch {
  position: relative;
  margin: 0;
  max-width: 100%;
  font-size: clamp(3.6rem, 13vw, 9rem);
  line-height: 0.88;
  letter-spacing: 0.025em;
  color: var(--ink);
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.18),
    0 0 38px rgba(216, 214, 208, 0.28),
    4px 0 0 rgba(216, 214, 208, 0.18);
  animation: neon-breathe 3.8s ease-in-out infinite;
}

.brand-glitch::before,
.brand-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.brand-glitch::before {
  color: rgba(216, 214, 208, 0.56);
  transform: translate(-3px, 1px);
  clip-path: inset(8% 0 58% 0);
  animation: glitch-slice 2.9s infinite steps(1);
}

.brand-glitch::after {
  color: rgba(216, 214, 208, 0.48);
  transform: translate(3px, -1px);
  clip-path: inset(62% 0 12% 0);
  animation: glitch-slice 3.6s infinite steps(1) reverse;
}

@keyframes neon-breathe {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.24);
  }
}

@keyframes glitch-slice {
  0%,
  86%,
  100% {
    opacity: 0;
    transform: translate(0);
  }
  88% {
    opacity: 1;
    transform: translate(-7px, 1px);
  }
  90% {
    opacity: 0.55;
    transform: translate(6px, -2px);
  }
  92% {
    opacity: 0;
    transform: translate(0);
  }
}

.tagline {
  margin: 0;
  color: var(--chrome);
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: #c4beb7;
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-actions,
.signal-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-cta {
  min-width: 190px;
}

.signal-grid {
  width: min(920px, 100%);
  margin-top: 14px;
}

.signal-grid div {
  flex: 1 1 150px;
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(216, 214, 208, 0.025));
  color: var(--ink);
  box-shadow: inset 0 0 24px rgba(216, 214, 208, 0.04);
}

.signal-grid span {
  color: var(--red);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 18px 0 12px;
}

.topbar h2 {
  margin: 5px 0 0;
  font-size: clamp(1.65rem, 4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px rgba(216, 214, 208, 0.5);
}

.workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(216, 214, 208, 0.018)),
    rgba(10, 8, 8, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.032);
}

.tab {
  flex: 1 1 130px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tab.is-active {
  border-color: rgba(216, 214, 208, 0.42);
  background: linear-gradient(90deg, rgba(216, 214, 208, 0.16), rgba(255, 255, 255, 0.05));
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(216, 214, 208, 0.08),
    0 0 24px rgba(216, 214, 208, 0.12);
}

.panel {
  display: none;
  padding: 20px;
}

.panel.is-active {
  display: block;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.grid {
  display: grid;
  gap: 12px;
}

.tool-stack {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(216, 214, 208, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.48);
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(216, 214, 208, 0.14), 0 0 24px rgba(216, 214, 208, 0.12);
}

.campaign-bar,
.toolbar {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.campaign-bar {
  grid-template-columns: 1.4fr 1fr auto;
  margin-bottom: 16px;
}

.toolbar {
  grid-template-columns: 2fr repeat(3, minmax(110px, 1fr)) auto;
  margin: 14px 0;
}

.button-row,
.actions,
.import-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button-row {
  align-items: end;
}

.import-row {
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
}

.import-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: max-content;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--red);
  font-weight: 900;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.primary,
.secondary,
.ghost {
  min-height: 40px;
  border-radius: 6px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.primary {
  border: 1px solid rgba(216, 214, 208, 0.68);
  background: linear-gradient(135deg, #f2eee9, #9f9d98 58%, #ffffff);
  color: #080404;
  padding: 0 16px;
  box-shadow: 0 0 26px rgba(216, 214, 208, 0.2);
}

.secondary {
  border: 1px solid rgba(216, 214, 208, 0.3);
  background: var(--panel);
  color: var(--red);
  padding: 0 14px;
}

.ghost {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 0 10px;
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.file-button:hover,
.tool-card:hover {
  filter: brightness(1.1);
}

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

.score-card,
.output-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(216, 214, 208, 0.018));
  backdrop-filter: blur(12px);
}

.score-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.score-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 900;
}

.score-card strong {
  color: var(--red);
  font-size: 2.8rem;
  line-height: 1;
  text-shadow: 0 0 22px rgba(216, 214, 208, 0.44);
}

.score-card span {
  color: var(--muted);
  line-height: 1.45;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-select {
  width: auto;
  height: 34px;
  min-width: 96px;
  padding: 0 8px;
  font-size: 0.88rem;
  font-weight: 900;
}

.issue-list,
.table-wrap,
.pad {
  padding: 12px;
}

label.pad {
  display: grid;
  gap: 7px;
}

.table-wrap {
  overflow-x: auto;
}

.stack-card {
  margin-top: 14px;
}

.empty {
  color: var(--muted);
}

.issue {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.issue:last-child {
  border-bottom: 0;
}

.issue strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #090404;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.high {
  background: var(--red);
}

.badge.medium {
  background: var(--amber);
}

.badge.low {
  background: var(--chrome);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: var(--ink);
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}

.report-shell {
  min-height: 460px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(216, 214, 208, 0.018));
}

.report-shell h2 {
  margin-bottom: 10px;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.report-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.report-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.report-section {
  margin-top: 24px;
}

.report-section ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.report-section li {
  margin: 8px 0;
  color: var(--muted);
}

.pass {
  color: var(--chrome);
  font-weight: 900;
}

.fail {
  color: var(--red);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(216, 214, 208, 0.32);
  border-radius: 8px;
  background: #12090a;
  color: var(--ink);
  box-shadow: var(--shadow), 0 0 28px rgba(216, 214, 208, 0.12);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media print {
  :root {
    --ink: #17211d;
    --muted: #60706a;
    --line: #d6ded8;
    --panel: #ffffff;
    --red: #a23b3b;
    --chrome: #265d9a;
  }

  body {
    background: #ffffff;
  }

  .hero,
  .topbar,
  .tabs,
  .rain-canvas,
  .atmosphere,
  .scanlines,
  .panel:not(#reports) .section-head,
  #reports > .section-head {
    display: none !important;
  }

  main,
  .workspace,
  .panel,
  .report-shell {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #ffffff;
  }

  .panel {
    display: none;
  }

  #reports {
    display: block;
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: 78vh;
    padding-top: 44px;
  }

  .tagline {
    letter-spacing: 0.12em;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    width: max-content;
  }

  .grid.two,
  .grid.three,
  .results-grid,
  .campaign-bar,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .report-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row,
  .import-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row > *,
  .file-button {
    width: 100%;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 18px, 1160px);
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .brand-glitch {
    font-size: clamp(3.1rem, 19vw, 5rem);
  }

  .panel {
    padding: 14px;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions {
    justify-content: flex-start;
  }

  .report-meta {
    grid-template-columns: 1fr;
  }
}
