@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Special+Elite&display=swap");

/* Desk World — the page is a table. Lift from Hands felt + tool .dsc */

body.desk-page {
  --felt: #1a3d2a;
  --felt2: #143224;
  --felt-hi: #2a5540;
  --felt-glow: rgba(60, 120, 80, 0.15);
  --text: #e8f0e4;
  --dim: #9ab09a;
  --brass: #c4a060;
  --brass-hi: #e8d090;
  background: #0e1a14;
  color: var(--text);
}

body.desk-page .site-rail {
  background: color-mix(in srgb, #e7ecf4 94%, #fff);
  color: #151a28;
}

body.desk-page .site-rail .brand small,
body.desk-page .site-rail .now-chip {
  color: #5c6578;
}

.dw-office {
  max-width: 1180px;
  width: auto;
  margin: 0.55rem var(--pad) 2.2rem;
  border: 1px solid #0a120c;
  box-shadow: 0 12px 28px #00000066;
}

.dw-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2.2rem;
  padding: 0 0.7rem;
  background: linear-gradient(180deg, #1a2820 0%, #121c16 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.dw-rail strong {
  color: var(--brass-hi);
  font-weight: 500;
}

.dw-felt {
  padding: 0.75rem 1rem 1.3rem;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 11px,
      rgba(0, 0, 0, 0.1) 11px 12px
    ),
    linear-gradient(180deg, var(--felt-hi) 0%, var(--felt) 48%, var(--felt2) 100%);
  box-shadow: inset 0 0 40px var(--felt-glow);
}

.dw-lead h1 {
  margin: 0 0 0.25rem;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: clamp(1.55rem, 3.4vw, 2.2rem);
  font-weight: 400;
  color: var(--brass-hi);
}

.dw-lead .pg-lede {
  margin: 0 0 0.85rem;
  max-width: 68ch;
  color: var(--dim);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.dw-lead .pg-lede kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78em;
  color: var(--brass-hi);
}

.dw-lead .fm-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.45rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--brass);
}

.dw-stage {
  display: grid;
  grid-template-columns: 1fr minmax(16rem, 34%);
  min-height: 34rem;
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.18);
}

