/* Cargo-style desktop shell for the whole portfolio. */

:root {
  color-scheme: dark;
  --desk-bg: #000;
  --desk-ink: #f7f7f5;
  --desk-dim: rgba(255, 255, 255, 0.68);
  --desk-line: rgba(255, 255, 255, 0.18);
  --desk-panel: #f5f3ea;
  --desk-panel-ink: #151515;
  --desk-note: #fff48f;
  --desk-menu-height: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--desk-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--desk-bg);
  color: var(--desk-ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Home page background image */
.desk-home {
  background-image: url("/assets/bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* faint film grain over the black desktop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.075;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 1px dashed rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: -60px;
  left: 12px;
  padding: 8px 12px;
  background: var(--desk-note);
  color: #111;
  font-size: 12px;
  text-decoration: none;
}

.skip-link:focus {
  top: 36px;
}

/* ---------------------------------------------------------------- menubar */

.desk-menubar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9000;
  height: var(--desk-menu-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.desk-menubar__group {
  display: flex;
  align-items: center;
  gap: 19px;
  min-width: 0;
}

.desk-menubar__brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.desk-menubar__clock {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.desk-menu-wrap {
  position: relative;
}

.desk-menu-trigger {
  padding: 2px 1px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.desk-menu-trigger[aria-expanded="true"],
.desk-menu-trigger:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.desk-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: -10px;
  z-index: 9100;
  min-width: 198px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  background: #161616;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  color: var(--desk-ink);
}

.desk-menu[hidden] {
  display: none;
}

.desk-menu a,
.desk-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.desk-menu a:hover,
.desk-menu button:hover {
  background: #2d64b4;
}

.desk-menu small {
  color: var(--desk-dim);
  font-size: 10px;
}

/* ------------------------------------------------------------ sticky note */

.desk-note {
  position: absolute;
  z-index: 20;
  top: 12vh;
  left: clamp(22px, 8vw, 130px);
  width: clamp(210px, 19vw, 280px);
  padding: 1.1rem;
  background: var(--desk-note);
  border: 1px solid rgba(0, 0, 0, 0.19);
  border-radius: 0.3rem;
  box-shadow: 0.1rem 0.1rem 0.6rem rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.85);
  font-size: 13px;
  line-height: 1.42;
  transform: rotate(-0.25deg);
  cursor: grab;
  touch-action: none;
}

.desk-note:active {
  cursor: grabbing;
}

.desk-note__text > a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.desk-caret {
  display: inline-block;
  animation: desk-blink 1.2s steps(1, end) infinite;
}

@keyframes desk-blink {
  50% {
    opacity: 0;
  }
}

/* ------------------------------------------------------------ desktop icons */

.desk-main {
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.desk-icons {
  position: absolute;
  inset: var(--desk-menu-height) 0 0;
  z-index: 10;
  list-style: none;
  margin: 0;
  padding: 0;
}

.desk-icon {
  position: absolute;
  left: calc(var(--x, 50) * 1%);
  top: calc(var(--y, 20) * 1%);
  z-index: var(--z, 1);
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #fff;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transform: translateX(-50%);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.desk-icon__art {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  transition: transform 140ms ease;
}

.desk-icon__art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.desk-icon__art--round svg {
  border-radius: 50%;
}

.desk-icon:hover .desk-icon__art,
.desk-icon:focus-visible .desk-icon__art {
  transform: translateY(-3px) scale(1.03);
}

.desk-icon__label {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 5px #000, 0 0 9px #000;
  overflow-wrap: anywhere;
}

.desk-icon.is-selected .desk-icon__label {
  background: #2d64b4;
  text-shadow: none;
  padding: 1px 3px;
}

.desk-hint {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 15;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  pointer-events: none;
}

/* --------------------------------------------------------------- windows */

.desk-window-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(0, 0, 0, 0.28);
}

.desk-window-backdrop[hidden] {
  display: none;
}

.desk-window {
  position: fixed;
  z-index: 9300;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 36px));
  max-height: min(76vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--desk-panel);
  color: var(--desk-panel-ink);
  border: 1px solid #111;
  border-radius: 5px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.72);
  transform: translate(-50%, -50%);
}

.desk-window[hidden] {
  display: none;
}

.desk-window__bar {
  flex: 0 0 auto;
  height: 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 9px;
  background: #dedcd3;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  cursor: move;
  touch-action: none;
}

.desk-window__lights {
  display: flex;
  gap: 6px;
}

.desk-window__lights i {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  background: #ff5f57;
}

.desk-window__lights i:nth-child(2) {
  background: #febc2e;
}

.desk-window__lights i:nth-child(3) {
  background: #28c840;
}

.desk-window__title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.desk-window__close {
  justify-self: end;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
  color: #111;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.desk-window__body {
  overflow-y: auto;
  padding: clamp(20px, 4vw, 38px);
  font-size: 14px;
  line-height: 1.55;
}

