/* The room. Light follows the time in Pakistan (data-time on <body>). */
:root {
  --ink: #1D1A16;
  --paper: #F4F1E8;
  --paper-2: #E9E4D6;
  --cork: #B88957;
  --wood: #6E4A30;
  --wood-dark: #4A3020;
  --floor: #5B3B27;
  --lamp: #FFC56E;
  --cap: #D2392B;
  --steel: #7E95A8;
  --steel-dark: #4E6273;
  --wall-a: #CBD4CD;
  --wall-b: #B9C4BC;
  --sky-a: #8FC1E8;
  --sky-b: #D9ECF5;
  --dark: 0;
  --muted: #5F5A51;
  --line: #CFC8B6;
  --ui: "Schibsted Grotesk", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}
body[data-time="dawn"]  { --wall-a: #C6C3C4; --wall-b: #B3AEB0; --sky-a: #7E8FB8; --sky-b: #F4B98A; --dark: .18; }
body[data-time="dusk"]  { --wall-a: #B7B2B6; --wall-b: #A19AA0; --sky-a: #4D5E92; --sky-b: #F08A5D; --dark: .28; }
body[data-time="night"] { --wall-a: #2A3448; --wall-b: #1E2738; --sky-a: #0B1326; --sky-b: #1D2A4A; --dark: .5; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--ui); color: var(--ink); background: #1E2738; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 20; background: var(--paper); padding: 8px 12px; border-radius: 6px; }

/* ---------- door (sign in) ---------- */
.door-page { background: #1E2738; min-height: 100%; display: grid; place-items: center; }
.door { display: flex; gap: 56px; align-items: center; padding: 32px; }
.door-art { width: 180px; height: auto; }
.door-frame { fill: #3A2A1E; }
.door-leaf { fill: #6E4A30; }
.door-panel { fill: none; stroke: #4A3020; stroke-width: 4; }
.door-knob { fill: #E4B35B; }
.door-sign { fill: var(--paper); }
.door-sign-text { font: 700 20px var(--hand); text-anchor: middle; fill: var(--ink); }
.door-light { fill: var(--lamp); filter: drop-shadow(0 4px 10px rgba(255, 197, 110, .8)); }
.door-form { width: min(320px, 80vw); color: var(--paper); }
.door-form h1 { font: 700 56px/1 var(--hand); margin: 0 0 4px; color: var(--lamp); }
.door-form p { margin: 0 0 24px; color: #AEB6C6; }
.door-form label { display: block; font-size: 14px; margin-bottom: 6px; color: #D7DCE5; }
.door-form input { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid #44506A; background: #141B29; color: var(--paper); }
.door-form button { margin-top: 16px; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: var(--lamp); color: var(--ink); font-weight: 700; cursor: pointer; }
.door-error { color: #FFB4A8 !important; margin: 12px 0 0 !important; }
@media (max-width: 600px) { .door { flex-direction: column; gap: 24px; } .door-art { width: 120px; } }

/* ---------- stage ---------- */
.room-page { overflow: hidden; }
.stage { position: fixed; inset: 0; touch-action: none; }
#scene { width: 100%; height: 100%; display: block; }
.wall-top { stop-color: var(--wall-a); }
.wall-bottom { stop-color: var(--wall-b); }
.sky-top { stop-color: var(--sky-a); }
.sky-bottom { stop-color: var(--sky-b); }
.wall-marks path { stroke: rgba(0, 0, 0, .06); stroke-width: 3; }
.skirting { fill: #3E2A1D; }
.floor { fill: var(--floor); }
.planks path { stroke: rgba(0, 0, 0, .22); stroke-width: 2; fill: none; }
.rug { fill: #2F4A5C; }
.rug-inner { fill: none; stroke: #C89B4E; stroke-width: 3; stroke-dasharray: 2 8; }
.frame-wood { fill: var(--wood); }
.mullion { stroke: var(--wood); stroke-width: 10; fill: none; }
.sill { fill: #7F5939; }
.sun { fill: #FFE7A3; transition: fill .6s; }
body[data-time="night"] .sun { fill: #E9EEF7; }
.skyline { fill: #39445A; }
body[data-time="night"] .skyline { fill: #0A0F1C; }
.stars circle { fill: #fff; opacity: 0; }
body[data-time="night"] .stars circle { opacity: .8; }
.lit-windows rect { fill: var(--lamp); opacity: 0; }
body[data-time="night"] .lit-windows rect, body[data-time="dusk"] .lit-windows rect { opacity: .85; }

.shelf-body { fill: var(--wood-dark); }
.shelf-back { fill: #3A2618; }
.shelf-board, .shelf-top { fill: var(--wood); }
.book-spine { stroke: rgba(0, 0, 0, .25); stroke-width: 1; }
.book-band { fill: rgba(255, 255, 255, .35); }
.pot { fill: #A95F3B; }
.leaves { fill: #5E8A55; stroke: #3F6439; stroke-width: 2; }

.jar { fill: rgba(214, 232, 240, .35); stroke: #C3D6DF; stroke-width: 3; }
.jar-lid { fill: #B8862F; }
.jar-label { fill: var(--paper); }
.jar-label-text { font-size: 17px; }
.coin { fill: #E4B35B; stroke: #A87C2A; stroke-width: 1.5; }

.note-paper { filter: drop-shadow(1px 3px 0 rgba(0, 0, 0, .25)); }
.note-text { font: 600 17px var(--hand); fill: var(--ink); }
.pin { stroke: rgba(0, 0, 0, .3); stroke-width: 1; }

.monitor { fill: #23272E; }
.monitor-screen { fill: #18324A; }
body[data-time="night"] .monitor-screen { fill: #102336; }
.monitor-neck, .monitor-foot { fill: #2E333B; }
.app-tile { stroke: rgba(255, 255, 255, .25); stroke-width: 1; }
.app-letter { font: 700 16px var(--ui); fill: #fff; text-anchor: middle; }
.desk-top { fill: #8A5E3B; }
.desk-leg, .desk-drawer { fill: #6E4A30; }
.desk-handle { fill: #C89B4E; }
.keyboard { fill: #D9D5CB; }
.mouse { fill: #D9D5CB; }
.mug { fill: var(--cap); }
.mug-handle { fill: none; stroke: var(--cap); stroke-width: 6; }
.steam { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 3; stroke-linecap: round; }
.chair-back, .chair-seat { fill: #243142; }
.chair-post { fill: #1A222E; }
.chair-base { fill: none; stroke: #1A222E; stroke-width: 10; stroke-linecap: round; }

.lamp-shade { fill: #2F6B5E; }
.lamp-pole, .lamp-base { fill: #23272E; }
.lamp-glow { opacity: 0; transition: opacity .5s; mix-blend-mode: screen; }
body.lamp-on .lamp-glow { opacity: 1; }
body.lamp-on .lamp-shade { fill: #3E8C7B; }

.mount { fill: #2B2F36; }
.tv-body { fill: #22262C; }
.tv-screen { transition: filter .3s; }
.tv-name { font: 600 15px var(--ui); fill: #fff; }
.tv-sub { font: 500 11px var(--ui); fill: rgba(255, 255, 255, .7); }
.tv-dot { fill: var(--cap); }
.onair { fill: var(--cap); filter: drop-shadow(0 0 6px rgba(210, 57, 43, .9)); }

.bat { fill: #E2C48F; stroke: #B6955C; stroke-width: 2; }
.bat-grip { fill: #2B2F36; }
.locker { fill: var(--steel-dark); }
.locker-door { fill: var(--steel); }
.locker-handle { fill: #C9D3DB; }
.padlock { fill: #E4B35B; }
.padlock-shackle { fill: none; stroke: #9AA6B0; stroke-width: 5; }
.sticker { fill: var(--paper); }
.sticker-text { font-size: 30px; fill: var(--cap); }
.hand { font-family: var(--hand); font-weight: 700; text-anchor: middle; fill: var(--ink); }

.dark { fill: #0A1020; opacity: var(--dark); transition: opacity .8s; }
body.lamp-on .dark { opacity: calc(var(--dark) * .55); }

/* objects respond to the pointer */
.obj { cursor: pointer; outline: none; transition: filter .2s; }
.obj:hover, .obj:focus-visible { filter: drop-shadow(0 0 10px rgba(255, 197, 110, .95)) brightness(1.06); }
.tag { position: fixed; pointer-events: none; font: 700 26px var(--hand); color: var(--paper); text-shadow: 0 2px 0 rgba(0, 0, 0, .45); opacity: 0; transform: translate(-50%, -130%); transition: opacity .15s; white-space: nowrap; z-index: 4; }
.tag.on { opacity: 1; }

.swipe-hint { display: none; position: fixed; left: 0; right: 0; bottom: 78px; margin: 0; text-align: center; font: 700 24px var(--hand); color: var(--paper); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); pointer-events: none; z-index: 4; transition: opacity .4s; }
body.pannable .swipe-hint { display: block; }
body.panned .swipe-hint, body.open .swipe-hint { opacity: 0; }

/* ---------- dock ---------- */
.dock { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(20, 27, 41, .78); backdrop-filter: blur(8px); z-index: 5; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
.dock button, .dock a { border: 0; background: transparent; color: #E6E9EF; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 15px; text-decoration: none; white-space: nowrap; }
.dock button:hover, .dock a:hover { background: rgba(255, 255, 255, .1); }
.dock button[aria-current="true"] { background: var(--lamp); color: var(--ink); }
.dock .leave { color: #AEB6C6; border-left: 1px solid rgba(255, 255, 255, .15); border-radius: 0 9px 9px 0; }
body.open .dock { opacity: 0; pointer-events: none; }

/* ---------- panel ---------- */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); background: var(--paper); box-shadow: -18px 0 40px rgba(0, 0, 0, .3); transform: translateX(102%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); z-index: 6; display: flex; flex-direction: column; outline: none; }
body.open .panel { transform: none; }
.close { align-self: flex-start; margin: 16px 20px 0; border: 0; background: none; padding: 6px 0; cursor: pointer; color: var(--muted); font-size: 15px; }
.close:hover { color: var(--ink); }
.panel-body { overflow-y: auto; padding: 8px 28px 40px; flex: 1; }
.panel h2 { font: 700 44px/1 var(--hand); margin: 6px 0 4px; }
.lede { color: var(--muted); margin: 0 0 22px; line-height: 1.45; max-width: 60ch; }
.panel h3 { font-size: 15px; font-weight: 700; margin: 26px 0 10px; color: var(--muted); }
.panel a { color: inherit; }
.empty { color: var(--muted); font-style: italic; }

@media (max-width: 760px) {
  .panel { top: auto; height: 72vh; width: 100vw; border-radius: 18px 18px 0 0; transform: translateY(102%); box-shadow: 0 -18px 40px rgba(0, 0, 0, .3); }
  .panel h2 { font-size: 38px; }
  .panel-body { padding: 4px 20px 32px; }
}

/* lists inside panels */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.row-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.row-title { font-weight: 700; }
.row-title a { text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.row-meta { color: var(--muted); font-size: 14px; margin-top: 3px; line-height: 1.45; }
.pill { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--paper-2); color: var(--muted); white-space: nowrap; }
.pill.live, .pill.built { background: #DDEBD6; color: #2F5A26; }
.pill.trying, .pill.planned { background: #FBE7C2; color: #7A4F06; }
.pill.dropped, .pill.archived { background: #ECE6E2; color: #8A7F78; text-decoration: line-through; }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* idea notes */
.idea-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.idea { background: #FFF8D9; padding: 14px 14px 10px; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); position: relative; display: flex; flex-direction: column; gap: 6px; }
.idea:nth-child(3n+2) { background: #E3F0E1; }
.idea:nth-child(3n) { background: #F7E2DC; }
.idea-title { font: 700 22px/1.05 var(--hand); }
.idea-note { font-size: 14px; line-height: 1.45; color: #3B372F; }
.idea-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.idea-foot select { font-size: 13px; border: 1px solid rgba(0, 0, 0, .15); background: rgba(255, 255, 255, .6); border-radius: 6px; padding: 2px 4px; }
.idea-from { font-size: 12px; color: var(--muted); }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.x:hover { color: var(--cap); }

/* forms */
.add { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0 0 20px; display: grid; gap: 8px; }
.add input, .add textarea, .add select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; background: #fff; }
.add textarea { min-height: 70px; resize: vertical; }
.add .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { border: 0; border-radius: 8px; background: var(--ink); color: var(--paper); padding: 9px 14px; font-weight: 700; cursor: pointer; justify-self: start; }
.btn.light { background: var(--paper-2); color: var(--ink); }

/* app tiles */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.app { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; min-height: 112px; }
.app:hover { border-color: var(--ink); }
.app-mark { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.app-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.app-host { font-size: 12px; color: var(--muted); word-break: break-all; }

/* channel screens */
.channel { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.channel:last-child { border-bottom: 0; }
.channel-screen { width: 74px; height: 50px; border-radius: 6px; border: 4px solid #22262C; position: relative; }
.channel-screen.live::after { content: ""; position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--cap); }

/* projects */
.search { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; background: #fff; }
.lang { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* locker */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--cap); font-weight: 700; }
.note-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.note-card input { width: 100%; border: 0; font-weight: 700; padding: 2px 0; background: none; }
.note-card textarea { width: 100%; border: 0; resize: vertical; min-height: 64px; background: none; line-height: 1.45; padding: 4px 0; }
.note-card input:focus, .note-card textarea:focus { outline: none; }
.note-card:focus-within { border-color: var(--ink); }
.ledger { width: 100%; border-collapse: collapse; }
.ledger td, .ledger th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.ledger th { font-size: 13px; color: var(--muted); font-weight: 500; }
.ledger input { width: 100%; border: 1px solid transparent; background: none; padding: 5px 6px; border-radius: 6px; }
.ledger input:hover, .ledger input:focus { border-color: var(--line); background: #fff; outline: none; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tfoot td { font-weight: 700; border-bottom: 0; }
.neg { color: #A3321F; }

/* today */
.clock { font: 700 64px/1 var(--hand); margin: 4px 0 2px; }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.todo input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.todo li.done span { text-decoration: line-through; color: var(--muted); }
.todo span { flex: 1; line-height: 1.4; }
.inline-add { display: flex; gap: 8px; margin-top: 12px; }
.inline-add input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }

/* earnings */
.total { font: 700 56px/1 var(--hand); margin: 6px 0 4px; }

.toast { position: fixed; left: 50%; top: 16px; transform: translate(-50%, -80px); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; font-size: 14px; transition: transform .3s; z-index: 9; }
.toast.on { transform: translate(-50%, 0); }
.toast.bad { background: #8E2A1C; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
