/* ============================================================
   trade.codyhurst.com — Accessible Trade Terminal marketing site
   Shares design language with codyhurst.com: navy + gold palette,
   deeper accent for the trading vertical.
   ============================================================ */

/* 1. Tokens -------------------------------------------------------- */
:root {
  color-scheme: light;

  --brand-primary:        #0f2744;   /* deep navy */
  --brand-primary-hover:  #173a66;
  --brand-accent:         #c9a04a;   /* muted gold */
  --brand-accent-strong:  #b48a30;

  --bg:          #f6f6f4;
  --surface:     #ffffff;
  --surface-alt: #f0efea;
  --border:      #d9d6cf;
  --text:        #1a1f2b;
  --text-muted:  #525a6b;
  --link:        var(--brand-primary);
  --link-hover:  var(--brand-primary-hover);

  --error:   #9a1b2e;
  --error-bg:#fbe7ea;
  --success: #0b6b3a;
  --success-bg:#e1f3e9;
  --info:    #1a3e7a;

  --font-sans: 'Inter', 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Inter', 'Open Sans', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --step--1: clamp(0.875rem, 0.84rem + 0.18vw, 0.95rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2:  clamp(1.35rem, 1.2rem + 0.75vw, 1.75rem);
  --step-3:  clamp(1.75rem, 1.45rem + 1.5vw, 2.5rem);
  --step-4:  clamp(2.25rem, 1.8rem + 2.25vw, 3.5rem);
  --step-5:  clamp(2.75rem, 2.1rem + 3.25vw, 4.5rem);

  --container: 68rem;
  --container-narrow: 44rem;
  --gap:       1.25rem;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06);

  --t-fast: 160ms ease;
  --t:      240ms ease;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0b1220;
  --surface:     #121a2a;
  --surface-alt: #182339;
  --border:      #2a3655;
  --text:        #e8ecf3;
  --text-muted:  #9aa4bb;
  --link:        #e7c774;
  --link-hover:  #fadb8f;
  --brand-accent: #e0be6b;
  --error:   #ff8897;
  --error-bg:#3a1820;
  --success: #7ee0a1;
  --success-bg:#123324;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 6px 14px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
}

/* 2. Reset + base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p, ul, ol { margin: 0 0 1em; }
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast);
}
a:hover, a:focus-visible { color: var(--link-hover); }
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text);
  box-shadow: 0 1px 0 var(--border);
}

/* 3. Accessibility primitives ------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--brand-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button, input, select, textarea { font: inherit; color: inherit; }

/* 4. Header -------------------------------------------------------- */
.site-header {
  background: var(--brand-primary);
  color: #fff;
  border-bottom: 3px solid var(--brand-accent);
}
.site-header a { color: #fff; text-decoration: none; }
.site-header a:hover, .site-header a:focus-visible { color: var(--brand-accent); }

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 700;
  font-size: var(--step-1);
}
.brand__logo { width: 36px; height: 36px; }
.brand__name { letter-spacing: 0.01em; }

.nav-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  display: none;
}
.nav-toggle__icon {
  display: block; width: 22px; height: 2px; background: #fff; position: relative;
}
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: ''; position: absolute; left: 0; width: 22px; height: 2px; background: #fff;
}
.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after  { top:  7px; }

.primary-nav { margin-left: auto; }
.primary-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.25rem 1rem; flex-wrap: wrap;
}
.primary-nav a {
  display: inline-block;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-weight: 500;
}
.primary-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.1);
  color: var(--brand-accent);
}

.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,0.08); }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .primary-nav {
    order: 4; width: 100%; display: none;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0.25rem; }
  .theme-toggle { order: 2; margin-left: 0.5rem; }
}

