@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (:root)
   ========================================================================== */
:root {
  color-scheme: light;
  
  /* Palette Minérale Ultra-Premium (Strictly Non-Judgmental / No Bold Reds) */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f4f4f5;
  --surface-bold: #09090b;
  
  /* Minimalist Structural Linework */
  --border: #eaeaea;
  --border-muted: #f4f4f5;
  --border-focus: #a1a1aa;
  
  /* Typography Hierarchy Colors */
  --text: #3f3f46;
  --text-strong: #09090b;
  --text-muted: #71717a;
  
  /* Neutral, Scientific Analytical Accents */
  --accent: #2563eb;
  --accent-soft: #f0f4ff;
  
  --indigo: #6366f1;
  --indigo-soft: #f5f3ff;
  
  --teal: #14b8a6;
  --teal-soft: #f0fdfa;
  
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  
  --slate: #71717a;
  --slate-soft: #f4f4f5;

  /* Invisible yet Deep Micro-Shadow System */
  --shadow-bento: 0 1px 2px rgba(0, 0, 0, 0.01), 0 12px 40px rgba(0, 0, 0, 0.02);
  
  /* Radii Geometry */
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  
  --container: 1200px;
}

/* ==========================================================================
   BASE STYLES & LAYOUT FOUNDATIONS
   ========================================================================== */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--text);
  background-color: var(--bg);
}

/* Discrete Engineer Blueprint Dot Grid Background Pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#e5e5e5 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 100%);
  z-index: 0;
}

main {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
  padding: 80px 0 120px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   GRID ARCHITECTURE & BENTO FLEXBOX STRUCTURES
   ========================================================================== */
.stack {
  display: grid;
  gap: 32px;
}

.score-grid,
.warning-list,
.technique-grid,
.results-grid,
form,
.field,
.cognitive-warnings {
  display: grid;
  gap: 16px;
}

/* Segmented horizontal meta header alignment block */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  background: var(--surface-muted);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.score-grid,
.technique-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Premium High-End Analytics Dashboard Grid Layout */
.cognitive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* ==========================================================================
   SURFACE LAYER DECORATION & COMPONENT STYLING
   ========================================================================== */
.panel,
.score-card,
.warning-card,
.technique,
.note,
.empty-state,
details,
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-bento);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel,
.table-card {
  padding: 40px;
}

/* Refined Bento Cards for Core Cognitive Tracking Dimensions */
.cognitive-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px !important; /* Forces breathing space over general layouts */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-bento);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cognitive-item:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

/* Embedded Gradient Ambient Depth Glow for Active Analytics */
.cognitive-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(9, 9, 11, 0.05), transparent);
  pointer-events: none;
}

/* Compressed Meta Header Items Styling (Replacing old chunky cards) */
.metric {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  min-height: auto;
}

/* ==========================================================================
   TYPOGRAPHY IDENTITY SYSTEM
   ========================================================================== */
h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

/* Micro-Labels & Subtitles */
.eyebrow,
.section-kicker,
.metric-label,
.score-label,
.warning-meta,
.mini-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Personalized Treatment for Advanced Analytics Labels */
.cognitive-item .score-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Massive High-Impact Data Metric Display (Dashboard KPIs) */
.score-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-strong);
}

/* Specialized Override for Cognitive Grid Percentages */
.cognitive-item .score-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--text-strong);
  margin: 4px 0 0 0 !important;
}

/* System State Context Indicators */
.metric-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-strong);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ==========================================================================
   INPUT COMPONENTS & SUBMISSION INTERFACES
   ========================================================================== */
label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-strong);
}

.helper,
.score-helper,
.technique-note,
.code-caption {
  font-size: 0.92rem;
  color: var(--text-muted);
}

textarea,
select {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-strong);
  padding: 16px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

textarea {
  min-height: 180px;
  line-height: 1.6;
  background: #fafafa;
  resize: vertical;
}

textarea:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border-focus);
}

select:focus {
  border-color: var(--border-focus);
}

/* Matte Solid Action Control Button (Signature Tech Styling) */
button {
  width: max-content;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-bold);
  color: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:hover {
  background: #27272a;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0px);
}

/* ==========================================================================
   BADGES, CHIPS & COMPARATIVE DEVIATION ZONES
   ========================================================================== */
.pill,
.status-chip,
.technique-code,
.inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.pill {
  background: var(--surface-muted);
  color: var(--text-strong);
  border: 1px solid var(--border);
}

.status-chip {
  background: var(--surface-bold);
  color: var(--surface);
  font-size: 0.8rem;
  padding: 8px 14px;
}

.status-chip.soft { background: var(--surface-muted); color: var(--text-strong); }
.status-chip.attention { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245,158,11,0.15); }
.technique-code { background: var(--surface-muted); color: var(--text-strong); font-family: monospace; }

