/* sivarajananda.com – one stylesheet, light and dark, no dependencies */

:root {
  --paper: #ffffff;
  --ink: #12151a;
  --muted: #59616b;
  --rule: #dfe3e8;
  --soft: #f3f5f8;
  --accent: #1a4fd6;
  --disc: #0d1014;
  --dot: #ffffff;
  --serif: Charter, "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1115;
    --ink: #e8ebef;
    --muted: #9aa3ad;
    --rule: #272d35;
    --soft: #161a20;
    --accent: #8fb4ff;
    --disc: #000000;
    --dot: #ffffff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

.page { max-width: 44rem; margin: 0 auto; padding: 1.4rem 1.25rem 4rem; }

a { color: var(--accent); text-underline-offset: 0.16em; text-decoration-thickness: 0.06em; }
a:hover { text-decoration-thickness: 0.12em; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* Navigation */
.site-nav {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.3rem;
  font-family: var(--sans); font-size: 0.95rem;
  padding-bottom: 0.9rem; border-bottom: 1px solid var(--rule);
}
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav .home { color: var(--ink); font-weight: 650; margin-right: auto; }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.site-nav .home[aria-current="page"] { text-decoration: none; }
.ext::after { content: "\2197"; font-size: 0.8em; margin-left: 0.2em; }

/* Type */
h1 { font-size: clamp(2.1rem, 6.5vw, 3rem); line-height: 1.08; letter-spacing: -0.015em; font-weight: 650; margin: 2.4rem 0 0.9rem; text-wrap: balance; }
h2 { font-size: 1.45rem; line-height: 1.25; font-weight: 650; margin: 3rem 0 0.8rem; text-wrap: balance; }
h3 { font-size: 1.125rem; line-height: 1.35; font-weight: 650; margin: 1.6rem 0 0.3rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.3rem; line-height: 1.42; margin-bottom: 1rem; text-wrap: pretty; }
.note { color: var(--muted); font-family: var(--sans); font-size: 0.9rem; line-height: 1.5; }
.back { font-family: var(--sans); font-size: 0.9rem; margin: 1.6rem 0 -1.2rem; }

/* Home header */
.hero { display: flex; gap: 1.4rem; align-items: center; margin-top: 2.4rem; }
.hero h1 { margin: 0 0 0.2rem; }
.hero .title { font-family: var(--sans); color: var(--muted); font-size: 1rem; margin: 0; }
.portrait { width: 6.5rem; height: 6.5rem; border-radius: 50%; object-fit: cover; flex: none; }
@media (max-width: 30rem) { .hero { flex-direction: column; align-items: flex-start; gap: 1rem; } }

/* Fact row */
.facts { list-style: none; padding: 0; margin: 1.8rem 0 0.4rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.facts li { background: var(--paper); padding: 0.9rem 1rem; }
.facts b { display: block; font-family: var(--sans); font-size: 1.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.facts span { display: block; font-family: var(--sans); font-size: 0.875rem; line-height: 1.4; color: var(--muted); margin-top: 0.2rem; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(4, 1fr); } }

.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-family: var(--sans); font-size: 1rem; padding: 0; margin: 1.2rem 0 0; list-style: none; }

/* Work cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card { border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.15rem 1rem; background: var(--paper); }
.card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card p { font-size: 1rem; line-height: 1.5; color: var(--muted); margin: 0; }
.card .big { display: block; font-family: var(--sans); font-weight: 700; font-size: 1.05rem; color: var(--accent); margin-bottom: 0.45rem; }

/* Summary box on a work page */
.brief { margin: 1.4rem 0 1.8rem; padding: 0; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.brief div { display: grid; grid-template-columns: 1fr; gap: 0.1rem; padding: 0.75rem 1rem; border-top: 1px solid var(--rule); }
.brief div:first-child { border-top: 0; }
.brief dt { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.brief dd { margin: 0; }
@media (min-width: 40rem) { .brief div { grid-template-columns: 7rem 1fr; gap: 1rem; } .brief dt { padding-top: 0.2rem; } }
.stack { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 1.2rem 0; }
details + details { border-top: 0; margin-top: -1.2rem; }
summary { cursor: pointer; font-family: var(--sans); font-size: 0.95rem; font-weight: 600; padding: 0.75rem 0; color: var(--accent); }
details[open] summary { margin-bottom: 0.4rem; }
details > :last-child { margin-bottom: 1.1rem; }

/* Timeline lists (education, experience) */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; gap: 0.9rem; align-items: center; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 1px solid var(--rule); }
.rows .mark { width: 3.6rem; height: 2.5rem; flex: none; object-fit: contain; }
.rows .what { flex: 1; }
.rows .what b { display: block; font-weight: 650; }
.rows .what span { display: block; font-size: 1rem; color: var(--muted); line-height: 1.4; }
.rows .when { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); white-space: nowrap; }

/* Sample answer card (MCP page) */
.sample { display: grid; gap: 0.9rem; margin: 1.2rem 0 0.5rem; }
@media (min-width: 40rem) { .sample { grid-template-columns: 1fr 1fr; } }
.answer { font-family: var(--sans); font-size: 0.9rem; line-height: 1.45; border: 1px solid var(--rule); border-radius: 10px; background: var(--soft); padding: 0.9rem 1rem; }
.answer .state { display: inline-block; font-weight: 700; font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; margin-bottom: 0.5rem; }
.answer .ok { color: #17803d; } .answer .no { color: #b3261e; }
@media (prefers-color-scheme: dark) { .answer .ok { color: #6fd08c; } .answer .no { color: #ff8a80; } }
.answer p { margin: 0 0 0.45rem; }
.answer dl { margin: 0.5rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--rule); display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.8rem; color: var(--muted); }
.answer dd { margin: 0; color: var(--ink); }

/* Charts */
figure { margin: 1.4rem 0; }
figure svg { display: block; width: 100%; height: auto; }
figcaption { margin-top: 0.5rem; }
.chart text { font-family: var(--sans); fill: var(--ink); }
.chart .ax { fill: var(--muted); }
.chart .grid { stroke: var(--rule); }
.chart .ideal { stroke: var(--muted); stroke-dasharray: 4 4; }
.chart .mk { fill: var(--accent); }
.chart .wh { stroke: var(--accent); stroke-width: 2; }

/* Experiment */
.demo { border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem; margin: 1.4rem 0; display: grid; gap: 1rem; justify-items: center; text-align: center; font-family: var(--sans); }
.demo canvas { width: 15rem; height: 15rem; border-radius: 50%; background: var(--disc); }
.demo p { margin: 0; font-size: 1rem; line-height: 1.45; max-width: 30rem; }
.demo .btns { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; min-height: 2.75rem; }
.demo button { font: inherit; font-weight: 600; padding: 0.55rem 1.1rem; border-radius: 999px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.demo button.go { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.demo button:hover { border-color: var(--accent); }

.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 0.7rem 0; border-top: 1px solid var(--rule); font-size: 1rem; line-height: 1.5; }
.pubs .role { display: block; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); margin-top: 0.15rem; }
.oneline { list-style: none; padding: 0; margin: 0; }
.oneline li { padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.oneline li:last-child { border-bottom: 1px solid var(--rule); }
.oneline .v { font-family: var(--sans); font-size: 0.875rem; color: var(--muted); display: block; }

footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.9rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; }
footer a { color: var(--muted); }
.foot-links a { margin-left: 1.1rem; }
.foot-links a:first-child { margin-left: 0; }

/* Run order strip */
.flow { list-style: none; padding: 0; margin: 0 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 0; font-family: var(--sans); font-size: 0.875rem; }
.flow li { padding: 0.3rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--soft); margin-right: 1.4rem; position: relative; }
.flow li:not(:last-child)::after { content: "\2192"; position: absolute; right: -1.15rem; color: var(--muted); }
code { font-size: 0.9em; }
