:root {
  --film: #eef1ee;      /* page: drafting film */
  --ink: #15233c;       /* solar-cell blue, all text */
  --muted: #4e5b66;
  --lake: #2f6470;      /* links, focus */
  --sun: #f2b01e;       /* the sun, and nothing else */
  --sand: #9a6a3f;      /* family + heritage */
  --rule: #cbd3cf;
  --display: 'Archivo', system-ui, sans-serif;
  --text: 'Source Serif 4', Georgia, serif;
  --deva: 'Noto Serif Devanagari', 'Source Serif 4', serif;
  --gutter: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--film); color: var(--ink);
  font: 400 clamp(17px, 1.15vw + 12px, 19px)/1.65 var(--text);
  font-optical-sizing: auto; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lake); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--film); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }

h1, h2, h3, .display { font-family: var(--display); font-stretch: 118%; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 0.6em; }
h3 { font-size: 1.2rem; font-stretch: 110%; }
p { margin: 0 0 1em; max-width: 64ch; }
.lede { font-size: 1.18em; line-height: 1.55; }
.muted { color: var(--muted); }

/* Layout: one column with a quiet index beside it on wide screens. */
.page { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 1100px) {
  .page.has-index { display: grid; grid-template-columns: 170px 1fr; column-gap: 56px; }
  .index { position: sticky; top: 0; align-self: start; padding-top: 44px; height: 100vh; }
  .index ol { flex-direction: column; gap: 6px; }
}
.index ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; overflow-x: auto; }
.index a { font: 600 15px/1.4 var(--display); font-stretch: 105%; color: var(--ink); text-decoration: none; white-space: nowrap; padding: 4px 0; display: inline-block; }
.index a:hover { color: var(--lake); }
.index .home { font-stretch: 125%; font-weight: 800; margin-bottom: 20px; display: block; }
@media (max-width: 1099px) {
  .index { position: sticky; top: 0; z-index: 5; background: var(--film); padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .index .home { display: none; }
}

section { padding-block: clamp(64px, 9vw, 120px); scroll-margin-top: 56px; }
section + section { border-top: 1px solid var(--rule); }

/* Hero */
.hero { padding-top: clamp(40px, 7vw, 96px); display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 820px) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.hero h1 { grid-column: 1 / -1; font-size: clamp(3.3rem, 9.2vw, 7.6rem); font-stretch: 125%; font-weight: 800; line-height: 0.9; letter-spacing: -0.025em; margin-bottom: -0.2em; }
.hero .roles { font: 600 1.05rem/1.5 var(--display); font-stretch: 108%; color: var(--muted); margin-bottom: 1.6em; }
.hero figure { margin: 0; }
.hero figure img { border-radius: 4px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.btn { font: 600 16px/1 var(--display); font-stretch: 108%; padding: 15px 22px; border-radius: 6px; text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink); display: inline-block; }
.btn.primary { background: var(--ink); color: var(--film); }
.btn:hover { background: var(--lake); border-color: var(--lake); color: #fff; }

/* The sun path: the one thing that moves. */
.sunpath { margin: clamp(32px, 5vw, 56px) 0 0; }
.sunpath svg { width: 100%; height: auto; overflow: visible; }
.sunpath .horizon { stroke: var(--ink); stroke-opacity: 0.45; stroke-width: 1.5; }
.sunpath .arc { fill: none; stroke: var(--ink); stroke-opacity: 0.35; stroke-width: 1.5; stroke-dasharray: 1 7; stroke-linecap: round; }
.sunpath .done { fill: none; stroke: var(--sun); stroke-width: 3.5; stroke-linecap: round; }
.sunpath .sun { fill: var(--sun); }
.sunpath .tick { stroke: var(--ink); stroke-opacity: 0.45; }
.sunpath .hour { font: 500 15px var(--display); fill: var(--muted); text-anchor: middle; }
.sunpath figcaption { font: 500 clamp(16px, 1.5vw, 19px)/1.5 var(--display); font-stretch: 104%; margin-top: 10px; max-width: 70ch; }
.sunpath.night .arc { stroke-opacity: 0.2; }

/* Timeline: a real sequence, so years lead each row. */
.timeline { margin: 0; display: grid; grid-template-columns: minmax(5.5rem, 8rem) 1fr; column-gap: clamp(16px, 3vw, 40px); }
.timeline dt { font: 700 1.05rem/1.6 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; padding-top: 0.15em; }
.timeline dd { margin: 0 0 1.8em; }
.timeline dd p:last-child { margin-bottom: 0; }
.timeline .photos { margin-top: 18px; }

.photos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0; }
.photos figure { margin: 0; }
.photos img { border-radius: 3px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.photos figcaption, figure > figcaption { font-size: 0.85em; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* Ventures and builds: plain rows, name first. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: grid; gap: 4px 32px; padding: 22px 0; border-top: 1px solid var(--rule); }
.rows > li:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .rows > li { grid-template-columns: 15rem 1fr auto; align-items: baseline; } }
.rows h3 { font-size: 1.12rem; }
.rows .role { display: block; font: 500 0.92rem/1.4 var(--display); color: var(--muted); margin-top: 4px; }
.rows p { margin: 0; }
.rows .state { font: 600 0.85rem var(--display); color: var(--muted); white-space: nowrap; }
.group-title { font: 700 1rem var(--display); font-stretch: 112%; color: var(--muted); margin: 2.4em 0 0.4em; }
.group-title:first-of-type { margin-top: 0; }

/* Video */
.videos { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.videos button.yt, .videos iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; }
button.yt { position: relative; padding: 0; cursor: pointer; background: var(--ink); overflow: hidden; }
button.yt img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
button.yt span { position: absolute; left: 12px; bottom: 12px; right: 12px; text-align: left; color: #fff; font: 600 15px/1.3 var(--display); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
button.yt::after { content: ''; position: absolute; top: 50%; left: 50%; translate: -40% -50%; border-style: solid; border-width: 16px 0 16px 27px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.5)); }
button.yt:hover img { opacity: 1; }

