/* BharatOS: a 1-bit desktop. Two colours (ink + paper), one grey, one accent. */

:root {
  --paper: #fbfaf6;
  --ink: #151515;
  --mute: #6b6861;
  --dot: #d3cfc5;
  --accent: #ff5a1f;
  --ui: "Pixelify Sans", ui-monospace, monospace;
  --body: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bar: 28px;
  color-scheme: light;
}
html.dark {
  --paper: #121212;
  --ink: #ebe8df;
  --mute: #9a968c;
  --dot: #2b2a27;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html.no-js { --paper: #121212; --ink: #ebe8df; --mute: #9a968c; --dot: #2b2a27; color-scheme: dark; }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 99999; background: var(--ink); color: var(--paper); padding: 6px 10px; }
.skip:focus { left: 8px; top: 34px; }

/* ---------- pixel icons ---------- */
.ico { display: inline-flex; line-height: 0; }
.ico svg { width: 100%; height: 100%; }
.px-i { fill: currentColor; }
.px-f { fill: var(--paper); }

/* ---------- buttons ---------- */
.btn {
  font: 15px/1 var(--ui);
  padding: 7px 16px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translate(1px, 1px); box-shadow: none; }
.btn-default { outline: 3px solid var(--paper); box-shadow: 0 0 0 4px var(--ink); }

/* ---------- menu bar ---------- */
.menubar {
  position: fixed; inset: 0 0 auto 0; z-index: 10000;
  height: var(--bar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  font: 15px/1 var(--ui);
}
.menus { display: flex; height: 100%; }
.menu { position: relative; height: 100%; }
.menu-title { height: 100%; padding: 0 11px; display: flex; align-items: center; }
.menu-title.logo .ico { width: 18px; height: 18px; }
.menu.open > .menu-title { background: var(--ink); color: var(--paper); }
.menu.open > .menu-title .px-f { fill: var(--ink); }
.menu-list {
  display: none;
  position: absolute; top: 100%; left: 0;
  min-width: 230px; padding: 4px 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.menu.open > .menu-list { display: block; }
.menu-list button {
  display: flex; justify-content: space-between; gap: 24px;
  width: 100%; padding: 6px 18px 6px 22px; text-align: left; position: relative;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--ink); color: var(--paper); outline: 0; }
.menu-list button[aria-checked="true"]::before { content: "✓"; position: absolute; left: 7px; }
.menu-list kbd { font: inherit; opacity: .55; }
.menu-list hr { border: 0; border-top: 1px dotted var(--ink); margin: 4px 0; }
.menu-right { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.status i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--accent); animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
html:not(.js) .menubar, html.no-js .menus { display: none; }

/* ---------- desktop (only when JS is on and not in recruiter mode) ---------- */
html.os body { overflow: hidden; }
html.os #desktop {
  position: fixed; inset: var(--bar) 0 0 0;
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 6px 6px;
}
.icons {
  position: absolute; top: 14px; right: 12px; bottom: 14px;
  display: flex; flex-flow: column wrap-reverse; align-content: flex-start; align-items: center;
  gap: 10px;
}
.icon {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 92px; padding: 4px 2px;
  font: 14px/1.2 var(--ui);
}
.icon .ico { width: 44px; height: 44px; }
.icon .label { padding: 1px 5px; background: var(--paper); }
.icon.sel .label, .icon:active .label { background: var(--ink); color: var(--paper); }
.icon.sel .px-f, .icon:active .px-f { fill: var(--ink); }
.icon.sel .px-i, .icon:active .px-i { fill: var(--paper); }
.icon:focus-visible { outline-offset: 0; }
.icons .trash { margin-top: auto; }
.icon-inline { margin: 4px auto 2px; }
html:not(.os) .icons, html:not(.os) .note { display: none; }

.marquee { position: absolute; border: 1px dashed var(--ink); pointer-events: none; z-index: 5; }
.zr { position: fixed; border: 1px dotted var(--ink); pointer-events: none; z-index: 9000; }

/* ---------- windows ---------- */
.win {
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
html.os .win {
  position: absolute; display: none; flex-direction: column;
  width: min(var(--w, 560px), calc(100% - 140px));
  max-height: calc(100% - 20px);
}
html.os .win.open { display: flex; }
html.os .win.zooming { visibility: hidden; }
html.os .win.max { left: 6px !important; top: 6px !important; width: calc(100% - 128px); height: calc(100% - 12px); max-height: none; }

.win-bar {
  display: flex; align-items: center; gap: 8px;
  height: 23px; flex: none; padding: 0 7px;
  border-bottom: 1px solid var(--ink);
  user-select: none; -webkit-user-select: none;
  background: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 3px) 0 5px / 100% 12px no-repeat;
}
html.os .win-bar { touch-action: none; cursor: default; }
html.os .win:not(.active) .win-bar { background: none; }
html.os .win:not(.active) .win-btn { visibility: hidden; }
html.os .win:not(.active) .win-title { color: var(--mute); }
.win-title { margin: 0 auto; padding: 0 9px; background: var(--paper); font: 400 15px/23px var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btn { position: relative; flex: none; width: 13px; height: 13px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 0 0 0 2px var(--paper); }
.win-btn:active { background: var(--ink); }
.win-zoom::after { content: ""; position: absolute; left: 0; top: 0; width: 6px; height: 6px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
html:not(.os) .win-btn { visibility: hidden; }

.win-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 22px 24px 18px; }
.infobar { margin: -22px -24px 18px; padding: 4px 24px; border-bottom: 1px solid var(--ink); font: 13px/1.6 var(--ui); color: var(--mute); }

/* ---------- content ---------- */
.hero { font: 600 clamp(32px, 6vw, 46px)/1.05 var(--ui); margin: 4px 0 6px; letter-spacing: -.5px; }
.byline { font: 14px/1.5 var(--ui); color: var(--mute); margin-bottom: 18px; }
.lede { font-size: 15px; }
.h { font: 600 15px/1.3 var(--ui); margin: 0 0 10px; text-transform: lowercase; }
.h::before { content: "# "; color: var(--mute); }
.muted { color: var(--mute); }
.center { text-align: center; }
.joke { color: var(--mute); font-style: italic; }
.rule { border: 0; border-top: 1px dashed var(--ink); margin: 22px 0; }

.facts, .skills { display: grid; grid-template-columns: max-content 1fr; gap: 3px 18px; margin: 16px 0; }
.facts dt, .skills dt { color: var(--mute); }
.facts dd, .skills dd { margin: 0; }
.next { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; }

.job { margin: 0 0 22px; }
.job header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.job h3 { font: 600 17px/1.3 var(--ui); margin: 0; }
.when { font: 13px/1.3 var(--ui); white-space: nowrap; border: 1px solid var(--ink); padding: 1px 7px; }
.where { margin: 0 0 4px; }
.job .joke { margin-bottom: 6px; }
.job li, .certs li { position: relative; padding-left: 18px; margin: 3px 0; }
.job li::before, .certs li::before { content: "–"; position: absolute; left: 2px; }

.proj { margin: 0 0 30px; }
.proj + .proj { padding-top: 26px; border-top: 1px dashed var(--ink); }
.proj-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.proj-head h3 { font: 600 24px/1 var(--ui); margin: 0; }
.num { font: 13px/1 var(--ui); padding: 3px 5px; background: var(--ink); color: var(--paper); }
.kind { font: 13px/1 var(--ui); color: var(--mute); margin-left: auto; }
.art { border: 1px solid var(--ink); margin: 0 0 12px; color: var(--ink); background: var(--paper); }
.art svg { display: block; width: 100%; height: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags span { border: 1px solid var(--ink); padding: 0 7px; font-size: 12px; line-height: 20px; }
.links { display: flex; gap: 18px; margin: 0; }

.list { width: 100%; border-collapse: collapse; margin: 0 0 14px; }
.list th { text-align: left; font: 400 13px/1.4 var(--ui); color: var(--mute); border-bottom: 1px solid var(--ink); padding: 4px 8px 4px 0; }
.list td { padding: 7px 10px 7px 0; border-bottom: 1px dotted var(--ink); vertical-align: top; }
.list tbody tr:hover { background: var(--ink); color: var(--paper); }
.list tbody tr:hover .muted { color: inherit; }
.list tbody tr:hover a { color: var(--paper); }

.mail-row { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 6px 0; border-bottom: 1px dotted var(--ink); }
.mail-row > span { width: 72px; flex: none; color: var(--mute); }
.mail input, .mail textarea { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; flex: 1; min-width: 0; }
.mail input:focus, .mail textarea:focus { outline: 0; }
.mail textarea { display: block; width: 100%; resize: vertical; margin: 12px 0; min-height: 110px; padding: 8px; border: 1px solid var(--ink); }
.mail textarea:focus { outline: 2px dashed var(--accent); outline-offset: 2px; }
.mail ::placeholder { color: var(--mute); opacity: .8; }
.mail-send { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0; }
.elsewhere li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }

.at-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.at-ico { width: 56px; height: 56px; flex: none; }
.at-name { font: 600 22px/1.1 var(--ui); margin: 0 0 4px; }
.mem li { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 10px; margin: 5px 0; }
.mem i { height: 12px; border: 1px solid var(--ink); background: linear-gradient(90deg, var(--ink) var(--p), transparent 0); }
.mem b { font-weight: 400; text-align: right; color: var(--mute); }

/* ---------- sticky note ---------- */
.note {
  position: absolute; left: 32px; bottom: 32px; width: 230px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1.5deg);
  font: 15px/1.5 var(--ui);
}
.note.dragging { transform: none; }
.note-bar { display: flex; justify-content: space-between; align-items: center; padding: 3px 4px 3px 10px; border-bottom: 1px solid var(--ink); font-size: 13px; color: var(--mute); user-select: none; -webkit-user-select: none; touch-action: none; }
.note-x { width: 22px; height: 22px; font-size: 18px; line-height: 1; }
.note-x:hover { background: var(--ink); color: var(--paper); }
.note ul { padding: 10px 14px 12px; }
.note li::before { content: "☐ "; }
.note li.done { text-decoration: line-through; color: var(--mute); }
.note li.done::before { content: "☑ "; }

/* ---------- alert ---------- */
.scrim { position: fixed; inset: 0; z-index: 9500; }
html.os .win.alert, .win.alert {
  position: fixed; z-index: 9600; display: block;
  left: 50%; top: 30%; transform: translate(-50%, -30%);
  width: min(420px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  outline: 1px solid var(--ink); outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--paper), 0 0 0 8px var(--ink), 4px 4px 0 8px var(--ink);
}
.alert-body { display: flex; gap: 16px; align-items: flex-start; }
.alert-ico { width: 40px; height: 40px; flex: none; }
.alert-actions { text-align: right; margin: 6px 0 0; }

/* ---------- boot + shut down ---------- */
#boot { display: none; }
html.booting #boot {
  position: fixed; inset: 0; z-index: 20000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 6px 6px;
  cursor: progress;
}
html.booting body { overflow: hidden; }
.boot-box { width: min(330px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 24px 18px; background: var(--paper); border: 1px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.boot-ico { width: 64px; height: 64px; }
.boot-title { font: 600 20px/1 var(--ui); margin: 4px 0 6px; }
.boot-bar { width: 100%; height: 14px; border: 1px solid var(--ink); }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.boot-msg { font-size: 12px; color: var(--mute); margin: 0; min-height: 1.6em; }
.boot-skip { font: 13px var(--ui); color: var(--mute); margin: 0; }

#shutdown {
  position: fixed; inset: 0; z-index: 20000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--paper); text-align: center; font: 22px/1.4 var(--ui);
}
#shutdown .muted { font-size: 16px; margin-bottom: 18px; }

