/* Paper theme layer for internal pages.
   Loaded after each page's own <style>, so these rules win the cascade.
   Same tokens as index.html and cnvrted.html. */
:root{
    --paper:#efeee9;
    --paper-2:#e7e6e0;
    --ink:#191917;
    --ink-2:rgba(25,25,23,.7);
    --ink-3:rgba(25,25,23,.58);
    --rule:rgba(25,25,23,.2);
    --blue:#2b3bd1;
    --pad:clamp(1.1rem,3.2vw,2.6rem);
    --sans:'Inter Tight','Helvetica Neue',Helvetica,Arial,sans-serif;
    --mono:'JetBrains Mono',ui-monospace,monospace;
}
html{background:var(--paper)}
body{background:var(--paper);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased}
::selection{background:var(--ink);color:var(--paper)}
:focus-visible{outline:1px solid var(--blue);outline-offset:3px}

/* ---- Top bar ---- */
.ptop{position:sticky;top:0;z-index:40;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:1.1rem var(--pad);background:rgba(239,238,233,.86);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.ptop a,.ptop span{font-family:var(--mono);font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;text-decoration:none;color:var(--ink-2);border:0}
.ptop .logo{text-transform:none;letter-spacing:0;font-size:.78rem;font-weight:500;color:var(--ink)}
.ptop .logo span{font-size:inherit;letter-spacing:inherit;text-transform:none;color:var(--ink-3)}
.ptop .mid{color:var(--blue)}
.ptop .right{justify-self:end;transition:color .2s}
.ptop .right:hover,.ptop .logo:hover span{color:var(--ink)}
.ptop .logo{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ptop .right{white-space:nowrap}
@media(max-width:520px){.ptop{gap:.8rem}.ptop .mid{display:none}.ptop{grid-template-columns:1fr auto}}
/* the old fixed bar reserved ~8rem of top padding; the sticky bar takes its own space */
.wrap{padding-top:clamp(3.5rem,9vh,6rem)!important}

/* ---- Display type: light, tight, sentence case ---- */
h1{font-family:var(--sans)!important;font-weight:400!important;text-transform:none!important;letter-spacing:-.055em!important;line-height:.95!important}
h2,h3,article h2,.p-title,.p-num,.m-open,.m-close .line,.loc-city,.npa-title,.vid-title,.item-title,
.fav-title,.substack-title,.pn-title,.q,.c-title{font-family:var(--sans)!important;font-weight:500!important;letter-spacing:-.025em!important}
.m-open,.m-close .line{font-weight:400!important;text-transform:none!important;letter-spacing:-.05em!important}
article .lede{font-family:var(--sans)!important}

/* ---- Footer ---- */
.pfoot{position:relative;z-index:2;border-top:1px dashed var(--rule);margin-top:4rem;padding:3rem 0 2.8rem;font-family:var(--sans)}
.pfoot-in{max-width:1240px;margin:0 auto;padding:0 var(--pad)}
.pfoot .addr{display:grid;grid-template-columns:2.6rem 1fr;gap:.2rem 1.4rem;padding-left:clamp(0rem,12vw,9rem);font-size:clamp(1rem,1.7vw,1.22rem);letter-spacing:-.02em;line-height:1.35}
.pfoot dt{color:var(--ink)}
.pfoot dd{margin:0 0 1.2rem}
.pfoot dd a{color:var(--blue);text-decoration:none;border:0;margin-right:1.1rem;display:inline-block}
.pfoot dd a:hover{text-decoration:underline;text-underline-offset:3px;background:none}
.pfoot .copy{padding-left:clamp(0rem,12vw,9rem);margin-left:4rem;font-size:clamp(1rem,1.7vw,1.22rem);letter-spacing:-.02em;color:var(--ink)}
.pfoot .up{float:right;font-size:1.2rem;color:var(--ink-2);text-decoration:none;border:0}
.pfoot .up:hover{color:var(--blue)}

/* ---- Page-specific contrast fixes ---- */
.p-num{-webkit-text-stroke-color:rgba(25,25,23,.5)!important}
.npa-label{color:var(--ink-2)!important}

/* the India map on /about was tuned for black; give the land some weight on paper */
.loc-map .land{fill:#cfcdc4!important;stroke:#cfcdc4!important}

/* justified paragraphs leave rivers of space on narrow screens */
@media(max-width:700px){p,article p{text-align:left!important}}

/* ---- Code on paper: /now terminal, /manifesto editor, contact decrypt popup ----
   Printed-listing style: a lighter sheet, hairline rules, ink syntax colours, no window chrome. */
:root{
    --sheet:#f6f5f1;
    --code-key:#2b3bd1; --code-str:#a3472a; --code-fn:#7a5600; --code-num:#1f7a4d;
    --code-com:rgba(25,25,23,.6); --code-punct:rgba(25,25,23,.5);
    /* /now */
    --term-bg:var(--sheet); --term-chrome:transparent;
    --g-hash:var(--code-fn); --g-ref:var(--code-num); --g-branch:var(--code-key); --g-prompt:var(--code-key);
    --g-plain:var(--ink); --g-dim:rgba(25,25,23,.58); --g-link:var(--code-key); --g-active:var(--code-num);
    /* /manifesto */
    --ed-bg:var(--sheet); --ed-chrome:transparent; --ed-line:rgba(25,25,23,.06);
    --tok-comment:var(--code-com); --tok-keyword:var(--code-key); --tok-string:var(--code-str); --tok-fn:var(--code-fn);
    --tok-var:var(--ink); --tok-num:var(--code-num); --tok-punct:var(--code-punct); --tok-plain:var(--ink);
}
/* let both pages scroll like documents instead of squeezing the code into one screen */
html:has(.term),html:has(.editor),body:has(.term),body:has(.editor){height:auto!important;overflow:visible!important}
body:has(.term){display:block!important}
body:has(.term) .wrap,body:has(.editor) .wrap{height:auto!important;min-height:0}
body .term,body .editor{flex:none;border:1px solid var(--rule);border-radius:4px;background:var(--sheet);box-shadow:none}
body .term-body{flex:none;overflow:visible;max-height:none;scrollbar-color:auto}
body .code{overflow-x:auto;overflow-y:visible}
body .term-bar,body .ed-bar{background:transparent;border-bottom:1px solid var(--rule);padding-top:.75rem;padding-bottom:.75rem}
body .dots{display:none}
body .term-title,body .ed-tab{color:var(--ink-2);font-size:.68rem}
body .ed-tab .dot{color:var(--code-key)}
body .ed-meta,body .ed-bar .ed-meta{color:var(--ink-3)}
body .term-side{border-left-color:var(--rule)}
body .subject{color:var(--ink);font-weight:500}
body .c-body{border-left-color:var(--rule);color:var(--ink-2);font-weight:400}
body .c-body a{border-bottom-color:rgba(43,59,209,.3)}
body .c-body a.trailer{width:fit-content;border-bottom:0}
body .c-body a.trailer:hover{text-decoration:underline;text-underline-offset:3px}
body .badge{border-color:rgba(31,122,77,.45)}
body .badge.ended{border-color:var(--rule);color:var(--ink-3)}
body .np-t{color:var(--ink)}
body .gh-widget{border-top-color:var(--rule)}
body .gh-link{background:#fff;border:1px solid var(--rule)}
body .l::before{color:rgba(25,25,23,.32)}
body .l:hover{background:rgba(25,25,23,.035)}
body .ed-foot{background:transparent;border-top:1px solid var(--rule);color:var(--ink-3)}
body .ed-foot .ok{color:var(--code-num)}
body .run-btn{color:var(--code-key);background:transparent;border:1px solid rgba(43,59,209,.45);border-radius:999px}
body .run-btn:hover{background:rgba(43,59,209,.07);border-color:var(--code-key)}
body .console{background:#efeee9}
body .editor.open .console{border-left:1px solid var(--rule)}
body .con-head{background:transparent;border-bottom:1px solid var(--rule)}
body .con-title,body .con-status.done{color:var(--ink-3)}
body .con-status{color:var(--code-num)}
body .con-spin,body .con-cur{background:var(--code-key)}
body .con-stop{border-color:var(--rule);color:var(--ink-2)}
body .con-stop:hover{color:var(--ink);border-color:var(--ink-2)}
body .con-body .cmd{color:var(--ink)}
body .con-body .out{color:var(--code-num)}
body .con-body .dim{color:var(--ink-3)}
@media(max-width:640px){
    body .editor.open .console{border-left:0;border-top:1px solid var(--rule)}
    /* wrap long lines with a hanging indent so the manifesto reads without sideways scrolling */
    body .code pre{min-width:0}
    body .l{white-space:pre-wrap;padding-left:3.1rem;text-indent:-3.1rem;padding-right:1rem}
    body .l::before{box-sizing:border-box;width:3.1rem;padding-right:.8rem;text-indent:0}
}

body .decrypt-win{background:var(--sheet);border:1px solid var(--rule);border-radius:6px;box-shadow:0 24px 60px rgba(25,25,23,.14)}
body .dw-bar{background:transparent;border-bottom:1px solid var(--rule)}
body .dw-status{background:var(--code-key);box-shadow:none}
body .dw-file{color:var(--ink-2)}
body .dw-close{color:var(--ink-3)}
body .dw-close:hover{color:var(--ink)}
body .dw-body{color:var(--ink)}
body .dw-log .sys{color:var(--code-key)}
body .dw-log .dim{color:var(--ink-3)}
body .dw-out{color:var(--code-str)}
body .dw-cur{background:var(--code-key)}

/* ---- Leftovers from the dark theme ---- */
.ghost,.site-foot{display:none!important}