/* Family */
.family h2, .family .deva { color: var(--sand); }
.deva { font-family: var(--deva); }
.lineage { list-style: none; padding: 0; margin: 1.4em 0; font-family: var(--deva); font-size: 1.15rem; line-height: 1.5; }
.lineage li { padding-left: 1.4em; position: relative; }
.lineage li + li { margin-top: 0.35em; }
.lineage li::before { content: ''; position: absolute; left: 0.35em; top: -0.55em; bottom: 0.6em; border-left: 1.5px solid var(--sand); opacity: 0.5; }
.lineage li:first-child::before { display: none; }
.lineage .en { font-family: var(--text); font-size: 0.82em; color: var(--muted); }
.vanshavali { margin: 2em 0 0; }
.vanshavali img { border-radius: 3px; border: 1px solid rgba(154, 106, 63, 0.35); }
.draft { font: 600 0.88rem/1.5 var(--display); background: #fff4d6; border-left: 3px solid var(--sun); padding: 10px 14px; max-width: 64ch; }
.two { display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; } }

/* Contact */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; list-style: none; margin: 0; padding: 0; }
.links li { padding: 14px 0; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; }
.links .net { font: 600 1rem var(--display); }
.links a { overflow-wrap: anywhere; text-align: right; }

.quote { margin: 0; }
.quote blockquote { margin: 0 0 10px; font-size: 1.05em; }
.quote figcaption { display: flex; align-items: center; gap: 10px; font: 600 0.9rem var(--display); color: var(--muted); }
.quote img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.quotes { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

footer { padding: 40px 0 56px; border-top: 1px solid var(--rule); font: 500 0.9rem/1.6 var(--display); color: var(--muted); }
footer p { max-width: none; margin: 0; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Family tree (rendered from family/family.json by family.js) */
.ftree { --branch: rgba(154, 106, 63, 0.45); list-style: none; margin: 1.2em 0 0; padding: 0; }
.ftree ul { list-style: none; padding: 0; margin: 0 0 0 27px; }
.ftree ul > li { position: relative; padding: 14px 0 0 24px; border-left: 1.5px solid var(--branch); }
.ftree ul > li:last-child { border-left-color: transparent; }
.ftree ul > li::before { content: ''; position: absolute; left: -1.5px; top: 0; width: 20px; height: 42px; border: solid var(--branch); border-width: 0 0 1.5px 1.5px; border-bottom-left-radius: 10px; }
.couple { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.couple > .with { padding-left: 22px; border-left: 1.5px dotted var(--branch); }
.fp { display: flex; align-items: center; gap: 10px; }
.fp img, .fp .init { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.fp .init { display: grid; place-items: center; background: #e7ddcf; color: var(--sand); font: 700 17px var(--display); }
.fp .nm { display: flex; flex-direction: column; line-height: 1.3; }
.fp b { font: 700 1rem var(--display); font-stretch: 108%; }
.fp .deva { font-size: 0.95rem; color: var(--sand); }
.fp small { font-size: 0.82rem; color: var(--muted); max-width: 40ch; }
@media (max-width: 600px) {
  .ftree ul { margin-left: 14px; }
  .ftree ul > li { padding-left: 14px; }
  .ftree ul > li::before { width: 11px; }
  .fp img, .fp .init { width: 44px; height: 44px; }
}
