/* =====================================================================
   Trader's Edge — shared stylesheet
   Skin only: brand-matched to thecodez.netlify.app (chart cyan, glass
   cards, Press3D edges, Fraunces + DM Sans). The class names and CSS
   variable names below are load-bearing: calc.js renders markup that
   uses them (.out-row, .fc-card, .verdict, var(--teal), var(--danger),
   var(--warn)...). Restyle values freely; never rename them.
   ===================================================================== */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: rgba(255, 255, 255, 0.05);
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.055);
  --bg-input: rgba(0, 0, 0, 0.35);

  /* Chart cyan — THE brand colour. Purple appears ONLY on the Temper CTA. */
  --teal: #00b8d8;
  --teal-deep: #0096b3;
  --teal-light: #4adcf5;
  --teal-tint: rgba(0, 184, 216, 0.08);
  --teal-glow: rgba(0, 184, 216, 0.18);
  --purple: #a78bfa;

  /* Data semantics (results, not brand): good / warn / bad */
  --good: #00b8d8;
  --warn: #ffb454;
  --danger: #ff5c72;

  --ink: #eef2f1;
  --text-body: #d4dad8;
  --muted: #97a3a0;
  --text-faint: #5e6a68;
  --line: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.16);
  --grid-line: rgba(255, 255, 255, 0.02);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.35);
}

html { scroll-behavior: smooth; }

body {
  /* Cyan glow on the base layer — matches the personal homepage exactly */
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(0, 184, 216, 0.07), transparent 60%),
    radial-gradient(700px 450px at -10% 25%, rgba(0, 184, 216, 0.06), transparent 55%),
    radial-gradient(800px 500px at 50% 110%, rgba(0, 184, 216, 0.04), transparent 60%),
    var(--bg-primary);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle grid texture — same graph-paper layer as the homepage */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative; z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ========== HEADER / NAV ========== */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 42px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: 'opsz' 34;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--teal); }
.wordmark .tools-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: 10px;
  vertical-align: 2px;
}
.back-link {
  font-size: 13.5px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: all 0.18s ease;
  box-shadow: 0 3px 0 rgba(255, 255, 255, 0.07);
}
.back-link:hover {
  color: var(--teal); border-color: rgba(0, 184, 216, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0, 184, 216, 0.3);
}

/* ========== HUB HERO ========== */
.hub-hero { text-align: center; margin-bottom: 48px; }
.hub-hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 6.5vw, 50px);
  letter-spacing: -0.02em;
  line-height: 1.06;
  color: var(--ink);
  margin-bottom: 16px;
}
.hub-hero h1 .accent { color: var(--teal); }
.hub-hero .sub {
  color: var(--muted); font-size: 16.5px;
  max-width: 480px; margin: 0 auto;
}
.hub-hero .free-line {
  margin-top: 14px; font-family: var(--font-mono);
  font-size: 12px; color: var(--teal); letter-spacing: 0.06em;
}

/* ========== HUB TOOL CARDS ========== */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-card {
  display: block; text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: all 0.18s ease;
  box-shadow: 0 3px 0 rgba(255, 255, 255, 0.05), var(--shadow-card);
}
.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 184, 216, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(0, 184, 216, 0.25), var(--shadow-card);
}
.tool-card:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 184, 216, 0.2); }
.tool-card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 18px; color: var(--ink); letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.tool-card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.tool-badge {
  display: inline-block; margin-top: 12px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
}
.tool-badge.free { background: var(--teal-tint); color: var(--teal); border: 1px solid rgba(0, 184, 216, 0.25); }
.tool-badge.email { background: rgba(255, 255, 255, 0.04); color: var(--muted); border: 1px solid var(--line); }

/* ========== CALCULATOR PAGE ========== */
.calc-head { margin-bottom: 26px; }
.calc-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.02em;
  line-height: 1.1; color: var(--ink); margin-bottom: 10px;
}
.calc-desc { color: var(--muted); font-size: 15px; max-width: 560px; }
.calc-desc b { color: var(--text-body); }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-card);
  position: relative;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--muted); margin-bottom: 7px; letter-spacing: 0.01em;
}
.field input, .field select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 12px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field select { cursor: pointer; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 184, 216, 0.12);
}
.field .hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

