/* MCT AI Technologies: dark theme (near-black, periwinkle + cyan accents). */

@font-face {
  font-family: "Poppins";
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/poppins-300-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin-var.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #0f1012;
  --surface: #17181b;
  --surface-2: #1f2024;
  --border: #2c2e34;
  --fg: #f4f5f8;
  --muted: #a6abb6;
  --accent: #c8d3fa;
  --accent-2: #889ce7;
  --accent-3: #2db6d4;
  --on-accent: #0f1012;
  --up: #34d399;
  --down: #f87171;

  --font-head: "Poppins", system-ui, "Segoe UI", sans-serif;
  --font-body: "Open Sans", system-ui, "Segoe UI", sans-serif;

  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 14px;
  --section: clamp(3.5rem, 9vw, 6.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3 {
  margin: 0 0 1rem;
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-weight: 300; font-size: clamp(2.25rem, 6vw, 4rem); }
h2 { font-weight: 300; font-size: clamp(1.75rem, 4vw, 2.6rem); }
h3 { font-weight: 500; font-size: 1.15rem; }
p  { margin: 0 0 1rem; color: var(--muted); text-wrap: pretty; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--fg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(15 16 18 / 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small {
  display: block;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}
.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 0.95rem;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent-2); }
.site-nav .btn { border-bottom: 0; padding: 0.5rem 1.1rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--fg); color: var(--on-accent); }

.btn-ghost { border-color: var(--border); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn svg { width: 1em; height: 1em; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(5rem, 14vw, 9.5rem) clamp(4rem, 10vw, 7rem);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 30rem at 85% 10%, rgb(136 156 231 / 0.28), transparent 60%),
    radial-gradient(45rem 28rem at 5% 100%, rgb(45 182 212 / 0.18), transparent 60%);
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  color: var(--accent-2);
  opacity: 0.45;
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
}
.hero-art .pulse { animation: pulse 4s ease-in-out infinite; }
.hero-art .pulse:nth-of-type(2n) { animation-delay: 1.3s; }
.hero-art .pulse:nth-of-type(3n) { animation-delay: 2.6s; }
.hero-art .flow { stroke-dasharray: 6 10; animation: flow 6s linear infinite; }

@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes flow { to { stroke-dashoffset: -160; } }

.hero-content { max-width: 44rem; }
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--fg); opacity: 0.85; }

.page-hero { padding-block: clamp(4rem, 10vw, 6.5rem) clamp(3rem, 7vw, 4.5rem); }

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
}

.card {
  position: relative;
  padding: 1.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgb(200 211 250 / 0.45); transform: translateY(-3px); }
.card p { margin: 0; font-size: 0.95rem; }

.icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(135deg, rgb(136 156 231 / 0.22), rgb(45 182 212 / 0.12));
  border: 1px solid rgb(200 211 250 / 0.2);
}
.icon svg { width: 1.5rem; height: 1.5rem; }

.split {
  display: grid;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.visual {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 20%, rgb(136 156 231 / 0.25), transparent 60%),
    radial-gradient(circle at 80% 90%, rgb(45 182 212 / 0.2), transparent 55%),
    var(--surface-2);
  color: var(--accent);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.visual svg { width: 100%; height: 100%; }

.stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  margin-top: 2rem;
}
.stat {
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--accent-2);
  background: rgb(255 255 255 / 0.02);
}
.stat strong { display: block; font-family: var(--font-head); font-weight: 500; color: var(--fg); }
.stat span { font-size: 0.9rem; color: var(--muted); }

.prose { max-width: 46rem; }
.prose + .prose { margin-top: 3rem; }

/* ---------- CTA band ---------- */

.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter);
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgb(200 211 250 / 0.25);
  background:
    radial-gradient(40rem 18rem at 50% 0%, rgb(136 156 231 / 0.35), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
.cta p { max-width: 38rem; margin-inline: auto; }
.cta .actions { justify-content: center; }

.contact-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1.75rem, 5vw, 2.5rem);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.contact-card a.email {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  word-break: break-all;
}

/* ---------- Tickers (/tickers) ---------- */

