/* CTSentinel portal - PYMEHackers design system implementation.
   Style kit: layered charcoal background (gradient + red glows + fading grid
   + side vignette), one vermilion accent (#D22C21), Inter with tight white
   headlines and a single red word, eyebrows with a glowing red bar, black
   surfaces with translucent borders and opt-in scroll effects (data-reveal).
   Reference: app-web/design/StyleGuide-PYMEHackers.md.

   Mobile rules applied throughout: min-width:0 on every flex/grid text child,
   overflow-wrap:anywhere on indicator/URL-bearing blocks, tables inside
   overflow-x:auto wrappers, no 100vw, no fixed pixel widths for content, and
   no overflow-x:hidden on html/body (fixed pseudo-elements use inset:0 and the
   only decorative overflow is clipped inside its own card). */

@font-face {
  font-family: Inter;
  src: url("/static/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Base: layered charcoal background ---------- */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% 10%, rgba(210, 44, 33, 0.045), transparent 30%),
    radial-gradient(circle at 90% 5%, rgba(210, 44, 33, 0.025), transparent 26%),
    linear-gradient(180deg, #202020 0%, var(--color-bg) 44%, #171717 100%);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
}

/* Fine grid that fades downwards (technical texture) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 82%);
  pointer-events: none;
}

/* Subtle side vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.20), transparent 30%, rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

main { flex: 1; width: 100%; }

a { color: var(--color-red); text-decoration: none; text-underline-offset: 4px; }
a:hover { color: var(--color-red-hover); text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }

.container { width: min(var(--max-width), calc(100% - 40px)); margin-inline: auto; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-red);
  color: #fff;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Topbar (sticky, blurred black) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.84);
  border-bottom: 1px solid var(--color-border-soft);
  backdrop-filter: blur(16px);
}
.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.nav > * { min-width: 0; }
.brand {
  display: inline-block;
  flex-shrink: 0;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.035em;
  font-size: 1.08rem;
  white-space: nowrap;
  overflow-wrap: normal;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand-wordmark { display: inline; }
.brand .brand-accent { color: var(--color-red, #D22C21); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links > li { min-width: 0; }
.nav-links a { color: var(--color-text); font-size: 0.94rem; font-weight: 700; }
.nav-links a:hover { color: var(--color-red-hover); text-decoration: none; }
/* Red pill of the bar (CTA) */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background-color: var(--color-red);
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(210, 44, 33, 0.22);
}
.nav-cta:hover { background-color: var(--color-red); color: #fff !important; }
.menu-button {
  display: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #111;
  color: #fff;
  padding: 10px 14px;
}
/* App pages: brand + who + tools, wrapping on narrow screens */
.nav-app { gap: 14px; flex-wrap: wrap; justify-content: flex-start; }
.nav-app .who {
  color: var(--color-muted);
  font-size: 0.9rem;
  flex: 1 1 8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.nav-tools > * { min-width: 0; }
.lang-select {
  width: auto;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-family: var(--font-mono-ui);
  border-radius: 999px;
}

/* ---------- Typography: eyebrow, headings, lead, red word ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 30px;
  height: 2px;
  background: var(--color-red);
  box-shadow: 0 0 18px rgba(210, 44, 33, 0.8);
}
h1, h2, h3 {
  margin: 0;
  color: #fff;
  line-height: 1.02;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}
h1 { max-width: 850px; font-size: clamp(3.05rem, 7.3vw, 5.35rem); }
.hero h1 { max-width: none; font-size: clamp(2.6rem, 5.8vw, 4.4rem); }
h2 { max-width: 800px; font-size: clamp(2.35rem, 5vw, 4.25rem); }
h3 { font-size: 1.28rem; letter-spacing: -0.035em; }
.red { color: var(--color-red); text-shadow: 0 0 30px rgba(210, 44, 33, 0.20); }
.lead { max-width: 710px; margin: 24px 0 0; color: #D7D7D7; font-size: clamp(1.04rem, 2vw, 1.28rem); }
.lead strong { color: #fff; }
.page-title { max-width: none; font-size: clamp(2.1rem, 4.2vw, 3.2rem); }
.muted { color: var(--color-muted); }
.muted-2 { color: var(--color-muted-2); }
.small { font-size: 0.9rem; }
.caps {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-2);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 850;
  letter-spacing: 0.01em;
  background: transparent;
  color: #fff;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.button:hover { transform: translateY(-2px); text-decoration: none; }
.button:disabled { opacity: 0.45; pointer-events: none; }
.button:focus-visible { outline: 2px solid var(--color-red-hover); outline-offset: 2px; }
.button-primary { background-color: var(--color-red); color: #fff; box-shadow: 0 16px 32px rgba(210, 44, 33, 0.23); }
.button-primary:hover { background-color: var(--color-red); color: #fff; }
.button-secondary { background: rgba(0, 0, 0, 0.55); color: #fff; border-color: var(--color-border); }
.button-secondary:hover { color: #fff; border-color: var(--color-red); background: rgba(210, 44, 33, 0.08); }
.button-danger { background: transparent; color: var(--color-red-hover); border-color: rgba(210, 44, 33, 0.5); }
.button-danger:hover { background: var(--color-red); color: #fff; border-color: var(--color-red); }
.button-sm { min-height: 38px; padding: 0 14px; font-size: 0.86rem; border-radius: 10px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 52px; }
.hero-grid { position: relative; display: block; }
.hero-grid::after { content: ""; display: block; clear: both; }
.hero-copy { display: block; }
/* Reserves the slot on the right where the visual card floats */
.hero-copy::before {
  content: "";
  float: right;
  width: min(520px, 46%);
  height: 500px;
  margin-top: 40px;
  margin-left: 58px;
  margin-bottom: 18px;
}
.hero .lead { max-width: none; width: 100%; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-actions > * { min-width: 0; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.hero-trust li {
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--color-border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
/* Typewriter word of the headline (types and deletes in a loop) */
.typewriter {
  display: inline-block;
  max-width: 100%;
  min-height: 1em;
  vertical-align: top;
  border-right: 2px solid var(--color-red);
  padding-right: 2px;
  white-space: nowrap;
  overflow: hidden;
  animation: caret-blink 1s steps(1) infinite;
}

/* ---------- Visual card + terminal (technical flavor) ---------- */
.visual-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent), var(--color-panel);
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.hero .visual-card { position: absolute; top: 40px; right: 0; width: min(520px, 46%); margin: 0; }
/* Red glow clipped by the card overflow (top right corner) */
.visual-card::before {
  content: "";
  position: absolute;
  inset: -120px -120px auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(210, 44, 33, 0.24), transparent 66%);
  pointer-events: none;
}
.terminal { padding: 18px; }
.terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--color-border-soft);
  color: var(--color-muted-2);
  font-family: var(--font-mono-ui);
  font-size: 0.82rem;
}
.terminal-top > * { min-width: 0; }
.dots { display: flex; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #707070; }
.dot:nth-child(1) { background: var(--color-red); }
.dot:nth-child(2) { background: #707070; }
.dot:nth-child(3) { background: #A0A0A0; }
.terminal-body {
  margin: 0;
  padding: 18px 2px 0;
  color: #eaeaea;
  font-family: var(--font-mono-term);
  font-size: clamp(0.8rem, 1.35vw, 0.93rem);
  line-height: 1.52;
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
}
.prompt-block { position: relative; margin: 0 0 8px; padding-left: 22px; }
.prompt-block + .prompt-block, .prompt-block.prompt-spaced { margin-top: 8px; }
.prompt-block::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 12px;
  height: 1.52em;
  border-left: 2px solid #D8D8D8;
  border-top: 2px solid #D8D8D8;
  border-bottom: 2px solid #D8D8D8;
}
.prompt-line { display: block; min-height: 1.52em; overflow-wrap: anywhere; }
.terminal-body .root, .terminal-body .cwd { color: var(--color-red); font-weight: 850; }
.terminal-body .user { color: #707070; font-weight: 850; }
.terminal-body .command { color: #eaeaea; transition: opacity 0.1s ease; }
.terminal-body .output { margin: 0; line-height: 1.52; overflow-wrap: anywhere; }
.terminal-body .ok { color: #f2f2f2; }
.terminal-body .muted { color: #858585; }
.terminal-body .command.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--color-red);
  animation: term-caret 1s steps(1) infinite;
}
.terminal-body .prompt-block.is-flash-off .command { opacity: 0.12; }

/* ---------- Sections and headers ---------- */
.section { padding: 60px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.section-head > * { min-width: 0; }
.section-head p { max-width: 540px; margin: 0; color: var(--color-muted); }
.section-head-stacked { display: block; }
.section-head-stacked h2 { width: 100%; max-width: none; }
.section-head-stacked p { max-width: none; margin-top: 16px; }
.section-head p strong { color: #fff; }

/* Black band with its own grid and a lateral red tint */
.black-band {
  position: relative;
  padding: 54px 0;
  background: linear-gradient(90deg, rgba(210, 44, 33, 0.08), transparent 28%, rgba(210, 44, 33, 0.05)), #0A0A0A;
  border-block: 1px solid var(--color-border-soft);
  overflow: hidden;
}
.black-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}
.black-band > .container { position: relative; }

/* ---------- Value grid (boxes whose red border draws itself) ---------- */
.value-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.value-item {
  position: relative;
  min-width: 0;
  min-height: 280px;
  padding: 18px 24px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  background: rgba(255, 255, 255, 0.035);
}
.value-grid-compact .value-item { min-height: 0; padding-bottom: 24px; }
.value-item strong {
  display: block;
  color: #fff;
  font-size: 1.28rem;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-align: center;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
.value-item p { margin: 0; color: var(--color-muted); font-size: 0.96rem; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards > * { min-width: 0; }
.card {
  position: relative;
  min-height: 260px;
  padding: 26px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent), var(--color-panel);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
/* Glowing red line on the bottom edge on hover */
.card::after {
  content: "";
  position: absolute;
  inset: auto 24px 0 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(210, 44, 33, 0.86), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover::after { opacity: 1; }
.card h3 { max-width: 100%; margin: 0 auto 4px; color: #fff; letter-spacing: -0.035em; text-align: center; }
.card p { margin: 14px 0 0; color: var(--color-muted); }
.card ul { margin: 16px 0 0; padding-left: 18px; color: var(--color-muted); }
.card li + li { margin-top: 7px; }
/* Step cards of "how it works": big red mono number, left aligned */
.card-step h3 { text-align: left; }
.step-num {
  display: block;
  margin-bottom: 12px;
  color: var(--color-red);
  font-family: var(--font-mono-ui);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 0 24px rgba(210, 44, 33, 0.35);
}

/* ---------- Tech grid (sector icons revealed with a scanner sweep) ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tech {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent), #101010;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
  text-align: center;
}
/* Monochrome vermilion icon with red glow */
.tech-logo {
  display: block;
  width: 64px;
  height: 92px;
  object-fit: contain;
  margin: 0 auto 26px;
  filter: drop-shadow(0 0 22px rgba(210, 44, 33, 0.22));
}
.tech h3 { overflow-wrap: anywhere; }
.tech p { margin: 12px 0 0; color: var(--color-muted); font-size: 0.94rem; }

/* ---------- Split / panel / capabilities ---------- */
.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 28px; align-items: stretch; }
.split > * { min-width: 0; }
.split-text { margin-top: 18px; color: var(--color-muted); }
.split-text strong { color: #fff; }
.panel {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.panel-inner { padding: 32px; }
.panel p { color: var(--color-muted); }
.capabilities { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.capabilities li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: #E6E6E6;
  overflow-wrap: anywhere;
}
.capabilities li::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 0 14px rgba(210, 44, 33, 0.75);
}

/* ---------- Report panel / finding / severity / tag (technical flavor) ---------- */
.report { height: 100%; padding: 22px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent), var(--color-panel); }
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--color-border-soft);
}
.report-header > * { min-width: 0; }
.report-header .eyebrow { margin-bottom: 6px; }
.report-title { display: block; color: #fff; font-weight: 850; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.severity {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(210, 44, 33, 0.14);
  color: var(--color-red-hover);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.finding { padding: 18px 0; border-bottom: 1px solid var(--color-border-soft); }
.finding:last-child { border-bottom: 0; }
.finding-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 850;
}
.finding-title > * { min-width: 0; overflow-wrap: anywhere; }
.finding p { margin: 0; color: var(--color-muted); font-size: 0.94rem; }
/* Monospaced tag with a translucent red border */
.tag {
  display: inline-flex;
  border: 1px solid rgba(210, 44, 33, 0.28);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--color-red-hover);
  font-family: var(--font-mono-ui);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ---------- CTA box ---------- */
.cta {
  position: relative;
  padding: 58px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 20%, rgba(210, 44, 33, 0.20), transparent 28%),
    linear-gradient(135deg, #0A0A0A, #171717 56%, #000000);
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-soft);
}
.cta-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; }
.cta-row > * { min-width: 0; }
.cta-row .button { justify-self: center; }
.cta h2 { font-size: clamp(2.03rem, 4.6vw, 3.93rem); }
.cta p { max-width: 720px; margin: 18px 0 0; color: var(--color-muted); }

/* ---------- Footer ---------- */
footer { padding: 38px 0; border-top: 1px solid var(--color-border-soft); background: #000000; color: var(--color-muted-2); }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-row > * { min-width: 0; overflow-wrap: anywhere; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--color-muted); }
footer a { color: var(--color-muted); }

/* ============================================================================
   Application pages (trust panel, analyst console, sign-in, assurance report)
   ============================================================================ */
.app { padding: 40px 0 64px; }
.page-head { margin-bottom: 26px; }
.page-head .eyebrow { margin-bottom: 12px; }
.page-sub { margin-top: 10px; color: var(--color-muted); overflow-wrap: anywhere; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 18px; }
.cards-grid > * { min-width: 0; }
.card-app { min-height: 0; padding: 22px; }
.card-app h3 { text-align: left; margin: 0; font-size: 1.15rem; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head > * { min-width: 0; }
.card-head h3 { flex: 1 1 10rem; }
.card-app p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > * { min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }
.spacer { flex: 1; }
.grow { flex: 1; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.section-gap { margin-top: 28px; }
.hidden { display: none; }
.help { color: var(--color-muted); font-size: 0.94rem; }

/* Severity chips on the brand palette (grey scale -> red scale) */
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border-soft);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip-low { background: var(--sev-low-bg); color: var(--sev-low-fg); border-color: var(--sev-low-border); }
.chip-guarded { background: var(--sev-guarded-bg); color: var(--sev-guarded-fg); border-color: var(--sev-guarded-border); }
.chip-elevated { background: var(--sev-elevated-bg); color: var(--sev-elevated-fg); border-color: var(--sev-elevated-border); }
.chip-high { background: var(--sev-high-bg); color: var(--sev-high-fg); border-color: var(--sev-high-border); }
.chip-critical { background: var(--sev-critical-bg); color: var(--sev-critical-fg); border-color: var(--sev-critical-border); box-shadow: 0 0 18px rgba(210, 44, 33, 0.55); }
.chip-neutral { background: rgba(255, 255, 255, 0.04); color: var(--color-muted); border-color: var(--color-border-soft); }
.level-big { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.level-big > * { min-width: 0; }
.level-big .chip { font-size: 1rem; padding: 8px 18px; }

/* Lists */
.item-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.item-list > li { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--color-border-soft); }
.item-list > li > * { min-width: 0; }
.item-list > li:first-child { border-top: 0; padding-top: 0; }
.item-main { flex: 1 1 12rem; min-width: 0; }
.item-main .title { color: #fff; font-weight: 850; overflow-wrap: anywhere; }
.item-main .meta { color: var(--color-muted-2); font-size: 0.82rem; margin-top: 2px; overflow-wrap: anywhere; }
.empty { color: var(--color-muted-2); padding: 8px 0; }

/* Indicators, code, results */
.mono, code, pre { font-family: var(--font-mono-ui); overflow-wrap: anywhere; }
pre { white-space: pre-wrap; margin: 0; }
.md-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #E6E6E6; }
.result-box {
  min-height: 1.6em;
  border: 1px solid var(--color-border-soft);
  border-radius: 12px;
  background: #0A0A0A;
  padding: 12px 14px;
  color: #eaeaea;
  font-family: var(--font-mono-term);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.feed-url {
  border: 1px dashed rgba(210, 44, 33, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  color: #f2f2f2;
  font-family: var(--font-mono-ui);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.quota-note { color: var(--color-muted-2); font-size: 0.82rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > * { min-width: 0; }
label { color: var(--color-muted); font-size: 0.74rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
label.row { text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 0.94rem; color: #E6E6E6; }
input, select, textarea {
  font: inherit;
  color: #fff;
  background: #0D0D0D;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  min-height: 46px;
  padding: 0 14px;
  width: 100%;
}
textarea { min-height: 110px; padding: 12px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--color-muted-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(210, 44, 33, 0.25);
}
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--color-red); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { min-width: 0; flex: 1 1 10rem; }
.form-row > .button { flex: 0 0 auto; }
.form-error { color: var(--color-red-hover); font-weight: 850; min-height: 1.2em; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-2);
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
td { padding: 12px 10px; border-bottom: 1px solid var(--color-border-soft); vertical-align: top; color: #E6E6E6; }
td.mono { overflow-wrap: anywhere; }
td .row { gap: 8px; }

/* Tabs (pills; the active one is the red pill) */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.tabs > * { min-width: 0; }
.tab-btn {
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 16px;
  font-weight: 850;
  font-size: 0.86rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.tab-btn:hover { border-color: var(--color-red); }
.tab-btn.active { background: var(--color-red); border-color: var(--color-red); box-shadow: 0 10px 28px rgba(210, 44, 33, 0.22); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--color-panel);
  color: var(--color-text);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 44rem;
  padding: 26px;
}
.modal-card > * { min-width: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head > * { min-width: 0; }
.modal-title { color: #fff; font-weight: 850; font-size: 1.15rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }

/* Sign-in */
.login-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: start; }
.login-split > * { min-width: 0; }
.login-copy .lead { max-width: none; }
.login-panel .tabs { margin: 0 0 18px; }

/* Assurance report page */
.report-page { max-width: 60rem; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 18px; }
.report-grid > * { min-width: 0; }
.kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kv > li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--color-border-soft); padding-top: 8px; color: var(--color-muted); }
.kv > li:first-child { border-top: 0; padding-top: 0; }
.kv > li > * { min-width: 0; overflow-wrap: anywhere; }
.kv strong { color: #fff; }
.report-disclaimer { border-top: 1px solid var(--color-border-soft); padding-top: 14px; font-style: italic; color: var(--color-muted); }

/* ============================================================================
   Reveal effects catalogue (data-reveal) - decoupled and opt-in.
   The JS observes every [data-reveal] and adds .is-revealed when it enters the
   viewport; siblings stagger automatically through --fx-i. Without JS there
   is no hidden state (initial states are prefixed with .js).
   ============================================================================ */
.js [data-reveal="pop"] { opacity: 0; transform: scale(0.5); }
[data-reveal="pop"].is-revealed { animation: fx-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(var(--fx-i, 0) * 0.09s); }
@keyframes fx-pop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

.js [data-reveal="rise"] { opacity: 0; transform: translateY(24px); }
[data-reveal="rise"].is-revealed { animation: fx-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(var(--fx-i, 0) * 0.09s); }
@keyframes fx-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.js [data-reveal="unfold"] { opacity: 0; clip-path: inset(0 50% 0 50% round var(--radius-lg)); }
[data-reveal="unfold"].is-revealed { animation: fx-unfold 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(var(--fx-i, 0) * 0.09s); }
@keyframes fx-unfold {
  0% { opacity: 0; clip-path: inset(0 50% 0 50% round var(--radius-lg)); }
  1% { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 0 0 round var(--radius-lg)); }
}

[data-reveal="scan"] { position: relative; }
.js [data-reveal="scan"] { opacity: 0; clip-path: inset(0 0 100% 0 round var(--radius-md)); }
[data-reveal="scan"]::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-red), transparent);
  box-shadow: 0 0 14px 2px rgba(210, 44, 33, 0.65);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
[data-reveal="scan"].is-revealed { animation: fx-scan 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(var(--fx-i, 0) * 0.09s); }
[data-reveal="scan"].is-revealed::before { animation: fx-scan-line 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(var(--fx-i, 0) * 0.09s); }
@keyframes fx-scan {
  0% { opacity: 0; clip-path: inset(0 0 100% 0 round var(--radius-md)); }
  1% { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 0 0 round var(--radius-md)); }
}
@keyframes fx-scan-line { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 82% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

[data-reveal="draw"] { position: relative; }
[data-reveal="draw"]::before, [data-reveal="draw"]::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-radius: inherit;
  box-sizing: border-box;
  pointer-events: none;
}
[data-reveal="draw"]::before { top: -1px; left: -1px; border-top: 2px solid transparent; border-right: 2px solid transparent; }
[data-reveal="draw"]::after { right: -1px; bottom: -1px; border-bottom: 2px solid transparent; border-left: 2px solid transparent; }
[data-reveal="draw"].is-revealed::before { animation: fx-draw-tr 0.6s ease forwards; animation-delay: calc(var(--fx-i, 0) * 0.18s); }
[data-reveal="draw"].is-revealed::after { animation: fx-draw-bl 0.6s ease forwards; animation-delay: calc(var(--fx-i, 0) * 0.18s); }
@keyframes fx-draw-tr {
  0% { width: 0; height: 0; border-top-color: var(--color-red); border-right-color: transparent; }
  50% { width: 100%; height: 0; border-top-color: var(--color-red); border-right-color: var(--color-red); }
  100% { width: 100%; height: 100%; border-top-color: var(--color-red); border-right-color: var(--color-red); }
}
@keyframes fx-draw-bl {
  0% { width: 0; height: 0; border-bottom-color: var(--color-red); border-left-color: transparent; }
  50% { width: 100%; height: 0; border-bottom-color: var(--color-red); border-left-color: var(--color-red); }
  100% { width: 100%; height: 100%; border-bottom-color: var(--color-red); border-left-color: var(--color-red); }
}

/* Blinking carets of the typewriter and the terminal */
@keyframes caret-blink { 0%, 50% { border-color: var(--color-red); } 50.01%, 100% { border-color: transparent; } }
@keyframes term-caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* Reduced motion: every effect shows its final state without movement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typewriter { animation: none; border-right: 0; padding-right: 0; }
  .js [data-reveal] { opacity: 1; transform: none; clip-path: none; }
  [data-reveal].is-revealed { animation: none; }
  [data-reveal="scan"]::before { display: none; }
  [data-reveal="draw"]::before, [data-reveal="draw"]::after { animation: none; width: 100%; height: 100%; }
  [data-reveal="draw"]::before { border-top-color: var(--color-red); border-right-color: var(--color-red); }
  [data-reveal="draw"]::after { border-bottom-color: var(--color-red); border-left-color: var(--color-red); }
  .button:hover { transform: none; }
}

/* Terminal animation: blocks stay hidden until the JS activates them */
@media (prefers-reduced-motion: no-preference) {
  .js .terminal-body .prompt-block, .js .terminal-body .output-group { display: none; }
  .js .terminal-body .prompt-block.is-active, .js .terminal-body .output-group.is-active { display: block; }
}

/* ============================================================================
   Responsive (breakpoints 1180 / 1120 / 980 / 760)
   ============================================================================ */
@media (max-width: 1180px) {
  .hero-copy::before { display: none; }
  .hero .visual-card {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 680px;
    margin: 34px auto 26px;
  }
}

@media (max-width: 1120px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .split, .cta-row, .login-split { grid-template-columns: 1fr; }
  .visual-card { max-width: 680px; }
  .cards-3, .value-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  .menu-button { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% + 10px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #000000;
    box-shadow: var(--shadow-soft);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 12px; border-radius: 12px; }
  .nav-links .lang-select { width: 100%; margin: 6px 0; border-radius: 12px; }
  .nav-cta { border-radius: 12px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { width: min(var(--max-width), calc(100% - 28px)); }
  .nav { min-height: 68px; gap: 12px; }
  .brand { font-size: clamp(0.82rem, 4vw, 1.08rem); }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: clamp(2rem, 9.6vw, 4.4rem); }
  .section { padding: 44px 0; }
  .section-head { display: block; }
  .section-head p { margin-top: 16px; }
  .cards, .cards-3, .value-grid, .capabilities { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .tech { min-height: auto; padding: 16px 10px; }
  .tech-logo { width: 44px; height: 60px; margin: 0 auto 14px; }
  .tech h3 { font-size: 0.95rem; }
  .tech p { display: none; }
  .card { min-height: auto; }
  .cta { padding: 30px; }
  .panel-inner { padding: 22px; }
  .app { padding: 26px 0 48px; }
  .card-app { padding: 16px; }
  .modal-card { padding: 18px; }
  .result-box, .feed-url { font-size: 0.78rem; padding: 10px; }
  .level-big .chip { font-size: 0.875rem; padding: 6px 14px; }
}

/* ---------- Print (assurance report) ---------- */
@media print {
  body { background: #fff; color: #000; display: block; }
  body::before, body::after { display: none; }
  .topbar, footer, .skip-link, .no-print, .button { display: none !important; }
  main { padding: 0; }
  .container { width: 100%; }
  h1, h2, h3, .item-main .title, .kv strong, .report-title { color: #000; }
  .eyebrow, .eyebrow::before { color: #000; box-shadow: none; }
  .card, .panel, .modal-card, .result-box { background: #fff; color: #000; border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .card::after { display: none; }
  .card p, .muted, .page-sub, .help, .kv > li, .report-disclaimer, td, th, .item-main .meta { color: #000; }
  .chip { background: none; color: #000; border: 1px solid #999; box-shadow: none; text-shadow: none; }
  .red { color: #000; text-shadow: none; }
  a { color: #000; }
  a[href]::after { content: ""; }
  .table-wrap { overflow: visible; }
}
