/* scottdsauer.com in MiAi's visual identity (miai-platform web/src/styles.css + web/src/orb/orb.css @ 2e2b629).
   One readable column (~68ch); figures and tables can break out wider. Dark values follow the system setting. */
:root {
  --bg: #f7f5ff; --surface: #ffffffd9; --rule: #e4def7;
  --fg: #1a1433; --muted: #564d78; --faint: #6a6290;
  --accent: #6d4aff; --accent-soft: #ebe5ff;
  --hot: #c4320a; --hot-soft: #fbe4dc;
  --opus: #b0308a; --opus-soft: #f8e1f1;
  --code-bg: #efebfd;
  --glass: #ffffffb3; --glass-line: #ffffffcc; --glow: #8a5cff33;
  --aurora: radial-gradient(60vmax 40vmax at 15% -10%, #ffd6f3 0%, transparent 60%),
            radial-gradient(50vmax 40vmax at 100% 0%, #d6ecff 0%, transparent 60%),
            radial-gradient(60vmax 50vmax at 50% 120%, #e6dcff 0%, transparent 60%);
  --font-ui: -apple-system, "SF Pro Text", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0b1f; --surface: #17132ed9; --rule: #2b2550;
    --fg: #ece8ff; --muted: #b3aad6; --faint: #9289bb;
    --accent: #9b7bff; --accent-soft: #241d4a;
    --hot: #f97066; --hot-soft: #3d1c22;
    --opus: #ff7ad9; --opus-soft: #3a1838;
    --code-bg: #1b1638;
    --glass: #ffffff0d; --glass-line: #ffffff1f; --glow: #8a5cff55;
    --aurora: radial-gradient(60vmax 40vmax at 15% -10%, #ff6ad522 0%, transparent 60%),
              radial-gradient(50vmax 40vmax at 100% 0%, #3ce0ff1c 0%, transparent 60%),
              radial-gradient(60vmax 50vmax at 50% 120%, #8a5cff2a 0%, transparent 60%);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--aurora), var(--bg); background-attachment: fixed; color: var(--fg);
  font-family: var(--font-ui); font-size: 18px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }

/* Header, footer, page column */
.site-header, .site-footer, main { max-width: 68ch; margin: 0 auto; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 22px 8px; }
.site-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.site-header nav { display: flex; gap: 18px; font-size: 0.9rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }
.site-footer { border-top: 1px solid var(--rule); margin-top: 64px; padding-block: 16px 40px; color: var(--faint); }
.site-footer p { margin: 0; font-size: 0.82rem; }
.site-footer a { color: var(--muted); }
main { display: flex; flex-direction: column; gap: 1.1em; padding-block: 24px; }

h1, h2, h3 { font-family: var(--font-ui); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
.dek { font-size: 1.15rem; color: var(--muted); margin: 0; }
time, .tags, .eyebrow { font-size: 0.82rem; color: var(--faint); }
time { font-variant-numeric: tabular-nums; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.tags a { color: var(--muted); text-decoration: none; }
.tags a:hover { color: var(--accent); }

/* Home hero: text beside the Orb; the Orb goes on top at phone width */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 28px; padding-block: 8px 12px; }
.hero .intro { padding: 0; }
@media (max-width: 600px) { .hero { grid-template-columns: 1fr; } .hero .orb { order: -1; justify-self: center; } }
.intro { display: flex; flex-direction: column; gap: 10px; padding-block: 16px 8px; min-width: 0; }

/* Post list as glass cards */
.post-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.post-list li { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: 0 8px 30px var(--glow); }
.post-list h2 { font-size: 1.3rem; }
.post-list h2 a { color: var(--fg); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); }
.post-list p { margin: 0; }
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.count { color: var(--faint); font-size: 0.85rem; }

/* Tags page: the tag list orbits the Orb once tags.js adds .sphere-live; otherwise it is a plain list. */
.tag-sphere { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.tag-sphere .orb-core { width: clamp(120px, 34vw, 220px); aspect-ratio: 1; }
.tag-sphere.sphere-live { position: relative; width: min(100%, 620px); aspect-ratio: 6 / 5; margin: 0 auto; display: block; overflow: hidden; }
.tag-sphere.sphere-live .orb-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.tag-sphere.sphere-live .tag-list { position: absolute; inset: 0; margin: 0; display: block; }
.tag-sphere.sphere-live li { position: absolute; left: 50%; top: 50%; white-space: nowrap; will-change: transform, opacity; }
.tag-sphere.sphere-live li a { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 6px 22px var(--glow); font-weight: 650; text-decoration: none; transition: background 0.2s, color 0.2s; }
.tag-sphere.sphere-live li a:hover, .tag-sphere.sphere-live li a:focus-visible { background: var(--accent); color: #fff; }
.tag-sphere.sphere-live li .count { position: absolute; top: -6px; right: -6px; font-size: 0.68rem; min-width: 1.4em; padding: 0 4px; text-align: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag-sphere.sphere-live li.back a { box-shadow: none; }
@media (max-width: 600px) { .tag-sphere.sphere-live { aspect-ratio: 1; } }
/* Two faint orbit rings that drift the other way, for depth. */
.tag-sphere.sphere-live::before, .tag-sphere.sphere-live::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 86%; height: 30%; border-radius: 50%;
  border: 1px solid var(--accent); opacity: 0.18; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-14deg); animation: tag-ring 48s linear infinite;
}
.tag-sphere.sphere-live::after { width: 64%; height: 58%; opacity: 0.12; transform: translate(-50%, -50%) rotate(28deg); animation-duration: 70s; animation-direction: reverse; }
@keyframes tag-ring { to { transform: translate(-50%, -50%) rotate(346deg); } }

/* Articles */
.post { display: flex; flex-direction: column; gap: 1.6em; }
.post-header { display: flex; flex-direction: column; gap: 12px; }
.prose { display: flex; flex-direction: column; gap: 1.1em; min-width: 0; }
.prose > * { margin: 0; }
.prose h2 { margin-top: 1.2em; }
.prose h3 { margin-top: 0.5em; }
.prose ul, .prose ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: 0.35em; }
.prose strong { font-weight: 650; }
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre, .highlight pre { font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55; padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 0; }
.highlight { border-radius: 10px; background: var(--code-bg); }
pre code { background: none; padding: 0; font-size: inherit; }
/* Screenshots in posts */
.shot { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--rule); }
.shot.narrow { width: min(100%, 420px); margin-inline: auto; }
figure:has(.shot.narrow) figcaption { text-align: center; }
/* About page photo */
.portrait { display: block; margin-inline: auto; width: min(280px, 70%); height: auto; border-radius: 18px; border: 1px solid var(--glass-line); box-shadow: 0 12px 40px var(--glow); }
blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--rule); color: var(--muted); }

/* Post-body components */
.wide { width: min(980px, calc(100vw - 32px)); margin-left: 50%; transform: translateX(-50%); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { border-top: 3px solid var(--rule); padding-top: 10px; }
.stat b { display: block; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 0.85rem; color: var(--faint); }
.stat.save { border-color: var(--accent); }
.stat.save b { color: var(--accent); }
.figure { display: flex; flex-direction: column; gap: 10px; margin: 0.4em 0; }
.figure.wide { margin-left: 50%; }
.figure .scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; }
.figure svg { display: block; width: 100%; min-width: 760px; height: auto; }
.figure.chart svg { min-width: 520px; }
figcaption { font-size: 0.85rem; color: var(--faint); line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
/* Image comparison rows (e.g. three screenshots side by side): equal columns, images fill them. */
td:has(> img) { width: 33.33%; }
td > img { display: block; width: 100%; height: auto; border-radius: 8px; }
th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.actual td { font-weight: 650; }
.note { border-left: 3px solid var(--hot); padding: 4px 0 4px 16px; }
.note.ok { border-color: var(--accent); }
.svg-text { fill: var(--fg); font-family: var(--font-ui); }
.svg-muted { fill: var(--muted); font-family: var(--font-ui); }
.svg-head { fill: var(--fg); font-family: var(--font-ui); font-weight: 700; }

/* Aurora Orb (from MiAi web/src/orb/orb.css). Canvas and fallback are stacked; .orb-live picks the canvas. */
.orb { position: relative; display: grid; place-items: center; flex: none; }
.orb > * { grid-area: 1 / 1; }
.orb.orb-hero { width: clamp(150px, 40vw, 240px); aspect-ratio: 1; }
.orb.orb-mark { width: 30px; height: 30px; }
.orb-canvas { width: 100%; height: 100%; display: none; }
.orb.orb-live .orb-canvas { display: block; }
.orb.orb-live .orb-fb { display: none; }
.orb-fb { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.orb-fb-blob, .orb-fb-glass { position: absolute; width: 64%; height: 64%; border-radius: 50%; }
.orb-mark .orb-fb-blob, .orb-mark .orb-fb-glass { width: 84%; height: 84%; }
.orb-fb-blob {
  border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
  background: conic-gradient(from 0deg, #ff6ad5, #8a5cff, #3ce0ff, #7dffb0, #ff6ad5);
  filter: blur(2px) saturate(1.0);
  box-shadow: 0 0 34px #8a5cff88;
  animation: orb-morph 8.4s ease-in-out infinite, orb-spin 12.5s linear infinite;
}
.orb-mark .orb-fb-blob { filter: blur(1px); box-shadow: 0 0 10px #8a5cff66; }
.orb-fb-glass { background: radial-gradient(circle at 35% 30%, #ffffff66, transparent 42%); pointer-events: none; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-morph { 50% { border-radius: 60% 40% 35% 65% / 55% 60% 40% 45%; } }

@media (max-width: 520px) { body { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .orb-fb-blob, .tag-sphere::before, .tag-sphere::after { animation: none !important; } }
