/* SEO — static, crawlable pages (company guides, free problems, course lessons and their hubs).
   Generated pages live under /company/, /practice/ and /course/ (scripts/seo/build_seo.py).
   Token-driven; sits on top of tokens.css, base.css, pages.css and theme.css. */

.seo { max-width: 860px; padding-top: var(--space-5); padding-bottom: var(--space-7); }
.seo--wide { max-width: var(--maxw); }
.seo-crumb { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: var(--fs-sm); color: var(--text-faint); margin-bottom: var(--space-4); }
.seo-crumb a { color: var(--text-muted); }
.seo-crumb [aria-current] { color: var(--text-faint); }
.seo-head { margin-bottom: var(--space-5); }
.seo-head h1 { font-size: clamp(1.85rem, 4.8vw, 2.7rem); margin-bottom: var(--space-3); text-wrap: balance; overflow-wrap: anywhere; }
.seo-brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.seo-brand .eyebrow { margin: 0; }
.seo-logo { width: 52px; height: 52px; flex: none; object-fit: contain; padding: 7px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.seo-lede { font-family: var(--font-prose); font-size: 1.2rem; line-height: 1.55; color: var(--text-muted); margin-bottom: var(--space-4); max-width: 66ch; }
.seo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 var(--space-4); }
.seo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-4); }

.seo h2 { font-size: var(--fs-2xl); margin: var(--space-7) 0 var(--space-3); }
.seo h3 { font-size: var(--fs-xl); margin: var(--space-5) 0 var(--space-2); }
.seo p, .seo li { overflow-wrap: anywhere; }
.seo-prose { font-family: var(--font-prose); font-size: 1.08rem; line-height: 1.68; max-width: 70ch; }
.seo-prose p { margin: 0 0 var(--space-4); }
.seo-note { font-size: var(--fs-sm); color: var(--text-faint); }

.seo-answer { background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: var(--space-4) 0; margin: 0 0 var(--space-5); }
.seo-answer p { margin: 0; font-size: 1.04rem; }
.seo-answer p + p { margin-top: var(--space-2); }

.seo-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 var(--space-5); padding: 0; }
.seo-facts > div { background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: var(--space-4) 0; min-width: 0; }
.seo-facts dt { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); }
.seo-facts dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.seo-stage { background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: var(--space-4) 0; margin: 0 0 var(--space-4); }
.seo-stage h3 { margin: 0 0 var(--space-1); display: flex; align-items: baseline; gap: 10px; }
.seo-stage__n { flex: none; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); }
.seo-stage__fmt { font-size: var(--fs-sm); color: var(--text-faint); margin: 0 0 var(--space-3); }
.seo-stage h4 { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--text-faint); margin: var(--space-4) 0 var(--space-2); }
.seo-stage ul:not(.rows) { margin: 0 0 var(--space-3); padding-left: 1.2em; }
.seo-stage ul:not(.rows) li { margin: 0.2em 0; }
.seo-stage__ev { font-size: var(--fs-sm); color: var(--text-faint); margin: var(--space-3) 0 0; }

.seo-list { margin: 0 0 var(--space-4); padding-left: 1.3em; }
.seo-list li { margin: 0.3em 0; }
.seo-check { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.seo-check li { position: relative; padding: 6px 0 6px 28px; border-bottom: 1px solid var(--border); }
.seo-check li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 12px; height: 7px; border-left: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); }
.seo-mix { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: 8px; }
.seo-mix li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: var(--fs-sm); }
.seo-mix i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.seo-mix i b { display: block; height: 100%; background: var(--text-muted); }

.seo-qlist { margin: var(--space-3) 0 var(--space-2); }
.seo-qlist .row { cursor: default; flex-wrap: wrap; gap: 8px var(--space-3); }
.seo-qlist .row__title a { color: var(--text); }
.seo-qlist .row__title a:hover { color: var(--text-muted); }
.seo-qlist .row__aside { display: flex; align-items: center; gap: 8px; flex: none; }
.seo-qmore { font-size: var(--fs-sm); color: var(--text-faint); margin: 0 0 var(--space-3); }

.seo-cta { background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: var(--space-4) 0; margin: var(--space-5) 0;  }
.seo-cta h2, .seo-cta h3 { margin: 0 0 var(--space-2); font-size: var(--fs-xl); }
.seo-cta p { color: var(--text-muted); margin: 0 0 var(--space-3); }
.seo-cta .seo-actions { margin-top: var(--space-3); }

