/* =========================================================================
   Metazen Trading — design system
   =========================================================================
   Thesis: the product is a MIRROR. One account moves, all accounts move.
   The paired-line motif (master + client, locked together, scaled by tier)
   is the signature element. Everything else stays quiet.
   ========================================================================= */

:root {
  /* Palette — deliberately not the default black+neon fintech look.
     Brass reads as money without reading as crypto. */
  --ink:        #0B0F14;   /* background */
  --ink-2:      #111820;   /* raised surface */
  --ink-3:      #18212B;   /* border / hairline */
  --bone:       #F2F0EB;   /* primary text */
  --bone-dim:   #8B96A3;   /* secondary text */
  --bone-faint: #4A5561;   /* tertiary / disabled */

  --brass:      #C9A227;   /* THE accent. Money. Used with restraint. */
  --brass-dim:  #8A6F1B;

  --teal:       #3D5A5B;   /* the "client" line — quieter than master */
  --teal-lit:   #5E8A8C;

  --oxide:      #8B2E2E;   /* loss / risk. Used honestly, never hidden. */
  --oxide-lit:  #C25454;

  --green:      #2F6B4F;   /* profit */
  --green-lit:  #4E9E77;

  /* Type */
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Scale */
  --step--1: 0.8125rem;
  --step-0:  0.9375rem;
  --step-1:  1.125rem;
  --step-2:  1.5rem;
  --step-3:  2.25rem;
  --step-4:  3.5rem;
  --step-5:  5rem;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 144px;

  --r: 3px;         /* barely-there radius. Institutional, not friendly. */
  --hair: 1px solid var(--ink-3);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Every number is monospace. In a trading product, numbers look like numbers. */
.num, td.num, .metric-value, .price, .lot, .pnl {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* ---------------- layout ---------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-5); }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--sp-5); }

section { padding: var(--sp-9) 0; }
@media (max-width: 720px) { section { padding: var(--sp-7) 0; } }

/* eyebrow — encodes a real category, not decoration */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bone-faint);
  margin-bottom: var(--sp-4);
}

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,15,20,0.88);
  backdrop-filter: blur(12px);
  border-bottom: var(--hair);
}
.nav-in {
  max-width: 1180px; margin: 0 auto; padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--display);
  font-weight: 800; font-size: var(--step-1);
  letter-spacing: -0.04em; color: var(--bone);
}
.logo span { color: var(--brass); }
.nav-links { display: flex; gap: var(--sp-5); align-items: center; }
.nav-links a { color: var(--bone-dim); font-size: var(--step-0); }
.nav-links a:hover { color: var(--bone); text-decoration: none; }
@media (max-width: 820px) {
  .nav-links a:not(.btn) { display: none; }
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--brass);
  background: var(--brass);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600; font-size: var(--step-0);
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:hover { background: #D9B22F; border-color: #D9B22F; text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--bone); border-color: var(--ink-3);
}
.btn-ghost:hover { background: var(--ink-2); border-color: var(--bone-faint); }
.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--step--1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- cards ---------------- */
.card {
  background: var(--ink-2);
  border: var(--hair);
  border-radius: var(--r);
  padding: var(--sp-5);
}
.card-pad-lg { padding: var(--sp-6); }

/* ---------------- forms ---------------- */
label {
  display: block;
  font-size: var(--step--1);
  color: var(--bone-dim);
  margin-bottom: var(--sp-2);
  font-weight: 500;
}
input[type=text], input[type=email], input[type=password],
input[type=number], select, textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--ink);
  border: 1px solid var(--ink-3);
  border-radius: var(--r);
  color: var(--bone);
  font-family: var(--body);
  font-size: var(--step-0);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brass);
}
.field { margin-bottom: var(--sp-5); }
.hint { font-size: var(--step--1); color: var(--bone-faint); margin-top: var(--sp-2); }

/* ---------------- tables ---------------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bone-faint);
  font-weight: 500;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--hair);
}
td {
  padding: var(--sp-4);
  border-bottom: 1px solid rgba(24,33,43,0.6);
  font-size: var(--step-0);
}
tbody tr:hover { background: rgba(24,33,43,0.4); }

/* ---------------- status pills ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid;
}
.pill::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}
.pill-active  { color: var(--green-lit);  border-color: rgba(78,158,119,.35); background: rgba(47,107,79,.12); }
.pill-pending { color: var(--brass);      border-color: rgba(201,162,39,.35); background: rgba(201,162,39,.10); }
.pill-paused  { color: var(--oxide-lit);  border-color: rgba(194,84,84,.35);  background: rgba(139,46,46,.12); }
.pill-dim     { color: var(--bone-faint); border-color: var(--ink-3); }

.up   { color: var(--green-lit); }
.down { color: var(--oxide-lit); }

/* ---------------- metrics ---------------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
}
.metric { background: var(--ink-2); border: var(--hair); border-radius: var(--r); padding: var(--sp-5); }
.metric-label {
  font-family: var(--mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--bone-faint); margin-bottom: var(--sp-3);
}
.metric-value { font-size: var(--step-2); font-weight: 500; }
.metric-sub { font-size: var(--step--1); color: var(--bone-faint); margin-top: var(--sp-2); }

/* ---------------- risk banner: permanent, not a footnote ---------------- */
.risk-bar {
  background: rgba(139,46,46,0.10);
  border-bottom: 1px solid rgba(139,46,46,0.28);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--step--1);
  color: #C08A8A;
  text-align: center;
}
.risk-bar strong { color: var(--oxide-lit); }

