/* Plain version for engineers. One stylesheet, system fonts, no JavaScript.
   Layout after karpathy.ai: centred 970px column, 12-column rows, a vertical timeline,
   a grey band for featured talks, then plain lists. Dark mode follows the OS setting. */
:root {
  --bg: #fff; --fg: #333; --muted: #6b6b6b; --faint: #cfcfcf; --hair: #e6e6e6;
  --band: #eee; --card: #fff; --link: #1a4fb5; --venue: #2a7a2a; --note: #8a1f1f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616; --fg: #ddd; --muted: #a3a3a3; --faint: #4a4a4a; --hair: #2c2c2c;
    --band: #202020; --card: #161616; --link: #8fb3ff; --venue: #7fcf7f; --note: #f0a0a0;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
}
a { color: var(--link); text-underline-offset: .15em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; }

/* Layout */
.container { margin: 0 auto; padding: 0 15px; }
@media (min-width: 992px) { .container { width: 970px; } }
.row { display: grid; grid-template-columns: repeat(12, 1fr); }

.switch { margin-top: 12px; font-size: 14px; text-align: right; }

/* Header */
#dhead { margin-top: 8px; }
#dpic { grid-column: span 6; text-align: right; }
#ddesc { grid-column: span 6; padding: 40px 0 0 20px; }
#dpic img { width: 240px; height: 240px; border-radius: 50%; object-fit: cover; }
h1 { font-size: 34px; font-weight: normal; margin: 0; }
#ddesc h2 { font-size: 18px; font-weight: normal; font-style: italic; color: var(--muted); margin: 5px 0 12px; max-width: 300px; }
#dico { display: flex; flex-wrap: wrap; gap: 8px; }
#dico a { display: inline-block; line-height: 0; padding: 4px; border-radius: 6px; }
.iico { width: 32px; height: 32px; }
.contact { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
@media (max-width: 991px) {
  #dpic, #ddesc { grid-column: span 12; text-align: center; }
  #ddesc { padding: 20px 0 0; }
  #ddesc h2 { max-width: none; }
  #dico { justify-content: center; }
}

hr { height: 1px; border: 0; margin: 24px 0; background: linear-gradient(90deg, transparent, var(--muted), transparent); }

/* Timeline */
#history { padding-top: 6px; }
.entry { display: grid; grid-template-columns: repeat(12, 1fr); }
.timespan { grid-column: span 1; font-size: 13px; text-align: right; padding-right: 8px; color: var(--muted); line-height: 1.3; }
.ico { grid-column: span 1; border-left: 2px solid var(--faint); position: relative; min-height: 64px; }
.ico img { width: 100%; max-width: 64px; margin-left: 10px; border-radius: 6px; background: #fff; border: 1px solid var(--hair); padding: 4px; }
.ico img.on-dark { background: #111; border-color: #111; }
.entry-dot { position: absolute; top: 0; left: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--faint); border: 2px solid var(--bg); }
.desc { grid-column: span 10; font-size: 17px; padding: 0 0 22px 24px; }
@media (max-width: 700px) {
  .timespan { grid-column: span 2; }
  .ico { grid-column: span 2; }
  .desc { grid-column: span 8; font-size: 16px; padding-left: 14px; }
  .ico img { max-width: 44px; margin-left: 8px; }
}

/* Section titles and bands */
.ctitle { font-size: 34px; font-weight: normal; margin: 40px 0 18px; }
h3 { font-size: 20px; font-weight: normal; margin: 30px 0 10px; }
.n { color: var(--muted); font-size: .75em; }
.band { background: var(--band); padding: 1px 0 30px; margin-top: 40px; }

/* Featured talks */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 991px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: 4px; padding: 5px 5px 10px; }
.card a { display: block; color: var(--fg); text-decoration: none; }
.card a:hover .cdesc { text-decoration: underline; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.cdesc { display: block; font-size: 15px; margin-top: 6px; line-height: 1.3; }

/* Books */
.covers { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.covers img { width: 96px; height: 120px; object-fit: cover; border-radius: 3px; border: 1px solid var(--hair); flex: none; }

/* Lists */
.nodot { list-style: none; padding-left: 0; margin: 8px 0; }
.nodot li { padding: 3px 0; }
.d { color: var(--muted); font-size: 14px; display: inline-block; min-width: 72px; font-variant-numeric: tabular-nums; }
.src { color: var(--muted); font-size: 14px; }
.alt { font-size: 13px; color: var(--muted); }
details { margin: 4px 0; }
summary { cursor: pointer; padding: 4px 0; min-height: 24px; }
details > ul { margin-left: 18px; }
.inline { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.inline li:not(:last-child)::after { content: "·"; color: var(--muted); margin: 0 8px; }

/* Publications style (companies, patents, testimony) */
.pub { font-size: 15px; border-left: 4px solid var(--faint); padding: 2px 0 2px 10px; margin-bottom: 12px; }
.pub-title { display: inline; }
.pub-venue { display: inline; color: var(--venue); }
.pub-authors { display: block; color: var(--muted); }

/* Review notes (prototype only) */
.rn { font-size: 12px; vertical-align: super; color: var(--note); text-decoration: none; margin-left: 2px; }
.review { margin-top: 30px; color: var(--muted); font-size: 15px; }
.review li { margin: 4px 0; }
.review :target { color: var(--fg); background: var(--band); }

.foot { margin: 60px auto 80px; font-size: 14px; color: var(--muted); }
/* Mobile QA: the "Switch to the full site" links were 17px tall; give them a 24px+ touch target */
.switch a, .foot a { display: inline-block; padding-block: 4px; }
