:root {
    color-scheme: dark;
    --accent: lab(64.67% -65.51 62.29);
    --accent-soft: lab(64.67% -65.51 62.29 / 10%);
    --text: #e9eeea;
    --muted: #9ca6a1;
    --line: #ffffff12;
    --surface: #101311;
    --mono: 'IBM Plex Mono', monospace;
    --font: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #0b0e0c;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
    cursor: pointer;
}

button {
    border: 0;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

button:hover,
a:hover {
    color: #fff;
}

button:disabled {
    cursor: default;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

input {
    min-width: 0;
}

::selection {
    background: #51876a;
    color: white;
}

::-webkit-scrollbar {
    width: 7px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: #515952;
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

.accent {
    color: var(--accent);
}

.muted {
    color: var(--muted);
}

.eyebrow {
    font: 10px/1.7 var(--mono);
    color: var(--muted);
}

body[data-accent="ice"] {
    --accent: #f46b6b;
    --accent-soft: #f46b6b1a;
}

.wallpaper {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(90deg, #12191660, #12191615), url('img/desktop-wallpaper.jpg');
    background-position: center 48%;
    background-size: cover;
    background-repeat: no-repeat;
}

.wallpaper iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.dither-preview,
.matrix-preview {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #8fb34d;
    background: #101810;
    font-size: 28px;
}

body[data-accent="ice"][data-wallpaper="dither"] .wallpaper iframe,
body[data-accent="ice"] .dither-preview {
    filter: grayscale(1) brightness(0.4) sepia(1) saturate(6) hue-rotate(-45deg) saturate(4);
}

body[data-wallpaper="matrix"] .wallpaper,
.matrix-preview {
    background: #000;
    color: #0f0;
}

body[data-wallpaper="grid"] .wallpaper,
.grid-preview {
    background-color: #111512;
    background-image: linear-gradient(#81988b0b 1px, transparent 1px), linear-gradient(90deg, #81988b0b 1px, transparent 1px);
    background-size: 48px 48px;
    background-repeat: repeat;
}

.system-panel {
    height: 40px;
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0c100ef5;
    border-bottom: 1px solid #ffffff0b;
    padding: 0 16px;
    font-size: 12px;
}

.panel-left,
.panel-right {
    display: flex;
    gap: 15px;
    align-items: center;
    height: 100%;
}

.panel-button {
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 12px;
}

.panel-button:hover,
.panel-button[aria-expanded="true"] {
    background: #ffffff0d;
}

.panel-button .fa {
    font-size: 14px;
}

.panel-brand {
    font-weight: 600;
}

.panel-brand .accent {
    font-size: 18px;
}

.panel-divider {
    height: 14px;
    width: 1px;
    background: #ffffff22;
}

.panel-clock {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font: 11px var(--mono);
    white-space: pre;
}

.panel-right {
    gap: 2px;
}

.language-select {
    width: 88px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font: 12px 'Noto Sans Arabic', var(--font);
    cursor: pointer;
}

.language-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

:root[lang="ar"] {
    --font: 'Noto Sans Arabic', sans-serif;
    --mono: 'Noto Sans Arabic', monospace;
}

[dir="rtl"] .mobile-back .fa,
[dir="rtl"] .folder-grid .fa-angle-right {
    transform: scaleX(-1);
}

.file-path,
.terminal-content,
.panel-brand,
.primary-action[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: isolate;
}

#desktop {
    position: fixed;
    inset: 40px 0 0;
}

.desktop-signature {
    position: fixed;
    top: 70px;
    left: 42px;
    pointer-events: none;
    text-shadow: 0 2px 20px #111;
}

.desktop-signature .eyebrow {
    color: #b8c8bd;
    font-size: 9px;
}

.desktop-signature h1 {
    font-size: 64px;
    line-height: 1.12;
    font-weight: 500;
}

.desktop-signature h1 span {
    color: var(--accent);
}

.desktop-signature p {
    margin-top: 5px;
    font-size: 12px;
    color: #c1ccc5;
}

.desktop-icons {
    position: fixed;
    left: 28px;
    top: 208px;
    bottom: 105px;
    display: grid;
    grid-template-rows: repeat(6, minmax(0, 92px));
    grid-auto-rows: minmax(0, 92px);
    width: 88px;
}

.app-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 5px;
    min-width: 0;
}

.app-icon:hover,
.app-icon:focus-visible {
    background: #c6e4d116;
    border-color: #ffffff20;
}

.app-tile {
    width: 49px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--tile-bg);
    color: var(--tile-color);
    box-shadow: inset 0 1px 0 #ffffff24, 0 4px 10px #0002;
    border: 1px solid #ffffff0e;
}

.app-tile .fa {
    font-size: 24px;
}

.tile-text {
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.tile-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.gold {
    --tile-bg: #d6b56b;
    --tile-color: #463615;
}

.mint {
    --tile-bg: #9ac4a7;
    --tile-color: #243d2c;
}

.coral {
    --tile-bg: #ca8f81;
    --tile-color: #492620;
}

.blue {
    --tile-bg: #8aacc7;
    --tile-color: #25374e;
}

.graphite {
    --tile-bg: #303b35;
    --tile-color: #b5d6c1;
}

.dark {
    --tile-bg: #111213;
    --tile-color: #e9eeea;
}

.app-label {
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    text-shadow: 0 2px 6px #000;
    overflow-wrap: anywhere;
}

.desktop-icons [data-app="hydrogen"],
.desktop-icons [data-app="djinn"],
.desktop-icons [data-app="videos"] {
    display: none;
}

.external-mark {
    position: absolute;
    right: 13px;
    top: 4px;
    font-size: 10px;
}

.desktop-caption {
    position: fixed;
    left: 28px;
    bottom: 22px;
    font: 8px var(--mono);
    color: #afc6b9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-caption>span:last-child {
    position: fixed;
    right: 28px;
    bottom: 22px;
}

.status-dot {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}

.mobile-clock {
    display: none;
}

.dock {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 22px;
    z-index: 110;
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    background: #101611ee;
    border: 1px solid #ffffff21;
    border-radius: 8px;
    box-shadow: 0 10px 40px #0006;
    max-width: calc(100% - 32px);
    backdrop-filter: blur(20px);
}

.dock-button {
    width: 49px;
    height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    flex-shrink: 0;
}

.dock-button .app-tile {
    width: 40px;
    height: 38px;
    border-radius: 6px;
    transition: transform 160ms;
}

.dock-button .app-tile .fa {
    font-size: 21px;
}

.dock-button:hover .app-tile {
    transform: translateY(-4px);
}

.dock-button.active {
    background: #ffffff11;
}

.dock-button.running::after {
    content: '';
    position: absolute;
    bottom: -3px;
    width: 4px;
    height: 3px;
    border-radius: 2px;
    background: #79847c;
}

.dock-button.active::after {
    width: 13px;
    background: var(--accent);
}

.dock-divider {
    width: 1px;
    height: 30px;
    background: #ffffff1a;
    margin: 0 3px;
    flex-shrink: 0;
}

.show-desktop {
    font-size: 23px;
    color: #bbc8bf;
}

.dock-tooltip {
    position: absolute;
    bottom: calc(100% + 20px);
    padding: 7px 10px;
    background: #141a15;
    border: 1px solid #ffffff26;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms;
}

.dock-button:hover .dock-tooltip,
.dock-button:focus-visible .dock-tooltip {
    opacity: 1;
}

#window-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.app-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid #636e645e;
    border-radius: 8px;
    box-shadow: 0 20px 70px #0008, 0 2px 6px #0006;
    overflow: hidden;
    animation: window-in 200ms ease-out;
    outline: none;
    min-width: 320px;
    min-height: 200px;
}

.app-window.focused {
    border-color: #7c8b777a;
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
    .app-window {
        background: #101311cc;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
}

.window-titlebar {
    height: 43px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 16px;
    background: #191e1a66;
    border-bottom: 1px solid #0005;
    user-select: none;
    touch-action: none;
    cursor: grab;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 500;
    min-width: 0;
}

.window-title>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-title>.fa {
    color: var(--accent);
    font-size: 13px;
}

.window-title .tile-image {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.window-controls {
    display: flex;
    gap: 5px;
    margin-left: 12px;
}

.window-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 27px;
    font-size: 10px;
    border-radius: 4px;
    color: #b5beb7;
}

.window-control:hover {
    background: #ffffff12;
}

.close-control {
    background: #ffffff09;
}

.close-control:hover {
    background: #aa5649;
    color: #fff;
}

.window-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.mobile-back {
    display: none;
}

.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    touch-action: none;
    background: linear-gradient(135deg, transparent 65%, #76857470 66%, transparent 70%, transparent 79%, #76857470 80%, transparent 85%);
}

.app-window.maximized {
    left: 8px !important;
    top: 48px !important;
    width: calc(100% - 16px) !important;
    height: calc(100% - 136px) !important;
}

.maximized .resize-handle {
    display: none;
}

.window-gesture iframe {
    pointer-events: none;
}

.window-gesture {
    cursor: grabbing;
    user-select: none;
}

@keyframes window-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-manager {
    display: flex;
    height: 100%;
}

.file-sidebar {
    flex: 0 0 154px;
    display: flex;
    flex-direction: column;
    padding: 20px 9px 12px;
    background: #13181440;
    border-right: 1px solid var(--line);
    gap: 3px;
}

.sidebar-label {
    font: 8px var(--mono);
    color: #85928a;
    margin: 0 12px 10px;
}

.sidebar-label:not(:first-child) {
    margin-top: 26px;
}

.file-sidebar>button,
.file-sidebar>a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 11px;
    text-align: left;
    color: #aeb8b0;
}

.file-sidebar>button:hover,
.file-sidebar>a:hover {
    background: #ffffff08;
}

.file-sidebar .selected {
    background: var(--accent-soft);
    color: var(--accent);
}

.file-sidebar .fa {
    width: 15px;
    text-align: center;
    font-size: 13px;
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: auto 8px 0;
    padding-top: 25px;
    font: 8px/1.8 var(--mono);
    color: #a6b4aa;
}

.sidebar-bottom .fa {
    font-size: 23px;
    width: auto;
}

.sidebar-bottom small {
    font-size: 8px;
    color: #798a7e;
}

.file-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-path {
    height: 43px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    font: 10px var(--mono);
    color: #aab6ad;
}

.file-path>.fa {
    color: var(--accent);
}

.file-path .muted {
    padding: 0 7px;
    color: #5f6f63;
}

.file-path b {
    color: #c9d4cc;
    font-weight: 400;
}

.path-end {
    margin-left: auto;
}

.file-scroll {
    overflow: auto;
    padding: 25px 27px;
    flex: 1;
    min-height: 0;
}

.portfolio-intro {
    margin-bottom: 24px;
}

.portfolio-intro .eyebrow {
    font-size: 8px;
}

.portfolio-intro h2 {
    font-size: 27px;
    font-weight: 500;
    margin-top: 4px;
}

.portfolio-intro p {
    font-size: 11px;
    line-height: 1.7;
    margin-top: 7px;
    color: #a1afa5;
    max-width: 390px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
}

.section-heading h3 {
    font-size: 11px;
    font-weight: 500;
}

.section-heading>span {
    font: 8px var(--mono);
    color: #85958a;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 23px;
}

.project-file {
    padding: 0;
    text-align: left;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden;
    background: #141a15;
    transition: border-color 150ms;
}

.project-file:hover {
    border-color: #a5c6ad80;
}

.project-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #101310;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.djinn-image {
    background: #111213;
}

.djinn-image img {
    padding: 20px;
}

.image-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font: 7px var(--mono);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 6px;
    border: 1px solid #ffffff19;
    background: #0c100ce8;
    border-radius: 3px;
}