.desk-window__body h2 {
  margin: 0 0 16px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.desk-window__body p {
  max-width: 62ch;
  margin: 0 0 14px;
}

.desk-window__kicker {
  margin-bottom: 18px !important;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.desk-window__meta {
  color: #777;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.desk-window a {
  color: #1b4fa0;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.desk-email {
  display: inline-block;
  margin: 6px 0 16px;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.desk-window__socials {
  display: flex;
  gap: 18px;
}

.desk-inline-link {
  border: 0;
  padding: 0;
  background: none;
  color: #1b4fa0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.desk-capabilities {
  margin: 22px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.desk-capabilities li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.desk-capabilities li > span {
  color: #999;
  font-size: 11px;
}

.desk-capabilities em {
  color: #777;
  font-size: 11px;
  font-style: normal;
}

.desk-projects {
  display: grid;
  gap: 1px;
  background: rgba(0, 0, 0, 0.13);
  border: 1px solid rgba(0, 0, 0, 0.13);
}

.desk-project {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  background: var(--desk-panel);
  color: var(--desk-panel-ink);
  text-decoration: none;
}

.desk-project:hover {
  background: #ebe8dc;
}

.desk-project img {
  width: 74px;
  height: 48px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #fff;
}

.desk-project strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.desk-project small {
  display: block;
  margin-top: 3px;
  color: #777;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.desk-project em {
  color: #777;
  font-style: normal;
}

.desk-window[data-window="practice"] {
  width: min(600px, calc(100vw - 36px));
}

.desk-window[data-window="practice"] .desk-window__body {
  padding: 0;
  background: #000;
}

.desk-practice-media {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  background: #000;
  border: 0;
}

.desk-practice-media img {
  display: block;
  width: 100%;
  height: auto;
}

.desk-profile {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.desk-profile > svg {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.desk-profile .desk-window__kicker {
  margin-bottom: 8px !important;
}

.desk-notes {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.desk-notes li {
  padding: 9px 0 9px 26px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  position: relative;
}

.desk-notes li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #999;
}

.desk-archive-list {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.desk-archive-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.desk-archive-list li > span {
  color: #999;
  font-size: 11px;
}

.desk-archive-list em {
  color: #777;
  font-size: 11px;
  font-style: normal;
}

.desk-cv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.desk-cv-head .desk-window__kicker {
  margin-bottom: 7px !important;
}

.desk-cv-pdf {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.desk-cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 14px 0 0 !important;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  color: #555;
  font-size: 12px;
}

.desk-cv-section {
  margin-top: 22px;
}

.desk-cv-section h3 {
  margin: 0 0 9px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.desk-cv-section p,
.desk-cv-section ul {
  margin: 0 0 9px;
}

.desk-cv-section ul {
  padding-left: 18px;
}

.desk-cv-section li + li {
  margin-top: 5px;
}

.desk-cv-entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.desk-cv-entry span {
  flex: 0 0 auto;
  color: #777;
  font-size: 11px;
  white-space: nowrap;
}

.desk-cv-place {
  color: #777;
  font-size: 12px;
}

/* ------------------------------------------- case-study and 404 pages */

body.desk-page {
  min-height: 100vh;
}

body.desk-page > .site-header,
body.desk-page > .site-footer,
body.desk-page > .to-top,
body.desk-page > dialog.menu,
body.desk-page > .load_grid,
body.desk-page > #portfolio-esc-fx {
  display: none !important;
}

body.desk-page main#main {
  position: relative;
  z-index: 30;
  width: min(920px, calc(100vw - 36px));
  margin: calc(var(--desk-menu-height) + 5vh) auto 12vh;
  padding: 0 0 34px;
  background: var(--desk-panel);
  color: var(--desk-panel-ink);
  border: 1px solid #111;
  border-radius: 5px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.72);
}

body.desk-page main#main::before {
  content: "case file / misbah haque";
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  background: #dedcd3;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  color: #333;
  font-size: 12px;
  font-weight: 600;
}

body.desk-page main#main > article,
body.desk-page main#main > section {
  padding: 0 clamp(20px, 4vw, 46px);
}

body.desk-page .case-hero,
body.desk-page .notice {
  padding-top: clamp(26px, 4vw, 44px);
}

body.desk-page .case-title,
body.desk-page .notice-title {
  color: var(--desk-panel-ink);
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

body.desk-page .case-lede,
body.desk-page .notice-copy,
body.desk-page .prose p,
body.desk-page .prose li,
body.desk-page .prose h2,
body.desk-page .prose h3,
body.desk-page .case-meta dt,
body.desk-page .case-meta dd,
body.desk-page .case-kicker,
body.desk-page .case-actions a {
  color: var(--desk-panel-ink);
}

body.desk-page .case-body,
body.desk-page .prose code {
  background: rgba(0, 0, 0, 0.05);
  color: var(--desk-panel-ink);
}

body.desk-page .case-meta div,
body.desk-page .case-actions,
body.desk-page .case-next,
body.desk-page .prose h2 {
  border-color: rgba(0, 0, 0, 0.18);
}

body.desk-page .case-actions a {
  border-color: rgba(0, 0, 0, 0.4);
}

body.desk-page .case-actions a:hover,
body.desk-page .case-next a:hover,
body.desk-page .link-arrow:hover {
  opacity: 0.6;
}

body.desk-page .link-arrow,
body.desk-page .link-arrow svg {
  color: #1b4fa0;
  stroke: #1b4fa0;
}

.desk-icons--inner {
  position: fixed;
  top: calc(var(--desk-menu-height) + 14px);
  left: 14px;
  right: auto;
  bottom: auto;
  width: 84px;
  height: auto;
  z-index: 40;
}

.desk-icons--inner .desk-icon {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  margin-bottom: 10px;
}

.desk-icons--inner .desk-icon__art {
  width: 44px;
  height: 44px;
}

.desk-icons--inner .desk-icon__label {
  font-size: 11px;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  :root {
    --desk-menu-height: 26px;
  }

  .desk-home {
    background-attachment: scroll;
  }

  .desk-menubar__group {
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .desk-menubar__group::-webkit-scrollbar {
    display: none;
  }

  .desk-menubar__clock {
    font-size: 10px;
  }

  .desk-note {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: calc(var(--desk-menu-height) + 22px) auto 12px;
    transform: none;
    cursor: default;
    touch-action: auto;
  }

  .desk-main {
    padding-bottom: 100px;
  }

  .desk-icons {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 4px;
    padding: 20px 14px 40px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .desk-icon {
    position: static;
    top: auto;
    left: auto;
    width: auto;
    transform: none;
    touch-action: manipulation;
  }

  .desk-icon__art {
    width: 52px;
    height: 52px;
  }

  .desk-icon__label {
    font-size: 11px;
  }

  .desk-hint {
    position: static;
    margin: 0 16px 24px;
    text-align: center;
  }

  .desk-window,
  body.desk-page main#main {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 42px);
  }

  .desk-window {
    top: 12px;
    left: auto;
    right: auto;
    transform: none;
  }

  .desk-capabilities li {
    grid-template-columns: 28px 1fr;
  }

  .desk-capabilities em,
  .desk-archive-list em {
    grid-column: 2;
  }

  .desk-archive-list li {
    grid-template-columns: 28px 1fr;
  }

  .desk-profile,
  .desk-cv-head,
  .desk-cv-entry {
    flex-direction: column;
  }

  .desk-cv-entry {
    gap: 3px;
  }

  .desk-project {
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    padding: 8px;
  }

  .desk-project img {
    width: 56px;
    height: 40px;
  }

  .desk-icons--inner {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    max-width: 100vw;
    margin: calc(var(--desk-menu-height) + 8px) 0 0;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .desk-icons--inner .desk-icon {
    width: 76px;
    margin: 0;
  }

  body.desk-page main#main {
    margin: 18px auto 60px;
    max-height: none;
  }
}

@media (max-width: 480px) {
  :root {
    --desk-menu-height: 24px;
  }

  .desk-menubar {
    padding: 0 8px;
  }

  .desk-menubar__brand {
    font-size: 11px;
  }

  .desk-note {
    width: calc(100% - 24px);
    margin: calc(var(--desk-menu-height) + 16px) auto 8px;
    padding: 0.85rem;
    font-size: 12px;
  }

  .desk-icons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 8px;
    padding: 16px 12px 32px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .desk-icon__art {
    width: 48px;
    height: 48px;
  }

  .desk-icon__label {
    font-size: 10px;
  }

  .desk-hint {
    font-size: 10px;
    margin: 0 12px 20px;
  }

  .desk-window,
  body.desk-page main#main {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 36px);
  }

  .desk-window {
    top: 8px;
    left: auto;
    right: auto;
  }

  .desk-window__body {
    padding: clamp(16px, 3vw, 28px);
    font-size: 13px;
  }

  .desk-window__body h2 {
    font-size: clamp(20px, 3.5vw, 28px);
  }

  .desk-project {
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "img name"
      "img cat";
    gap: 8px;
    padding: 6px;
  }

  .desk-project img {
    grid-area: img;
    width: 48px;
    height: 36px;
  }

  .desk-project strong {
    grid-area: name;
    font-size: 13px;
  }

  .desk-project small {
    grid-area: cat;
    font-size: 9px;
  }

  .desk-project em {
    display: none;
  }

  .desk-icons--inner {
    gap: 12px;
    padding: 0 6px;
  }

  .desk-icons--inner .desk-icon {
    width: 68px;
  }

  .desk-icons--inner .desk-icon__art {
    width: 40px;
    height: 40px;
  }

  .desk-icons--inner .desk-icon__label {
    font-size: 10px;
  }

  body.desk-page main#main {
    margin: 12px auto 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desk-caret {
    animation: none;
  }

  .desk-icon__art {
    transition: none;
  }
}
