/* rishimashelkar.com — dark by default, sibling to datacharter.dev.
   One serif display face carries the page. Mono labels are metadata, not
   decoration. Light is opt-in only, so dark stays the default for everyone. */
:root {
  /* Dark is the default palette and the only one on bare :root. */
  --bg: #0A1119;
  --bg-2: #0E1721;
  --surface: #111C28;
  --surface-2: #16222F;
  --line: #223040;
  --line-soft: #1A2633;
  --ink: #DCE6EF;
  --ink-dim: #AEBECE;
  --muted: #8293A5;
  --accent: #5DA0DC;
  --accent-ink: #9CC6ED;
  --warm: #E0944A;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1000px;
  --r: 14px;
  --nav-h: 64px;
  color-scheme: dark;
}
/* Light only when the viewer explicitly asks for it. Dark stays the default. */
:root[data-theme="light"] {
  --bg: #F4F7FA;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EDF2F7;
  --line: #D6DFE8;
  --line-soft: #E6ECF2;
  --ink: #16212C;
  --ink-dim: #33434F;
  --muted: #59697A;
  --accent: #2E6CA6;
  --accent-ink: #27608F;
  --warm: #B4651A;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-2), var(--bg) 360px);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }

/* ---- top bar ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 18px; }
.brand { font-family: var(--mono); font-weight: 600; font-size: .92rem; letter-spacing: .01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 600; }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a {
  position: relative; font-size: .92rem; text-decoration: none; color: var(--muted);
  padding: 6px 1px; transition: color .18s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left center; transition: transform .24s ease;
}
.nav__links a:hover, .nav__links a:focus-visible { color: var(--ink); }
.nav__links a:hover::after, .nav__links a:focus-visible::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .nav__links a::after { transition: none; } }
.themebtn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  font-size: 1rem; line-height: 1; transition: color .18s, border-color .18s, background .18s;
}
.themebtn:hover { color: var(--ink); border-color: var(--accent); background: var(--surface-2); }
@media (max-width: 620px) {
  .nav__links { gap: 16px; }
  .nav__links a { white-space: nowrap; }
  .nav__links a.hide-sm { display: none; }
  .brand { font-size: .82rem; }
}

/* ---- shared section bits ---- */
section { padding-block: 76px; }
.section-head { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.section-head h2 { white-space: nowrap; }
.section-head::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.eyebrow {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; text-transform: none;
  color: var(--accent); margin: 0 0 16px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.75rem, 4vw, 2.35rem); letter-spacing: -.012em; }
.lead { color: var(--ink-dim); font-size: 1.08rem; max-width: 60ch; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: .93rem; font-weight: 600; padding: 11px 19px; border-radius: 11px;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface);
  transition: border-color .18s, background .18s, color .18s, transform .05s;
}
.btn:hover { border-color: var(--accent); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #07121D; }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #07121D; }
.btnrow { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---- hero ---- */
.hero { padding-top: 72px; padding-bottom: 68px; }
.hero__grid { display: grid; grid-template-columns: .85fr 1.35fr; gap: 50px; align-items: center; }
.hero__grid .portrait { order: -1; }
.hero h1 { font-size: clamp(2.8rem, 7.4vw, 4.4rem); letter-spacing: -.025em; line-height: 1.04; }
.hero .lead { margin-top: 20px; font-size: 1.2rem; max-width: 46ch; }
.portrait {
  position: relative; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 26px 64px -34px rgba(0,0,0,.75);
}
/* Keep the width, trim the height to 75% of the old 512px box (512 -> 384). */
.portrait img { width: 100%; height: auto; aspect-ratio: 267 / 384; object-fit: cover; object-position: center; }
.portrait figcaption {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .03em; color: var(--muted);
  padding: 11px 13px; border-top: 1px solid var(--line-soft); background: var(--bg-2);
}
.portrait figcaption b { color: var(--accent); font-weight: 600; }
@media (max-width: 780px) {
  .hero__grid { grid-template-columns: 1fr; gap: 34px; }
  .hero__grid .portrait { order: 0; }
  .hero { padding-top: 48px; }
  .portrait { max-width: 360px; }
}

/* ---- about ---- */
.about { border-top: 1px solid var(--line-soft); }
.about__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about p { color: var(--ink-dim); margin: 0 0 16px; max-width: 58ch; }
.facts { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 4px 18px; }
.facts dl { margin: 0; }
.facts div { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.facts dd { margin: 0; font-size: .97rem; color: var(--ink); }
.facts dd a { color: var(--accent-ink); text-decoration: none; }
.facts dd a:hover { text-decoration: underline; }
@media (max-width: 780px) { .about__grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---- projects ---- */
.projects { border-top: 1px solid var(--line-soft); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); padding: 26px; transition: border-color .2s ease, background .2s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface-2); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__name { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; }
.tag { font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.tag--live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tag--oss { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 45%, var(--line)); }
.card__quote { font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--ink-dim); margin: 0 0 14px; }
.card p { color: var(--ink-dim); margin: 0 0 18px; font-size: .96rem; }
.card ul { margin: 0 0 22px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.card ul li { font-family: var(--mono); font-size: .68rem; color: var(--muted); border: 1px solid var(--line-soft); border-radius: 7px; padding: 3px 9px; }
.card__links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 680px) { .cards { grid-template-columns: 1fr; } }

/* ---- data-doc page specifics ---- */
.back {
  font-family: var(--mono); font-size: .84rem; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; transition: color .18s, gap .18s;
}
.back:hover { color: var(--ink); gap: 11px; }
.panel {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 28px; margin-top: 28px;
}
.panel--hot { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface)); }
.code {
  font-family: var(--mono); font-size: .82rem; line-height: 1.7; color: var(--ink-dim);
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; margin: 18px 0 0; white-space: pre;
}
.code .c { color: var(--muted); }
.code .k { color: var(--accent-ink); }
.featgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.feat { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 22px; transition: border-color .2s ease; }
.feat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.feat h3 { font-size: 1.14rem; margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: .9rem; margin: 0; }
.feat .mk { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 11px; }
@media (max-width: 780px) { .featgrid { grid-template-columns: 1fr; } }
.answer { font-family: var(--mono); font-size: .86rem; color: var(--ink); margin-top: 18px; }
.answer b { color: var(--accent); }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line-soft); padding-block: 44px; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.foot__links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .18s; }
.foot a:hover { color: var(--ink); }
.foot .mono { font-family: var(--mono); font-size: .8rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
