/* youssef-os — desktop portfolio */
:root {
    --wall: #0E0904;
    --glass: rgba(31, 22, 13, .78);
    --glass2: rgba(255, 255, 255, .05);
    --edge: rgba(255, 255, 255, .10);
    --ink: #F4EDE4;
    --muted: #BFB09E;
    --pink: #FF4FD8;
    --mint: #3DF5B0;
    --amber: #FFB547;
    --peri: #8FA8FF;
    --crit: #FF5C8A;
    --dark: #150C04;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--wall); }
body { color: var(--ink); font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.disp { font-family: 'Unbounded', 'Manrope', sans-serif; }
.muted { color: var(--muted); margin: 4px 0 0; }
.small { font-size: 14px; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wallpaper, .wallpaper * { stroke-linecap: butt; }

.os { position: relative; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden; }

/* ---------- wallpaper + scanner ---------- */
.wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.wordmark { position: absolute; right: 30px; bottom: 26px; font-weight: 800; font-size: clamp(64px, 11vw, 160px); line-height: 1; color: rgba(255, 181, 71, .04); pointer-events: none; user-select: none; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- top bar ---------- */
.topbar { position: relative; z-index: 900; height: 40px; display: flex; align-items: center; gap: 4px; padding: 0 10px; background: rgba(21, 14, 7, .7); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--edge); font-size: 13px; }
.brand { font-weight: 700; padding: 0 10px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--pink); }
.status { margin-left: auto; display: flex; align-items: center; gap: 14px; padding: 0 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-live { display: flex; align-items: center; gap: 6px; }
.dot-mint { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }

/* ---------- desktop icons ---------- */
.deskicons { position: absolute; z-index: 1; top: 60px; left: 16px; display: grid; gap: 6px; }
.dicon { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 88px; padding: 8px 4px; border-radius: 12px; text-decoration: none; transition: background .15s; }
.dicon:hover { background: rgba(255, 255, 255, .07); }
.dicon .mono { font-size: 12px; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.tile { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.tile svg { width: 24px; height: 24px; }
.t-peri { background: var(--peri); color: var(--dark); box-shadow: 0 8px 20px -8px var(--peri); }
.t-pink { background: var(--pink); color: var(--dark); box-shadow: 0 8px 20px -8px var(--pink); }
.t-amber { background: var(--amber); color: var(--dark); box-shadow: 0 8px 20px -8px var(--amber); }
.t-term { background: #24190E; color: var(--mint); border: 1px solid var(--edge); }
.t-ink { background: var(--ink); color: var(--dark); box-shadow: 0 8px 20px -8px var(--ink); }
.t-glass { background: rgba(255, 255, 255, .12); color: var(--ink); }
.t-blog { background: #C7A6FF; color: var(--dark); box-shadow: 0 8px 20px -8px #C7A6FF; }

/* ---------- windows ---------- */
.win { position: absolute; display: flex; flex-direction: column; max-width: calc(100vw - 32px); background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); border: 1px solid var(--edge); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .25); overflow: hidden; transform-origin: 50% 100%; transition: transform .38s cubic-bezier(.3, 1.1, .4, 1), opacity .28s ease, box-shadow .3s ease, border-color .3s ease; }
.win:focus { outline: none; }
.win.opening { animation: popIn .5s cubic-bezier(.2, 1.25, .35, 1) both; }
.win.closing { animation: popOut .17s ease-in both; }
.win.minimized { visibility: hidden; pointer-events: none; transition: none; }
.genie { position: fixed; inset: 0; z-index: 960; pointer-events: none; }
.genie-band { position: absolute; overflow: hidden; transform-origin: 0 0; will-change: transform; contain: strict; backface-visibility: hidden; }
.genie .genie-win { position: absolute; left: 0; margin: 0; max-width: none; transform: none; transition: none; animation: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(29, 20, 11); box-shadow: none; }
.genie .genie-win * { animation: none !important; transition: none !important; }
.win.top { border-color: rgba(255, 79, 216, .35); }
.win.back { box-shadow: 0 18px 50px -24px rgba(0, 0, 0, .6); }
.win.back .bar-title { opacity: .6; }
.win.dragging { transition: none; }
@keyframes popIn { from { opacity: 0; transform: translateY(24px) scale(.9) } to { opacity: 1; transform: none } }
@keyframes popOut { to { opacity: 0; transform: scale(.94) } }

.bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--edge); cursor: grab; user-select: none; touch-action: none; background: rgba(255, 255, 255, .03); }
.win.dragging .bar { cursor: grabbing; }
.bar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.ldot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.wbtn { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--muted); transition: background .15s, color .15s; }
.wbtn svg { width: 14px; height: 14px; stroke-width: 2.4; }
.wbtn:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.wbtn.x:hover { background: var(--crit); color: var(--dark); }
.body { overflow: auto; max-height: calc(100dvh - 170px); }
.pad { padding: 22px; }

/* about */
.who { display: flex; gap: 16px; align-items: center; }
.avatar { width: 72px; height: 72px; flex: none; border-radius: 20px; display: grid; place-items: center; background: var(--pink); color: var(--dark); font-weight: 800; font-size: 24px; box-shadow: 0 10px 30px -8px rgba(255, 79, 216, .6); }
.h1 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.1; }
.h2 { margin: 14px 0 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.h2.flush { margin: 0; }
.stats { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 12px; border-radius: 12px; background: var(--glass2); border: 1px solid var(--edge); }
.stat-n { font-size: 18px; font-weight: 700; }
.stat-l { font-size: 12px; color: var(--muted); }
.xp { margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.xp div { display: flex; gap: 10px; align-items: baseline; }
.xp dt { width: 92px; flex: none; font-size: 12px; color: var(--muted); }
.xp dd { margin: 0; }
.actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.pbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 14px; text-decoration: none; transition: transform .2s, filter .2s; }
.pbtn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.b-pink { background: var(--pink); color: var(--dark) !important; }
.b-amber { background: var(--amber); color: var(--dark) !important; margin-top: 16px; }
.b-glass { background: var(--glass2); border: 1px solid var(--edge); }

/* explorer */
.explorer { display: flex; min-height: 320px; }
.folders { width: 150px; flex: none; padding: 12px 8px; border-right: 1px solid var(--edge); display: flex; flex-direction: column; gap: 2px; }
.side { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 9px; font-size: 13px; text-align: left; transition: background .15s; }
.side:hover { background: rgba(255, 255, 255, .06); }
.side[aria-pressed="true"] { background: rgba(255, 79, 216, .14); font-weight: 700; }
.side .n { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); }
.grid { flex: 1; min-width: 0; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 4px; align-content: start; }
.file { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 12px; text-align: center; transition: background .15s, transform .2s; }
.file:hover { background: rgba(255, 255, 255, .06); transform: translateY(-2px); }
.file svg { width: 46px; height: 56px; stroke: none; }
.file .fname { font-family: 'IBM Plex Mono', monospace; font-size: 12px; line-height: 1.3; word-break: break-word; }
.file .fsev { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.file.enter { animation: fileIn .35s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes fileIn { from { opacity: 0; transform: translateY(8px) scale(.94) } to { opacity: 1; transform: none } }

/* viewer */
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.sev { padding: 3px 10px; border-radius: 99px; color: var(--dark); font-weight: 800; letter-spacing: .04em; }
.label { margin: 20px 0 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain .arrow { color: var(--muted); }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 99px; background: var(--glass2); border: 1px solid var(--edge); font-size: 12px; }
.chain .chip { font-family: 'IBM Plex Mono', monospace; }
.chain .chip.end { color: var(--dark); border-color: transparent; font-weight: 600; }

/* terminal */
.term { background: rgba(10, 6, 2, .55); padding: 14px 16px; font-size: 13px; line-height: 1.6; height: 240px; }
.term .line { white-space: pre-wrap; word-break: break-word; }
.t-muted { color: var(--muted); }
.t-mint { color: var(--mint); }
.t-err { color: var(--crit); }
.t-out { color: var(--muted); }
.t-input { display: flex; align-items: center; }
.t-input label { white-space: nowrap; }
.t-input input { flex: 1; min-width: 0; min-height: 32px; background: transparent; border: 0; outline: none; color: var(--ink); font: inherit; caret-color: var(--mint); }

/* andropen */
.andro { display: flex; flex-wrap: wrap; gap: 24px; }
.andro-main { flex: 1 1 220px; min-width: 0; }
.phone { position: relative; width: 120px; height: 220px; flex: none; border-radius: 22px; border: 2px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .3); overflow: hidden; }
.notch { position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 9px; background: rgba(255, 255, 255, .2); }
.apk { position: absolute; top: 72px; left: 50%; margin-left: -24px; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--amber); color: var(--dark); font-weight: 800; font-size: 14px; }
.scanner { position: absolute; left: 10%; right: 10%; height: 2px; top: 8%; background: var(--mint); box-shadow: 0 0 14px 2px rgba(61, 245, 176, .6); opacity: 0; }
.andro.run .scanner { opacity: 1; animation: scanY 2.4s ease-in-out infinite; }
@keyframes scanY { 0% { top: 8% } 50% { top: 86% } 100% { top: 8% } }
.stages { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.stage-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.stage-h b { font-weight: 600; }
.stage-h span { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); }
.track { margin-top: 5px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.fillbar { height: 100%; width: 0; border-radius: 99px; }
.andro.run .fillbar { animation: fill .9s cubic-bezier(.6, 0, .3, 1) both; }
@keyframes fill { from { width: 0 } to { width: 100% } }
.done { margin-top: 10px; font-size: 12px; color: var(--mint); opacity: 0; }
.andro.run .done { animation: fadeIn .3s cubic-bezier(.3, 1.5, .5, 1) 3s both; }
@keyframes fadeIn { from { opacity: 0; transform: scale(.8) } to { opacity: 1; transform: none } }
.chips { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }

/* mail */
.mail { display: flex; flex-direction: column; gap: 12px; }
.mail .row { display: flex; gap: 10px; align-items: center; }
.mail .row.top { align-items: flex-start; }
.mail .row.spread { flex-wrap: wrap; justify-content: space-between; }
.mail .lbl { width: 64px; flex: none; color: var(--muted); font-size: 14px; }
.mail .row.top .lbl { padding-top: 8px; }
.links { display: flex; gap: 14px; font-size: 14px; }
.send { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-alt { margin: 0; font-size: 13px; color: var(--muted); }
.mail-alt a, .mail-alt button { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.field { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--edge); color: var(--ink); font: inherit; font-size: 14px; }
.field:focus { outline: none; border-color: var(--pink); }
textarea.field { resize: vertical; }

/* ---------- dock ---------- */
.dock { position: absolute; z-index: 950; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 10px; padding: 10px 12px 8px; border-radius: 22px; background: rgba(31, 22, 13, .6); -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%); border: 1px solid var(--edge); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7); }
.dk { position: relative; text-decoration: none; display: flex; flex-direction: column; align-items: center; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.dk:hover { transform: translateY(-8px) scale(1.12); }
.dk:active { transform: translateY(-4px) scale(1.02); }
.dk .tip { position: absolute; bottom: calc(100% + 10px); padding: 4px 9px; border-radius: 7px; background: var(--dark); border: 1px solid var(--edge); font-size: 12px; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.dk:hover .tip, .dk:focus-visible .tip { opacity: 1; transform: none; }
.dk .run { width: 4px; height: 4px; margin-top: 5px; border-radius: 50%; background: transparent; transition: background .2s; }
.dk.on .run { background: var(--ink); }

.noscript { position: absolute; inset: 60px 20px auto; z-index: 999; max-width: 520px; padding: 24px; border-radius: 16px; background: var(--glass); border: 1px solid var(--edge); }

/* ---------- small screens: one window at a time, like sheets ---------- */
@media (max-width: 760px) {
    .win { left: 8px !important; right: 8px; top: 48px !important; width: auto !important; max-width: none; }
    .win.back { display: none; }
    .body { max-height: calc(100dvh - 200px); }
    .deskicons { grid-template-columns: repeat(3, 88px); left: 50%; transform: translateX(-50%); top: 72px; }
    .status-live { display: none; }
    .brand { padding: 0 6px; }
    .folders { width: 118px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .dock { gap: 6px; padding: 8px 10px 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .packets { display: none; }
}
