/* ============================================================
   Market Survival Guide · Extreme Volatility Risk Handbook
   styles/main.css — dark trading-terminal theme
   Structure: tokens → base → top bar → hero/calculator →
   rules → strategies → footer → responsive
   ============================================================ */

/* -------------------- Design tokens -------------------- */
:root {
  --bg-void: #07090e;
  --bg-card: rgba(17, 22, 34, 0.92);
  --bg-input: #0b0f18;
  --bg-panel: rgba(9, 13, 22, 0.9);
  --bg-soft: rgba(255, 255, 255, 0.04);
  --text-main: #f3f6fc;
  --text-dim: #94a3b8;
  --red-alert: #f43f5e;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber: #f59e0b;
  --blue-tech: #38bdf8;
  --border: rgba(255, 255, 255, 0.09);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-w: 1180px;
}

/* -------------------- Reset & base -------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% 18%, rgba(16, 185, 129, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 85% 22%, rgba(56, 189, 248, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 0%, rgba(244, 63, 94, 0.12) 0%, transparent 52%),
    linear-gradient(180deg, #06080c 0%, #0c111b 55%, #07090e 100%);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

/* -------------------- Sticky top bar -------------------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 12, 19, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  padding: 10px 20px;
}

.top-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.academy-badge {
  background: linear-gradient(135deg, #0284c7, #10b981);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-tip {
  color: #bae6fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--emerald);
}

/* -------------------- Layout container -------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------- Hero -------------------- */
.hero {
  padding: 42px 0 34px;
}

.hero-card {
  background: linear-gradient(
    145deg,
    rgba(16, 23, 36, 0.95) 0%,
    rgba(12, 17, 27, 0.96) 60%,
    rgba(16, 26, 34, 0.94) 100%
  );
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red-alert), var(--amber), var(--emerald));
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.special-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.38);
  padding: 5px 12px;
  border-radius: 999px;
}

.vol-tags {
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.v-pill {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #cbd5e1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}

.hero-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-title .red {
  color: var(--red-alert);
}

.hero-title .green {
  color: var(--emerald);
}

.hero-desc {
  font-size: 15px;
  color: #cbd5e1;
  margin-bottom: 22px;
}

/* Core principles trio */
.core-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.p-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.p-box strong {
  display: block;
  font-size: 14px;
  color: var(--blue-tech);
  margin-bottom: 4px;
}

.p-box span {
  font-size: 12px;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
}

.btn-ghost {
  background: var(--bg-soft);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-size: 13px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s ease;
}

.btn-ghost:hover {
  border-color: var(--blue-tech);
}

/* -------------------- Risk calculator panel -------------------- */
.calc-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 22px;
}

.calc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.calc-head h3 {
  font-size: 15px;
  color: var(--emerald);
}

.calc-badge {
  font-size: 11px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.c-field label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.c-field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease;
}

.c-field input:focus {
  outline: none;
  border-color: var(--emerald);
}

.calc-result {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.res-item span {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
}

.res-item strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

/* -------------------- Sections -------------------- */
.section {
  padding: 22px 0 42px;
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.sec-head h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.sec-head p {
  font-size: 13px;
  color: var(--text-dim);
}

/* -------------------- 3 stop-loss rules -------------------- */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.rule-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 63, 94, 0.4);
}

.rule-step {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.rule-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: #f8fafc;
}

.rule-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.rule-tip {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--red-alert);
  padding: 9px 12px;
  font-size: 12px;
  color: #e2e8f0;
  border-radius: 0 8px 8px 0;
}

/* -------------------- Strategy filters -------------------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.f-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.f-btn.active,
.f-btn:hover {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: #fff;
}

/* -------------------- 4 profit strategies -------------------- */
.strat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.strat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.strat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.4);
}

.strat-card[hidden] {
  display: none;
}

.strat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.strat-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.risk-badge {
  font-size: 12px;
  color: var(--amber);
  font-weight: 600;
  white-space: nowrap;
}

.strat-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #f8fafc;
}

.strat-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.strat-steps {
  list-style: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: #cbd5e1;
}

.strat-steps li {
  margin-bottom: 6px;
}

.strat-steps li:last-child {
  margin-bottom: 0;
}

.strat-steps strong {
  color: var(--emerald);
}

/* -------------------- Footer -------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(6, 8, 12, 0.95);
}

/* -------------------- Responsive -------------------- */
@media (max-width: 920px) {
  .hero-grid,
  .rules-grid,
  .strat-grid {
    grid-template-columns: 1fr;
  }

  .core-principles {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .hero-card {
    padding: 26px 20px;
  }

  .calc-grid,
  .calc-result {
    grid-template-columns: 1fr;
  }
}