.image-badge .fa {
    font-size: 10px;
}

.project-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    gap: 10px;
}

.project-detail h4 {
    font-weight: 500;
    font-size: 12px;
}

.project-detail p {
    margin-top: 4px;
    color: #8b9b90;
    font: 8px var(--mono);
}

.project-detail>.fa {
    font-size: 11px;
    color: #8a9f90;
}

.project-detail>.fa-arrow-up {
    transform: rotate(45deg);
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.folder-grid>button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    text-align: left;
    border-top: 1px solid var(--line);
    font-size: 11px;
    min-width: 0;
}

.small-tile {
    color: var(--tile-bg);
    width: 28px;
    text-align: center;
    font-size: 21px;
    flex-shrink: 0;
}

.folder-grid small {
    display: block;
    color: #819186;
    font-size: 9px;
    margin-top: 5px;
}

.folder-grid>button>.fa {
    margin-left: auto;
    color: #829989;
}

.file-status {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 8px 16px;
    font: 8px var(--mono);
    color: #84988a;
}

.app-launcher {
    position: fixed;
    top: 49px;
    left: 12px;
    width: 420px;
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 145px);
    display: flex;
    flex-direction: column;
    z-index: 120;
    background: #111713f5;
    backdrop-filter: blur(24px);
    border: 1px solid #ffffff20;
    border-radius: 8px;
    box-shadow: 0 16px 70px #0009;
    padding: 20px;
    animation: window-in 150ms ease-out;
}