.calcing { opacity: 0.45; transition: opacity 0.2s; }

.seg-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin: 24px 0 12px;
}

/* outputs */
.out {
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
}
.out-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  gap: 14px;
}
.out-row:last-child { border-bottom: none; }
.out-row .k { color: var(--muted); font-size: 14px; }
.out-row .v { font-family: var(--font-mono); font-weight: 600; font-size: 17px; color: var(--ink); text-align: right; }
.v.good { color: var(--good); } .v.bad { color: var(--danger); } .v.warn { color: var(--warn); }

/* tables (breakeven) */
table { width: 100%; border-collapse: collapse; margin-top: 4px; font-family: var(--font-mono); }
th, td { padding: 10px 8px; text-align: right; font-size: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); color: var(--text-body); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
th:first-child, td:first-child { text-align: left; }
tr.be td { background: rgba(255, 180, 84, 0.08); }
tr.exact td { background: rgba(255, 180, 84, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 180, 84, 0.35); }
tr.straddle td { background: rgba(255, 180, 84, 0.11); }
tr.straddle:first-of-type td { border-top: 1px solid rgba(255, 180, 84, 0.3); }
.be-tag {
  display: inline-block; font-family: var(--font-body); font-weight: 600; font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 20px;
  margin-left: 8px; vertical-align: middle;
  background: rgba(255, 180, 84, 0.18); color: var(--warn);
}
.be-tag.up { background: var(--teal-tint); color: var(--teal); }
.be-tag.down { background: rgba(255, 92, 114, 0.16); color: var(--danger); }
td .pill { font-size: 10px; padding: 2px 7px; border-radius: 20px; margin-left: 6px; font-family: var(--font-body); font-weight: 600; }
.pill.profit { background: var(--teal-tint); color: var(--teal); }
.pill.loss { background: rgba(255, 92, 114, 0.15); color: var(--danger); }
.pill.be { background: rgba(255, 180, 84, 0.15); color: var(--warn); }

