/* BrainComputer — Spotify-inspired dark theme.
   Near-black surfaces, single functional green accent, pill buttons, heavy shadows,
   compact type. Fully responsive (mobile-first friendly). See design.md. */

:root {
  /* Surfaces (depth through shade) */
  --bg: #121212;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --card: #181818;
  --card-hover: #282828;

  /* Brand + semantic */
  --green: #1ed760;
  --green-press: #1db954;
  --red: #f3727f;
  --orange: #ffa42b;
  --blue: #539df5;

  /* Text */
  --text: #ffffff;
  --muted: #b3b3b3;
  --near-white: #cbcbcb;

  /* Lines */
  --border: #4d4d4d;
  --light-border: #7c7c7c;

  /* Shadows */
  --shadow-card: rgba(0, 0, 0, 0.3) 0 8px 8px;
  --shadow-heavy: rgba(0, 0, 0, 0.5) 0 8px 24px;

  /* Radii */
  --r-card: 8px;
  --r-input: 8px;
  --pill: 9999px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--near-white); text-decoration: none; }
a:hover { color: var(--text); }

.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #000;
  display: grid; place-items: center; font-size: 19px;
  box-shadow: var(--shadow-card);
}
.brand small { color: var(--muted); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--muted); font-size: 0.82rem; font-weight: 700;
  padding: 8px 16px; border-radius: var(--pill); background: var(--surface-2);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--card-hover); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 {
  font-size: clamp(2rem, 6.5vw, 3.25rem); line-height: 1.08; margin: 0 0 16px;
  font-weight: 800; letter-spacing: -0.02em;
}
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 28px;
}

/* ---------- dropzone ---------- */
.dropzone {
  margin-top: 8px; background: var(--surface-2);
  border-radius: var(--r-input); padding: 52px 24px; text-align: center;
  cursor: pointer; transition: background .15s ease, box-shadow .15s ease;
  box-shadow: rgb(124, 124, 124) 0 0 0 1px inset;
}
.dropzone:hover, .dropzone:focus-visible { background: #232323; outline: none; box-shadow: var(--green) 0 0 0 1px inset; }
.dropzone.drag { background: #232323; box-shadow: var(--green) 0 0 0 2px inset; }
.dropzone .big { font-size: 1.15rem; font-weight: 700; }
.dropzone .hint { color: var(--muted); margin-top: 8px; font-size: 0.9rem; }
.dropzone .formats { color: var(--light-border); margin-top: 14px; font-size: 0.75rem; letter-spacing: 0.02em; }
input[type="file"] { display: none; }

.filechip {
  margin-top: 16px; display: none; align-items: center; gap: 12px;
  background: var(--surface-2); padding: 12px 16px; border-radius: var(--r-input);
}
.filechip.show { display: flex; }
.filechip .name { font-weight: 700; word-break: break-all; }
.filechip .meta { color: var(--muted); font-size: 0.8rem; margin-left: auto; white-space: nowrap; }

/* ---------- buttons (pills) ---------- */
.row { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 32px; cursor: pointer; border: none;
  border-radius: var(--pill); font-size: 0.88rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  background: var(--green); color: #000; transition: transform .06s ease, background .15s ease, opacity .15s ease;
}
.btn:hover { transform: scale(1.03); background: #1fdf64; }
.btn:active { transform: scale(0.99); background: var(--green-press); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.secondary:hover { background: var(--card-hover); }

.error { color: var(--red); margin-top: 14px; min-height: 1.2em; font-size: 0.9rem; }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 44px 0; }
.feature { background: var(--surface); border-radius: var(--r-card); padding: 22px; transition: background .15s ease; }
.feature:hover { background: var(--card-hover); }
.feature .ico { font-size: 1.5rem; }
.feature h3 { margin: 10px 0 6px; font-size: 1rem; font-weight: 700; }
.feature p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* ---------- loading ---------- */
.loading { text-align: center; padding: 88px 0; }
.spinner {
  width: 48px; height: 48px; margin: 0 auto 22px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12); border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .status { color: var(--muted); }

/* ---------- results ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 28px 0; flex-wrap: wrap; }
.results-head h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -0.01em; }
.index-badge {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border-radius: var(--r-card); padding: 18px 24px; box-shadow: var(--shadow-card);
}
.index-ring { position: relative; width: 110px; height: 110px; }
.index-ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; }
.index-ring .lbl { display: block; font-size: 0.58rem; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { background: var(--surface); border-radius: var(--r-card); padding: 22px; box-shadow: var(--shadow-card); }
.panel-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 16px; }
.panel-sub { margin: -8px 0 16px; font-size: 0.82rem; color: var(--muted); }

/* Brain-network activation maps */
#brainMapsCard { margin-top: 16px; }
.brain-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.brain-cell { margin: 0; background: var(--surface-2); border-radius: var(--r-input); padding: 8px; }
.brain-cell img { width: 100%; height: auto; display: block; border-radius: 6px; }
.brain-cell figcaption {
  margin-top: 6px; text-align: center; font-size: 0.78rem; font-weight: 600; color: var(--text);
}

.insights { margin-top: 20px; display: grid; gap: 10px; }
.insight {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r-card);
  background: var(--surface); border-left: 4px solid var(--muted);
}
.insight.positive { border-left-color: var(--green); }
.insight.tip { border-left-color: var(--blue); }
.insight.warning { border-left-color: var(--orange); }
.insight .i-ico { font-size: 1.25rem; line-height: 1.4; }
.insight h4 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 700; }
.insight p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.exp-pill {
  display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: capitalize; color: var(--orange);
  background: rgba(255, 164, 43, 0.12); border-radius: var(--pill);
  padding: 3px 10px; margin-left: 8px; vertical-align: middle;
}

.note {
  margin-top: 20px; font-size: 0.82rem; color: var(--muted);
  background: var(--surface); border-radius: var(--r-card); padding: 14px 18px;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 56px; padding: 32px 0 40px; border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.site-footer .by { font-size: 0.9rem; color: var(--muted); }
.site-footer .by a { color: var(--text); font-weight: 700; }
.site-footer .by a:hover { color: var(--green); }
.socials { display: flex; align-items: center; gap: 10px; }
.socials a {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; transition: background .15s ease, transform .06s ease;
}
.socials a:hover { background: var(--card-hover); transform: translateY(-1px); }
.socials img, .socials svg { width: 18px; height: 18px; display: block; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .site-header { padding: 14px 0; }
  .brand { font-size: 0.98rem; }
  .nav a { padding: 7px 13px; font-size: 0.78rem; }
  .hero { padding: 40px 0 20px; }
  .card { padding: 20px; }
  .dropzone { padding: 40px 18px; }
  .row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .results-head { gap: 16px; }
  .index-badge { width: 100%; justify-content: center; }
  .filechip .meta { margin-left: 0; width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 16px; }
}
