/**
 * The Market Buddy — research-desk UI.
 * Same approach as Betslip Buddy: warm slate, serif display,
 * one accent on actions, no gradient headlines or hover lifts.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap');

:root {
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --bg: #12110e;
  --card: #1a1915;
  --card-raised: #221f1a;
  --card-hover: #221f1a;
  --muted: #8f8c82;
  --muted-light: #c4c0b4;
  --text: #f2efe6;
  --text-secondary: #e6e2d6;
  --brand: #3b6cf0;
  --brand-hover: #5b87f5;
  --brand-light: #7c9cf8;
  --brand-muted: rgba(59, 108, 240, 0.14);
  --accent: #7a766c;
  --accent-light: #a8a49a;
  --ok: #3d9a5c;
  --warn: #c9862a;
  --danger: #d4534a;
  --border: rgba(242, 239, 230, 0.1);
  --border-hover: rgba(242, 239, 230, 0.22);
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-brand: none;
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --page-max: 1120px;
  --page-padding: clamp(1rem, 3.5vw, 1.75rem);
  --section-gap: clamp(2rem, 5vw, 3rem);
  --radius: 4px;
  --radius-lg: 6px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

a:hover { color: #fff; }

.container {
  width: min(var(--page-max), 94%);
  margin: 0 auto;
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
}

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  z-index: 10000;
  text-decoration: none;
}

h1, .tmb-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw + 0.4rem, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

h2, .tmb-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.8vw + 0.6rem, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

h3, .tmb-h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.muted, .sub { color: var(--muted); }
.lead {
  font-size: 1.05rem;
  color: var(--muted-light);
  line-height: 1.65;
  max-width: 40rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(242, 239, 230, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* Header */
header,
.tmb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  backdrop-filter: none;
}

.nav,
.tmb-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--page-max), 94%);
  margin: 0 auto;
  padding: 0.7rem var(--page-padding);
  position: relative;
}

.brand,
.tmb-brand {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover,
.tmb-brand:hover {
  color: var(--text);
  opacity: 0.92;
}

.brand-badge,
.tmb-brand-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ece8dc;
  padding: 3px;
}

.brand-badge img,
.tmb-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
  display: block;
}

.nav-links,
.tmb-links {
  display: flex;
  gap: 1.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a,
.tmb-links a {
  color: var(--muted-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
}

.nav-links a:hover,
.tmb-links a:hover {
  color: var(--text);
}

.tmb-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 860px) {
  .tmb-menu-toggle { display: inline-flex; }
  .nav-links,
  .tmb-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem var(--page-padding) 1rem;
    z-index: 49;
  }
  .nav-links.is-open,
  .tmb-links.is-open { display: flex; }
  .nav-links a,
  .tmb-links a {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
  }
}

/* Buttons — cream fill, not a rainbow */
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn:hover,
.btn-primary:hover {
  background: #fff;
  color: var(--bg);
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline:hover {
  border-color: var(--text);
  color: var(--text);
  text-decoration: none;
  transform: none;
}

.btn-discord,
.btn-discord-solid {
  background: var(--discord);
  color: #fff;
  border: none;
}

.btn-discord:hover,
.btn-discord-solid:hover {
  background: var(--discord-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.cta-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* Cards */
.card,
.feature-card,
.welcome-card,
.stat-card,
.membership-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  transition: border-color 0.15s ease;
}

.card:hover,
.feature-card:hover,
.membership-card:hover {
  border-color: var(--border-hover);
  transform: none;
  box-shadow: none;
}

/* Forms */
label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: none;
}

.form-group { margin-bottom: 1.15rem; }

.error {
  background: rgba(212, 83, 74, 0.1);
  border: 1px solid rgba(212, 83, 74, 0.35);
  color: var(--danger);
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.success {
  background: rgba(61, 154, 92, 0.1);
  border: 1px solid rgba(61, 154, 92, 0.35);
  color: var(--ok);
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Auth pages */
.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.auth-main .container {
  width: 100%;
  max-width: 440px;
  padding: 0;
}

.auth-main .card { padding: clamp(1.75rem, 4vw, 2.25rem); }

.auth-main .brand {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.auth-main h1 {
  text-align: center;
  font-size: 1.65rem;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.shared-login-notice,
.shared-notice {
  border: 1px solid var(--border);
  background: var(--card-raised);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted-light);
}

.shared-login-notice strong,
.shared-notice strong { color: var(--text); }

.divider {
  text-align: center;
  color: var(--muted);
  margin: 1.25rem 0;
  position: relative;
  font-size: 0.85rem;
}
.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.footer-links {
  text-align: center;
  margin-top: 1.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-links a { color: var(--muted-light); }

.auth-main .btn { width: 100%; margin-bottom: 0.75rem; }

/* Footer */
footer,
.tmb-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

footer a,
.tmb-footer a {
  color: var(--muted-light);
  text-decoration: none;
}
footer a:hover,
.tmb-footer a:hover { color: var(--text); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Homepage */
.hero {
  padding: clamp(1.75rem, 4vw, 2.75rem) 0 1.5rem;
  text-align: left;
}

.tmb-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 2.5rem;
  align-items: start;
}

.tmb-home-hero__copy { max-width: 36rem; }

.tmb-home-hero__meta {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.tmb-home-hero__meta a { color: var(--muted-light); text-decoration: none; }
.tmb-home-hero__meta a:hover { color: var(--text); }

@media (max-width: 860px) {
  .tmb-home-hero { grid-template-columns: 1fr; gap: 1.5rem; }
}

.tmb-scan {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  min-height: 16rem;
}

.tmb-scan__label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.65rem;
}

.tmb-scan-row {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.tmb-scan-row:last-child { border-bottom: none; }
.tmb-scan-row strong { font-family: var(--font-mono); font-size: 0.9rem; }
.tmb-scan-why { color: var(--muted); font-size: 0.84rem; margin-top: 0.2rem; }

.section { padding: var(--section-gap) 0; }

.tmb-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}

.tmb-showcase a,
.tmb-showcase-item {
  display: block;
  padding: 1.15rem 1.1rem 1.15rem 0;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.tmb-showcase-item:nth-child(2n) {
  padding-left: 1.25rem;
  border-right: 0;
}

.tmb-showcase-item:hover { background: rgba(242, 239, 230, 0.03); }

.tmb-showcase-item h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.tmb-showcase-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .tmb-showcase { grid-template-columns: 1fr; }
  .tmb-showcase-item,
  .tmb-showcase-item:nth-child(2n) { padding-left: 0; border-right: 0; }
}

.tmb-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}

.tmb-step { padding-top: 0.25rem; }
.tmb-step h3::before {
  counter-increment: step;
  content: counter(step) ".";
  font-family: var(--font-mono);
  color: var(--muted);
  margin-right: 0.4rem;
  font-weight: 500;
}

.tmb-step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

@media (max-width: 760px) {
  .tmb-steps { grid-template-columns: 1fr; }
}

.tmb-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.tmb-plan {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-lg);
}

.tmb-plan:hover { border-color: var(--border-hover); }
.tmb-plan strong { display: block; font-size: 1.35rem; margin: 0.15rem 0 0.35rem; }
.tmb-plan span { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 760px) {
  .tmb-plans { grid-template-columns: 1fr; }
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.faq-item strong { display: block; margin-bottom: 0.35rem; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.tmb-note {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 1.5rem;
}

.tmb-note a { color: var(--muted-light); }

*:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