/* streak forecast cards + bars */
.forecast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) { .forecast { grid-template-columns: 1fr; } }
.fc-card {
  background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 17px 15px; text-align: center;
}
.fc-period { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.fc-trades { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 3px; }
.fc-big { font-family: var(--font-display); font-weight: 900; font-size: 38px; line-height: 1.05; margin: 9px 0 2px; letter-spacing: -0.03em; }
.fc-unit { font-size: 12px; color: var(--muted); font-weight: 500; }
.fc-odds { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.08); font-size: 12px; color: var(--muted); }
.fc-odds b { font-family: var(--font-mono); font-weight: 600; color: var(--text-body); }
.streak-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.streak-label { font-family: var(--font-mono); font-size: 13px; width: 78px; color: var(--muted); }
.streak-track { flex: 1; height: 22px; background: rgba(0, 0, 0, 0.35); border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.streak-fill { height: 100%; border-radius: 6px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.streak-pct { font-family: var(--font-mono); font-size: 13px; width: 54px; text-align: right; font-weight: 600; }

/* verdicts — the sensei speaks */
.verdict {
  margin-top: 20px; padding: 15px 17px; border-radius: 12px;
  font-size: 14px; line-height: 1.55; border: 1px solid;
  display: flex; gap: 11px; align-items: flex-start;
}
.verdict .ic { font-size: 18px; line-height: 1.2; }
.verdict.v-good { background: rgba(0, 184, 216, 0.06); border-color: rgba(0, 184, 216, 0.35); color: #bfe9f2; }
.verdict.v-warn { background: rgba(255, 180, 84, 0.07); border-color: #7a5a22; color: #ffdca8; }
.verdict.v-bad { background: rgba(255, 92, 114, 0.07); border-color: #7a2e3a; color: #ffc2cb; }
.verdict b { font-weight: 600; color: #fff; }

/* prop hero + optimizer */
.ev-hero {
  text-align: center; padding: 22px; border-radius: 14px; margin-bottom: 4px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 184, 216, 0.05), rgba(167, 139, 250, 0.03));
}
.ev-hero .lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.ev-hero .num { font-family: var(--font-display); font-weight: 900; font-size: 46px; letter-spacing: -0.03em; line-height: 1.05; margin: 6px 0 2px; }
.ev-hero .cap { font-size: 12px; color: var(--muted); }

.opt-btn {
  width: 100%; margin-top: 18px; padding: 15px; border-radius: 12px; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  background: var(--teal); color: #021419; border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
  box-shadow: 0 4px 0 var(--teal-deep), 0 8px 20px rgba(0, 184, 216, 0.25);
}
.opt-btn:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 6px 0 var(--teal-deep), 0 12px 28px rgba(0, 184, 216, 0.38); }
.opt-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--teal-deep), 0 2px 8px rgba(0, 184, 216, 0.2); }
.opt-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.opt-wrap { margin-top: 18px; }
.opt-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 13px; padding: 18px; margin-bottom: 13px; }
.opt-card h4 { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.opt-card .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 13px; }
.opt-best { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: -0.02em; color: var(--teal); margin: 2px 0; }
.skill-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.skill-tag { width: 62px; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.skill-track { flex: 1; height: 18px; background: rgba(0, 0, 0, 0.35); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.skill-fill { height: 100%; border-radius: 5px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.skill-val { width: 120px; text-align: right; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }

/* ========== EMAIL GATE ========== */
.gate-shroud { position: relative; }
.gate-shroud.locked > .gate-content { filter: blur(7px); pointer-events: none; user-select: none; }
.gate-overlay {
  display: none;
  position: absolute; inset: 0; z-index: 5;
  align-items: flex-start; justify-content: center;
  padding: 24px;
}
.gate-shroud.locked .gate-overlay { display: flex; }
.gate-box {
  max-width: 380px; width: 100%;
  /* tall calculators (prop firm): keep the unlock box in view while scrolling */
  position: sticky; top: 90px;
  background: rgba(14, 16, 20, 0.92);
  border: 1px solid rgba(0, 184, 216, 0.3);
  border-radius: 16px;
  padding: 26px 24px;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.gate-box .lock-ic { font-size: 26px; margin-bottom: 10px; }
.gate-box h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); margin-bottom: 8px; }
.gate-box p { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font-family: var(--font-body);
  font-size: 14.5px; padding: 12px 14px;
}
.gate-form input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 184, 216, 0.12); }
.gate-form button {
  padding: 12px 20px; background: var(--teal); color: #021419;
  border: none; border-radius: 10px; font-family: var(--font-body);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
  box-shadow: 0 4px 0 var(--teal-deep), 0 8px 20px rgba(0, 184, 216, 0.25);
}
.gate-form button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.gate-form button:active { transform: translateY(3px); box-shadow: 0 0 0 var(--teal-deep); }
.gate-note { margin-top: 12px; font-size: 11.5px; color: var(--text-faint); }

/* ========== TEMPER CTA (the one purple thing on the site) ========== */
.temper-cta {
  margin-top: 44px;
  background: rgba(167, 139, 250, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.temper-cta .tag {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--purple);
}
.temper-cta h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); margin: 8px 0 6px; }
.temper-cta p { font-size: 13.5px; color: var(--muted); max-width: 420px; margin: 0 auto 16px; }
.temper-cta a {
  display: inline-block; text-decoration: none;
  padding: 11px 24px; background: var(--purple); color: #16102b;
  border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
  box-shadow: 0 4px 0 #8b6ce8, 0 8px 20px rgba(167, 139, 250, 0.25);
}
.temper-cta a:hover { filter: brightness(1.1); transform: translateY(-2px); }
.temper-cta a:active { transform: translateY(3px); box-shadow: 0 0 0 #8b6ce8; }

/* ========== FOOTER ========== */
footer { text-align: center; margin-top: 44px; color: var(--text-faint); font-size: 12px; line-height: 1.7; }
footer .dis { max-width: 520px; margin: 0 auto; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--teal); }

/* reveal-on-scroll (same pattern as the personal site) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; } .reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; } .reveal-d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