.launcher-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #ffffff18;
    border-radius: 5px;
    background: #0b110d;
}

.launcher-search .fa {
    font-size: 13px;
    color: var(--accent);
}

.launcher-search input {
    flex: 1;
    width: 100%;
    border: 0;
    color: var(--text);
    background: transparent;
    font-size: 13px;
    outline: none;
}

.launcher-search:focus-within {
    border-color: var(--accent);
}

.launcher-search kbd {
    font: 9px var(--mono);
    color: #8c9c91;
}

.launcher-heading {
    display: flex;
    justify-content: space-between;
    margin: 23px 0 15px;
    font: 9px var(--mono);
    color: #99aa9f;
}

.launcher-apps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: auto;
}

.launcher-app {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 12px 2px;
    border-radius: 5px;
}

.launcher-app:hover {
    background: #ffffff0a;
}

.launcher-app .app-tile {
    width: 42px;
    height: 40px;
}

.launcher-app .app-label {
    font-size: 11px;
}

.launcher-app .external-mark {
    right: 21px;
    top: 10px;
    color: #afc0b3;
}

.launcher-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    font: 11px var(--mono);
}

.launcher-footer img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.launcher-footer a {
    margin-left: auto;
    padding: 8px;
}

#search-empty {
    padding: 25px 0;
    color: var(--muted);
    font-size: 13px;
}

