/* Landing-page overrides for the existing Milligram foundation.
   Kept separate from the portal's account and dashboard styles. */
body.landing {
  --surface: #101216;
  --surface-raised: #171b22;
  --text: #f1f2f6;
  --muted: #b0b8c7;
  --accent: #bb98f1;
  --line: #343b47;
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.6em;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.6;
}
.landing *, .landing *::before, .landing *::after { box-sizing: border-box; }
.landing a { color: var(--accent); }
.landing a:hover { color: #dfcbff; }
.landing :focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.landing a:focus-visible { border-radius: 2px; }
.landing h1, .landing h2, .landing h3 { color: var(--text); font-weight: 650; }
.landing h1 { font-size: clamp(3.6rem, 4.45vw, 6.2rem); line-height: 1.09; letter-spacing: -.045em; margin-bottom: 2.6rem; }
.landing h2 { font-size: clamp(2.7rem, 3.15vw, 4.2rem); line-height: 1.2; letter-spacing: -.035em; margin-bottom: 2.6rem; }
.landing h3 { font-size: 1.9rem; line-height: 1.4; letter-spacing: -.015em; margin-bottom: .8rem; }
.landing p { color: var(--muted); margin-bottom: 0; }
.landing-shell { width: min(1200px, calc(100% - 96px)); margin: 0 auto; }
.landing-header { display: flex; align-items: center; justify-content: space-between; gap: 3rem; padding: 2.5rem 0; }
.landing .brand { display: inline-flex; align-items: center; gap: 1.1rem; color: var(--text); font-size: 2.5rem; font-weight: 700; letter-spacing: -.04em; flex-shrink: 0; }
.brand img { width: 5.2rem; height: 5.2rem; filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; }
.landing-nav { display: flex; align-items: center; gap: 3.2rem; margin: 0; }
.landing-nav a { color: var(--muted); font-size: 1.4rem; padding: .8rem 0; }
.landing-nav .nav-account { color: var(--text); }
.nav-account span { margin-left: .5rem; color: var(--accent); }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 2rem; padding: 6.2rem 0 7.2rem; }
.landing .eyebrow { color: var(--muted); font: 500 1.15rem/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .19em; text-transform: uppercase; margin-bottom: 2rem; }
.hero-description { max-width: 53rem; font-size: 1.8rem; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2.5rem; margin-top: 2.8rem; }
.landing .button { height: auto; line-height: 1.5; margin: 0; padding: 1.25rem 2.2rem; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: #171120; font-size: 1.5rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.landing .button:hover { background: #cfb3fa; border-color: #cfb3fa; color: #171120; }
.landing .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.button span { margin-left: 1.4rem; }
.text-link { font-size: 1.5rem; font-weight: 500; }
.text-link span { margin-left: .6rem; }
.landing .access-note { margin-top: 1.1rem; font-size: 1.3rem; }
.lab-illustration { margin: 0; padding-top: 1rem; }
.lab-illustration svg { display: block; width: 100%; height: auto; overflow: visible; }
.diagram-browser { color: #aeb8c9; }
.diagram-muted { color: #7d899b; }
.diagram-accent { color: var(--accent); }
.diagram-code { fill: #dce1ec; font: 13px ui-monospace, "SFMono-Regular", Consolas, monospace; }
.diagram-code .diagram-accent { fill: var(--accent); }
.diagram-label { color: var(--muted); font: 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.lab-illustration figcaption { color: var(--muted); text-align: right; font-size: 1.2rem; padding-right: 1rem; margin-top: 1.2rem; }
.landing-section { padding: 4.8rem 0; border-top: 1px solid var(--line); scroll-margin-top: 2.4rem; }
.workflow-steps, .workspace-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5rem; }
.workflow-steps { list-style: none; padding: 0; margin: 0; }
.workflow-steps li { margin: 0; }
.step-number { display: block; color: var(--accent); font: 500 3.2rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: -.08em; margin-bottom: 1rem; }
.workflow-steps p, .workspace-benefits p { max-width: 32rem; font-size: 1.5rem; }
#workspace h2 { margin-bottom: .8rem; }
.section-intro { font-size: 1.9rem; }
.workspace-preview { margin: 2.6rem 0 2.8rem; border: 1px solid #404957; border-radius: 6px; overflow: hidden; }
.workspace-caption { display: flex; align-items: center; gap: .9rem; padding: 1.2rem 1.8rem; background: var(--surface-raised); color: #c8d0dd; font: 1.2rem/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace; border-bottom: 1px solid var(--line); }
.preview-dot { width: .6rem; height: .6rem; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.preview-label { margin-left: auto; color: var(--muted); font-size: 1.1rem; }
.workspace-panes { display: grid; grid-template-columns: 1fr 1fr; }
.code-pane, .trace-pane { min-width: 0; padding: 2rem 2.2rem; }
.code-pane { border-right: 1px solid var(--line); }
.landing .pane-title { font: 500 1.3rem/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0; margin-bottom: 1.8rem; }
.code-pane pre { margin: 0; border: 0; background: none; overflow: auto; }
.code-pane pre > code { display: block; padding: 0; margin: 0; background: none; color: #e3e8f1; font: 1.3rem/2 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: pre; counter-reset: code-line; }
.code-line { display: block; counter-increment: code-line; }
.code-line::before { content: counter(code-line); display: inline-block; width: 3.2rem; color: #8995a8; user-select: none; }
.code-comment { color: #93a4b8; }
.code-keyword { color: #d9a1e9; }
.code-function { color: #9bc9f0; }
.code-number { color: #e4b184; }
.trace-pane img { display: block; width: 100%; height: auto; }
.workspace-benefits h3 { font-size: 1.6rem; }
.faq-list { margin: 0; }
.faq-list > div { display: grid; grid-template-columns: 1fr 1.8fr; gap: 3rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.faq-list > div:last-child { border: 0; padding-bottom: 0; }
.faq-list dt { font-weight: 600; }
.faq-list dd { margin: 0; color: var(--muted); }
.faq-list a { text-decoration: underline; text-underline-offset: .3em; }
.closing { display: flex; justify-content: space-between; align-items: center; gap: 3rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3.8rem 0; }
.closing h2 { margin: 0; font-size: clamp(2.6rem, 3vw, 3.8rem); }
.closing .button { flex-shrink: 0; }
.landing-footer { padding: 2.8rem 0 3rem; color: var(--muted); font-size: 1.3rem; }
.footer-top { display: flex; justify-content: space-between; gap: 2rem; }
.footer-top a { color: var(--text); font-weight: 600; }
.footer-legal { margin-top: 1.8rem; font-size: 1.2rem; line-height: 1.6; }
.footer-legal p + p { margin-top: .4rem; }
.footer-legal small { font-size: 1.1rem; }
.skip-link { position: absolute; top: 1rem; left: 1rem; z-index: 2; padding: 1rem 1.5rem; background: var(--surface-raised); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.landing [class^="flash-"] { max-width: 1200px; margin: 1.5rem auto; padding: 1rem 2rem; border: 1px solid var(--accent); background: var(--surface-raised); }
@media (max-width: 1000px) {
  .landing-shell { width: calc(100% - 64px); }
  .landing-nav { gap: 2rem; }
  .workflow-steps, .workspace-benefits { gap: 2.8rem; }
  .preview-label { display: none; }
  .code-pane, .trace-pane { padding: 1.8rem 1.4rem; }
  .code-pane pre > code { font-size: 1.15rem; }
  .code-line::before { width: 2.2rem; }
}
@media (max-width: 760px) {
  .landing-shell { width: calc(100% - 40px); }
  .landing-header { flex-wrap: wrap; gap: 1rem; padding: 1.8rem 0; }
  .landing .brand { font-size: 2.2rem; }
  .brand img { width: 4.2rem; height: 4.2rem; }
  .landing-nav { width: 100%; justify-content: space-between; gap: 1.2rem; }
  .landing-nav a { font-size: 1.3rem; }
  .hero { grid-template-columns: 1fr; padding: 3.8rem 0 4rem; gap: 3rem; }
  .landing h1 { font-size: clamp(3.6rem, 7.3vw, 5.4rem); }
  .hero-description { font-size: 1.7rem; }
  .lab-illustration { max-width: 46rem; width: 100%; justify-self: center; }
  .landing-section { padding: 3.6rem 0; }
  .workflow-steps { grid-template-columns: 1fr; gap: 2.6rem; }
  .workflow-steps li { display: grid; grid-template-columns: 4.6rem 1fr; column-gap: 1.4rem; }
  .step-number { grid-row: 1 / 3; font-size: 2.7rem; margin: 0; }
  .workflow-steps p { max-width: none; }
  .workspace-panes { grid-template-columns: 1fr; }
  .code-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .code-pane, .trace-pane { padding: 2rem 1.6rem; }
  .code-pane pre > code { font-size: 1.2rem; }
  .workspace-benefits { grid-template-columns: 1fr; gap: 2rem; }
  .workspace-benefits p { max-width: none; }
  .faq-list > div { grid-template-columns: 1fr; gap: .6rem; }
  .closing { align-items: flex-start; flex-direction: column; gap: 2rem; padding: 3rem 0; }
  .footer-top { flex-direction: column; gap: .8rem; }
}
@media (prefers-reduced-motion: no-preference) {
  html:has(body.landing) { scroll-behavior: smooth; }
  .landing a { transition: color .15s ease, background-color .15s ease; }
}