.seo-statement { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.seo-statement pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.seo-statement img { height: auto; }
.seo .md-math-display { display: block; margin: 0.9em 0; text-align: center; overflow-x: auto; overflow-y: hidden; }
.seo-hint { margin: var(--space-4) 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; }
.seo-hint summary { cursor: pointer; padding: 12px var(--space-4); font-weight: 600; }
.seo-hint div { padding: 0 var(--space-4) var(--space-4); color: var(--text-muted); }

.seo-terms { margin: 0 0 var(--space-4); }
.seo-terms dt { font-weight: 600; margin-top: var(--space-3); }
.seo-terms dd { margin: 2px 0 0; color: var(--text-muted); }

.seo-cards { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.seo-cards a { display: block; height: 100%; padding: var(--space-4) 0; background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; color: var(--text); }
.seo-cards a:hover { border-color: var(--text-muted); text-decoration: none; }
.seo-cards b { display: block; font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin-bottom: 2px; }
.seo-cards span { display: block; font-size: var(--fs-sm); color: var(--text-muted); }
.seo-cards em { display: block; margin-top: 6px; font-style: normal; font-size: var(--fs-xs); color: var(--text-faint); font-family: var(--font-mono); }

.seo-part { margin: var(--space-6) 0 var(--space-2); }
.seo-unit { font-size: var(--fs-md); font-family: var(--font-sans); font-weight: 600; margin: var(--space-4) 0 var(--space-1); }
.seo-unit span { font-weight: 400; color: var(--text-faint); font-size: var(--fs-sm); }

.faq { margin-left: 0; margin-right: 0; max-width: none; }
.seo .faq h2 { margin-top: var(--space-7); }

.seo-browse { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--border-strong); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-4) var(--space-5); }
.seo-browse h2 { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--text-faint); margin: 0 0 var(--space-2); }
.seo-browse a { display: block; padding: 3px 0; color: var(--text-muted); font-size: var(--fs-sm); }
.seo-browse a:hover { color: var(--text-muted); }

@media (max-width: 640px) {
  .seo { padding-top: var(--space-4); }
  .seo-lede { font-size: 1.1rem; }
  .seo-stage { padding: var(--space-4) 0; }
  .seo-cta, .seo-statement { padding: var(--space-4); }
  .seo-answer { padding: var(--space-4) 0; }
  .seo h2 { font-size: 1.6rem; margin-top: var(--space-6); }
  .seo-actions .btn { flex: 1 1 100%; }
  .seo-qlist .row__aside { width: 100%; justify-content: space-between; }
  .seo-cards { grid-template-columns: 1fr; }
}

