/* NIRANJAN — purpose-built night palette. The rope never inverts the page or a photo. */
:root { color-scheme: light; }
html { transition: background-color .5s ease; }
html.night {
  color-scheme: dark;
  --ink: #f4eee8;
  --clay: #d69b76;
  --claylight: #c88d6a;
  --muted: #c0b3aa;
  --bg: #24201e;
  --paper: #302925;
  --line: #554942;
  --dark: #191614;
  background: #24201e;
}
html.night body { filter: none !important; color: var(--ink); background: var(--bg); }
html.night img, html.night video, html.night canvas, html.night svg { filter: none; }
html.night .hero-right .photo-frame img { filter: grayscale(1) saturate(.28) contrast(1.075) !important; }
html.night .hero-right .photo-frame.is-color-flash img { filter: grayscale(0) saturate(1.12) contrast(1.025) !important; }
html.night .hero-right .photo-frame { filter: none !important; background: transparent; }
html.night .hero-right::before { background: radial-gradient(ellipse at center,rgba(210,148,100,.2),transparent 70%); }
html.night .site-header,
html.night .site-header.is-scrolled { background: rgba(37,32,30,.97)!important; border-color: #574b43; box-shadow: 0 8px 30px #0002; }
html.night .site-header .site-logo,
html.night .site-header .desktop-nav a:is(:hover,:focus-visible,.active) { color: #f6eee7; }
html.night .site-header .desktop-nav a { color: #baada4; }
html.night .site-header .desktop-nav a::after { background: #d39a77; }
html.night .ist-clock { color: #cabdb2; }
html.night .round-pill { background: #38312d; color:#f5ede7; border-color:#776258; }
html.night .round-pill:hover { background: #514039; color: #fff7f0; }
html.night .menu-toggle { border-color: #78685e; }
html.night .menu-toggle span { background: #f5ece4; }
html.night .hero { background: #24201e; }
html.night .hero-left #heroTitle { color:#f3ede8; }
html.night .hero-left #heroTitle span { color:#c0b4ab; }
html.night .status-line, html.night .hero-bottom { color:#d5c9be; }
html.night .hero-bottom { border-color:#514641; }
html.night .hero-bottom a { color:#eee3d8; }
/* The notebook stays a tactile, pale object against the dark background. */
html.night .hero-left .pad { color:#161513; background:linear-gradient(180deg,#fffdf8,#eae5dd); box-shadow:0 3px #bcb5aa,0 7px #a59e94,0 11px #726d67,6px 19px 0 #100d0c,7px 26px 28px #0005; }
html.night .hero-left .pad small { color:#666059; }
html.night .hero-left .rings i { border-color:#878076; border-left-color:#d5d0c9; }
html.night .hero-ability-pill { background:#1c1616dc; border-color:#dfc7b4; color:#f8f0e8; }
/* Section surfaces and text colors — explicit contrast instead of photo inversion. */
html.night .doors-section { background:#302925; }
html.night .doors-section .section-side p,
html.night .section-head p,
html.night .section-side p { color:#cfc3b8; }
/* Keep the architectural door scene softly lit, as a real room. */
html.night .door-stage { background: radial-gradient(ellipse at 50% 0%,#cec1b4 0%,#b7a79c 68%,#a99588 100%); color:#2b2420; }
html.night .door-index,html.night .door-stage .door-visit { color:#342c26; }
html.night .door-footnote,html.night .door-stage .door-wrap h3 { color:#2b2420; }
html.night .drag-hint { color:#d2bbaa; }
html.night .projects-section { background:#24201e; }
html.night .project-info p,html.night .project-role,html.night .project-depth { color:#d6c9be; }
html.night .tag-row span { color:#e8dbd0;border-color:#7a675b; }
html.night .project-feature-clean .project-visual,html.night .project-visual { background:#51443c; }
html.night .project-feature .text-link,html.night .moment-detail-link { color:#f7e6d9; }
html.night .moments-section { background:#29231f; }
html.night .moment-tab { color:#c0b1a6; }
html.night .moment-tab.active,html.night .moment-tab:hover { color:#fff4ea; }
html.night .moment-tab.active { background:linear-gradient(90deg,#79513a40,transparent); }
html.night .moment-tab small, html.night .moment-detail>p { color:#cfc0b4; }
html.night .moment-detail-link { border-color:#ad9789; }
html.night .story-section,html.night .timewalk { background:#292321; color:#f5ede7; }
html.night .timeface { background:#2f2925; }
html.night .timeposts { color:#f5ede7; }
html.night .timeposts p, html.night .timeposts li,html.night .timeposts strong { color:#e2d2c6; }
html.night .about-section { background:#332c28; }
html.night .about-copy p { color:#d6c8bc; }
html.night .about-photo-mat { background:#4c3f37; }
html.night .credentials-section { background:#26211e; }
html.night .credential-row p, html.night .cert-row small,html.night .credentials-note { color:#d3c5b9; }
html.night .credentials-layout h3 { color:#f3eae3; }
html.night .cert-row { border-color:#584c43; color:#eee4dc; }
html.night .cert-row:hover { background:#392f29; }
html.night .skills-section { background:#39312c; }
html.night .skills-cloud span { color:#eee1d6; background:#494039; border-color:#67564c; }
html.night .skills-card-cta { border-color:#957a67;color:#f3e4d6; }
html.night .focus-section { background:#28231f; color:#f3eae3; border-color:#51463c; }
html.night .focus-section p,html.night .focus-section li,html.night .focus-section small { color:#d5c8be; }
html.night .contact-section { background:#171412; }
html.night .site-footer,html.night .premium-footer { background:#100e0d; }
html.night .text-link { color:#f4e8dd; }
/* Never alter modals, their portraits, or other media. */
html.night .ability-world,html.night .contact-dialog,html.night .modal-layer { filter:none!important; }
html.night .contact-dialog { background:#f6f2ee; color:#1a1818; color-scheme:light; }
html.night .wizard-step,html.night .wizard-step h2 { color:#1a1818; }
/* Pull cord: a refined wall switch, not a screen-wide photographic filter. */
#cord { position:fixed; top:var(--nav-height,78px); right:clamp(10px,2vw,26px); width:34px; height:178px; z-index:200; cursor:grab; touch-action:pan-y; }
#cord:active { cursor:grabbing; }
#cord:before { left:15px; bottom:29px; width:3px; background:repeating-linear-gradient(55deg,#725c4e 0 1px,#d2bda8 2px 4px); }
#cord i { left:5px;bottom:0;width:26px;height:38px;background:linear-gradient(90deg,#4f3729,#ad7956 40%,#4b3025);box-shadow:0 6px 12px #0004; }
#cord:hover i,#cord:focus-visible i { box-shadow:0 7px 18px #bd8755b0; }
html.night #cord i { background:linear-gradient(90deg,#8f725a,#d6bb99 42%,#836146); }
#cord:focus-visible { outline:3px solid #bd835e; outline-offset:4px; border-radius:18px; }
@media(max-width:850px){#cord{height:126px;right:3px;width:30px;top:var(--nav-height,76px)}#cord:before{left:13px}#cord i{left:3px;width:24px;height:34px}}
@media(prefers-reduced-motion:reduce){html,html.night .hero-right .photo-frame img{transition:none!important}}

/* Hero CTAs remain readable in both modes. */
html.night .hero-actions .primary-btn { background:#f6f2ee!important;color:#1a1818!important;border-color:#f6f2ee!important; }
html.night .hero-actions .primary-btn .circle-arrow {background:#211c1b!important;color:#fff7f0!important;}
html.night .hero-actions .secondary-btn { background:transparent!important;color:#f7eee5!important;border-color:#c6b6aa!important; }
html.night .hero-actions .primary-btn:hover {background:#e6d1c0!important;}
html.night .hero-actions .secondary-btn:hover { background:#39302b!important; }
/* Real secondary pages also follow the selected mode. */
html.night .work-hero { background:#24201e; }
html.night .work-hero p, html.night .work-case p, html.night .work-case li,
html.night .work-case-stack { color:#d6c8bd; }
html.night .work-stack { background:#2b2521; }
html.night .work-case { border-color:#51463f; }
html.night .work-case .text-link { color:#f5e6d9; }
html.night .work-contact { background:#191512; }
html.night .privacy-content { color:#f4e9df; }
html.night .privacy-content p, html.night .privacy-content li { color:#d4c5b8; }
html.night .back-link { color:#f6eee8; border-color:#d3bbaa; }
/* On a phone keep the cord at the page edge without blocking menu buttons. */
@media(max-width:600px){#cord{width:30px;right:2px;height:118px;opacity:.94}#cord:before{left:13px;bottom:27px}#cord i{left:3px;width:24px;height:32px}}
/* Mobile overlay must not reverse colors through --ink/--paper tokens. */
html.night .mobile-menu { background:#201b18!important; color:#f7eee7!important; }
html.night .mobile-menu>a { color:#f7eee7; border-color:#574a43; }
html.night .mobile-menu-top,html.night .mobile-close {color:#f7eee7;}
html.night .door-gallery-section .gallery-header p { color:#d1c0b3; }
html.night .door-gallery-section .gallery-header .kicker { color:#d7a47c; }