/* ---------- recruiter mode / no JS: the same windows, stacked like a document ---------- */
.plain-banner { display: none; }
html.js:not(.os) .plain-banner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px;
  max-width: 760px; margin: calc(var(--bar) + 24px) auto 0; padding: 0 20px;
}
.plain-banner p { margin: 0; }
.plain-actions { display: flex; gap: 10px; flex-wrap: wrap; }
html:not(.os) #desktop { max-width: 760px; margin: 0 auto; padding: 24px 20px 80px; }
html.no-js #desktop { padding-top: 40px; }
html:not(.os) .win { margin: 0 0 28px; }
html:not(.os) [data-plain="hide"], html:not(.os) .scrim { display: none !important; }
html:not(.os) .win.alert:not([hidden]) { display: block !important; }

/* ---------- phones ---------- */
@media (max-width: 759px) {
  .status { display: none; }
  .menu-title { padding: 0 9px; }
  html.os #desktop { overflow-y: auto; }
  html.os .icons {
    position: static;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 0;
    padding: 18px 8px 8px;
  }
  .icon { width: auto; font-size: 13px; }
  .icons .trash { margin-top: 0; }
  html.os .note { position: relative; left: auto; bottom: auto; margin: 22px auto 30px; transform: rotate(-1.5deg); }
  html.os .win {
    position: fixed; z-index: 100;
    left: 6px !important; top: calc(var(--bar) + 6px) !important; right: 6px; bottom: 6px;
    width: auto; height: auto; max-height: none;
  }
  html.os .win.max { width: auto; height: auto; }
  html.os .win-bar { height: 32px; background-position: 0 9px; }
  .win-title { line-height: 32px; }
  .win-btn { width: 20px; height: 20px; }
  .win-zoom { display: none; }
  .win-body { padding: 18px 16px 16px; }
  .infobar { margin: -18px -16px 16px; padding: 4px 16px; }
  .facts, .skills { grid-template-columns: 1fr; gap: 0; }
  .facts dd, .skills dd { margin-bottom: 8px; }
  .kind { margin-left: 0; width: 100%; }
  .list thead { display: none; }
  .list td { display: block; padding: 0; border: 0; }
  .list tr { display: block; padding: 8px 0; border-bottom: 1px dotted var(--ink); }
  .mem li { grid-template-columns: 90px 1fr 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .status i { animation: none; }
  .btn:active { transform: none; }
}

/* ---------- print: always the recruiter layout ---------- */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; overflow: visible !important; }
  :root, html.dark { --paper: #fff; --ink: #000; --mute: #444; }
  .menubar, .plain-banner, .icons, .note, #boot, #shutdown, .scrim, .art, .win-btn, .icon-inline, .icon-inline + p,
  .next, .mail, .mail + .rule, [data-plain="hide"], .skip { display: none !important; }
  #desktop { position: static !important; max-width: none !important; padding: 0 !important; background: none !important; overflow: visible !important; }
  .win { position: static !important; display: block !important; width: auto !important; max-height: none !important; box-shadow: none !important; border: 0 !important; margin: 0 0 14px !important; }
  .win-bar { background: none !important; border-bottom: 2px solid #000; padding: 0; height: auto; }
  .win-title { margin: 0; padding: 0; font-size: 15px; }
  .win-body { overflow: visible !important; padding: 10px 0 0 !important; }
  .infobar { display: none; }
  body { font-size: 11px; line-height: 1.45; }
  .hero { font-size: 26px; }
  .job, .proj { break-inside: avoid; margin-bottom: 12px; }
  .proj + .proj { padding-top: 10px; }
  .links a::after, .elsewhere a[href^="http"]::after { content: " (" attr(href) ")"; }
  .elsewhere .muted { display: none; }
}