/* ---------------- flash messages ---------------- */
.flash {
  padding: var(--sp-4);
  border-radius: var(--r);
  margin-bottom: var(--sp-5);
  font-size: var(--step-0);
  border: 1px solid;
}
.flash-ok    { background: rgba(47,107,79,.12);  border-color: rgba(78,158,119,.3);  color: var(--green-lit); }
.flash-err   { background: rgba(139,46,46,.12);  border-color: rgba(194,84,84,.3);   color: var(--oxide-lit); }
.flash-info  { background: rgba(201,162,39,.10); border-color: rgba(201,162,39,.3);  color: var(--brass); }

/* ---------------- copy-to-clipboard (admin asked for this explicitly) ---- */
.copyable {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--ink); border: 1px solid var(--ink-3);
  border-radius: var(--r); padding: var(--sp-3) var(--sp-4);
  font-family: var(--mono); font-size: var(--step--1);
  word-break: break-all;
}
.copyable button {
  margin-left: auto; flex-shrink: 0;
  background: var(--ink-3); border: none; color: var(--bone-dim);
  padding: 4px 10px; border-radius: var(--r); cursor: pointer;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em;
}
.copyable button:hover { background: var(--brass); color: var(--ink); }
.copyable button.done { background: var(--green); color: var(--bone); }

/* ---------------- footer ---------------- */
footer {
  border-top: var(--hair);
  padding: var(--sp-7) 0 var(--sp-8);
  color: var(--bone-faint);
  font-size: var(--step--1);
}
footer a { color: var(--bone-dim); }
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-6);
}
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-links { display: flex; flex-direction: column; gap: var(--sp-3); }


/* =========================================================================
   MOBILE NAV
   Google uses mobile-first indexing — the mobile experience IS the ranked
   experience. The old nav simply hid its links below 820px, which left
   phone users with no way to reach anything.
   ========================================================================= */
.nav-toggle {
  display: none;
  flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 8px; margin: -8px;
  /* 44px min touch target — WCAG + iOS guidance */
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--bone); border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(300px, 82vw);
    background: var(--ink-2);
    border-left: var(--hair);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 88px var(--sp-5) var(--sp-5);
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.16,1,.3,1);
    z-index: 99;
    overflow-y: auto;
  }
  .nav-links.open { transform: none; }

  /* the old rule hid every link on mobile — that was the bug */
  .nav-links a:not(.btn) {
    display: block !important;
    padding: var(--sp-4) 0;
    border-bottom: 1px solid rgba(24,33,43,.7);
    font-size: var(--step-1);
    min-height: 44px;
  }
  .nav-links .btn { margin-top: var(--sp-5); justify-content: center; }
}


/* =========================================================================
   MOBILE POLISH
   ========================================================================= */
@media (max-width: 640px) {
  .wrap, .wrap-narrow { padding-left: var(--sp-4); padding-right: var(--sp-4); }

  /* stop long crypto addresses / txids blowing out the layout */
  .copyable { flex-wrap: wrap; font-size: 11px; }
  .copyable span { min-width: 0; word-break: break-all; }
  .copyable button { margin-left: 0; margin-top: var(--sp-2); }

  /* tables scroll rather than squash */
  table { min-width: 460px; }
  .card table { min-width: 0; }

  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: var(--sp-4); }
  .metric-value { font-size: var(--step-1); }

  /* every tappable thing gets a real touch target */
  .btn { min-height: 44px; }
  input, select, textarea {
    min-height: 44px;
    font-size: 16px;   /* < 16px makes iOS Safari zoom on focus */
  }
}

/* honour reduced-motion everywhere */
@media (prefers-reduced-motion: reduce) {
  .nav-links { transition: none; }
}


/* =========================================================================
   FAQ
   The FAQ schema in <head> has to match visible content on the page —
   Google penalises structured data that describes something the user
   can't actually see.
   ========================================================================= */
.faq { display: grid; gap: 0; }
.faq-item { border-bottom: var(--hair); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  background: none; border: none; cursor: pointer;
  color: var(--bone);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  text-align: left;
  transition: color .2s ease;
}
.faq-q:hover { color: var(--brass); }
.faq-q .ic {
  flex-shrink: 0;
  width: 18px; height: 18px;
  position: relative;
}
.faq-q .ic::before, .faq-q .ic::after {
  content: ''; position: absolute;
  background: var(--brass);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.faq-q .ic::before { top: 8px; left: 0; width: 18px; height: 2px; }
.faq-q .ic::after  { left: 8px; top: 0; width: 2px; height: 18px; }
.faq-item.open .faq-q .ic::after { transform: rotate(90deg); opacity: 0; }

.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .35s cubic-bezier(.16,1,.3,1);
}
.faq-item.open .faq-a { max-height: 400px; }
.faq-a p {
  color: var(--bone-dim);
  margin: 0 0 var(--sp-5);
  padding-right: var(--sp-7);
  max-width: 68ch;
}