.seo .pill, .seo .chip { background: none; border: 0; border-radius: 0; padding: 0; color: var(--text-muted); }
.seo .pill::first-letter, .seo .chip::first-letter { text-transform: uppercase; }
.seo :is(a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.seo-cards a:hover { background: var(--bg-sunken); }

.seo :is(h1, h2, h3) { font-family: var(--font-display); font-weight: 500; }
.seo .rows { background: none; border: 0; border-radius: 0; }
.seo .row { padding-inline: 0; border-top: 1px solid var(--border); background: none; }
.seo .row:hover { background: var(--bg-sunken); }
.seo .row__icon { display: none; }
.seo .seo-check li { padding-left: 0; }
.seo .seo-check li::before { display: none; }

.seo .pill--easy { color: var(--easy); }
.seo .pill--medium { color: var(--medium); }
.seo .pill--hard { color: var(--hard); }
.seo .btn { box-shadow: none; }

@media (max-width: 640px) {
  .seo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
  .seo-facts > div { padding-block: 10px; }
}
.seo-actions .btn { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
@media (min-width: 641px) {
  .seo-actions .btn { flex: 0 1 auto; width: auto; }
}
.seo-head .seo-brand .eyebrow { display: none; }
@media (min-width: 641px) {
  .seo-head > .seo-starter, .seo-head > .seo-actions { display: inline-flex; vertical-align: middle; margin: 16px 12px 0 0; }
}

.seo:has(.seo-statement) .seo-head > .seo-meta { gap: 5px; font-size: .9rem; }
.seo-continue { margin: 20px 0; padding: 0; border: 0; background: none; }
.seo-continue h2 { font: 400 1rem var(--font-sans); }

@media (max-width: 600px) { .seo-statement pre code { font-size: 12px; white-space: pre; } .seo-statement pre { overflow-x: auto; } }

.seo-facts:has(> div:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seo-logo[src*="stripe.svg"] { padding: 0; border: 0; border-radius: 0; background: none; filter: invert(39%) sepia(97%) saturate(3290%) hue-rotate(232deg) brightness(102%) contrast(101%); }
.seo-logo[src*="citadel"] { width: 148px; height: 52px; padding: 0; border: 0; background: none; }
:root[data-theme="dark"] .seo-logo[src*="stripe.svg"] { filter: invert(70%) sepia(30%) saturate(1230%) hue-rotate(202deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seo-logo[src*="stripe.svg"] { filter: invert(70%) sepia(30%) saturate(1230%) hue-rotate(202deg); } }
@media (max-width: 640px) {
  .seo-facts:has(> div:nth-child(6):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-head > .seo-starter, .seo-head > .seo-actions { display: block; width: 100%; margin: 12px 0 0; }
  .seo-head > .seo-starter .btn, .seo-head > .seo-actions .btn { display: flex; width: 100%; justify-content: center; }
}

@media (max-width: 700px) {
  .seo-facts > div { padding-block: 6px; }
}
.seo-timing-note { display: block; margin-top: 6px; font-size: .8rem; font-weight: 400; color: var(--text-muted); }

.seo-actions .btn { min-height: 44px; gap: 8px; }

.seo-source-details { margin: 8px 0 20px; font-size: .875rem; }
.seo-source-details > summary { min-height: 36px; padding: 6px 0; cursor: pointer; }

/* Existing generated pages retain only the header's solve action. */
.seo-continue { display: none; }

.seo-logo[src*="headlands"] { width: 148px; height: 52px; padding: 4px; }
@media (max-width: 700px) {
  .seo-stage { padding-bottom: 12px; margin-bottom: 12px; }
  .seo-stage > .seo-source-details:last-child { margin-bottom: 0; }
}

@media (min-width: 900px) {
  .seo-browse { grid-template-columns: 1fr 2fr; }
  .seo-browse > div:last-child { columns: 2; }
  .seo-browse > div:last-child h2 { column-span: all; }
}
@media (max-width: 599px) {
  .seo-qlist .row { flex-wrap: nowrap; }
  .seo-qlist .row__aside { width: auto; }
}

.seo-statement { background: none; border: 0; border-radius: 0; padding: 0; }
.seo-statement :not(pre) > code { background: none; border: 0; padding: 0; }

.seo-head > .seo-facts { margin-block: 16px 8px; }
@media (max-width: 640px) {
  .seo-head > .seo-actions .btn--secondary { width: auto; justify-content: flex-start; padding-inline: 0; border: 0; background: none; }
}

.seo:has(.seo-statement) .seo-head > .eyebrow { display: none; }

/* Header actions also occur in the standalone starter beside the action group. */
.seo-head .btn--primary { min-height: 44px; }

/* Model and project pages (/ml-models/, /ml-projects/) */
.mdl .seo-lede p { margin: 0 0 var(--space-2); }
.mdl-fig { margin: var(--space-4) 0 var(--space-5); text-align: center; }
.mdl-fig svg { max-width: min(100%, 640px); height: auto; }
.mdl-fig figcaption, .mdl-fig .ld-cap { margin-top: var(--space-2); color: var(--text-muted); font-size: var(--fs-sm); }
.mdl-fig table { margin: 0 auto; border-collapse: collapse; font-size: var(--fs-sm); }
.mdl-fig td, .mdl-fig th { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.mdl-sec { margin: var(--space-5) 0; }
.mdl-sec h2 { font-size: var(--fs-xl); margin: 0 0 var(--space-2); }
.mdl-sec ol, .mdl-sec ul:not(.rows) { padding-left: 1.2em; margin: 0; }
.mdl-sec li { margin: 0.3em 0; line-height: 1.6; }
.mdl-formula { overflow-x: auto; }
.mdl-knobs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.mdl-knobs dt { font-weight: 600; }
.mdl-knobs dd { margin: 0; color: var(--text-muted); }
.mdl-steps { columns: 2; column-gap: var(--space-5); }
@media (max-width: 600px) { .mdl-knobs { grid-template-columns: 1fr; gap: 2px; } .mdl-knobs dd { margin-bottom: 8px; } .mdl-steps { columns: 1; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mdl-fig svg { filter: invert(.88) hue-rotate(180deg); } }
:root[data-theme="dark"] .mdl-fig svg { filter: invert(.88) hue-rotate(180deg); }

/* Diagram legend and caption (same as learn.css, for diagrams outside Learn) */
.ld-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.ld-legend i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.ld-legend__line { width: 18px; height: 0; border-top: 2.5px solid var(--c); }
.ld-legend__line.is-dash { border-top-style: dashed; }
.ld-legend__dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--c); }
.mdl-fig__m { display: none; }
@media (max-width: 600px) { .mdl-fig__d { display: none; } .mdl-fig__m { display: block; } }

/* Company guides: later stages blurred for free visitors (build_seo.py, js/seo-gate.js) */
.seo-gated { position: relative; }
.seo-gated__inner { filter: blur(4px); pointer-events: none; user-select: none; max-height: 1200px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); }
.seo-gate { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-start; padding: 96px 16px 0; pointer-events: none; }
.seo-gate__card { pointer-events: auto; max-width: 420px; text-align: center; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg-elev) 92%, transparent); box-shadow: 0 24px 60px -30px rgba(28, 25, 21, .45); }
.seo-gate__card h3 { margin: 0 0 8px; }
.seo-gate__card p { margin: 0 0 14px; color: var(--text-muted); }
.is-pro .seo-gated__inner { filter: none; pointer-events: auto; user-select: auto; max-height: none; -webkit-mask-image: none; mask-image: none; }
.is-pro .seo-gate { display: none; }