.dw-cloth {
  min-height: 34rem;
  overflow: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dw-cloth::-webkit-scrollbar {
  display: none;
}

.dw-surface {
  position: relative;
  width: 100%;
  min-width: 42rem;
  height: 34rem;
}

.dw-piece {
  position: absolute;
  z-index: 2;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.dw-piece.is-held {
  position: absolute;
  z-index: 40;
  cursor: grabbing;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.dw-piece.is-hand {
  outline: 1px solid rgba(232, 220, 170, 0.55);
  outline-offset: 3px;
}

.dw-piece.is-in {
  position: relative;
  left: auto !important;
  top: auto !important;
  transform: scale(0.55);
  transform-origin: top left;
  margin: 0.1rem 0 0;
  width: 11rem;
}

.dw-pocket {
  min-height: 0.4rem;
}

.dw-hint {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}

.dw-space.is-held {
  outline: none;
}

/* envelopes */
.dw-env {
  width: 168px;
  height: 104px;
  display: flex;
  flex-direction: column;
  filter: drop-shadow(1px 2px 5px rgba(0, 0, 0, 0.28));
}

.dw-env .env-flap {
  flex: 0 0 22%;
  min-height: 18px;
  background: linear-gradient(180deg, #c4b48e 0%, #b5a47c 55%, #a8966c 100%);
  border: 1px solid rgba(70, 58, 40, 0.4);
  border-bottom: none;
  clip-path: polygon(0 100%, 0 38%, 50% 0, 100% 38%, 100% 100%);
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.22);
  z-index: 2;
}

.dw-env .env-body {
  flex: 1;
  margin-top: -1px;
  padding: 0.28rem 0.35rem 0.2rem;
  background: linear-gradient(165deg, #d2c29a 0%, #c4b28a 48%, #b5a37a 100%);
  border: 1px solid rgba(70, 58, 40, 0.42);
  color: #3a3228;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  overflow: hidden;
}

.dw-env .env-label {
  display: inline-block;
  padding: 0.08rem 0.24rem;
  background: linear-gradient(165deg, #f2e8d4, #ddd0b4);
  border: 1px solid rgba(90, 70, 48, 0.4);
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 0.72rem;
  color: #2a2018;
}

.dw-env.is-oak .env-flap {
  background: linear-gradient(180deg, #a89068, #887048);
}

.dw-env.is-oak .env-body {
  background: linear-gradient(165deg, #b8a078, #988058);
}

.dw-env.is-velvet .env-flap {
  background: linear-gradient(180deg, #2a181c, #120c0e);
  clip-path: polygon(0 100%, 0 40%, 50% 4%, 100% 40%, 100% 100%);
}

.dw-env.is-velvet .env-body {
  background:
    radial-gradient(ellipse at 30% 20%, #2a1c20 0%, transparent 55%),
    linear-gradient(165deg, #1c1416, #0e0a0c);
  color: #e8dcd0;
}

.dw-env.is-velvet .dw-hint {
  color: #c8b0b4;
}

/* leaf / card */
.dw-leaf,
.dw-card {
  position: absolute;
  background:
    linear-gradient(165deg, #ebe0c4 0%, #e0d0a8 42%, #e4d4b0 72%, #c8b48a 100%);
  border: 1px solid rgba(70, 48, 24, 0.5);
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255, 248, 230, 0.35) inset,
    2px 4px 12px rgba(0, 0, 0, 0.35);
  color: #2a1c10;
  font-family: "Special Elite", "Courier New", monospace;
}

.dw-leaf {
  width: 9.2rem;
  min-height: 6.6rem;
  padding: 0.65rem 0.6rem 0.45rem;
}

.dw-leaf.is-lined {
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent calc(1.15rem - 1px),
      rgba(200, 184, 152, 0.42) calc(1.15rem - 0.9px),
      rgba(200, 184, 152, 0.42) 1.15rem
    ),
    linear-gradient(165deg, #ebe0c4 0%, #e0d0a8 42%, #e4d4b0 72%, #c8b48a 100%);
}

.dw-leaf.is-letter {
  background: linear-gradient(180deg, #f6f1e4, #efe6d2);
  font-family: Georgia, "Times New Roman", serif;
}

.dw-card {
  width: 7rem;
  min-height: 4.8rem;
  padding: 0.5rem 0.45rem 0.35rem;
}

.dw-leaf .k,
.dw-card .k {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}

.dw-leaf h3,
.dw-card h3 {
  margin: 0.15rem 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 400;
}

.dw-leaf p,
.dw-card p {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.35;
}

.dw-key {
  width: 3.4rem;
  height: 3.4rem;
}

.dw-key .key-cap {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f4efe4 0%, #d8cbb3 55%, #c4b396 100%);
  border: 1px solid rgba(70, 52, 32, 0.45);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: grid;
  place-items: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2a1c10;
}

.dw-key .key-pip {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 8px;
  height: 2px;
  margin-left: -4px;
  background: rgba(42, 28, 16, 0.55);
}

.dw-board {
  width: 9.2rem;
  min-height: 7.2rem;
  padding: 0.4rem;
  background:
    radial-gradient(circle at 20% 30%, #c4a06a 0 1px, transparent 1.4px),
    #8a6240;
  border: 4px solid #5a3c24;
  box-shadow: 2px 4px 10px #00000055;
  color: #f0e4d0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.58rem;
}

.dw-board .dw-pocket {
  min-height: 4rem;
}

.dw-trash {
  width: 4.2rem;
}

.dw-trash .lid {
  height: 0.55rem;
  background: linear-gradient(180deg, #4a4a4e, #161618);
  border: 1px solid #050506;
}

.dw-trash .can {
  height: 3.2rem;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(0, 0, 0, 0.22) 8px 9px),
    linear-gradient(105deg, #141416, #2c2c32 22%, #0c0c0e);
  border: 1px solid #050506;
  border-top: 0;
  color: #f2eee4;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: grid;
  place-items: center;
}

.dw-trash .dw-pocket {
  min-height: 0;
}

/* tools — lift from editor .dsc */
.tool-stamper-body {
  width: 92px;
  height: 86px;
  border-radius: 8px 8px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.28rem 0.42rem 0.4rem;
  background: linear-gradient(165deg, #8a6a48, #6a4a30 50%, #4a3220);
  border: 1px solid rgba(40, 28, 16, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.2), 2px 4px 10px #00000059;
}

.tool-stamper-knob {
  width: 14px;
  height: 10px;
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #c4a070, #5a4028);
}

.tool-stamper-handle {
  width: 22px;
  height: 16px;
  border-radius: 4px 4px 2px 2px;
  background: #3a2818;
}

.tool-stamper-collar {
  width: 36px;
  height: 7px;
  margin: 2px 0 4px;
  background: linear-gradient(180deg, #7a5a38, #4a3220);
}

.tool-stamper-plate {
  flex: 1;
  width: 100%;
  min-height: 36px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: #2a2018;
  color: #f0e0c8;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dw-karaoke {
  width: 10.5rem;
}

.tool-karaoke {
  background: linear-gradient(165deg, #2a2430, #1a1620 50%, #121018);
  border: 2px solid #3a3040;
  box-shadow: 0 3px 0 #0a080c, 0 5px 12px #00000059;
  padding: 0.7rem 0.55rem 0.4rem;
  font-family: "Special Elite", "Courier New", monospace;
}

.tool-karaoke-tag {
  position: absolute;
  top: -0.3rem;
  left: 0.45rem;
  font-size: 0.5rem;
  letter-spacing: 0.07em;
  padding: 0.1rem 0.38rem;
  color: #f0e0c8;
  background: #a02848;
}

.tool-karaoke-slot {
  background: #08060a;
  border: 2px inset #4a4050;
  padding: 0.18rem 0.35rem;
}

.tool-karaoke-face {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-align: center;
  color: #e8c060;
  text-shadow: 0 0 8px rgba(232, 160, 64, 0.35);
}

.tool-karaoke-face.is-live {
  animation: karaoke-pull 0.4s ease;
}

@keyframes karaoke-pull {
  0% { letter-spacing: 0.3em; opacity: 0.3; }
  100% { letter-spacing: 0.12em; opacity: 1; }
}

.tool-karaoke-levers {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.tool-karaoke-lever {
  flex: 1;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.07em;
  padding: 0.28rem 0.4rem;
  border: none;
  color: #f8e8e0;
  background: linear-gradient(180deg, #c04060, #801830);
  box-shadow: 0 2px 0 #401018;
  cursor: pointer;
}

.tool-karaoke-copy {
  background: linear-gradient(180deg, #d0a040, #906018);
  box-shadow: 0 2px 0 #403010;
}

.tool-chipper-body {
  width: 108px;
  border-radius: 10px 10px 14px 14px;
  padding: 0.45rem 0.4rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: linear-gradient(168deg, #5a6068, #3a4048);
  border: 1px solid rgba(20, 20, 24, 0.5);
  box-shadow: 3px 7px 14px #00000059;
}

.tool-chipper-clip {
  width: 42px;
  height: 10px;
  border-radius: 6px 6px 2px 2px;
  background: #a8b0b8;
}

.tool-chipper-jaw {
  width: 54px;
  height: 8px;
  background: #1a1e24;
}

.tool-chipper-plate {
  min-width: 88px;
  min-height: 2.1rem;
  padding: 0.28rem 0.3rem;
  display: grid;
  place-items: center;
  background: #121418;
  color: #c8ccd4;
  border: 1px solid #2a3038;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  font-weight: 600;
}

.tool-eraser-body {
  width: 86px;
  height: 52px;
  border-radius: 6px 10px 8px 6px;
  display: flex;
  flex-direction: column;
  transform: rotate(-8deg);
  background: linear-gradient(165deg, #e8d8c0, #c8b090 50%, #a89070);
  border: 1px solid rgba(60, 45, 28, 0.45);
  box-shadow: 2px 4px 10px #00000059;
}

.tool-eraser-band {
  height: 10px;
  background: linear-gradient(180deg, #f2e6d4, #d4c0a0);
}

.tool-eraser-block {
  flex: 1;
  display: grid;
  place-items: center;
  color: #3a3020;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-eraser-edge {
  height: 6px;
  background: linear-gradient(180deg, #b8a080, #907858);
}

.dw-inbox {
  width: 8.6rem;
}

.tool-inbox-shell {
  min-height: 6.4rem;
  padding: 0.45rem 0.5rem 0.4rem;
  border-radius: 6px;
  background: linear-gradient(165deg, #3a6a58, #2a4a40 48%, #1a322c);
  border: 1px solid rgba(10, 30, 24, 0.75);
  box-shadow: inset 0 1px 0 rgba(180, 220, 200, 0.18), 2px 5px 14px #00000066;
  color: #c8e8d4;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.tool-inbox-flag {
  float: right;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 0.12rem 0.28rem;
  background: #c8e080;
  color: #1a2810;
}

.tool-inbox-slot {
  display: block;
  height: 0.55rem;
  width: 78%;
  margin: 0.45rem auto 0.4rem;
  background: #0a100e;
  border: 1px solid #0000008c;
}

.tool-inbox-shell strong {
  display: block;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.dw-fax {
  width: 8.2rem;
}

.tool-fax-shell {
  min-height: 6.2rem;
  padding: 0.4rem;
  border-radius: 5px;
  background: linear-gradient(165deg, #2a3038, #1c2026);
  border: 1px solid #3a424c;
  color: #c4ccd6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.tool-fax-brand {
  font-size: 0.42rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #8a94a0;
}

.tool-fax-word {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #e8b060;
}

.tool-fax-dest {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.55rem;
  padding: 0.18rem 0.4rem;
  background: #12151a;
  color: #e0c090;
  border: 1px solid #4a4030;
}

/* Mira — silly terminal on the cloth */
.dw-mira {
  position: relative;
  z-index: 8;
  width: auto;
  min-height: 34rem;
  display: flex;
  flex-direction: column;
  background: #0a120c;
  border: 1px solid #1a4024;
  border-left: 1px solid #1a4024;
  box-shadow:
    0 0 18px rgba(61, 200, 90, 0.22),
    inset 0 1px 0 rgba(109, 255, 122, 0.16);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  cursor: default;
}

.dw-mira .bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.5rem;
  background: #061008;
  border-bottom: 1px solid rgba(61, 255, 100, 0.28);
  color: rgba(109, 255, 122, 0.65);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dw-mira .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #6dff7a;
  box-shadow: 0 0 8px rgba(61, 200, 90, 0.5);
}

.dw-mira .log {
  flex: 1;
  min-height: 12rem;
  overflow: auto;
  padding: 0.55rem 0.7rem;
  color: #9fffab;
  text-shadow: 0 0 6px rgba(61, 200, 90, 0.22);
  font-size: 0.78rem;
  line-height: 1.45;
}

.dw-mira .log .dim {
  color: rgba(109, 255, 122, 0.55);
}

.dw-mira .log .echo {
  color: #6dff7a;
}

.dw-mira .row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem 0.55rem 0.45rem;
  border-top: 1px solid rgba(61, 255, 100, 0.2);
  margin: 0;
}

.dw-mira label {
  color: #6dff7a;
  font-size: 0.78rem;
}

.dw-mira input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #9fffab;
  font: inherit;
  font-size: 0.78rem;
  outline: none;
}

.dw-foot {
  margin: 0.4rem 0 0;
  max-width: 72ch;
  color: var(--dim);
  font-size: 0.84rem;
}

.dw-foot a {
  color: var(--brass-hi);
}

@media (max-width: 860px) {
  .dw-office {
    margin-left: 0.6rem;
    margin-right: 0.6rem;
    overflow: hidden;
  }

  .dw-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .dw-cloth {
    display: block;
    width: 100%;
    min-width: 0;
    height: min(70vh, 32rem);
    min-height: 22rem;
    overflow: auto;
  }

  .dw-surface {
    width: 42rem;
    height: 34rem;
  }

  .dw-mira {
    min-height: 12rem;
    width: 100%;
    flex: 0 0 auto;
  }
}
