/* ============================================================
   McClean Performance — Strength Predictor
   Brand: #C65A1E (orange), #111111 (near-black), #F5F3F0 (warm off-white)
   ============================================================ */

:root {
  --orange:      #C65A1E;
  --orange-light:#e8784a;
  --orange-dim:  #f5e9e3;
  --black:       #111111;
  --dark:        #1c1c1c;
  --mid:         #444444;
  --soft:        #777777;
  --border:      #e2ddd8;
  --bg:          #F5F3F0;
  --white:       #FFFFFF;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --ecc-color:   #2563eb;
  --iso-color:   #7c3aed;
  --con-color:   #059669;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  font-size: 15px;
}

/* ─── LAYOUT ──────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── HEADER ──────────────────────────────────────────── */
.site-header {
  background: var(--black);
  border-bottom: 3px solid var(--orange);
  padding: 1rem 0;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header-logo {
  height: 52px;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.header-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.2rem;
  font-weight: 400;
}

/* ─── INTRO BAND ──────────────────────────────────────── */
.intro-band {
  background: var(--orange);
  padding: 0.85rem 0;
}
.intro-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.intro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 2rem;
}
.intro-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.intro-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
  text-align: center;
}
.intro-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.3);
}

/* ─── ABOUT ───────────────────────────────────────────── */
.about-section {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem 1.25rem;
}
.about-text {
  flex: 1;
  font-size: 0.92rem;
  color: var(--mid);
  line-height: 1.7;
}
.about-text p + p { margin-top: 0.6rem; }
.about-text a { color: var(--orange); }
.about-actions { flex-shrink: 0; padding-top: 0.2rem; }

/* ─── MODE TABS ───────────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem;
  margin-bottom: 1.25rem;
}
.mode-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.25rem;
  border: 2px solid var(--border);
  background: var(--white);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--soft);
  transition: all 0.18s;
}
.mode-tab:hover { border-color: var(--orange); color: var(--orange); }
.mode-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.tab-icon { font-size: 1rem; }

/* ─── CARD ────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.3rem;
}
.card-caption {
  font-size: 0.83rem;
  color: var(--soft);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

/* ─── PANEL ───────────────────────────────────────────── */
.panel { margin-bottom: 2.5rem; }

/* ─── TOOL GRID ───────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.tool-inputs { position: sticky; top: 1rem; }

/* ─── INPUT GROUPS ────────────────────────────────────── */
.input-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.input-group:last-of-type { border-bottom: none; margin-bottom: 0; }
.group-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--orange);
  margin-bottom: 0.75rem;
}
.group-note {
  font-weight: 400;
  text-transform: none;
  color: var(--soft);
  letter-spacing: 0;
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.field-row label {
  font-size: 0.82rem;
  color: var(--mid);
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.field-row input,
.field-row select {
  width: 110px;
  flex-shrink: 0;
  padding: 0.38rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--dark);
  background: var(--bg);
  transition: border-color 0.15s;
  outline: none;
}
.field-row input:focus,
.field-row select:focus { border-color: var(--orange); background: var(--white); }
.field-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

/* Tooltip hint */
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--border);
  color: var(--soft);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  margin-left: 3px;
  vertical-align: middle;
  text-decoration: none;
}

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 7px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}
.btn-primary:hover { background: var(--orange-light); border-color: var(--orange-light); }
.btn-outline {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}
.btn-outline:hover { background: var(--orange-dim); }
.btn-ghost {
  background: transparent;
  color: var(--soft);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--mid); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.full-width { width: 100%; justify-content: center; margin-top: 1rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── SPINNER ─────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── PLACEHOLDER ─────────────────────────────────────── */
.placeholder-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--soft);
  font-size: 0.88rem;
}
.placeholder-icon { font-size: 2.2rem; margin-bottom: 0.6rem; }

/* ─── VL PLOT ─────────────────────────────────────────── */
.result-plot { width: 100%; border-radius: 6px; }
.vl-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--mid);
}
.vl-stat strong { color: var(--black); }

/* ─── STRENGTH RESULTS ────────────────────────────────── */
.results-header.card { padding: 1rem 1.5rem; }
.results-meta { font-size: 0.9rem; color: var(--mid); }
.results-meta strong { color: var(--black); }

.strength-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.strength-card { text-align: center; padding: 1.2rem 1rem; }
.strength-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.strength-label.eccentric  { color: var(--ecc-color); }
.strength-label.isometric  { color: var(--iso-color); }
.strength-label.concentric { color: var(--con-color); }
.strength-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.strength-pct {
  font-size: 0.82rem;
  color: var(--soft);
  margin-bottom: 0.75rem;
}
.dist-plot { width: 100%; border-radius: 6px; }

.download-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ─── ERROR ───────────────────────────────────────────── */
.error-msg {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 7px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ─── BATCH ───────────────────────────────────────────── */
.batch-workflow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
}
.workflow-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-content strong { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.step-content p { font-size: 0.83rem; color: var(--soft); margin-bottom: 0.5rem; }
.step-content code {
  background: var(--border);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.82rem;
}

.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--bg);
}
.file-upload-zone:hover,
.file-upload-zone.drag-over {
  border-color: var(--orange);
  background: var(--orange-dim);
}
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-label { font-weight: 600; color: var(--dark); font-size: 0.92rem; }
.upload-hint { font-size: 0.8rem; color: var(--soft); margin-top: 0.2rem; }
.upload-selected {
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 600;
  margin-top: 0.5rem;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.results-toolbar-actions { display: flex; gap: 0.5rem; }

.batch-warnings {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 7px;
  padding: 0.75rem 1rem;
  font-size: 0.83rem;
  color: #92400e;
  margin-bottom: 1rem;
}

.table-wrap { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.results-table th {
  background: var(--black);
  color: var(--white);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
.results-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
}
.results-table tr:nth-child(even) td { background: var(--bg); }
.results-table tr:hover td { background: var(--orange-dim); }
.pct-high { color: var(--con-color); font-weight: 600; }
.pct-mid  { color: var(--iso-color); font-weight: 600; }
.pct-low  { color: #b91c1c; font-weight: 600; }

/* ─── HOW IT WORKS ────────────────────────────────────── */
.how-section {
  padding: 2.5rem 1.25rem;
  border-top: 1px solid var(--border);
}
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--black);
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.how-item { }
.how-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--orange-dim);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.how-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--black);
}
.how-item p { font-size: 0.85rem; color: var(--soft); line-height: 1.65; }

/* ─── FOOTER ──────────────────────────────────────────── */
.site-footer {
  background: var(--black);
  padding: 1.75rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-logos {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.footer-logo {
  height: 40px;
  filter: brightness(0) invert(1);
  opacity: 0.75;
}
.footer-right { flex: 1; }
.footer-cite {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}
.footer-cite em { font-style: italic; }
.footer-cite a { color: rgba(255,255,255,0.6); }
.footer-copy {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  margin-top: 0.4rem;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-inputs { position: static; }
  .strength-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .intro-divider { display: none; }
  .about-section { flex-direction: column; }
  .header-logo { height: 38px; }
  .header-title { font-size: 1.05rem; }
}

@media (max-width: 560px) {
  .field-row { flex-direction: column; align-items: flex-start; }
  .field-row input, .field-row select { width: 100%; }
  .intro-item { padding: 0.3rem 1rem; }
}