/* 5. Hero ---------------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(201,160,74,0.18), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  padding: 4rem 1rem 3rem;
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  max-width: var(--container); margin: 0 auto;
}
.hero__kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--step--1);
  color: var(--brand-accent-strong);
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.hero__title {
  font-size: var(--step-5);
  margin: 0 0 0.5em;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero__title-line { display: block; }
.hero__title-line--accent { color: var(--brand-primary); }
[data-theme="dark"] .hero__title-line--accent { color: var(--brand-accent); }
.hero__tagline {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 42rem;
}
.hero__cta {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}
.hero__meta {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: var(--step--1);
}

/* 6. Sections + containers ---------------------------------------- */
.section {
  padding: 3rem 1rem;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }
.section--page-head {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  padding-top: 3rem; padding-bottom: 2rem;
}
.section--intro { background: var(--surface); }
.section--pillars { background: var(--surface-alt); }
.section--features { background: var(--surface); }
.section--preview { background: var(--surface-alt); }
.section--faq { background: var(--surface); }
.section--cta {
  background: var(--brand-primary);
  color: #fff;
  text-align: center;
}
.section--cta h2 { color: #fff; }
.section--cta a { color: var(--brand-accent); }
.section--cta a:hover { color: #fff; }

.container { max-width: var(--container); margin: 0 auto; }
.container--narrow { max-width: var(--container-narrow); margin: 0 auto; }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--step--1);
  color: var(--brand-accent-strong);
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.lead {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 42rem;
}
.section__more {
  margin-top: 1.5rem;
  font-weight: 600;
}
.badge {
  display: inline-block;
  font-size: var(--step--1);
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: var(--brand-accent);
  color: #1a1f2b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 0.5rem;
}
[data-theme="dark"] .badge { color: #0b1220; }

.prose p { max-width: 42rem; }
.prose ul { max-width: 42rem; }
.prose__footnote { color: var(--text-muted); font-size: var(--step--1); }

/* 7. Pillars ------------------------------------------------------- */
.pillars {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  counter-reset: pillar;
}
.pillars li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  counter-increment: pillar;
}
.pillars li::before {
  content: counter(pillar);
  position: absolute; top: 1rem; right: 1.25rem;
  color: var(--brand-accent);
  font-weight: 800;
  font-size: var(--step-2);
  opacity: 0.5;
}
.pillars h3 { margin-top: 0; }

/* 8. Feature grid ------------------------------------------------- */
.feature-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.feature-grid--large { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
}
.feature-card h3 { margin-top: 0; font-size: var(--step-1); }
.feature-card p  { margin-bottom: 0; }
.feature-card__body { margin-top: 0.75rem; color: var(--text-muted); }

/* Provider list */
.provider-list {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: grid; gap: 0.5rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.provider-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}

/* 9. Preview placeholder ------------------------------------------ */
.preview-placeholder {
  margin-top: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1rem;
  text-align: center;
  background: var(--surface);
  color: var(--text-muted);
}
.preview-placeholder__title {
  font-size: var(--step-2);
  color: var(--text);
  margin: 0 0 0.3em;
}
.preview-placeholder__sub { margin: 0; }

.walkthrough {
  list-style: decimal; padding: 0 0 0 1.25rem; margin: 0;
}
.walkthrough > li { margin-bottom: 1rem; }
.walkthrough h3 { margin: 0 0 0.25em; font-size: var(--step-1); }

.demo-list {
  list-style: disc; padding-left: 1.25rem; margin: 0;
}

/* 10. FAQ ---------------------------------------------------------- */
.faq { display: grid; gap: 0.5rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 1rem;
}
.faq details[open] {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-sm);
}
.faq summary {
  padding: 0.85rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::marker { content: ''; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  float: right;
  font-weight: 700;
  color: var(--brand-accent-strong);
  transition: transform var(--t-fast);
}
.faq details[open] summary::after { content: '\2212'; }
.faq__answer {
  padding: 0.25rem 0 1rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
}
.faq__answer a { color: var(--link); }

.faq-group {
  margin-bottom: 2rem;
}
.faq-group__heading {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 3px solid var(--brand-accent);
}
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.toc h2 { margin: 0 0 0.5em; font-size: var(--step-1); }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.5rem 1rem; flex-wrap: wrap; }