/* Structural Reference Deviation Classes (Completely Neutralized) */
.high, .inline-badge.high { background: var(--indigo-soft); color: var(--indigo); }
.low, .inline-badge.low { background: var(--teal-soft); color: var(--teal); }
.normal, .inline-badge.normal, .unknown, .inline-badge.unknown { background: var(--slate-soft); color: var(--slate); }

/* ==========================================================================
   COMPLEX REPORTS, TABLES & DATA VISUALIZATION
   ========================================================================== */

/* High-Impact Executive Verdict Framework */
.verdict-panel {
  padding: 40px;
  border-left: 4px solid var(--text-strong) !important;
}

.verdict-panel.attention {
  border-left-color: var(--amber) !important;
}

/* Operational Status Notification Alerts */
.warning-card {
  padding: 24px;
  border-left: 3px solid var(--border);
}
.warning-card.info { border-left-color: var(--accent); }
.warning-card.warning { border-left-color: var(--amber); }
.warning-card.critical { border-left-color: var(--text-strong); }

/* Radicalized Editorial Scientific Data Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-muted);
  color: var(--text-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr:hover td { background: var(--surface-muted); }
tbody tr:last-child td { border-bottom: 0; }

/* Ultra-Thin Minimalist Linear Gauges (Vercel Style) */
.gauge {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-muted);
  overflow: hidden;
  border: none;
}

.gauge > span {
  display: block;
  height: 100%;
  background: var(--surface-bold);
  border-radius: inherit;
}

/* Core Override for Cognitive Jauges Inside Bento Cards */
.cognitive-item .gauge {
  height: 3px;
  background: var(--border-muted);
  width: 100%;
  margin-top: 8px;
}

.cognitive-item .gauge > span {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progressive Disclosure Interface Toggles */
.disclosure-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-strong);
  font-size: 0.9rem;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  text-align: center;
}

.disclosure-btn:hover {
  background: var(--surface-muted);
  border-color: var(--border-focus);
}

/* Immersive Code Inspector Windows (JSON Debug Mode) */
pre {
  margin: 0;
  padding: 24px;
  background: var(--surface-bold);
  color: #a1a1aa;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow-x: auto;
}

/* System Evaluation & Inline Context Notes */
.cognitive-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ==========================================================================
   FLUID SAAS RESPONSIVE MEDIA BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-grid, .form-grid, .score-layout {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr; /* Compresses top metrics panel safely on tablet */
  }
}

@media (max-width: 768px) {
  main { 
    padding-top: 40px; 
  }
  .panel, .table-card { 
    padding: 24px; 
  }
  textarea { 
    min-height: 160px; 
  }
  button { 
    width: 100%; 
    text-align: center; 
  }
}

/* Clean Hero Strip Layer on Minimalist Viewports */
.hero {
  padding: 0 0 24px 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.hero-side {
  display: none;
}

/* ==========================================================================
   ANALYZE LAB STRUCTURAL UX UTILITIES
   ========================================================================== */
.hero-pill-row {
  margin-top: 8px;
}

.executive-interpretation {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--text-strong);
  margin-top: 4px;
}

.executive-summary {
  margin-top: 16px;
  color: var(--text-strong);
  font-size: 1.04rem;
}

.runtime-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.runtime-note-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.runtime-note-chip p {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.metrics-compact {
  margin-bottom: 8px;
}

.cognitive-grid-expanded {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.cognitive-item-compact {
  padding: 24px;
}

.cognitive-score-label {
  font-size: 0.85rem;
  color: var(--text-strong);
}

.cognitive-score-value {
  margin: 8px 0;
}

.muted-placeholder {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0;
}

.ai-slope-helper {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.cognitive-warnings-spaced {
  margin-top: 16px;
}

.technique-soft {
  background: var(--surface);
  border-color: var(--border);
}

.technique-heading {
  gap: 8px;
}

.technique-label {
  font-weight: 600;
  color: var(--text-strong);
}

.expert-disclosure {
  margin-top: 8px;
}

.expert-disclosure .disclosure-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.hidden-research-layer {
  display: none;
  margin-top: 16px;
}

.research-toggle {
  display: none;
}

.research-toggle:checked ~ .hidden-research-layer {
  display: grid;
}

.expert-surface {
  background: var(--surface);
}

.note-spaced {
  margin-bottom: 12px;
}

.score-helper-attention {
  color: var(--amber);
}

.raw-json-panel {
  padding: 0;
  border: 0;
}

.cognitive-warning-attention {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.processing-error {
  border-color: var(--border-focus);
  background: var(--surface-muted);
  color: var(--text-strong);
}