/* AI Explained (/explained) + AI Coding (/coding): engineer pages built by _build/eng.py.
   Ink "blueprint" hero and panels instead of cobalt, lemon only for the path that matters. Diagrams come from _build/eng/diagrams.py. */
:root { --eng-ink: #0b1733; --eng-panel: #0f1f45; --eng-line: #2b437f; --eng-sub: #93a4cc; }

.eng-hero { background: var(--eng-ink); background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 24px 24px; }
.eng-hero .art-chip { background: var(--lemon); }
.eng-hero .art-chip-alt { background: rgba(255,255,255,.12); color: #fff; }
.eng-hub-hero { padding-bottom: 72px; }
.eng-hub-hero .post-title { max-width: 14ch; }
.eng-hub-hero .lead { max-width: 60ch; }
.eng-wide { max-width: 1040px; }

/* diagrams */
.dg { margin: 32px 0; }
.eng-wide > .dg { margin: -40px auto 8px; position: relative; }
.dg-svg { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 2px 6px rgba(14,26,51,.08), 0 30px 60px -28px rgba(14,26,51,.45); }
.dg figcaption { margin-top: 10px; font-size: 14px; line-height: 21px; color: var(--ink-muted); max-width: 72ch; }
.art-body .dg { margin-inline: 0; }
@media (min-width: 1000px) { .art-body .dg { margin-inline: -60px; } }
.dg-tree { border-radius: 18px; background: var(--eng-ink); color: #eef2fc; padding: 18px 22px 20px; overflow-x: auto; }
.dg-tt { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--eng-sub); }
.dg-tree pre, .eng-code pre { margin: 0; font: 500 13.5px/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; }
.dg-tl { display: block; }
.dg-tc { margin-left: 18px; color: #9fe3b4; }
.dg-tc::before { content: "# "; }

/* text blocks */
.eng-body h3 { margin: 32px 0 10px; font-size: 21px; line-height: 27px; font-weight: 800; letter-spacing: -.02em; }
.eng-body ul, .eng-body ol { margin: 0 0 22px; padding-left: 22px; font-size: 18px; line-height: 29px; }
.eng-body li { margin-bottom: 8px; }
.eng-body code { padding: 1px 6px; border-radius: 6px; background: #e9edf7; font: 600 .86em ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.eng-code { margin: 24px 0; border-radius: 16px; overflow: hidden; background: var(--eng-ink); color: #eef2fc; }
.eng-code-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--eng-line); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--eng-sub); }
.eng-code-h button { border: 0; border-radius: 999px; padding: 4px 12px; background: rgba(255,255,255,.1); color: #fff; font: 700 12px var(--font-sans); cursor: pointer; }
.eng-code-h button:hover { background: var(--lemon); color: var(--ink); }
.eng-code pre { padding: 16px 18px 18px; overflow-x: auto; }
.eng-code code { padding: 0; background: none; font: inherit; color: inherit; }
.eng-note { margin: 24px 0; padding: 18px 22px; border-radius: 16px; background: var(--pith); border: 1px solid rgba(14,26,51,.08); font-size: 16.5px; line-height: 26px; }
.eng-note strong { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.eng-q { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--lemon); }
.eng-q p { margin: 0 0 6px !important; font-size: 21px !important; line-height: 31px !important; font-weight: 650 !important; }
.eng-q cite { font-style: normal; font-size: 14px; color: var(--ink-muted); }
.eng-table { margin: 24px 0; overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.eng-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.eng-table th { text-align: left; padding: 12px 14px; background: var(--eng-ink); color: #fff; font-weight: 700; white-space: nowrap; }
.eng-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.eng-src-d { color: var(--ink-muted); font-size: 12px; }
.eng-proof { margin: 14px 0 0; font-size: 14px; font-weight: 700; color: var(--lemon); }

/* pro / lab profile */
.eng-who { display: flex; gap: 16px; align-items: center; margin-top: 22px; }
.eng-who b { display: block; font-size: 18px; }
.eng-who > div > span { display: block; font-size: 14px; color: rgba(255,255,255,.8); }
.eng-follow { margin-top: 4px; }
.eng-follow a { margin-right: 10px; color: var(--lemon); font-weight: 700; }
.eng-av { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--eng-panel); color: var(--lemon); font-size: 18px; font-weight: 800; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px var(--eng-line); }
.eng-av-lg { width: 64px; height: 64px; font-size: 22px; }
.eng-av-logo { background: #fff; }
.eng-av-logo img { width: 58%; height: 58%; }
.eng-subs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 32px 0 0; }
.eng-sub { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 0; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(14,26,51,.06), inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; overflow: hidden; animation: yz-rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 50ms); transition: transform .3s cubic-bezier(.3,.7,.3,1.4), box-shadow .25s ease; }
.eng-sub:hover { transform: translateY(-3px); box-shadow: 0 2px 6px rgba(14,26,51,.08), 0 24px 40px -24px rgba(14,26,51,.4), inset 0 0 0 1px var(--line); }
.eng-sub-k, .eng-sec-k, .eng-k { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cobalt); }
.eng-sub b { font-size: 17px; line-height: 22px; letter-spacing: -.01em; }
.eng-sub > span:not(.eng-sub-k):not(.eng-sub-dg) { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.eng-sub-dg { margin-top: auto; padding-top: 12px; height: 120px; overflow: hidden; }
.eng-sub-dg .dg-svg, .eng-thumb .dg-svg { box-shadow: none; border-radius: 12px 12px 0 0; }
.eng-sub-dg .dg-tree { border-radius: 12px 12px 0 0; padding: 12px; font-size: 10px; }
.eng-card-sec { margin-top: 64px; padding-top: 8px; scroll-margin-top: 96px; }
.eng-card-sec h2 { margin-top: 6px !important; }

/* hubs */
.eng-map { display: grid; gap: 28px; position: relative; }
.eng-map-dg { margin-top: -40px; }
.eng-map-nav { padding-top: 20px; }
@media (min-width: 960px) { .eng-map { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.eng-map-nav { display: grid; gap: 8px; }
.eng-map-h { margin: 0 0 6px; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.eng-map-nav a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; transition: transform .25s ease, box-shadow .2s ease; }
.eng-map-nav a:hover { transform: translateX(4px); box-shadow: inset 0 0 0 1.5px var(--cobalt); }
.eng-map-nav a b { font-size: 16px; }
.eng-map-nav a span { grid-column: 1; font-size: 13.5px; color: var(--ink-muted); }
.eng-map-nav a em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 13px; font-weight: 800; color: var(--cobalt); }
.eng-map-nav .eng-soon { opacity: .55; pointer-events: none; }
.eng-map-nav .eng-map-start { display: block; background: var(--lemon); box-shadow: none; font-weight: 800; }
.eng-group { margin-top: 72px; scroll-margin-top: 96px; }
.eng-group h2 { margin: 0 0 22px; font-size: 32px; line-height: 36px; font-weight: 800; letter-spacing: -.035em; }
.eng-group h2 span { display: block; margin-top: 6px; max-width: 70ch; font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0; color: var(--ink-muted); }
.eng-h3 { margin: 26px 0 12px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.eng-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.eng-card { display: flex; flex-direction: column; gap: 8px; padding: 0 0 20px; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(14,26,51,.06), inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; overflow: hidden; animation: yz-rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 50ms); transition: transform .3s cubic-bezier(.3,.7,.3,1.4), box-shadow .25s ease; }
.eng-card:hover, .eng-pro:hover { transform: translateY(-4px); box-shadow: 0 2px 6px rgba(14,26,51,.08), 0 30px 50px -28px rgba(14,26,51,.45), inset 0 0 0 1px var(--line); }
.eng-card > :not(.eng-thumb) { margin-inline: 20px; }
.eng-card b { font-size: 19px; line-height: 24px; letter-spacing: -.02em; }
.eng-card p { margin: 0; font-size: 14.5px; line-height: 21px; color: var(--ink-muted); }
.eng-thumb { display: block; height: 190px; overflow: hidden; background: var(--eng-ink); margin-bottom: 8px; }
.eng-thumb .dg-svg { border-radius: 0; }
.eng-co { padding-top: 20px; border-top: 4px solid var(--lemon); }
.eng-proof-s { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); }
.eng-pros { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.eng-pro { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 20px; background: var(--eng-ink); background-image: radial-gradient(120% 80% at 100% 0%, rgba(46,134,222,.35), transparent 60%); color: #fff; text-decoration: none; animation: yz-rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 60ms); transition: transform .3s cubic-bezier(.3,.7,.3,1.4), box-shadow .25s ease; }
.eng-pro .eng-av { margin-bottom: 8px; }
.eng-pro b { font-size: 21px; line-height: 25px; letter-spacing: -.02em; }
.eng-pro-r { font-size: 13.5px; font-weight: 700; color: var(--lemon); }
.eng-pro p { margin: 4px 0 8px; font-size: 14.5px; line-height: 21px; color: rgba(255,255,255,.82); }
.eng-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.eng-chips span { padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 700; color: rgba(255,255,255,.88); }
.eng-trend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.eng-trend a { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 16px 20px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; transition: transform .25s ease, box-shadow .2s ease; }
.eng-trend a:hover { transform: translateX(4px); box-shadow: inset 0 0 0 1.5px var(--cobalt); }
.eng-rank { font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--cobalt); }
.eng-trend b { display: block; font-size: 17px; line-height: 23px; }
.eng-trend a > span > span { display: block; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.eng-trend time { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.eng-foot-note { margin: 0 0 40px; font-size: 14px; color: var(--ink-muted); }
.eng-foot-note a { color: var(--cobalt); font-weight: 700; }
.eng-rel { margin: 8px 0 72px; }
.eng-rel h2 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; }

@media (max-width: 719px) {
  /* phones: diagrams keep a readable size and scroll sideways inside their own frame */
  figure.dg { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  figure.dg .dg-svg { min-width: 640px; }
  .eng-map-dg .dg-svg { min-width: 0; }
  .eng-wide > .dg { margin-top: -28px; }
  .eng-trend a { grid-template-columns: auto 1fr; }
  .eng-trend time { display: none; }
  .eng-group { margin-top: 52px; }
  .eng-group h2 { font-size: 26px; line-height: 30px; }
  .eng-q p { font-size: 18px !important; line-height: 27px !important; }
  .eng-body ul, .eng-body ol { font-size: 16.5px; line-height: 26px; }
  .eng-thumb { height: 160px; }
}
@media (prefers-reduced-motion: reduce) { .eng-card, .eng-pro, .eng-sub { animation: none; transition: none; } }