/* 11. Pricing tiers ------------------------------------------------ */
.tiers {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.tier h3 { margin-top: 0; }
.tier__price { font-size: var(--step-3); font-weight: 800; margin: 0 0 0.25em; color: var(--brand-primary); }
[data-theme="dark"] .tier__price { color: var(--brand-accent); }
.tier__price-unit { font-size: var(--step-0); font-weight: 500; color: var(--text-muted); }
.tier__tag { color: var(--text-muted); font-style: italic; margin-bottom: 1rem; }
.tier__features { list-style: disc; padding-left: 1.25rem; margin: 0 0 1rem; }
.tier__features li { margin-bottom: 0.35rem; }
.tier__note { margin-top: auto; color: var(--text-muted); font-size: var(--step--1); }
.tier--featured {
  border-color: var(--brand-accent);
  border-width: 2px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.tier--featured::before {
  content: 'Most popular';
  position: absolute; top: -0.75rem; left: 1rem;
  background: var(--brand-accent);
  color: #1a1f2b;
  font-weight: 700; font-size: var(--step--1);
  padding: 0.15em 0.6em; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
[data-theme="dark"] .tier--featured::before { color: #0b1220; }

/* 12. Forms -------------------------------------------------------- */
.form { margin-top: 1.5rem; }
.form__row { margin-bottom: 1.1rem; }
.form__row label,
.form__row legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.form__row input[type=text],
.form__row input[type=email],
.form__row select,
.form__row textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.form__row input:focus,
.form__row select:focus,
.form__row textarea:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(201,160,74,0.25); }
.form__row textarea { min-height: 8rem; resize: vertical; }
.form__row .form__radio,
.form__row .form__check {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 500;
  padding: 0.25rem 0;
}
.form__row fieldset { border: 0; padding: 0; margin: 0; }
.form__required { color: var(--error); font-weight: 700; }
.form__optional { color: var(--text-muted); font-weight: 400; font-size: var(--step--1); }
.form__hint { color: var(--text-muted); font-size: var(--step--1); margin: 0.25rem 0 0; }
.form__note { color: var(--text-muted); font-size: var(--step--1); margin-top: 1rem; }
.form__actions { margin-top: 0.5rem; }

/* 13. Buttons ------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  font-size: var(--step-0);
  line-height: 1.1;
}
.btn--primary {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  background: var(--brand-primary);
  color: #fff;
}
[data-theme="dark"] .btn--ghost {
  color: var(--brand-accent);
  border-color: var(--brand-accent);
}
[data-theme="dark"] .btn--ghost:hover {
  background: var(--brand-accent);
  color: #0b1220;
}

/* 14. Alerts ------------------------------------------------------- */
.alert {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-left: 4px solid;
}
.alert h2 { margin: 0 0 0.25em; font-size: var(--step-1); }
.alert ul { margin: 0.25rem 0 0 1.25rem; }
.alert--error   { background: var(--error-bg);   border-color: var(--error);   color: var(--text); }
.alert--success { background: var(--success-bg); border-color: var(--success); color: var(--text); }

/* 15. Next-steps + help-routes ------------------------------------ */
.next-steps, .help-routes {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
}
.next-steps li, .help-routes li { margin-bottom: 0.5rem; }

/* 16. Footer ------------------------------------------------------- */
.site-footer {
  background: var(--brand-primary);
  color: #fff;
  padding: 2.5rem 1rem 2rem;
  border-top: 3px solid var(--brand-accent);
}
.site-footer a { color: #fff; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--brand-accent); }
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}
.site-footer__nav ul, .social-links {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
}
.site-footer__socials h2 {
  color: #fff;
  font-size: var(--step-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5em;
}
.site-footer__extra { color: rgba(255,255,255,0.8); font-size: var(--step--1); }
.site-footer__extra p { margin: 0 0 0.5em; }
.site-footer__copyright {
  color: rgba(255,255,255,0.7);
  font-size: var(--step--1);
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* 17. Reduced motion + print -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .nav-toggle, .theme-toggle, .skip-link { display: none; }
  a { text-decoration: underline; }
  .section { border-bottom: 1px solid #ccc; page-break-inside: avoid; }
}
