/* Dark theme for jigarrajpura.com
 * Applied when <html data-theme="dark">, which the head snippet on every page sets
 * from the visitor's choice (the pull-cord bulb) or their device setting.
 * Pages share one family of colour tokens, so most of the work is redefining them;
 * the rules further down fix the few hard-coded colours.
 */
html[data-theme="dark"] {
  color-scheme: dark;
  /* surfaces */
  --bg: #121316; --paper: #121316; --surface: #1B1C21; --soft: #22232A; --plot: #1B1C21; --land: #2A2C33;
  /* text */
  --ink: #EDEDEA; --ink-2: #C4C6CC; --muted: #9A9DA5; --strip-ink: #F2E7B8;
  /* lines and quiet fills */
  --rule: #2E3036; --ghost: #3A3B40; --pill: #2A2B30;
  /* tints behind coloured panels */
  --navy-bg: #18213D; --clin-bg: #18213D; --blue-bg: #18213D; --navy-line: #33437A; --clin-line: #33437A;
  --ox-bg: #3A1428; --reimb-bg: #3A1428; --ox-line: #6B2A4C; --reimb-line: #6B2A4C; --reimb-soft: #4A1A33;
  --amber-bg: #2E2414; --med-bg: #10291E; --sage-bg: #10291E; --mint-bg: #10291E; --sage-line: #1F5A40;
  --strip: #3A3418;
  /* accent text, lifted for contrast on dark */
  --navy: #7E9DFF; --clin-ink: #93B1FF; --blue: #7E9DFF;
  --ox-ink: #FF8FC6; --reimb-ink: #FF8FC6; --pink-ink: #FF8FC6;
  --gold: #E5C35A; --amber: #FFB24A; --mint-ink: #5BE3A8; --sage-ink: #5BE3A8; --med: #3DDC97; --good: #3DDC97;
  --c1: #7E9DFF; --c2: #FF6FB5; --c3: #3DDC97; --c4: #FFB24A; --c5: #B39BFF; --c6: #9A9DA5;
}
html[data-theme="dark"] body { background: var(--paper, var(--bg, #121316)); color: var(--ink); }

/* Theme switch: a bulb on a pull-cord (built by theme.js) */
.bulb { --s: 1; --k: #161616; position: absolute; top: 0; z-index: 43; width: 64px; height: 84px; margin-left: -32px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transform: scale(var(--s)); transform-origin: 50% 0; }
/* the wire above the drawing, up past the top of the screen */
.bulb::before { content: ""; position: absolute; left: 26.9px; bottom: 100%; width: 2.2px; height: 400px; background: var(--k); pointer-events: none; }
html[data-theme="dark"] .bulb { --k: #C9CACF; }
.bulb svg { display: block; width: 64px; height: 84px; overflow: visible; transform-origin: 28px 0; }
.bulb .cord { transition: transform .18s ease-out; }
.bulb-slot { display: inline-block; flex: none; align-self: stretch; }
.bar a.back-short { padding-inline: 12px; }
.bulb.pull .cord { transform: translateY(7px); }
.bulb.swing svg { animation: bulb-swing 1.1s ease-out; }
@keyframes bulb-swing { 0% { transform: rotate(0); } 20% { transform: rotate(5deg); } 45% { transform: rotate(-3.5deg); } 70% { transform: rotate(1.5deg); } 100% { transform: rotate(0); } }
.bulb:focus-visible { outline: 3px solid #FFB24A; outline-offset: 2px; border-radius: 10px; }
.bulb .tip { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #161616; color: #fff; font: 600 12px/1 'DM Sans', Arial, sans-serif; border-radius: 999px; padding: 6px 10px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.bulb:hover .tip, .bulb:focus-visible .tip { opacity: 1; }
html[data-theme="dark"] .bulb .tip { background: #EDEDEA; color: #161616; }
@media (hover: none) { .bulb .tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .bulb.swing svg { animation: none; } .bulb .cord { transition: none; } }

/* ---------- Fixes for hard-coded colours (found by rendering every page in dark mode) ---------- */
/* Grey pill buttons and round buttons */
html[data-theme="dark"] .fab, html[data-theme="dark"] .ss-btn, html[data-theme="dark"] .bar .btn, html[data-theme="dark"] .navlink.pillnav,
html[data-theme="dark"] .back, html[data-theme="dark"] .jump a, html[data-theme="dark"] .av, html[data-theme="dark"] .morework,
html[data-theme="dark"] .tabs.end button:not([aria-selected="true"]) { background: #26272C; color: #EDEDEA; }
html[data-theme="dark"] .bar .btn:hover, html[data-theme="dark"] .navlink.pillnav:hover, html[data-theme="dark"] .back:hover,
html[data-theme="dark"] .jump a:hover, html[data-theme="dark"] .ss-btn:hover, html[data-theme="dark"] .morework:hover { background: var(--lime); color: #161616; }
html[data-theme="dark"] .bar { background: rgba(18, 19, 22, .92); }
html[data-theme="dark"] .eyebrow, html[data-theme="dark"] .motto { color: var(--ink); }
html[data-theme="dark"] .credit { color: #9A9DA5; }

/* Inverted chips (dark chip with white text in light mode) */
html[data-theme="dark"] .skip, html[data-theme="dark"] .tagd, html[data-theme="dark"] .mhint, html[data-theme="dark"] .rs-new,
html[data-theme="dark"] .seg button[aria-pressed="true"], html[data-theme="dark"] .tabs button[aria-selected="true"] { background: #EDEDEA; color: #161616; }
html[data-theme="dark"] .tabs button[aria-selected="true"] small { color: #4A4D55; }
html[data-theme="dark"] .tabs button[aria-selected="true"] .n { background: #161616; color: #EDEDEA; border-color: #161616; }
html[data-theme="dark"] .fnode small { color: #4A4D55; }
html[data-theme="dark"] .port { background: #22232A; color: var(--ink); }

/* Labels on bright fills keep dark text */
html[data-theme="dark"] .jump a.dl, html[data-theme="dark"] .gchips span, html[data-theme="dark"] .steps > li > .n, html[data-theme="dark"] .sub button,
html[data-theme="dark"] .believe, html[data-theme="dark"] .rs, html[data-theme="dark"] .rs strong, html[data-theme="dark"] .rs-go { color: #161616; }
html[data-theme="dark"] .rs-tx em { color: #2F4A3E; }
html[data-theme="dark"] .mock .m-pill { color: #fff; }

/* Home and About */
html[data-theme="dark"] .contact { background: #1B1C21; }
html[data-theme="dark"] .giant { color: #26272C; }
html[data-theme="dark"] .vinny { background: #2A2218; border-color: #3A3B40; }

/* Project pages */
html[data-theme="dark"] .pic, html[data-theme="dark"] .get, html[data-theme="dark"] .gate, html[data-theme="dark"] .steps > li > .n { border-color: #3A3B40; }
html[data-theme="dark"] .blind { background: #3A1428; color: #FF8FC6; }
html[data-theme="dark"] .exit span { color: #8FF0C2; border-color: #2F7A58; }
html[data-theme="dark"] .gate .caught { color: #8FF0C2; }
html[data-theme="dark"] .dd-facets .rwe .k { color: var(--clin-ink); }
html[data-theme="dark"] .rgrid thead th.hot3 { color: #93B1FF; }
html[data-theme="dark"] .card .tag { color: color-mix(in srgb, var(--ws) 55%, #fff); }
html[data-theme="dark"] .sub input[type=email] { background: var(--surface); color: var(--ink); border-color: #3A3B40; }
html[data-theme="dark"] [style*="color:#1F4BFF"], html[data-theme="dark"] [style*="color: #1F4BFF"] { color: #7E9DFF !important; }
/* Line drawings with black strokes sit on a soft light tile so they stay visible */
html[data-theme="dark"] .node svg, html[data-theme="dark"] .why svg, html[data-theme="dark"] .anat .mid svg, html[data-theme="dark"] .lane svg,
html[data-theme="dark"] .results svg, html[data-theme="dark"] .rounds .chart svg { background: #E9EBEF; border-radius: 14px; }
html[data-theme="dark"] .lane svg, html[data-theme="dark"] .results svg, html[data-theme="dark"] .rounds .chart svg { padding: 6px 8px; }

/* Search panel */
html[data-theme="dark"] .ss-sh { background: #1B1C21; border-color: #3A3B40; color: var(--ink); }
html[data-theme="dark"] .ss-top, html[data-theme="dark"] .ss-foot { border-color: #2E3036; }
html[data-theme="dark"] .ss-top svg, html[data-theme="dark"] .ss-in, html[data-theme="dark"] .ss-t { color: #EDEDEA; }
html[data-theme="dark"] .ss-x2, html[data-theme="dark"] .ss-hint { color: #C4C6CC; }
html[data-theme="dark"] .ss-p { color: #5BE3A8; }
html[data-theme="dark"] .ss-x, html[data-theme="dark"] .ss-chips button { background: #2A2B30; color: #EDEDEA; border-color: #5A5D66; }
html[data-theme="dark"] .ss-res a:hover, html[data-theme="dark"] .ss-res a[aria-selected="true"] { background: #22232A; border-color: #5A5D66; }
html[data-theme="dark"] .ss-res mark { color: #161616; }
html[data-theme="dark"] .ss-foot { color: #9A9DA5; }
html[data-theme="dark"] .ss-foot kbd { background: #22232A; border-color: #3A3B40; color: #C4C6CC; }
html[data-theme="dark"] .jump a.dl { background: var(--mint); color: #161616; }
html[data-theme="dark"] .jump a.dl:hover { background: var(--lime); }
html[data-theme="dark"] .port h2, html[data-theme="dark"] .port p b { color: #EDEDEA; }
html[data-theme="dark"] .port p { color: #C4C6CC; }
html[data-theme="dark"] .fnode.end small { color: #FFE0EF; }
html[data-theme="dark"] .contact .fine { color: #9A9DA5; }
html[data-theme="dark"] .eyebrow a { color: var(--ink); }

/* Pop-ups: collection, project and disclaimer panels, and the menu (home and About) */
html[data-theme="dark"] .sheet { background: #1B1C21; box-shadow: 0 0 0 1px #2E3036, 0 30px 60px -24px rgba(0,0,0,.7); }
html[data-theme="dark"] .sheet .x { background: #26272C; color: #EDEDEA; box-shadow: 0 0 0 1px #3A3B40; }
html[data-theme="dark"] .mc { background: #22232A; }
html[data-theme="dark"] .mc .t b { color: #EDEDEA; }
html[data-theme="dark"] .sheet .cta a { color: #161616; }
html[data-theme="dark"] .sheet .shot { border-color: #2E3036; }
html[data-theme="dark"] .modal { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .navcard { background: #1B1C21; box-shadow: 0 0 0 1px #2E3036, 0 20px 40px -20px rgba(0,0,0,.7); }
html[data-theme="dark"] .navcard a { color: #EDEDEA; }
html[data-theme="dark"] .navcard a:hover { color: #FF8FC6; }
html[data-theme="dark"] .cols button { color: color-mix(in srgb, var(--t, #EDEDEA) 55%, #fff); }

/* Interactive pages: primary and pressed buttons, the launch engine's results panel */
html[data-theme="dark"] .btn.pri, html[data-theme="dark"] .btn[aria-pressed="true"] { color: #161616; }
html[data-theme="dark"] .mode button[aria-pressed="true"] small, html[data-theme="dark"] .seg button[aria-pressed="true"] small { color: #4A4D55; }
html[data-theme="dark"] .view .hero, html[data-theme="dark"] main .hero:not(header) { background: #22232A; color: var(--ink); box-shadow: inset 0 0 0 1px #2E3036; }
html[data-theme="dark"] .hero .k3, html[data-theme="dark"] .hero .sub, html[data-theme="dark"] .hero .busy { color: #9A9DA5; }
html[data-theme="dark"] .q .row .btn[aria-pressed="true"] { color: #161616; }

/* ---------- Ask Vinny chatbot (built by vinny.js) ---------- */
.vc-launch { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 55; display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #161616; border-radius: 999px; padding: 5px 18px 5px 5px; box-shadow: 0 18px 36px -16px rgba(0,0,0,.5); font: 700 15px/1 'Bricolage Grotesque', Arial, sans-serif; text-transform: uppercase; letter-spacing: .03em; color: #161616; cursor: pointer; text-align: left; transition: transform .15s; }
.vc-launch:hover { transform: translateY(-2px); }
.vc-launch:focus-visible, .vc button:focus-visible, .vc a:focus-visible { outline: 3px solid #1F4BFF; outline-offset: 2px; }
.vc-launch .vc-av { width: 48px; height: 48px; }
.vc-launch .vc-av svg { width: 38px; height: 38px; }
.vc-launch small { display: block; font: 500 12px/1.2 'DM Sans', Arial, sans-serif; text-transform: none; letter-spacing: 0; color: #5A6172; margin-top: 3px; }
.vc-av { width: 30px; height: 30px; flex: none; border-radius: 999px; background: #FFF4E6; border: 1.5px solid #161616; display: grid; place-items: center; }
.vc-av svg { width: 24px; height: 24px; display: block; }
.vc-tip { position: fixed; right: 24px; bottom: 92px; z-index: 55; background: #161616; color: #fff; border-radius: 14px; padding: 10px 14px; font: 500 14px/1.4 'DM Sans', Arial, sans-serif; max-width: 240px; cursor: pointer; box-shadow: 0 14px 30px -14px rgba(0,0,0,.5); animation: vc-in .25s ease-out; }
.vc-tip::after { content: ""; position: absolute; right: 34px; bottom: -7px; border: 7px solid transparent; border-top-color: #161616; border-bottom: 0; }
.vc-tip[hidden], .vc[hidden], .vc-launch[hidden] { display: none; }
@keyframes vc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vc { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 55; width: 400px; height: min(640px, calc(100vh - 40px)); height: min(640px, calc(100dvh - 40px)); display: flex; flex-direction: column; background: #fff; border: 2px solid #161616; border-radius: 22px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.55); overflow: hidden; font-family: 'DM Sans', Arial, sans-serif; color: #1D2433; animation: vc-in .2s ease-out; }
.vc-h { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: #FFF4E6; border-bottom: 2px solid #161616; }
.vc-h .vc-av { width: 42px; height: 42px; background: #fff; border-width: 2px; }
.vc-h .vc-av svg { width: 34px; height: 34px; }
.vc-h b { display: block; font: 700 18px/1.1 'Bricolage Grotesque', Arial, sans-serif; text-transform: uppercase; color: #161616; }
.vc-h > div { min-width: 0; }
.vc-h small { font-size: 12.5px; color: #434B5C; white-space: nowrap; }
.vc-h .vc-new { margin-left: auto; font: 600 12px/1 'DM Sans', Arial, sans-serif; background: none; border: 0; color: #434B5C; text-decoration: underline; cursor: pointer; padding: 6px; white-space: nowrap; }
.vc-h .vc-x { width: 34px; height: 34px; flex: none; border-radius: 999px; background: #fff; border: 1.5px solid #161616; display: grid; place-items: center; font: 700 20px/1 Arial, sans-serif; color: #161616; cursor: pointer; }
.vc-b { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #FAFAFA; overscroll-behavior: contain; }
.vc-m { display: flex; gap: 8px; align-items: flex-end; }
.vc-bub { background: #fff; border: 1.5px solid #E2E4EC; border-radius: 16px 16px 16px 4px; padding: 10px 12px; font-size: 14px; line-height: 1.5; max-width: 86%; overflow-wrap: anywhere; }
.vc-bub p { margin: 0 0 6px; } .vc-bub p:last-child { margin-bottom: 0; }
.vc-bub ul { margin: 4px 0 6px; padding-left: 18px; } .vc-bub li { margin: 2px 0; }
.vc-u { justify-content: flex-end; }
.vc-u .vc-bub { background: #161616; color: #fff; border-color: #161616; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.vc-err .vc-bub { background: #FFF6E5; border-color: #F0C36A; }
.vc-src { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vc-src a { font: 700 11.5px/1.2 'DM Sans', Arial, sans-serif; letter-spacing: .02em; color: #0B4F33; background: #E9FBF2; border: 1.5px solid #007A4C; border-radius: 999px; padding: 5px 9px; text-decoration: none; }
.vc-src a:hover { background: #C9F5DF; }
.vc-src a.ext { color: #1A2F80; background: #EDF1FF; border-color: #1F4BFF; }
.vc-src a.ext:hover { background: #D9E2FF; }
.vc-launch { transition: transform .2s ease-out; }
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vc-chips button { border: 1.5px solid #161616; border-radius: 999px; padding: 6px 10px; font: 600 12.5px/1.2 'DM Sans', Arial, sans-serif; background: #fff; color: #161616; cursor: pointer; text-align: left; }
.vc-chips button:hover { background: #E8FF5A; }
.vc-typing .vc-bub { display: flex; gap: 4px; padding: 14px; }
.vc-typing i { width: 7px; height: 7px; border-radius: 999px; background: #9AA1AE; animation: vc-dot 1s infinite ease-in-out; }
.vc-typing i:nth-child(2) { animation-delay: .15s; } .vc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vc-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.vc-i { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid #E2E4EC; margin: 0; }
.vc-i textarea { flex: 1; resize: none; border: 1.5px solid #C9CDD6; border-radius: 20px; padding: 10px 14px; font: 400 16px/1.3 'DM Sans', Arial, sans-serif; color: #1D2433; background: #fff; max-height: 120px; }
.vc-i textarea:focus { outline: none; border-color: #161616; }
.vc-i button { width: 42px; height: 42px; flex: none; border-radius: 999px; background: #3DDC97; border: 2px solid #161616; display: grid; place-items: center; font: 800 18px/1 Arial, sans-serif; color: #161616; cursor: pointer; }
.vc-i button:disabled { opacity: .5; cursor: wait; }
.vc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.vc-f { padding: 0 14px 10px; font-size: 11px; line-height: 1.4; color: #5A6172; text-align: center; }
.vc-f a { color: inherit; }
@media (max-width: 640px) {
  .vc { right: 0; bottom: 0; width: 100%; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
  .vc-h { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  .vc-f { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  html.vc-open, html.vc-open body { overflow: hidden; }
  .vc-launch { right: 14px; bottom: 14px; padding: 4px; }
  .vc-launch .vc-lt { display: none; }
  .vc-tip { right: 16px; bottom: 80px; }
  .vc-tip::after { right: 22px; }
}
@media print { .vc, .vc-launch, .vc-tip { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .vc, .vc-tip, .vc-typing i { animation: none; } }
html[data-theme="dark"] .vc-launch { background: #1B1C21; color: #EDEDEA; border-color: #EDEDEA; }
html[data-theme="dark"] .vc-launch small, html[data-theme="dark"] .vc-f, html[data-theme="dark"] .vc-h .vc-new { color: #9A9DA5; }
html[data-theme="dark"] .vc { background: #1B1C21; color: #EDEDEA; border-color: #3A3B40; }
html[data-theme="dark"] .vc-h { background: #2A2218; border-color: #3A3B40; }
html[data-theme="dark"] .vc-h b { color: #EDEDEA; } html[data-theme="dark"] .vc-h small { color: #C4C6CC; }
html[data-theme="dark"] .vc-h .vc-x { background: #26272C; color: #EDEDEA; border-color: #5A5D66; }
html[data-theme="dark"] .vc-b { background: #121316; }
html[data-theme="dark"] .vc-bub { background: #22232A; border-color: #2E3036; }
html[data-theme="dark"] .vc-u .vc-bub { background: #EDEDEA; color: #161616; border-color: #EDEDEA; }
html[data-theme="dark"] .vc-err .vc-bub { background: #2E2414; border-color: #6B5320; }
html[data-theme="dark"] .vc-src a { background: #10291E; color: #8FF0C2; border-color: #2F7A58; }
html[data-theme="dark"] .vc-src a.ext { background: #18213D; color: #93B1FF; border-color: #33437A; }
html[data-theme="dark"] .vc-chips button { background: #26272C; color: #EDEDEA; border-color: #5A5D66; }
html[data-theme="dark"] .vc-chips button:hover { background: #E8FF5A; color: #161616; }
html[data-theme="dark"] .vc-i { border-color: #2E3036; }
html[data-theme="dark"] .vc-i textarea { background: #121316; color: #EDEDEA; border-color: #3A3B40; }
html[data-theme="dark"] .vc-i textarea:focus { border-color: #EDEDEA; }
html[data-theme="dark"] .vc-tip { background: #EDEDEA; color: #161616; } html[data-theme="dark"] .vc-tip::after { border-top-color: #EDEDEA; }

/* Sources: collapsed by default on every page (details/summary) */
.srcs-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.srcs-fold > summary::-webkit-details-marker { display: none; }
.srcs-fold > summary h2 { margin: 0; }
.srcs-fold > summary .srcs-n { font: 600 13px/1 'DM Sans', 'Source Sans 3', Arial, sans-serif; padding: 5px 9px; border-radius: 999px; background: #EFEFEF; color: #434B5C; }
.srcs-fold > summary::after { content: ""; width: 9px; height: 9px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex: none; }
.srcs-fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.srcs-fold > summary:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.srcs-fold > summary:focus-visible { outline: 3px solid #FFB24A; outline-offset: 4px; border-radius: 6px; }
.srcs-fold[open] > summary { margin-bottom: 14px; }
html[data-theme="dark"] .srcs-fold > summary .srcs-n { background: #2A2B30; color: #C4C6CC; }
@media (prefers-reduced-motion: reduce) { .srcs-fold > summary::after { transition: none; } }
.sec > .srcs-fold > summary { border-top: 2px solid var(--ink); padding-top: 10px; }
.sec > .srcs-fold > summary h2 { font-family: var(--f-head, var(--f-display)); font-weight: 700; text-transform: uppercase; font-size: clamp(21px, 2vw, 25px); line-height: 1.2; }