.embed-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 10px;
    color: var(--muted);
    flex-shrink: 0;
}

.embed-toolbar a {
    color: var(--accent);
    white-space: nowrap;
}

.embed-toolbar a .fa {
    margin-left: 5px;
}

.embed-view iframe {
    display: block;
    width: 100%;
    border: 0;
    flex: 1;
    min-height: 0;
    background: transparent;
}

:root.desktop-embedded,
:root.desktop-embedded body,
:root.desktop-embedded #experiment-view,
:root.desktop-embedded #experiment-view iframe {
    background: transparent;
}

:root.desktop-embedded .experiments-toolbar,
:root.desktop-embedded .experiments-status,
:root.desktop-embedded .gallery-toolbar {
    background: #13181440;
}

.about-content {
    max-width: 600px;
    padding: 38px;
    margin: auto;
}

.about-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 22px;
}

.about-content h2,
.settings-content h2 {
    font-size: 28px;
    font-weight: 500;
    margin: 7px 0 15px;
}

.about-content>p {
    line-height: 1.9;
    font-size: 13px;
    color: #acb9b0;
}

.about-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 22px 0;
    margin-top: 15px;
    border-top: 1px solid var(--line);
}

.about-facts span {
    font: 9px var(--mono);
    color: #889c8f;
}

.about-facts b {
    display: block;
    font: 12px var(--font);
    color: #d5e1d8;
    margin-top: 8px;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 4px;
    padding: 12px 18px;
    background: var(--accent);
    color: #15291d;
    font-weight: 500;
    font-size: 12px;
}

.primary-action:hover {
    color: #15291d;
    filter: brightness(1.08);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 28px;
    font-size: 10px;
    color: #a1b3a7;
}

.social-links .fa {
    font-size: 8px;
    margin-left: 4px;
}

.settings-content {
    padding: 26px 30px;
}

.settings-content h2 {
    font-size: 25px;
}

.settings-content fieldset {
    border: 0;
    padding: 0;
    margin: 25px 0;
}

.settings-content legend {
    font-size: 12px;
    margin-bottom: 12px;
}

.wallpaper-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wallpaper-options label {
    position: relative;
    font-size: 11px;
    color: #a4b3a9;
    cursor: pointer;
}

.wallpaper-options input {
    position: absolute;
    top: 10px;
    left: 9px;
    accent-color: var(--accent);
}

.wallpaper-preview {
    display: block;
    height: 90px;
    border-radius: 5px;
    border: 2px solid transparent;
    margin-bottom: 8px;
}

.wallpaper-options input:checked+.wallpaper-preview {
    border-color: var(--accent);
}

.world-preview {
    background: url('img/desktop-wallpaper.jpg') center / cover;
}

.image-preview {
    background-position: center;
    background-size: cover;
}

.swatch-options {
    display: flex;
    gap: 24px;
}

.swatch-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    cursor: pointer;
}

.swatch-options input {
    accent-color: var(--accent);
}

.swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tile-bg);
}

.swatch.red {
    --tile-bg: #f46b6b;
}

.swatch.green {
    --tile-bg: lab(64.67% -65.51 62.29);
}

.setting-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    font-size: 12px;
}

