/* ===== Variables & reset ===== */
:root {
  --color-bg: #0c1322;
  --color-surface: #111827;
  --color-surface-alt: #1a2744;
  --color-primary: #3b82f6;
  --color-primary-dim: #2563eb;
  --color-accent: #00c9a7;
  --color-accent-dim: #00a88a;
  --color-text: #e8ecf4;
  --color-text-muted: #94a3b8;
  --font-heading: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 12px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
/*test*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body.modal-lock {
  overflow: hidden;
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  color: var(--color-text);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--color-text-muted);
  max-width: 65ch;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dim);
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

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

.nav-links a.nav-link-active {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle.nav-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.nav-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.nav-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav {
    padding: 0.75rem 1rem;
  }
  .nav-inner {
    max-width: 100%;
    gap: 0.75rem;
  }
  .nav-logo {
    font-size: 1.25rem;
    flex-shrink: 0;
  }
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    z-index: 110;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.75rem 1.25rem 1rem;
    background: rgba(12, 19, 34, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    display: none;
  }
  .nav-links a {
    font-size: 0.95rem;
    padding: 0.25rem 0;
  }
  .nav-links.nav-links-open {
    display: flex;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    align-items: center;
  }
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  text-align: center;
  position: relative;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 201, 167, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse 60% 40% at 80% 20%, rgba(123, 104, 238, 0.06) 0%, transparent 40%);
}

@media (max-width: 768px) {
  .hero {
    padding: 5rem 1.25rem 3rem;
    min-height: auto;
    padding-top: 6rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 5rem 1rem 2.5rem;
  }
}

.hero-content {
  max-width: 720px;
}

.hero h1 {
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.hero h1 span {
  color: var(--color-primary);
  font-style: italic;
}

.hero p {
  font-size: 1.15rem;
  margin: 0 auto 2rem;
  color: var(--color-text-muted);
}

.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  margin-left: 0.75rem;
}

@media (max-width: 480px) {
  .hero-content .btn {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem 0;
    text-align: center;
    min-height: 48px;
  }
  .hero-content .btn-outline {
    margin-left: 0;
  }
  .hero-content .btn:last-child {
    margin-bottom: 0;
  }
}

.btn-outline:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary-dim);
  border-color: var(--color-primary-dim);
}

.btn-small {
  padding: 0.65rem 1.1rem;
  font-size: 0.92rem;
}

/* ===== Section scroll transitions (main page only) ===== */
main:not(.about-page):not(.standalone-page) .hero,
main:not(.about-page):not(.standalone-page) .section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

main:not(.about-page):not(.standalone-page) .hero.in-view,
main:not(.about-page):not(.standalone-page) .section.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Sections ===== */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

@media (max-width: 768px) {
  .section {
    padding: 3rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 2rem 1rem;
  }
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

@media (max-width: 480px) {
  .section-header {
    margin-bottom: 2rem;
  }
  .section-header .btn {
    display: block;
    width: 100%;
    text-align: center;
    min-height: 48px;
    margin: 0 auto;
  }
}

.section-header p {
  margin: 0 auto;
}

/* Financial literacy section */
.literacy {
  background: var(--color-surface);
}

/* Mission section (distinct from literacy) */
.mission {
  background: radial-gradient(ellipse 70% 60% at 20% 20%, rgba(59, 130, 246, 0.10) 0%, transparent 55%),
              radial-gradient(ellipse 70% 60% at 80% 30%, rgba(0, 201, 167, 0.08) 0%, transparent 55%);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8.5rem;
}

.mission-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .mission-cards {
    grid-template-columns: 1fr;
  }
}

.mission-card {
  background: rgba(17, 24, 39, 0.70);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

.mission-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-bg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  margin-bottom: 0.9rem;
}

.mission-card h3 {
  font-family: var(--font-heading);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.mission-card p {
  margin: 0;
  color: var(--color-text-muted);
}

.literacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .literacy-grid {
    grid-template-columns: 1fr;
  }
}

.literacy-content h2 {
  margin-bottom: 1.25rem;
}

.literacy-content p {
  margin-bottom: 1rem;
}

.literacy-visual {
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.literacy-visual h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.literacy-visual ul {
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.literacy-visual li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.literacy-visual li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* Compound section */
.compound h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.compound .section-header p {
  margin-bottom: 2.5rem;
}

.compound-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 480px) {
  th, td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
  .compound-table-wrap {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 8px;
  }
}

th {
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-weight: 600;
  font-family: var(--font-body);
}

td {
  color: var(--color-text-muted);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  color: var(--color-text);
}

.compound-note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(0, 201, 167, 0.08);
  border-radius: var(--radius);
  border-left: 4px solid var(--color-accent);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.compound-cta {
  text-align: center;
  margin-top: 2rem;
}

.compound-cta .btn {
  margin: 0;
}

@media (max-width: 480px) {
  .compound-cta .btn {
    display: block;
    width: 100%;
    text-align: center;
    min-height: 48px;
  }
}

/* Compound layout + visuals */
.compound-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.compound-left {
  min-width: 0;
}

.compound-table-actions {
  margin-top: 4rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
}

.compound-table-actions .btn {
  margin: 0;
  min-width: 320px;
  text-align: center;
  padding: 1.05rem 2.1rem;
  font-size: 1.05rem;
}

.compound-try {
  margin: 0;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .compound-layout {
    grid-template-columns: 1fr;
  }
}

.compound-side {
  display: grid;
  gap: 1.5rem;
}

.compound-card {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.compound-card-sub {
  margin-top: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.compound-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.compound-chart-grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.compound-chart-line {
  fill: none;
  stroke: url(#cg);
  stroke-width: 5;
  stroke-linecap: round;
}

.compound-chart-area {
  fill: rgba(59, 130, 246, 0.12);
}

.compound-chart-dot {
  fill: var(--color-accent);
  stroke: rgba(10, 14, 23, 0.9);
  stroke-width: 3;
}

.compound-chart-label {
  fill: var(--color-text-muted);
  font-size: 12px;
  font-family: var(--font-body);
}

.compound-bars {
  display: grid;
  gap: 1rem;
}

.compound-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.45rem;
}

.compound-bar-track {
  display: flex;
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.compound-bar-fill {
  height: 100%;
}

.compound-bar-contrib {
  background: rgba(59, 130, 246, 0.95);
}

.compound-bar-growth {
  background: rgba(0, 201, 167, 0.95);
}

.compound-legend {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.compound-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.compound-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.compound-legend-swatch.contrib {
  background: rgba(59, 130, 246, 0.95);
}

.compound-legend-swatch.growth {
  background: rgba(0, 201, 167, 0.95);
}

/* Investment calculator */
.calculator-wrap {
  max-width: 480px;
  margin: 0 auto 2rem;
}

.calculator-form {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
}

@media (max-width: 480px) {
  .calculator-wrap {
    padding: 0;
  }
  .calculator-form {
    padding: 1.25rem;
  }
  .calculator-form .btn {
    width: 100%;
    min-height: 48px;
  }
  .calculator-result {
    padding: 1.25rem;
  }
}

.calc-field {
  margin-bottom: 1.25rem;
}

.calc-field:last-of-type {
  margin-bottom: 1.5rem;
}

.calc-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.calc-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface-alt);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-sizing: border-box;
}

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

.calculator-result {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}
.calculator-note {
  margin-top: 1.5rem;
}

.calc-total {
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.calc-total strong {
  color: var(--color-accent);
}

.calc-contrib {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Standalone pages (about, trading tools) */
.about-page,
.standalone-page {
  padding-top: 6rem;
  min-height: 100vh;
}

/* Trading Tools hub – two separate tool entries */
.tools-hub {
  max-width: 900px;
  margin: 0 auto;
}

.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.tool-hub-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 480px) {
  .tool-hub-card {
    padding: 1.5rem;
  }
}

.tool-hub-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
}

.tool-hub-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.tool-hub-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

@media (max-width: 640px) {
  .tools-hub-grid {
    grid-template-columns: 1fr;
  }
}

/* Full-page tool (Trading Algorithms / Research Assistant) – each tool takes the page */
.tool-fullpage {
  padding-top: 6rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.section.tool-page {
  padding: 2rem;
}

@media (max-width: 480px) {
  .section.tool-page {
    padding: 1rem;
  }
  .tool-page-content {
    padding: 1.25rem;
  }
  .about-page,
  .standalone-page,
  .tool-fullpage {
    padding-top: 5rem;
  }
}

.tool-page {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.tool-back {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tool-back:hover {
  color: var(--color-primary);
}

.tool-page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.tool-page-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.tool-page-content {
  flex: 1;
  min-height: 60vh;
  background: transparent;
  border: none;
  padding: 0;
}

/* About section */
.about-inner {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.about-portrait {
  aspect-ratio: 3 / 4;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  overflow: hidden;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-name {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.about-bio .about-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.about-bio p:not(.about-title) {
  margin-bottom: 0;
}

.about-contact {
  margin-top: 7rem;
  text-align: center;
}

.home-contact {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  text-align: center;
}

@media (max-width: 768px) {
  .home-contact {
    padding: 0 1.25rem 4rem;
  }
}

@media (max-width: 480px) {
  .home-contact {
    padding: 0 1rem 3.5rem;
  }
}

@media (max-width: 640px) {
  .about-inner {
    grid-template-columns: 1fr;
  }

  .about-portrait {
    max-width: 240px;
    margin: 0 auto;
  }
}

/* Footer */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.footer-brand {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

.footer-links {
  display: inline-flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-links a:hover,
.footer-links a.footer-link-active {
  color: var(--color-accent);
}

.footer-disclaimer {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 70ch;
}

.footer a {
  color: var(--color-primary);
}

/* Modal (privacy policy) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.modal-open {
  display: flex;
}

.modal {
  width: min(900px, 100%);
  max-height: min(78vh, 860px);
  overflow: auto;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--color-text);
}

.modal-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.modal-close:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
}

.prose h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose ul {
  margin-left: 1.25rem;
  color: var(--color-text-muted);
}

.prose li {
  margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
  .footer {
    padding: 1.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Prevent horizontal overflow on small screens */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
