/* /markets Python workbench. Tokens and components follow slash-dashboard (BRAND_GUIDELINES.md). */

@font-face { font-family: "Departure Mono"; src: url("assets/fonts/departure-mono.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("assets/fonts/onest-latin.woff2") format("woff2"); font-style: normal; font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("assets/fonts/libre-baskerville-500-latin.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }

:root {
  --font-heading: "Libre Baskerville", Georgia, serif;
  --font-body: "Onest", Arial, sans-serif;
  --font-mono: "Departure Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-body: clamp(16px, 1.5vw, 19px);
  --page: #ffffff;
  --ink: #20251b;
  --ink-hero: #161816;
  --muted: #62675f;
  --warm: #f7f6f2;
  --yellow: #f6d64d;
  --button: #171a17;
  --border: #e4e7dc;
  --terminal-bg: #fffef8;
  --terminal-chrome: #edf0e6;
  --terminal-border: #bdc9b6;
  --terminal-ink: #34432e;
  --terminal-muted: #66775a;
  --ok: #8fa975;
  --down: #bd745f;
  --gutter: clamp(24px, 3.5vw, 48px);
}

html, body { min-height: 100%; margin: 0; background: var(--page); }
html { scroll-padding-top: 104px; }
body { color: var(--ink); font-family: var(--font-body); font-weight: 400; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; line-height: 1.1; }
button, input, select, textarea { font: inherit; }
* { box-sizing: border-box; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Inline /markets wordmark */
.markets-label { display: inline; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; white-space: nowrap; }
.markets-wordmark { white-space: nowrap; }
.markets-slash { display: inline-block; width: .424em; height: .8em; margin-right: .04em; vertical-align: -.12em; overflow: hidden; text-indent: 1em; background: currentColor; mask: url("assets/icons/markets-slash.svg") center / contain no-repeat; -webkit-mask: url("assets/icons/markets-slash.svg") center / contain no-repeat; }

/* Floating navigation (brand component, reused as-is) */
.floating-nav { position: fixed; z-index: 50; inset: 16px 0 auto; display: flex; align-items: center; gap: 28px; width: calc(100% - 48px); max-width: 1120px; min-height: 66px; margin-inline: auto; padding: 9px 22px; border: 1px solid #e0e5d9; border-radius: 999px; background: rgb(250 251 246 / .74); backdrop-filter: blur(8px) saturate(1.1); -webkit-backdrop-filter: blur(8px) saturate(1.1); box-shadow: 0 5px 24px #25301d0a; color: var(--ink); }
.nav-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: inherit; font-size: 20px; text-decoration: none; }
.nav-brand img { object-fit: contain; }
.nav-brand .markets-wordmark { font-weight: 600; }
.nav-page { flex: 1; text-align: right; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav-connect { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 20px; border-radius: 999px; background: #191d16; color: #fff; font-size: 16px; font-weight: 400; text-decoration: none; white-space: nowrap; transition: background 150ms ease; }
.nav-connect img { filter: invert(1); }
.nav-connect:hover { background: #35412b; }
.floating-nav a:focus-visible { outline: 2px solid #879668; outline-offset: 4px; }

/* Hero: the one centred moment on the page */
.hero { max-width: 1360px; margin-inline: auto; padding: max(148px, 9vw) var(--gutter) 56px; text-align: center; color: var(--ink-hero); }
.hero-title { max-width: 14ch; margin: 0 auto; font-size: clamp(40px, 5.4vw, 76px); line-height: 1.04; letter-spacing: -0.03em; font-kerning: normal; font-variant-ligatures: common-ligatures; text-wrap: balance; }
.hero-title span { display: block; }
.hero-quote { max-width: 44ch; margin: 36px auto 0; }
.hero-quote p { margin: 0; color: var(--ink); font-size: clamp(20px, 1.9vw, 26px); line-height: 1.4; letter-spacing: -0.01em; text-wrap: pretty; }
.hero-quote p::before { content: "\201C"; }
.hero-quote p::after { content: "\201D"; }
.hero-description { max-width: 46ch; margin: 24px auto 0; color: #60645f; font-size: var(--text-body); line-height: 1.7; text-wrap: pretty; }

/* Workbench */
.workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 1100px; margin: 32px auto 0; padding: 0 var(--gutter) 128px; }
.editor-column, .result-column { min-width: 0; }

.editor-card { overflow: hidden; border: 1px solid var(--terminal-border); background: var(--terminal-bg); color: var(--terminal-ink); }
.editor-chrome, .result-chrome { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid #d4dccb; background: var(--terminal-chrome); font-family: var(--font-body); font-size: 16px; font-weight: 500; letter-spacing: -.02em; color: var(--terminal-ink); }
.backend-logo { display: block; flex-shrink: 0; width: 32px; height: auto; image-rendering: pixelated; }
.editor-file { flex: 1; }
.editor-runtime, .result-status { color: var(--terminal-muted); font-weight: 400; letter-spacing: 0; }
.editor-host { min-height: 440px; }
.editor-host .cm-editor { height: 100%; min-height: 440px; max-height: 70vh; }
.editor-host .cm-editor.cm-focused { outline: none; }
.editor-host .cm-scroller { overflow: auto; }

.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 18px; }
.editor-hint { flex-basis: 100%; margin: 4px 0 0; color: #656b63; font-size: 14px; line-height: 1.6; text-wrap: pretty; }
.editor-hint code { font-family: var(--font-mono); font-size: 14px; }
.editor-hint kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; background: var(--terminal-chrome); color: var(--terminal-ink); font-family: var(--font-body); font-size: 13px; text-align: center; }

/* Buttons (brand component) */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 50px; padding: 0 21px; border: 1px solid var(--button); border-radius: 999px; font-size: 16px; font-weight: 400; cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.button-primary { background: var(--button); color: #fff; }
.button-primary:hover { background: #343a32; }
.button-secondary { background: #fff; color: var(--button); border-color: #d7dbd3; }
.button-secondary:hover { background: #f4f5f1; }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline: 2px solid #4a6640; outline-offset: 4px; }
.button[disabled] { cursor: progress; opacity: .7; }
.button .icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Result card: brand's square light-mode terminal */
.result-card { scroll-margin-top: 104px; overflow: hidden; border: 1px solid var(--terminal-border); background: var(--terminal-bg); color: var(--terminal-ink); }
.result-progress { height: 3px; overflow: hidden; background: var(--terminal-chrome); }
.result-progress span { display: block; width: 32%; height: 100%; background: var(--yellow); opacity: 0; }
.result-card[data-state="running"] .result-progress span, .result-card[data-state="writing"] .result-progress span { opacity: 1; animation: result-activity 1400ms ease-in-out infinite; }
.result-card[data-state="running"] .result-status::before, .result-card[data-state="writing"] .result-status::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 1.5px solid #b7c3aa; border-top-color: var(--yellow); border-radius: 50%; vertical-align: -1px; animation: result-spin 900ms linear infinite; }
@keyframes result-activity { from { transform: translateX(-110%); } to { transform: translateX(420%); } }
@keyframes result-spin { to { transform: rotate(360deg); } }
.result-card[data-state="error"] .result-status { color: #9a4d3a; }
.result-card[data-state="done"] .result-status { color: #45613b; }

.result-body { min-height: 220px; padding: 20px 22px 24px; }
.result-idle { display: flex; flex-direction: column; justify-content: center; min-height: 176px; padding: 0 8px; text-align: center; }
.result-idle p { margin: 0; font-family: var(--font-heading); font-size: 24px; line-height: 1.3; letter-spacing: -.02em; color: #283a25; }
.result-idle .result-idle-note { max-width: 44ch; margin: 16px auto 0; font-family: var(--font-body); font-size: 16px; line-height: 1.6; letter-spacing: 0; color: var(--terminal-muted); }

/* Error: traceback in the terminal face */
.run-error h3 { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid #d4dccb; font-family: var(--font-body); font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -.035em; color: #283a25; }
.run-error p { margin: 0 0 14px; font-size: 16px; line-height: 1.6; color: var(--terminal-ink); }
.run-error pre { margin: 0; padding: 14px 16px; overflow: auto; background: #f6eee9; color: #5b3a30; font-family: var(--font-mono); font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.run-error pre .error-line { background: #f0d7cf; }
.run-error .error-summary { margin-top: 14px; padding: 12px 14px; background: var(--terminal-chrome); color: var(--terminal-ink); font-size: 16px; line-height: 1.5; }
.run-error .error-summary strong { font-weight: 500; }
.run-note { padding: 12px 14px; background: var(--terminal-chrome); color: var(--terminal-ink); font-size: 16px; line-height: 1.5; }

/* Report: the warm conversation surface with the brand's serif headings */
.report { font-family: var(--font-body); font-size: 16px; line-height: 1.65; color: var(--ink); }
.report > :first-child { margin-top: 0; }
.report h1, .report h2, .report h3, .report h4 { margin: 26px 0 10px; font-family: var(--font-heading); font-weight: 500; letter-spacing: -.02em; color: #283a25; }
.report h1 { font-size: 28px; line-height: 1.2; }
.report h2 { font-size: 24px; line-height: 1.25; }
.report h3 { font-size: 20px; line-height: 1.3; }
.report h4 { font-size: 17px; font-family: var(--font-body); }
.report p { margin: 0 0 14px; text-wrap: pretty; }
.report ul, .report ol { margin: 0 0 14px; padding-left: 22px; }
.report li { margin: 4px 0; }
.report li::marker { color: var(--terminal-muted); }
.report strong { font-weight: 600; }
.report blockquote { margin: 16px 0; padding: 12px 16px; background: var(--warm); font-style: normal; }
.report blockquote p:last-child { margin-bottom: 0; }
.report code { padding: 1px 5px; border-radius: 4px; background: var(--terminal-chrome); font-family: var(--font-mono); font-size: 14px; }
.report pre { margin: 0 0 14px; padding: 12px 14px; overflow: auto; background: var(--terminal-chrome); font-family: var(--font-mono); font-size: 14px; line-height: 1.55; }
.report pre code { padding: 0; background: none; }
.report table { width: 100%; margin: 6px 0 18px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.report th, .report td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.report th { font-weight: 500; color: #283a25; background: var(--warm); }
.report td:has(> :only-child:empty) { color: var(--muted); }
.report hr { margin: 20px 0; border: 0; height: 1px; background: var(--border); }
.report a { color: #45613b; text-underline-offset: 3px; }
.report-meta { margin-top: 22px; padding-top: 14px; border-top: 1px solid #d4dccb; color: var(--terminal-muted); font-size: 14px; line-height: 1.6; }
.report-raw { margin-top: 16px; }
.report-raw summary { cursor: pointer; color: var(--terminal-ink); font-size: 15px; font-weight: 500; }
.report-raw summary:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.report-raw pre { margin: 10px 0 0; padding: 12px 14px; overflow: auto; background: var(--terminal-chrome); font-family: var(--font-mono); font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

/* Footer (brand component) */
.site-footer { overflow: hidden; color: var(--muted); }
.footer-content { max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }
.footer-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 64px; padding: 48px 0; border-top: 1px solid var(--border); }
.footer-brand { display: inline-flex; align-items: center; gap: 18px; color: var(--ink); font-size: clamp(32px, 3.2vw, 44px); font-weight: 500; letter-spacing: -.045em; text-decoration: none; }
.footer-brand img { width: 80px; height: 44px; object-fit: contain; filter: brightness(0); }
.site-footer p { margin: 0; }
.footer-tagline { margin-top: 14px; font-size: 16px; line-height: 1.7; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 24px clamp(24px, 4vw, 64px); font-size: 16px; line-height: 1.6; }
.footer-link-group { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; }
.footer-link-group > span { margin-bottom: 4px; color: var(--ink); font-size: 14px; font-weight: 500; text-transform: uppercase; }
.footer-nav a { color: var(--muted); text-decoration: none; text-underline-offset: 4px; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-nav a:focus-visible, .footer-brand:focus-visible { outline: 2px solid #879668; outline-offset: 5px; }
.footer-disclaimer { padding-top: 28px; border-top: 1px solid var(--border); }
.footer-disclaimer h2 { margin: 0 0 18px; color: #343a30; font-family: var(--font-body); font-size: 14px; font-weight: 500; line-height: 1.6; }
.footer-disclaimer-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; font-size: 14px; line-height: 1.8; }
.footer-art { position: relative; width: 100%; height: clamp(220px, 25vw, 420px); margin-top: 24px; mask-image: linear-gradient(to bottom, transparent, #000 46%); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 46%); }
.footer-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.footer-art::after { content: ""; position: absolute; inset: 0; background: url("assets/images/footer-horizon-v1-dithered.webp") center bottom / cover no-repeat; mask-image: linear-gradient(to bottom, transparent 70%, #000 100%); -webkit-mask-image: linear-gradient(to bottom, transparent 70%, #000 100%); pointer-events: none; }

/* Entrance motion: opacity + transform only, once */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 520ms ease, transform 520ms cubic-bezier(.2,.7,.2,1); transition-delay: var(--rise-delay, 0ms); }
.rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .button, .nav-connect { transition: none; }
  .result-progress span { animation: none !important; opacity: 1 !important; width: 100%; }
  .result-status::before { animation: none !important; }
}

@media (max-width: 980px) {
  .workbench { gap: 24px; }
  .editor-host, .editor-host .cm-editor { min-height: 360px; }
}

@media (max-width: 900px) {
  .floating-nav { inset-block-start: 12px; width: calc(100% - 32px); max-width: 600px; min-height: 60px; gap: 10px; padding: 7px 16px; }
  .nav-brand { gap: 7px; margin-right: auto; font-size: 18px; }
  .nav-brand img { width: 30px; height: 24px; }
  .nav-page { display: block; font-size: 13px; }
  .nav-connect { min-height: 42px; gap: 7px; padding: 9px 14px; }
  .nav-connect img { display: none; }
}

@media (max-width: 680px) {
  :root { --gutter: 20px; }
  .hero { padding-top: 118px; padding-bottom: 40px; }
  .hero-title { font-size: clamp(36px, 11vw, 44px); }
  .hero-quote p { font-size: 20px; }
  .workbench { padding-bottom: 80px; }
  .editor-actions .button { flex: 1 1 auto; }
  .footer-main { flex-direction: column; gap: 32px; }
  .footer-disclaimer-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