.setting-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.terminal-content {
    padding: 25px;
    font: 12px/1.9 var(--mono);
    background: #0b100d33;
    min-height: 100%;
    overflow-wrap: anywhere;
}

.terminal-brand {
    font: 36px var(--font);
    color: var(--accent);
    margin-bottom: 14px;
}

.terminal-output>p {
    margin: 8px 0;
    white-space: pre-wrap;
}

.terminal-output>p:nth-child(4) {
    margin: 20px 0;
}

.terminal-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 20px;
}

.terminal-form label {
    white-space: nowrap;
    font-size: 11px;
}

.terminal-form input {
    flex: 1;
    border: 0;
    background: transparent;
    color: #e0ede3;
    outline: none;
    padding: 4px 0;
    font: inherit;
    width: 100%;
}

.terminal-form:focus-within {
    border-bottom: 1px solid #a7edc233;
}

.terminal-form button {
    padding: 8px;
    color: var(--accent);
}

.no-script {
    position: fixed;
    top: 210px;
    left: 150px;
    padding: 30px;
    background: #131814;
    z-index: 200;
    max-width: calc(100% - 30px);
}

.no-script a {
    text-decoration: underline;
}

.app-window {
    container-type: inline-size;
}

@container (max-width: 600px) {
    .file-sidebar {
        flex-basis: 48px;
        padding: 14px 5px;
    }

    .file-sidebar>button,
    .file-sidebar>a {
        justify-content: center;
        padding: 12px 0;
    }

    .file-sidebar>button span,
    .file-sidebar>a span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .sidebar-label,
    .sidebar-bottom {
        display: none;
    }

    .file-scroll {
        padding: 20px 16px;
    }

    .project-grid,
    .folder-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-intro h2 {
        font-size: 24px;
    }

    .file-status>span:last-child {
        display: none;
    }
}

@media (min-width: 761px) and (max-height: 700px) {
    .desktop-signature {
        top: 60px;
    }

    .desktop-signature h1 {
        font-size: 48px;
    }

    .desktop-icons {
        top: 170px;
    }

    .app-icon {
        gap: 5px;
    }

    .app-icon .app-tile {
        width: 38px;
        height: 35px;
    }

    .app-icon .app-tile .fa {
        font-size: 20px;
    }

    .desktop-caption {
        display: none;
    }
}

