/* The computer inside the monitor */
#os {
  --os-accent: #f08a3c;
  --os-ink: #f3f1ee;
  --os-soft: rgba(243, 241, 238, 0.62);
  --os-win: rgba(26, 25, 32, 0.86);
  --os-line: rgba(255, 255, 255, 0.09);
  --os-field: rgba(255, 255, 255, 0.06);
  --os-font: 'Segoe UI Variable Text', 'Segoe UI', 'Inter', system-ui, sans-serif;
  position: fixed; inset: 0; z-index: 20; overflow: hidden; pointer-events: none;
  font-family: var(--os-font); font-size: 13px; color: var(--os-ink); user-select: none;
}
#os[hidden] { display: none; }
#os.live { pointer-events: auto; }
#os button { font-family: inherit; }
:where(#os) svg { display: block; width: 100%; height: 100%; }

/* wallpapers */
.os-wall { position: absolute; inset: 0; background: #17132a center 62% / cover no-repeat; }
.wall-aurora { background: radial-gradient(90% 70% at 20% 10%, #2fd3a6 0%, transparent 60%), radial-gradient(80% 80% at 85% 20%, #5b6bff 0%, transparent 60%), radial-gradient(90% 90% at 50% 110%, #b84bd8 0%, transparent 60%), #0b1026; }
.wall-ember { background: radial-gradient(70% 60% at 70% 75%, #ff9a4d 0%, transparent 62%), radial-gradient(80% 70% at 20% 90%, #e2574c 0%, transparent 60%), radial-gradient(90% 80% at 40% 0%, #3a1f4d 0%, transparent 70%), #14090f; }
.wall-paper { background: radial-gradient(80% 70% at 75% 20%, #ffffff 0%, transparent 60%), linear-gradient(160deg, #efe6d8, #dccdb8); }

.os-greet { position: absolute; right: 6vw; top: 9vh; text-align: right; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); pointer-events: none; }
.os-time { font-family: 'Fraunces', Georgia, serif; font-weight: 300; font-size: clamp(54px, 9vw, 124px); line-height: 0.95; letter-spacing: -0.02em; }
.os-date { font-family: 'Fraunces', Georgia, serif; font-size: clamp(15px, 1.5vw, 22px); margin-top: 8px; opacity: 0.9; }
#os.light .os-greet { color: #2a2118; text-shadow: none; }

/* app tiles, used on the desktop, in the taskbar and in the start menu */
.tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; color: #fff; padding: 10px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 14px rgba(0, 0, 0, 0.28); }
.tile.sm { width: 30px; height: 30px; border-radius: 8px; padding: 6px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); }

.os-icons { position: absolute; left: 14px; top: 14px; bottom: 66px; display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.desk-icon { width: 84px; padding: 9px 4px 7px; border: 1px solid transparent; border-radius: 8px; background: none; color: #fff; cursor: pointer;
  display: grid; justify-items: center; gap: 6px; font-size: 12px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75); }
.desk-icon:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.14); }
.desk-icon:active .tile { transform: scale(0.94); }
#os.light .desk-icon { color: #2a2118; text-shadow: none; }

/* windows */
.os-wins { position: absolute; inset: 0 0 52px 0; overflow: hidden; pointer-events: none; }
.win { position: absolute; display: flex; flex-direction: column; pointer-events: auto; outline: none;
  background: var(--os-win); border: 1px solid var(--os-line); border-radius: 10px; overflow: hidden;
  backdrop-filter: blur(26px) saturate(1.5); -webkit-backdrop-filter: blur(26px) saturate(1.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.40); animation: win-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1); }
.win.front { box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05); }
.win.min { display: none; }
.win.max { border-radius: 0; border: 0; }
.win.closing { opacity: 0; transform: scale(0.96); transition: opacity 0.15s ease, transform 0.15s ease; }
@keyframes win-in { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: none; } }
.win-bar { flex: none; height: 36px; display: flex; align-items: center; gap: 9px; padding-left: 11px; cursor: default; touch-action: none; }
.win-ico { width: 16px; height: 16px; color: color-mix(in srgb, var(--c) 60%, #fff); flex: none; }
.win-title { flex: 1; font-size: 12px; color: var(--os-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win.front .win-title { color: var(--os-ink); }
.win-ctl { display: flex; height: 100%; }
.win-ctl button { width: 44px; height: 100%; border: 0; background: none; color: var(--os-ink); cursor: pointer; display: grid; place-items: center; padding: 0; }
.win-ctl button svg { width: 12px; height: 12px; }
.win-ctl button:hover { background: rgba(255, 255, 255, 0.10); }
.win-ctl button[data-a=close]:hover { background: #d9452f; color: #fff; }
.win-body { flex: 1; min-height: 0; position: relative; border-top: 1px solid var(--os-line); user-select: text; }
.rs { position: absolute; z-index: 3; }
.rs-e { right: 0; top: 36px; bottom: 12px; width: 6px; cursor: ew-resize; }
.rs-s { left: 0; right: 12px; bottom: 0; height: 6px; cursor: ns-resize; }
.rs-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }

/* taskbar */
.os-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 19, 26, 0.72); border-top: 1px solid var(--os-line);
  backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6); }
.bar-mid { display: flex; gap: 4px; align-items: center; }
.bar-btn { position: relative; width: 42px; height: 42px; border: 0; border-radius: 7px; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--os-ink);
  transition: background 0.15s ease, transform 0.1s ease; }
.bar-btn:hover, .bar-btn.on { background: rgba(255, 255, 255, 0.10); }
.bar-btn:active { transform: scale(0.92); }
.bar-btn.run::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); transition: width 0.2s ease, margin 0.2s ease, background 0.2s ease; }
.bar-btn.run.on::after { width: 16px; margin-left: -8px; background: var(--os-accent); }
.bar-start { color: var(--os-accent); padding: 9px; }
.bar-start svg { width: 22px; height: 22px; }
.bar-right { position: absolute; right: 10px; top: 0; height: 100%; display: flex; align-items: center; gap: 6px; }
.bar-sound, .bar-back { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--os-line); background: var(--os-field); color: var(--os-ink); cursor: pointer; font-size: 12px; white-space: nowrap; }
.bar-sound svg, .bar-back svg { width: 15px; height: 15px; }
.bar-sound:hover, .bar-back:hover { background: rgba(255, 255, 255, 0.13); }
.bar-sound.on { border-color: color-mix(in srgb, var(--os-accent) 60%, transparent); color: var(--os-accent); }
.bar-back kbd { font: inherit; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: var(--os-soft); }
.bar-clock { display: grid; justify-items: end; line-height: 1.25; padding: 0 8px; font-size: 12px; }
.bar-clock b { font-weight: 500; }
.bar-clock span { color: var(--os-soft); font-size: 11.5px; }