/* MSN Money-style palette and Segoe UI, on the tickers page only (<body class="theme-market">). */
.theme-market {
  --bg: #172032;
  --surface: #212d43;
  --surface-2: #283449;
  --border: #36425a;
  --fg: #ffffff;
  --muted: #9a9fa9;
  --accent: #76ace1;
  --accent-2: #2f6db9;
  --on-accent: #ffffff;
  --up: #75de7b;
  --down: #f27c57;
  --chrome: #242424;
  --field: #2f3747;
  --outline: #69717f;
  --radius: 8px;
  --font-head: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-body: var(--font-head);
}
.theme-market .site-header { background: var(--chrome); border-bottom-color: var(--chrome); }
.theme-market .site-footer { background: var(--chrome); border-top-color: var(--chrome); }
.theme-market .btn-primary { background: var(--accent-2); color: var(--on-accent); }
.theme-market .btn-primary:hover { background: #3b7fd1; color: var(--on-accent); }
.theme-market .btn-ghost { border-color: var(--outline); }
.theme-market h1 { font-weight: 600; font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: 0; }
.theme-market .eyebrow {
  margin-bottom: 0.25rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.theme-market .quote-table-wrap,
.theme-market .ticker-settings { border-color: transparent; }
.theme-market .quote-table thead th { font-weight: 600; font-size: 0.72rem; letter-spacing: 0.04em; }
.theme-market .quote-table tbody tr:hover > * { background: #2f3c54; }
.theme-market .ticker-settings input { background: var(--field); border-color: #3e485b; }

.section.tickers { padding-top: 1rem; }

.tickers-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: 1.5rem;
}
.tickers-head h1 { margin: 0; }

.tickers-meta { display: grid; gap: 0.2rem; }
.market-status { margin: 0; font-size: 0.9rem; }
.account { margin: 0; font-size: 0.82rem; }
.market-status::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--muted);
}
.market-status.is-open::before {
  background: var(--up);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 20%, transparent);
}
.market-status.is-error { color: var(--down); }
.market-status.is-error::before { background: var(--down); }

.quote-table-wrap {
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.quote-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.quote-table th,
.quote-table td {
  padding: 0.75rem 1rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.quote-table th:first-child { text-align: left; }
.quote-table thead th {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
/* Sortable headings: the arrow sits left of right-aligned headings so they stay flush with their numbers. */
.quote-table .sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.quote-table th:not(:first-child) .sort { flex-direction: row-reverse; }
.quote-table .sort:hover,
.quote-table th[aria-sort] .sort { color: var(--fg); }
.quote-table .sort::after { content: "\25B2" / ""; font-size: 0.8em; opacity: 0; }
.quote-table .sort:hover::after { opacity: 0.4; }
.quote-table th[aria-sort] .sort::after { opacity: 1; }
.quote-table th[aria-sort="descending"] .sort::after { content: "\25BC" / ""; }
.quote-table tbody th { font-family: var(--font-head); font-weight: 600; color: var(--fg); }
.quote-table tbody tr:last-child > * { border-bottom: 0; }
.quote-table .price { font-weight: 600; color: var(--fg); }
.quote-table .up .chg { color: var(--up); }
.quote-table .down .chg { color: var(--down); }

.tick-up { animation: tick-up 1.2s ease-out; }
.tick-down { animation: tick-down 1.2s ease-out; }
@keyframes tick-up { from { background: color-mix(in srgb, var(--up) 25%, transparent); } }
@keyframes tick-down { from { background: color-mix(in srgb, var(--down) 25%, transparent); } }

.ticker-settings {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ticker-settings summary {
  padding: 0.9rem 1.25rem;
  font-family: var(--font-head);
  font-weight: 500;
  cursor: pointer;
}
.ticker-settings form { display: grid; gap: 0.4rem; max-width: 36rem; padding: 0 1.25rem 1.25rem; }
.ticker-settings label { margin-top: 0.75rem; font-size: 0.9rem; color: var(--fg); }
.ticker-settings label span { display: block; font-size: 0.82rem; color: var(--muted); }
.ticker-settings input {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.ticker-settings input:focus-visible { border-color: var(--accent); }
.ticker-settings .actions { margin-top: 0.5rem; }
.form-msg { margin: 0.5rem 0 0; font-size: 0.9rem; }
.form-msg:empty { display: none; }

.quote-note { margin: 1rem 0 0; font-size: 0.85rem; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--section);
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
}
.footer-main {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  padding-block: 3rem 2rem;
}
.footer-main p { max-width: 26rem; }
.footer-main h2 {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Scroll reveal (only when JS is running) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 40rem) {
  .brand small { display: none; }
  .site-nav { gap: 0.25rem 1rem; }
  .hero-art { opacity: 0.25; }
  .quote-table .opt { display: none; }
  .quote-table th, .quote-table td { padding-inline: 0.7rem; }
}
