/* MRA&T — Apple-inspired design system */
:root {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-card: #f5f5f7;
  --surface: rgba(255,255,255,0.72);
  --border: rgba(0,0,0,0.1);
  --text-primary: #1d1d1f;
  --text-secondary: #424245;
  --text-tertiary: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: #e8f0fe;
  --green: #30d158;
  --yellow: #ffd60a;
  --orange: #ff9f0a;
  --red: #ff453a;
  --blue: #0a84ff;
  --purple: #bf5af2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary); line-height: 1.5; min-height: 100vh; }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.75; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 520px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }

/* ── NAV ────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,251,253,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover { color: var(--text-primary); opacity: 1; }
.nav-cta { font-size: 14px; font-weight: 500; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 22px; border-radius: 980px;
  font-family: var(--font); font-size: 15px; font-weight: 500;
  cursor: pointer; border: none; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.02); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); }
.btn-secondary:hover { background: #e8e8ed; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 30px; font-size: 17px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-loading::after {
  content: ''; width: 14px; height: 14px; border: 2px solid currentColor;
  border-top-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform var(--transition), box-shadow var(--transition); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── FORM ELEMENTS ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.form-input {
  width: 100%; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-family: var(--font); font-size: 15px;
  color: var(--text-primary); transition: border-color var(--transition), background var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--accent); background: var(--bg-elevated); box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }
.form-input::placeholder { color: var(--text-tertiary); }
.form-input.error { border-color: var(--red); }
.form-hint { font-size: 12px; color: var(--text-tertiary); }
.form-error { font-size: 12px; color: var(--red); }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── BADGES / CHIPS ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 980px; font-size: 12px; font-weight: 500;
}
.badge-green  { background: rgba(48,209,88,0.15);  color: #1a7c3e; }
.badge-red    { background: rgba(255,69,58,0.15);   color: #c0392b; }
.badge-yellow { background: rgba(255,214,10,0.15);  color: #856404; }
.badge-orange { background: rgba(255,159,10,0.15);  color: #9a5700; }
.badge-blue   { background: rgba(10,132,255,0.15);  color: #0040a0; }

/* ── TOAST NOTIFICATIONS ───────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 380px; padding: 14px 18px;
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500; color: #fff;
  animation: slideIn 0.3s ease; display: flex; align-items: center; gap: 10px;
}
.toast-success { background: #1c8c3e; }
.toast-error   { background: #c0392b; }
.toast-info    { background: #0040a0; }

/* ── HIVE SCORE ─────────────────────────────────────────── */
.hive-ring {
  width: 140px; height: 140px; position: relative; display: flex;
  align-items: center; justify-content: center;
}
.hive-score { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.hive-label { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

/* ── PARAMETER ROW ──────────────────────────────────────── */
.param-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.param-row:last-child { border-bottom: none; }
.param-name { font-size: 15px; font-weight: 500; }
.param-category { font-size: 12px; color: var(--text-tertiary); }
.param-value { font-size: 18px; font-weight: 600; }
.param-range { font-size: 12px; color: var(--text-tertiary); }
.param-bar { width: 80px; height: 6px; border-radius: 3px; background: var(--bg-card); overflow: hidden; }
.param-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

/* ── TIMELINE FILTER ────────────────────────────────────── */
.timeline-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline-pill {
  padding: 6px 14px; border-radius: 980px; font-size: 13px; font-weight: 500;
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  border: 1px solid transparent; transition: all var(--transition);
}
.timeline-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.timeline-pill:hover:not(.active) { border-color: var(--border); }

/* ── UPLOAD ZONE ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--bg-card);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-light);
}
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-size: 17px; font-weight: 500; }
.upload-hint { font-size: 14px; color: var(--text-tertiary); margin-top: 6px; }

/* ── DISCLAIMER ─────────────────────────────────────────── */
.disclaimer {
  background: rgba(255,159,10,0.1); border: 1px solid rgba(255,159,10,0.3);
  border-radius: var(--radius-md); padding: 14px 18px; font-size: 13px;
  color: var(--text-secondary); line-height: 1.6;
}
.disclaimer strong { color: var(--text-primary); }

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress { height: 8px; border-radius: 4px; background: var(--bg-card); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }

/* ── SKELETON LOADING ───────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, #eee 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── GRID ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }
  .nav-links { display: none; }
  h1 { font-size: 2rem; }
}

/* ── DARK MODE ──────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg-elevated: #1c1c1e; --bg-card: #2c2c2e;
    --surface: rgba(28,28,30,0.72); --border: rgba(255,255,255,0.1);
    --text-primary: #f5f5f7; --text-secondary: #a1a1a6; --text-tertiary: #6e6e73;
    --accent: #2997ff; --accent-hover: #1e88ff; --accent-light: rgba(41,151,255,0.12);
  }
  .skeleton { background: linear-gradient(90deg, #2c2c2e 25%, #3a3a3c 50%, #2c2c2e 75%); background-size: 200% 100%; }
}