/* start menu */
.os-start { position: absolute; left: 50%; bottom: 62px; width: min(520px, calc(100vw - 24px)); transform: translateX(-50%); z-index: 9000; pointer-events: auto;
  background: rgba(30, 29, 37, 0.90); border: 1px solid var(--os-line); border-radius: 12px; overflow: hidden;
  backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); animation: start-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1); }
.os-start[hidden] { display: none; }
@keyframes start-in { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%); } }
.start-head { padding: 20px 26px 6px; font-weight: 600; }
.start-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 18px 18px; }
.start-app { border: 0; background: none; color: var(--os-ink); cursor: pointer; border-radius: 8px; padding: 12px 4px 10px; display: grid; justify-items: center; gap: 8px; font-size: 12px; }
.start-app:hover { background: rgba(255, 255, 255, 0.08); }
.start-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; background: rgba(0, 0, 0, 0.22); border-top: 1px solid var(--os-line); }
.start-user { display: flex; align-items: center; gap: 10px; }
.start-user i { width: 28px; height: 28px; border-radius: 50%; background: var(--os-accent); color: #1b0f05; display: grid; place-items: center; font-style: normal; font-weight: 700; }
.start-back { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 7px; border: 0; background: none; color: var(--os-ink); cursor: pointer; font-size: 12px; }
.start-back svg { width: 15px; height: 15px; }
.start-back:hover { background: rgba(255, 255, 255, 0.10); }

/* boot */
.os-boot { position: absolute; inset: 0; z-index: 9999; background: #050508; display: grid; place-content: center; justify-items: center; gap: 26px; transition: opacity 0.6s ease; }
.os-boot.done { opacity: 0; pointer-events: none; }
.boot-mark { width: 62px; height: 62px; color: var(--os-accent); opacity: 0; }
.boot-text { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--os-soft); opacity: 0; }
.boot-ring { position: relative; width: 34px; height: 34px; opacity: 0; }
.boot-ring i { position: absolute; inset: 0; animation: orbit 1.5s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite; }
.boot-ring i::after { content: ''; position: absolute; left: 50%; top: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #fff; }
.boot-ring i:nth-child(2) { animation-delay: 0.08s; } .boot-ring i:nth-child(3) { animation-delay: 0.16s; }
.boot-ring i:nth-child(4) { animation-delay: 0.24s; } .boot-ring i:nth-child(5) { animation-delay: 0.32s; }
@keyframes orbit { to { transform: rotate(360deg); } }
.os-boot.run .boot-mark { animation: fade-up 0.5s 0.1s ease forwards; }
.os-boot.run .boot-ring { animation: fade-up 0.4s 0.45s ease forwards; }
.os-boot.run .boot-text { animation: fade-up 0.5s 0.6s ease forwards; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* shared bits inside windows */
.win-body h3 { margin: 0 0 10px; font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: 22px; letter-spacing: -0.01em; }
.win-body p { margin: 0 0 10px; line-height: 1.55; color: var(--os-soft); }
.win-body a { color: var(--os-accent); text-decoration: none; }
.win-body a:hover { text-decoration: underline; }
.dim { color: var(--os-soft); }
.win-body ::-webkit-scrollbar { width: 10px; height: 10px; }
.win-body ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }

/* Notes */
.notes { display: grid; grid-template-columns: 150px 1fr; height: 100%; }
.notes nav { padding: 12px 8px; border-right: 1px solid var(--os-line); display: grid; align-content: start; gap: 2px; background: rgba(0, 0, 0, 0.14); }
.notes nav button { text-align: left; border: 0; background: none; color: var(--os-soft); padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.notes nav button:hover { background: rgba(255, 255, 255, 0.06); }
.notes nav button.on { background: rgba(255, 255, 255, 0.10); color: var(--os-ink); box-shadow: inset 3px 0 0 var(--os-accent); }
.notes article { padding: 20px 24px; overflow: auto; display: flex; flex-direction: column; }
.notes article p { color: var(--os-ink); font-size: 14px; }
.kv { margin: 0; display: grid; grid-template-columns: 96px 1fr; }
.kv dt, .kv dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--os-line); line-height: 1.45; }
.kv dt { color: var(--os-soft); }
.pad { flex: 1; min-height: 160px; width: 100%; resize: none; border: 1px solid var(--os-line); border-radius: 8px; background: var(--os-field); color: var(--os-ink); padding: 12px; font: 13px/1.6 'JetBrains Mono', Consolas, monospace; outline: none; }
.pad:focus { border-color: var(--os-accent); }

/* Projects */
.projects { height: 100%; overflow: auto; padding: 14px; display: grid; gap: 8px; align-content: start; }
.projects article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--os-line); border-radius: 9px; background: var(--os-field); }
.projects article:hover { background: rgba(255, 255, 255, 0.09); }
.projects small { color: var(--os-soft); font-size: 11px; }
.projects h3 { margin: 2px 0 3px; font-size: 20px; }
.projects p { margin: 0; }
.projects a, .projects .soon { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.projects a { background: var(--os-accent); color: #1b0f05; }
.projects a:hover { text-decoration: none; filter: brightness(1.08); }
.projects .soon { border: 1px solid var(--os-line); color: var(--os-soft); font-weight: 400; }

/* Terminal */
.term { height: 100%; overflow: auto; padding: 12px 14px; background: rgba(8, 8, 12, 0.72); font: 12.5px/1.55 'JetBrains Mono', Consolas, monospace; color: #d8dccf; cursor: text; }
.term-out div { white-space: pre-wrap; word-break: break-word; }
.term-out .cmd { color: #fff; margin-top: 4px; }
.term-out .dim { color: #8b8f86; }
.term-line { display: flex; gap: 8px; margin-top: 4px; }
.term-ps { color: var(--os-accent); white-space: nowrap; }
.term-in { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: inherit; padding: 0; caret-color: var(--os-accent); }

/* Paint */
.paint { height: 100%; display: flex; flex-direction: column; }
.paint-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; flex-wrap: wrap; border-bottom: 1px solid var(--os-line); }
.paint-bar .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); background: var(--c); cursor: pointer; padding: 0; }
.paint-bar .sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--os-accent); }
.paint-bar .gap { flex: 1; }
.paint-bar label { display: flex; align-items: center; gap: 6px; color: var(--os-soft); font-size: 12px; }
.paint-bar input[type=range], .beats-top input[type=range] { width: 90px; accent-color: var(--os-accent); }
.paint-bar button:not(.sw), .beats-top .play, .m-new, .settings .s-sound { height: 28px; padding: 0 11px; border-radius: 6px; border: 1px solid var(--os-line); background: var(--os-field); color: var(--os-ink); cursor: pointer; font-size: 12px; }
.paint-bar button:not(.sw):hover, .beats-top .play:hover, .m-new:hover, .settings .s-sound:hover { background: rgba(255, 255, 255, 0.13); }
.paint-bar button.on:not(.sw) { background: var(--os-accent); color: #1b0f05; border-color: var(--os-accent); }
.paint-area { flex: 1; min-height: 0; position: relative; background: #f4efe8; }
.paint-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }

/* Beats */
.beats { height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow: auto; }
.beats-top { display: flex; align-items: center; gap: 14px; color: var(--os-soft); font-size: 12px; }
.beats-top label { display: flex; align-items: center; gap: 8px; }
.beats-top b { color: var(--os-ink); font-weight: 500; min-width: 26px; }
.beats-hint { margin-left: auto; text-align: right; }
.seq { display: grid; gap: 5px; }
.seq .row { display: grid; grid-template-columns: 52px repeat(16, 1fr); gap: 4px; align-items: center; }
.seq .row span { color: var(--os-soft); font-size: 11.5px; }
.st { height: 26px; border-radius: 5px; border: 0; background: rgba(255, 255, 255, 0.06); cursor: pointer; padding: 0; transition: transform 0.08s ease; }
.st.b { background: rgba(255, 255, 255, 0.11); }
.st.on { background: var(--os-accent); }
.st.now { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55); }
.st.on.now { transform: scale(1.12); filter: brightness(1.3); }
.pads { flex: 1; min-height: 110px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad-btn { border-radius: 10px; border: 1px solid var(--os-line); background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)); color: var(--os-ink); cursor: pointer; display: grid; align-content: space-between; justify-items: start; padding: 10px 12px; font-size: 12px; touch-action: none; }
.pad-btn b { font-weight: 500; }
.pad-btn kbd { font: 10.5px 'JetBrains Mono', Consolas, monospace; color: var(--os-soft); padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
.pad-btn.hit { animation: hit 0.28s ease; }
@keyframes hit { 0% { background: var(--os-accent); transform: scale(0.96); } 100% { transform: none; } }

/* Mines */
.mines { height: 100%; padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; user-select: none; }
.mines-top { width: 100%; display: flex; align-items: center; justify-content: space-between; font: 500 15px 'JetBrains Mono', Consolas, monospace; }
.m-left, .m-time { min-width: 44px; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); text-align: center; color: var(--os-accent); }
.m-grid { display: grid; grid-template-columns: repeat(9, 34px); gap: 2px; }
.m-cell { width: 34px; height: 34px; border: 0; border-radius: 5px; padding: 0; cursor: pointer; font: 600 14px 'JetBrains Mono', Consolas, monospace; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.10)); color: var(--os-ink); }
.m-cell:hover:not(.open) { background: rgba(255, 255, 255, 0.26); }
.m-cell.open { background: rgba(0, 0, 0, 0.26); cursor: default; }
.m-cell.n1 { color: #7aa7ff; } .m-cell.n2 { color: #5fd08f; } .m-cell.n3 { color: #ff7d6e; } .m-cell.n4 { color: #c58bff; }
.m-cell.n5 { color: #ffb45e; } .m-cell.n6 { color: #5fd0d0; } .m-cell.n7 { color: #fff; } .m-cell.n8 { color: #aaa; }
.m-cell.boom { background: #d9452f; }
.m-cell .mine { width: 12px; height: 12px; border-radius: 50%; background: #111; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.m-cell .flag { width: 0; height: 0; border-left: 11px solid var(--os-accent); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.m-grid.won .m-cell.open { background: rgba(35, 163, 107, 0.28); }
.m-msg { margin: 0 !important; font-size: 12px; text-align: center; }

/* Settings */
.settings { height: 100%; overflow: auto; padding: 18px 22px; }
.settings h3 { font-size: 17px; margin: 14px 0 9px; }
.settings h3:first-child { margin-top: 0; }
.walls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.walls button { border: 0; background: none; color: var(--os-soft); cursor: pointer; padding: 0; display: grid; gap: 6px; font-size: 11.5px; text-align: left; }
.walls i { position: relative; inset: auto; display: block; aspect-ratio: 16 / 10; border-radius: 7px; border: 2px solid transparent; background-size: cover; }
.walls button.on i { border-color: var(--os-accent); }
.walls button.on { color: var(--os-ink); }
.accents { display: flex; gap: 8px; }
.accents button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.accents button.on { border-color: #fff; }

@media (max-width: 760px) {
  .bar-back span, .bar-sound span, .bar-clock span, .bar-back kbd { display: none; }
  .bar-right { gap: 4px; right: 6px; }
  .bar-clock { display: none; }
  .bar-sound, .bar-back { padding: 0 9px; }
  .os-bar { justify-content: flex-start; padding-left: 6px; }
  .bar-mid { gap: 0; }
  .bar-btn { width: 36px; }
  .os-icons { display: none; }
  .os-greet { right: 5vw; top: 5vh; }
  .notes { grid-template-columns: 104px 1fr; }
  .seq .row { grid-template-columns: 38px repeat(16, 1fr); gap: 2px; }
}