@media (max-width: 760px) {
    .system-panel {
        height: calc(44px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 12px 0;
        background: #141b1780;
        border: 0;
    }

    .panel-left {
        gap: 5px;
    }

    .panel-button {
        height: 40px;
        min-width: 40px;
        justify-content: center;
    }

    .panel-button span,
    .panel-divider,
    .panel-clock {
        display: none;
    }

    .panel-brand {
        font-size: 14px;
    }

    .panel-right {
        gap: 0;
    }

    #desktop {
        top: calc(44px + env(safe-area-inset-top));
        overflow-y: auto;
        padding: 0 20px calc(110px + env(safe-area-inset-bottom));
    }

    .wallpaper {
        background-position: 55% center;
    }

    .desktop-signature,
    .desktop-caption {
        display: none;
    }

    .mobile-clock {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 38px 0 35px;
        text-shadow: 0 2px 20px #0008;
    }

    .mobile-clock>p {
        font-size: 13px;
        color: #d1e0d5;
    }

    #mobile-time {
        font-size: 48px;
        font-weight: 400;
        line-height: 1.2;
        margin: 5px 0 14px;
        font-variant-numeric: tabular-nums;
    }

    .mobile-clock>span {
        font: 8px var(--mono);
        color: #c0d2c6;
        text-align: center;
    }

    .desktop-icons {
        position: static;
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: auto;
        gap: 22px 7px;
    }

    .desktop-icons .app-icon {
        display: flex;
        gap: 10px;
        min-height: 94px;
        padding: 4px 0;
    }

    .app-tile {
        width: 53px;
        height: 53px;
        border-radius: 8px;
    }

    .app-tile .fa {
        font-size: 26px;
    }

    .app-label {
        font-size: 11px;
        line-height: 1.4;
    }

    .external-mark {
        top: 3px;
        right: 7px;
    }

    .dock {
        bottom: calc(12px + env(safe-area-inset-bottom));
        max-width: calc(100% - 24px);
        padding: 7px;
        gap: 3px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .dock-button {
        width: 43px;
        height: 47px;
    }

    .dock-button .app-tile {
        width: 36px;
        height: 37px;
    }

    .dock-divider {
        margin: 0;
        height: 26px;
    }

    .dock-tooltip {
        display: none;
    }

    .dock-button:hover .app-tile {
        transform: none;
    }

    .app-window,
    .app-window.maximized {
        position: fixed;
        top: calc(44px + env(safe-area-inset-top)) !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        min-width: 0;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .window-titlebar {
        height: 49px;
        padding: 0 14px 0 7px;
        justify-content: flex-start;
        gap: 9px;
        cursor: default;
    }

    .window-title {
        font-size: 13px;
    }

    .mobile-back {
        display: flex;
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    .window-controls,
    .resize-handle {
        display: none;
    }

    .file-sidebar {
        flex: 0 0 48px;
        padding: 14px 5px;
        gap: 8px;
    }

    .file-sidebar>button,
    .file-sidebar>a {
        padding: 12px 0;
        justify-content: center;
        min-height: 42px;
    }

    .file-sidebar>button .fa,
    .file-sidebar>a .fa {
        font-size: 16px;
    }

    .file-sidebar>button span,
    .file-sidebar>a span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .sidebar-label,
    .sidebar-bottom {
        display: none;
    }

    .file-path {
        padding: 0 15px;
        height: 39px;
        font-size: 9px;
        gap: 8px;
    }

    .file-path .muted {
        padding: 0 3px;
    }

    .path-end {
        display: none;
    }

    .file-scroll {
        padding: 22px 16px;
    }

    .portfolio-intro h2 {
        font-size: 25px;
    }

    .portfolio-intro p {
        font-size: 11px;
    }

    .project-grid,
    .folder-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .project-detail h4 {
        font-size: 14px;
    }

    .project-detail p {
        font-size: 10px;
    }

    .project-image {
        aspect-ratio: 16 / 9;
    }

    .section-heading h3 {
        font-size: 12px;
    }

    .section-heading>span {
        font-size: 7px;
    }

    .folder-grid>button {
        font-size: 12px;
        min-height: 60px;
    }

    .folder-grid small {
        font-size: 10px;
    }

    .file-status {
        padding: 8px 12px;
        font-size: 7px;
    }

    .file-status>span:last-child {
        display: none;
    }

    .app-launcher {
        top: calc(54px + env(safe-area-inset-top));
        max-height: calc(100dvh - 145px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        padding: 18px;
    }

    .launcher-search input {
        font-size: 16px;
    }

    .launcher-apps {
        gap: 4px;
    }

    .launcher-app {
        padding: 13px 0;
    }

    .launcher-app .app-tile {
        width: 44px;
        height: 44px;
    }

    .launcher-footer {
        margin-top: 12px;
    }

    .embed-toolbar {
        padding: 12px;
        gap: 8px;
    }

    .embed-toolbar>span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:has(.app-window[data-app-id="projects"]:not([hidden])) .system-panel {
        display: none;
    }

    .app-window[data-app-id="projects"] {
        top: env(safe-area-inset-top) !important;
        height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    }

    .app-window[data-app-id="projects"] .window-titlebar {
        height: 44px;
    }

    .app-window[data-app-id="projects"] .mobile-back {
        width: 44px;
        height: 44px;
    }

    .app-window[data-app-id="projects"] .embed-toolbar {
        display: none;
    }

    .about-content,
    .settings-content {
        padding: 27px 22px;
    }

    .about-content h2 {
        font-size: 28px;
    }

    .about-content>p {
        font-size: 13px;
    }

    .social-links {
        gap: 18px;
        font-size: 12px;
    }

    .social-links a {
        padding: 7px 0;
    }

    .terminal-content {
        padding: 20px 16px;
        font-size: 11px;
    }

    .terminal-form {
        gap: 4px;
        flex-wrap: wrap;
    }

    .terminal-form label {
        font-size: 10px;
    }

    .terminal-form input {
        font-size: 16px;
        min-width: 80px;
    }

    .terminal-form button {
        min-width: 40px;
        min-height: 40px;
    }

    .no-script {
        left: 15px;
        top: 180px;
    }
}

@media (max-width: 360px) {
    #desktop {
        padding-left: 12px;
        padding-right: 12px;
    }

    .desktop-icons {
        gap: 18px 4px;
    }

    .app-label {
        font-size: 10px;
    }

    .app-tile {
        width: 48px;
        height: 48px;
    }

    .dock-button {
        width: 38px;
    }

    .dock {
        gap: 2px;
    }

    .file-scroll {
        padding: 18px 12px;
    }

    .portfolio-intro h2 {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation: none !important;
    transition: none !important;
}