@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&family=Ubuntu+Mono:wght@400;700&family=JetBrains+Mono:wght@700&display=swap');

/* Yaru dark, as close as CSS gets. Colours are taken from the Yaru
   GTK theme and the Tango palette GNOME Terminal ships with. */
:root {
    --panel-bg: rgba(0, 0, 0, 0.85);
    --dock-bg: rgba(0, 0, 0, 0.62);
    --orange: #e95420;
    --orange-hover: #f08763;
    --aubergine-0: #2c001e;
    --aubergine-1: #5e2750;
    --aubergine-2: #772953;
    --win-bg: #1e1e1e;
    --win-header: #2b2b2b;
    --win-header-unfocused: #242424;
    --win-border: rgba(255, 255, 255, 0.08);
    --fg: #f7f7f7;
    --fg-dim: #c0bfbc;
    --fg-muted: #9a9996;
    --term-bg: #300a24;
    --term-fg: #ffffff;
    --term-green: #8ae234;
    --term-blue: #729fcf;
    --term-cyan: #34e2e2;
    --term-yellow: #fce94f;
    --term-red: #ef2929;
    --term-muted: #b7aeb3;
    --font-ui: 'Ubuntu', 'Noto Sans', 'DejaVu Sans', system-ui, sans-serif;
    --font-mono: 'Ubuntu Mono', 'DejaVu Sans Mono', 'Liberation Mono', monospace;
    --panel-h: 27px;
    --dock-w: 64px;
    --header-h: 46px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--fg);
    background: var(--aubergine-0);
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
}

/* Wallpaper: aubergine gradient with an orange glow and a few big
   translucent shapes, in the spirit of the stock wallpapers. */
.wallpaper {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 55% at 85% 95%, rgba(233, 84, 32, 0.45), transparent 70%),
        radial-gradient(ellipse 50% 40% at 10% 10%, rgba(119, 41, 83, 0.6), transparent 70%),
        linear-gradient(135deg, var(--aubergine-0) 0%, var(--aubergine-1) 55%, var(--aubergine-2) 100%);
}

.wallpaper svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Top panel */
.top-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--panel-h);
    background: var(--panel-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    font-size: 13px;
    z-index: 3000;
    user-select: none;
}

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

.panel-item {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 6px;
    cursor: default;
}

.panel-item.activities {
    cursor: pointer;
    font-weight: 500;
    padding: 0 12px;
}

.panel-item.activities:hover,
.panel-item.activities.open {
    background: rgba(255, 255, 255, 0.12);
}

.panel-clock {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    white-space: nowrap;
}

.panel-tray {
    gap: 8px;
    padding-right: 8px;
}

.panel-tray svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.panel-tray:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Dock (left, "panel mode" as Ubuntu ships it) */
.dock {
    position: fixed;
    top: var(--panel-h);
    left: 0;
    bottom: 0;
    width: var(--dock-w);
    background: var(--dock-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    gap: 2px;
    z-index: 2500;
    user-select: none;
}

.dock-item {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.dock-item img {
    width: 44px;
    height: 44px;
}

.dock-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.dock-item.focused {
    background: rgba(255, 255, 255, 0.18);
}

.dock-item::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: var(--orange);
    opacity: 0;
}

.dock-item.running::after {
    opacity: 1;
}

.dock-item .tooltip {
    position: absolute;
    left: 66px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    border: 1px solid var(--win-border);
}

.dock-item:hover .tooltip {
    opacity: 1;
}

.dock-spacer {
    flex: 1;
}

.dock-item.show-apps svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

/* Work area: everything below the panel and right of the dock */
.desktop {
    position: fixed;
    top: var(--panel-h);
    left: var(--dock-w);
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
}

/* Desktop icons */
.desktop-icons {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 500;
}

.desktop-icon {
    position: absolute;
    width: 88px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    border-radius: 6px;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon.selected {
    background: rgba(233, 84, 32, 0.35);
    border-color: rgba(233, 84, 32, 0.6);
}

.icon-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.icon-label {
    color: #fff;
    font-size: 13px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
    max-width: 84px;
    overflow-wrap: break-word;
    word-break: keep-all;
}

/* Windows */
.window {
    position: absolute;
    background: var(--win-bg);
    border: 1px solid var(--win-border);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 400px;
    min-height: 300px;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    display: none;
    overflow: hidden;
}

.window.active {
    display: flex;
    flex-direction: column;
    animation: windowOpen 0.15s ease-out;
}

@keyframes windowOpen {
    from { opacity: 0; scale: 0.96; }
    to { opacity: 1; scale: 1; }
}

.window.minimized {
    display: none;
}

.window.maximized {
    max-width: none;
    max-height: none;
    border-radius: 0;
    border-color: transparent;
    box-shadow: none;
}

.window-header {
    height: var(--header-h);
    flex: 0 0 var(--header-h);
    background: var(--win-header-unfocused);
    display: flex;
    align-items: center;
    padding: 0 8px 0 14px;
    cursor: default;
    user-select: none;
    position: relative;
}

.window.focused .window-header {
    background: var(--win-header);
}

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--fg);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 140px);
    pointer-events: none;
}

.window.focused .window-title {
    color: #fff;
}

.window:not(.focused) .window-title {
    color: var(--fg-muted);
}

.window-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.window-control {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s ease;
}

.window-control svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--fg);
    stroke-width: 1.5;
}

.window:not(.focused) .window-control svg {
    stroke: var(--fg-muted);
}

.window-control.minimize:hover,
.window-control.maximize:hover {
    background: rgba(255, 255, 255, 0.14);
}

.window-control.close {
    background: var(--orange);
}

.window-control.close svg {
    stroke: #fff;
    stroke-width: 1.8;
}

.window:not(.focused) .window-control.close {
    background: #4a4a4a;
}

.window-control.close:hover {
    background: var(--orange-hover);
}

.window-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    color: var(--fg-dim);
}

/* Default window positions (relative to the work area) */
.hero-window {
    width: 820px;
    height: auto;
    max-height: calc(96% - 16px);
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
}

.about-window {
    width: 700px;
    height: 620px;
    top: 8%;
    left: 12%;
}


.contact-window {
    width: 800px;
    height: 600px;
    top: 12%;
    left: 14%;
}


/* Terminal windows (GNOME Terminal, Tango palette) */
.terminal-app .window-content {
    background: var(--term-bg);
    color: var(--term-fg);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.4;
    padding: 8px 12px;
}

/* Box-drawing glyphs need a font that actually has them at the same
   advance width; Ubuntu Mono doesn't, JetBrains Mono does. */
.ascii-art {
    color: var(--term-green);
    font-family: 'JetBrains Mono', 'DejaVu Sans Mono', monospace;
    font-size: 9px;
    line-height: 1.2;
    white-space: pre;
    margin: 4px 0 18px;
    font-weight: 700;
}

.terminal-line {
    margin-bottom: 0.7em;
}

.prompt {
    color: var(--term-fg);
    font-weight: 700;
}

.prompt .user {
    color: var(--term-green);
}

.prompt .path {
    color: var(--term-blue);
}

.command {
    color: var(--term-fg);
}

.output {
    color: var(--term-fg);
    margin-left: 0;
}

.success {
    color: var(--term-green);
    font-weight: 700;
}

.highlight {
    color: var(--term-cyan);
    font-weight: 700;
}

.dir-comment {
    color: var(--term-muted);
}

.output a {
    color: var(--term-cyan);
    text-decoration: underline;
}

.output a:hover {
    color: var(--term-green);
}

.output.tree {
    white-space: pre;
    overflow-x: auto;
    font-family: inherit;
}

/* Hello line (typed on first visit) */
.hello-line {
    color: var(--term-fg);
    min-height: 1.4em;
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    margin-left: 1px;
    vertical-align: text-bottom;
    background: var(--term-fg);
    animation: blink 1s steps(1) infinite;
}

.cursor.done {
    display: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Text Editor documents */
.editor-app .window-content {
    width: 100%;
    max-width: calc(72ch + 48px);
}

.contact-window .window-content {
    max-width: none;
    margin: 0 auto;
    padding: 24px;
    font: 15px/1.7 var(--font-ui);
    color: var(--fg-dim);
    overflow-wrap: anywhere;
}

.editor-app .terminal-line { font: inherit; }
.editor-app .output { color: var(--fg-dim); }
.editor-app .highlight { color: var(--orange-hover); }
.editor-app .success { color: #8ae234; }
.editor-app .prompt .user { color: var(--term-green); }
.editor-app .prompt .path { color: var(--term-blue); }
.editor-app .command { color: var(--fg); }
.editor-app .output.tree,
.editor-app .json-doc,
.editor-app .prompt,
.editor-app .command { font-family: var(--font-mono); }
.editor-app .output.tree,
.editor-app .json-doc { white-space: pre-wrap; overflow-wrap: anywhere; }

/* contact.json: a plain document with JSON colouring */
.json-doc { color: var(--fg-dim); margin-bottom: 20px; font-size: 14px; line-height: 1.6; }
.json-doc .json-key { color: var(--term-blue); }
.json-doc .json-str { color: #8ae234; }
.json-doc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.json-doc a:hover { color: var(--orange-hover); }

.about-text h2 {
    color: var(--fg);
    font-size: 22px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.about-text p { margin-bottom: 16px; }

.contact-links {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    border: 1px solid var(--win-border);
    border-radius: 8px;
    overflow: hidden;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    color: var(--fg);
    text-decoration: none;
    background: #262626;
}

.contact-row + .contact-row { border-top: 1px solid var(--win-border); }
.contact-row:hover { background: #303030; }
.contact-row:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.contact-row img { width: 32px; height: 32px; flex: 0 0 auto; }
.contact-row > span { min-width: 0; }
.contact-row strong { font-size: 14px; }
.contact-description { display: block; font-size: 12px; color: var(--fg-muted); }
.contact-arrow { margin-left: auto; color: var(--fg-muted); }

/* Files (Nautilus) */
.files-window {
    width: 960px;
    height: 620px;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
}

.files-header {
    gap: 6px;
    padding-left: 8px;
}

.files-header .window-title {
    display: none;
}

.hb-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--fg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.hb-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hb-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.hb-btn:disabled {
    color: #6a6a6a;
    cursor: default;
}

.files-nav {
    display: flex;
    gap: 2px;
}

.files-path {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 6px;
}

.files-path::-webkit-scrollbar { display: none; }

.crumb {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--fg-dim);
    font: inherit;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.crumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

.crumb.current {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg);
    font-weight: 700;
}

.crumb-sep {
    color: var(--fg-muted);
    padding: 0 2px;
}

.files-tools {
    display: flex;
    gap: 2px;
    margin-right: 6px;
}

.files-body {
    flex: 1;
    min-height: 0;
    display: flex;
}

.files-sidebar {
    flex: 0 0 200px;
    background: #262626;
    border-right: 1px solid rgba(0, 0, 0, 0.4);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--fg);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.sb-item img {
    width: 18px;
    height: 18px;
}

.sb-star {
    width: 18px;
    text-align: center;
    color: var(--fg-muted);
}

.sb-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sb-item.current {
    background: rgba(255, 255, 255, 0.14);
}

.sb-item.muted {
    color: var(--fg-muted);
    cursor: default;
}

.sb-item.muted:hover {
    background: transparent;
}

.files-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--win-bg);
}

.files-grid {
    width: 100%;
    max-width: 458px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 104px);
    grid-auto-rows: max-content;
    gap: 6px;
    align-content: start;
}

.fs-item {
    width: 104px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    cursor: default;
    user-select: none;
}

.fs-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.fs-item.selected {
    background: rgba(233, 84, 32, 0.35);
}

.fs-icon {
    position: relative;
    width: 64px;
    height: 64px;
}

.fs-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.fs-emblem {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    padding: 3px;
    border-radius: 50%;
    background: #f7f7f7;
    fill: #1e1e1e;
}

.fs-label {
    font-size: 13px;
    color: var(--fg);
    text-align: center;
    line-height: 1.25;
    max-width: 96px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.files-grid[hidden] {
    display: none;
}

.fs-count {
    font-size: 11px;
    color: var(--fg-muted);
}

.fs-item:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: -2px;
}

.files-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--fg-muted);
}

.files-empty[hidden] {
    display: none;
}

.files-empty img {
    width: 96px;
    height: 96px;
    opacity: 0.5;
}

.files-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg-dim);
}

.files-status {
    flex: 0 0 auto;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--fg-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.4);
}

.files-details {
    flex: 0 0 300px;
    background: #262626;
    border-left: 1px solid rgba(0, 0, 0, 0.4);
    padding: 20px 18px;
    overflow-y: auto;
    position: relative;
}

.files-details[hidden] {
    display: none;
}

.dt-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    margin-bottom: 14px;
}

.dt-head img {
    width: 80px;
    height: 80px;
    margin-bottom: 6px;
    object-fit: contain;
}

.dt-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--fg);
}

.dt-sub {
    font-size: 13px;
    color: var(--fg-muted);
}

.dt-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--fg-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dt-close svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.dt-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg);
}

.dt-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--fg-dim);
    margin-bottom: 12px;
}

.dt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.chip {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg-dim);
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 12px;
}

.dt-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dt-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.dt-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.dt-btn.primary {
    background: var(--orange);
    color: #fff;
}

.dt-btn.primary:hover {
    background: var(--orange-hover);
}

.dt-note {
    font-size: 12.5px;
    color: var(--fg-muted);
    text-align: center;
}

/* Browser (Firefox-ish chrome in Yaru dark) */
.browser-window {
    width: 1100px;
    height: 720px;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
}

.browser-app .window-header {
    background: #1c1b22;
    padding-left: 8px;
}

.browser-app.focused .window-header {
    background: #1c1b22;
}

.browser-tabs {
    display: flex;
    align-items: flex-end;
    align-self: stretch;
    gap: 4px;
    padding-top: 6px;
    min-width: 0;
    flex: 1;
}

.browser-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    background: #42414d;
    color: #fbfbfe;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    max-width: 240px;
    min-width: 0;
    align-self: flex-end;
    margin-bottom: 2px;
    box-shadow: inset 0 2px 0 var(--orange);
}

.tab-favicon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8f8f9d;
    flex: 0 0 auto;
}

.tab-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-newtab {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbfbfe;
    font-size: 18px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.browser-newtab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.browser-toolbar {
    flex: 0 0 42px;
    height: 42px;
    background: #2b2a33;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

.nav-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #fbfbfe;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.nav-btn:disabled {
    color: #6f6f7a;
    cursor: default;
}

.address-bar {
    flex: 1;
    min-width: 0;
    height: 32px;
    margin: 0 6px;
    background: #1c1b22;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    color: #fbfbfe;
    font-size: 14px;
}

.address-bar .lock {
    width: 14px;
    height: 14px;
    fill: #8f8f9d;
    color: #8f8f9d;
    flex: 0 0 auto;
}

.address-bar .address {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.open-external {
    flex: 0 0 auto;
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--orange);
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.open-external:hover {
    background: var(--orange-hover);
}

.browser-loading {
    height: 2px;
    flex: 0 0 2px;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.browser-loading.on::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    background: var(--orange);
    animation: loadingBar 1.1s ease-in-out infinite;
}

@keyframes loadingBar {
    from { left: -35%; }
    to { left: 100%; }
}

.browser-body {
    padding: 0;
    overflow: hidden;
    position: relative;
    background: #1c1b22;
}

.browser-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    display: block;
}

.browser-fallback {
    position: absolute;
    inset: 0;
    background: #1c1b22;
    color: #fbfbfe;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    gap: 10px;
}

.browser-fallback.on {
    display: flex;
}

.browser-fallback h2 {
    font-size: 20px;
    font-weight: 500;
}

.browser-fallback p {
    color: #bfbfc9;
    max-width: 48ch;
}

.fallback-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--orange);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

/* App grid (Activities / Show Applications) */
.app-grid {
    position: fixed;
    inset: var(--panel-h) 0 0 0;
    background: rgba(20, 10, 18, 0.92);
    z-index: 2800;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 24px;
    overflow-y: auto;
}

.app-grid.open {
    display: flex;
    animation: fadeIn 0.12s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.app-grid-inner {
    display: grid;
    grid-template-columns: repeat(4, 120px);
    gap: 28px 24px;
}

.app-launcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 6px;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.app-launcher:hover {
    background: rgba(255, 255, 255, 0.1);
}

.app-launcher img {
    width: 64px;
    height: 64px;
}

/* Boot: a systemd journal on black */
.boot-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 5000;
    padding: 24px 28px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.45;
    display: none;
}

.boot-screen.on {
    display: block;
}

.boot-screen.off {
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.boot-log {
    font-family: inherit;
    white-space: pre-wrap;
}

.boot-log .ok {
    color: #4e9a06;
    font-weight: 700;
}

.boot-log .ok b {
    color: #8ae234;
}

.boot-log::after {
    content: '_';
    animation: blink 1s steps(1) infinite;
}

.boot-skip {
    position: absolute;
    left: 28px;
    bottom: 24px;
    color: #777;
    font-family: var(--font-mono);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --dock-w: 0px;
    }

    .desktop {
        left: 0;
        bottom: 64px;
    }

    .dock {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        height: 64px;
        flex-direction: row;
        justify-content: center;
        padding: 0 6px;
        gap: 4px;
    }

    .dock-item .tooltip {
        display: none;
    }

    .dock-item::after {
        left: 50%;
        top: auto;
        bottom: 2px;
        margin: 0 0 0 -2px;
    }

    .dock-spacer {
        display: none;
    }

    .panel-item.activities span {
        display: none;
    }

    .window {
        min-width: 0;
        width: calc(100vw - 16px) !important;
        height: calc(100% - 16px) !important;
        top: 8px !important;
        left: 8px !important;
        right: auto !important;
        transform: none !important;
    }

    .window-content {
        padding: 14px 16px;
    }

    .terminal-app .window-content {
        font-size: 13px;
        padding: 8px 10px;
    }

    .ascii-art {
        font-size: 6.5px;
    }

    .output.tree {
        font-size: 12px;
    }

    .boot-screen {
        padding: 14px;
        font-size: 12px;
    }

    .boot-skip {
        left: 14px;
        bottom: 14px;
    }

    .files-sidebar,
    .files-tools {
        display: none;
    }

    .files-body {
        position: relative;
    }

    .files-details {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 60%;
        flex: none;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    }

    .files-path { margin: 0; }
    .crumb { padding: 5px 6px; font-size: 12px; }
    .crumb-sep { padding: 0; }
    .files-header { gap: 2px; }
    .files-nav .hb-btn { width: 28px; }

    .editor-app .window-content { padding: 16px; }
    .terminal-app .output.tree { white-space: pre-wrap; overflow-wrap: anywhere; }

    .files-grid {
        grid-template-columns: repeat(auto-fill, 88px);
        justify-content: space-around;
    }

    .fs-item {
        width: 88px;
    }

    .browser-tab {
        max-width: 150px;
    }

    .open-external {
        padding: 0 8px;
        font-size: 12px;
    }

    .nav-btn.menu,
    #browser-reload {
        display: none;
    }

    .app-grid-inner {
        grid-template-columns: repeat(3, 96px);
        gap: 20px 12px;
    }

    /* Icons reflow into a wrapped grid instead of absolute positions */
    .desktop-icons {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px 8px;
        align-content: flex-start;
    }

    .desktop-icon {
        position: static !important;
        width: 84px;
    }

    .icon-image {
        width: 52px;
        height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .window.active { animation: none; }
    .cursor { animation: none; }
}

/* Interactive desktop applications */
[hidden], .desktop-icon[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.panel-tray { border: 0; background: transparent; color: white; }
.system-menu { position: fixed; z-index: 100000; right: 10px; top: 35px; width: min(360px, calc(100vw - 20px)); padding: 18px; background: #303030; border: 1px solid #555; border-radius: 14px; box-shadow: 0 12px 30px #0009; }
.volume-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.volume-row label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.volume-row input { min-width: 0; flex: 1; accent-color: var(--orange); }
.volume-row output { width: 38px; font-size: 12px; }
#system-mute { background: #454545; color: white; border: 0; border-radius: 50%; width: 34px; height: 34px; }
.system-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-top: 1px solid #ffffff18; }
.system-row strong { margin-left: auto; }
.system-row > span:last-child { font-size: 12px; color: var(--fg-muted); }
.egg-tracker { position: fixed; bottom: 12px; right: 12px; z-index: 100000; border: 1px solid #ffffff30; color: #ccc; background: #242424e8; border-radius: 16px; padding: 6px 12px; font-size: 12px; }
.egg-tracker.complete { color: #1e1700; background: #e9b949; border-color: #ffe3a0; }
.has-eggs .desktop { bottom: 48px; }
.crash-screen { position: fixed; inset: 0; z-index: 1000000; background: #160713; color: #eee; display: grid; place-items: center; padding: 24px; }
.crash-screen pre { white-space: pre-wrap; max-width: 70ch; font: 16px/1.8 var(--font-mono); }
.boot-screen { z-index: 1000001; }
.boot-ok { color: var(--term-green); }
.boot-skip { color: #ddd; border: 1px solid #555; padding: 8px 14px; border-radius: 5px; background: #222; }
.window-header, .desktop-icon { touch-action: none; }
.window-header, .desktop-icon, .desktop-icon img, .fs-item, .fs-item img, .playing-card, .dock-item img, .icon-image { -webkit-user-drag: none; user-select: none; }
.pointer-dragging { cursor: grabbing !important; user-select: none; }
.pointer-dragging iframe { pointer-events: none !important; }
.drag-source { opacity: 0.6; pointer-events: none !important; }
.desktop-icon.drag-source { z-index: 100000; }
.drop-ready { background: #e9542066 !important; outline: 2px solid var(--orange); }
.sb-item { border: 0; background: transparent; text-align: left; flex-shrink: 0; }
.fs-item { touch-action: pan-y; }
.fs-repo-emblem { position: absolute; right: 0; bottom: 0; font: bold 10px/18px var(--font-mono); background: #eee; color: #222; border-radius: 50%; width: 22px; height: 22px; text-align: center; border: 2px solid #eee; }
.files-footer { display: flex; align-items: center; gap: 8px; border-top: 1px solid #ffffff12; padding-right: 8px; }
.files-footer .files-status { border-top: 0; margin-right: auto; }
.files-footer button { border: 0; border-radius: 4px; color: var(--fg-dim); background: transparent; font-size: 11px; padding: 6px; }
#files-hidden[aria-pressed="true"] { background: #ffffff1a; color: white; }
.fs-photo .fs-icon img { object-fit: contain; }
#browser-location { flex: 1; min-width: 0; }
#browser-address { display: block; border: 0; background: transparent; color: inherit; width: 100%; min-width: 0; padding: 3px; text-overflow: ellipsis; }
#terminal-form { display: flex; gap: 8px; align-items: baseline; padding-bottom: 8px; }
#terminal-form .prompt { flex: 0 1 auto; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#terminal-input { min-width: 40px; flex: 1; border: 0; background: transparent; color: var(--term-fg); caret-color: var(--term-fg); font: inherit; outline-offset: 2px; }
#terminal-output { overflow-wrap: anywhere; }
.terminal-response { white-space: pre-wrap; margin: 5px 0 14px; font: inherit; overflow-wrap: anywhere; }
.terminal-echo { color: var(--term-green); white-space: pre-wrap; }
.intro-skip { position: sticky; bottom: 5px; float: right; color: #ddd; background: #48213c; border: 1px solid #835274; border-radius: 5px; padding: 4px 10px; }
.extra-window { width: 800px; height: 640px; top: 4%; left: 50%; transform: translateX(-50%); }
.extra-window .window-content { min-width: 0; }
#notes-content { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.7 var(--font-mono); }
.photo-app .window-content { display: flex; flex-direction: column; padding: 0; background: #151515; }
.photo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; background: #262626; }
.photo-toolbar button, .game-toolbar button, .media-controls button { background: #414141; border: 1px solid #555; border-radius: 5px; color: #fff; min-width: 36px; min-height: 34px; }
#photo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
#photo-image { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.media-app { width: 680px; height: 640px; }
.media-app .window-content { padding: 16px; }
.youtube-stage { width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #111; display: grid; place-items: center; border-radius: 5px; overflow: hidden; }
.youtube-stage iframe { width: 100%; height: 100%; min-height: 200px; border: 0; }
.media-start { background: var(--orange); color: white; padding: 10px 18px; border: 0; border-radius: 5px; }
.media-info { margin: 14px 0; font-weight: 700; overflow-wrap: anywhere; }
.media-controls { display: flex; align-items: center; gap: 8px; }
.media-controls input { min-width: 0; flex: 1; accent-color: var(--orange); }
.media-controls button:disabled { opacity: 0.35; cursor: default; }
.media-message { font-size: 13px; color: var(--fg-muted); margin: 14px 0 8px; }
.media-external { color: var(--orange-hover); font-size: 13px; }
.solitaire-app { width: 900px; height: 700px; }
.solitaire-app .window-content { padding: 0; display: flex; flex-direction: column; }
.game-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px; background: #292929; }
.game-toolbar button { padding: 3px 12px; }
.game-toolbar button:disabled { opacity: 0.4; }
#game-status { margin-left: auto; font-size: 12px; color: #d0d0d0; }
.game-board { --card-step: 26px; flex: 1; overflow-y: auto; padding: 18px; background: #254c3e; }
.game-top, .game-tableau { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.game-top { margin-bottom: 20px; }
.playing-card, .pile-empty { aspect-ratio: 0.7; border-radius: 6px; width: 100%; }
.playing-card { border: 1px solid #aaa; background: #f4f2ec; color: #252525; font: bold clamp(12px, 2vw, 23px)/1.2 var(--font-ui); text-align: left; padding: 5px; display: flex; align-items: flex-start; touch-action: none; box-shadow: 0 1px 3px #0004; }
.card-red { color: #aa2435; }
.card-back { background: repeating-linear-gradient(45deg, #654359 0 5px, #58314a 5px 10px); color: #e9c5dd; border: 3px solid #d7bacc; align-items: center; justify-content: center; }
.card-pile { position: relative; min-width: 0; }
.card-pile .playing-card { position: absolute; top: 0; left: 0; }
.pile-empty { display: grid; place-items: center; color: #ffffff45; border: 1px solid #ffffff30; background: #0001; }
.tableau-pile { min-height: calc((var(--pile-count) - 1) * var(--card-step) + 145px); }
.tableau-pile .playing-card { top: calc(var(--card-index) * var(--card-step)); }
.card-selected { outline: 3px solid #f5b963; outline-offset: -3px; }
.card-ghost { position: fixed !important; z-index: 100000; pointer-events: none; opacity: 0.9; }
@media (max-width: 1100px) and (min-width: 769px) {
    .files-sidebar { flex-basis: 150px; }
    .files-details { flex-basis: 250px; }
    .files-grid { grid-template-columns: repeat(auto-fill, 90px); }
    .fs-item { width: 90px; }
}
@media (max-width: 768px) {
    .egg-tracker { bottom: 72px; }
    .has-eggs .desktop { bottom: 106px; }
    .crash-screen pre { font-size: 13px; }
    .browser-app .browser-body { padding: 0; }
    .extra-window .window-content { padding: 12px; }
    .photo-app .window-content, .solitaire-app .window-content { padding: 0; }
    .game-board { --card-step: 22px; padding: 8px 5px; }
    .game-top, .game-tableau { gap: 4px; }
    .playing-card { border-radius: 4px; font-size: 13px; padding: 3px; }
    .card-back { border-width: 2px; }
    .game-toolbar { padding: 8px; gap: 6px; }
    .game-toolbar button { padding: 3px 8px; }
    #game-status { max-width: 120px; text-align: right; }
    .tableau-pile { min-height: calc((var(--pile-count) - 1) * var(--card-step) + 74px); }
    .media-controls { gap: 5px; }
    .media-controls button { min-width: 30px; }
    .files-footer { gap: 2px; padding-right: 4px; }
}

/* Mobile gate: phones see this page instead of the desktop */
.mobile-gate {
    position: fixed;
    inset: 0;
    z-index: 2000000;
    overflow: hidden;
    background: #050805;
    color: #8ae234;
    font: 15px/1.7 var(--font-mono);
    padding: max(24px, env(safe-area-inset-top)) 22px 32px;
}

body.gated .wallpaper,
body.gated .top-panel,
body.gated .dock,
body.gated .desktop,
body.gated .boot-screen,
body.gated .system-menu,
body.gated .egg-tracker { display: none !important; }

.gate-bits {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    color: rgba(138, 226, 52, 0.12);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
    padding: 0 6px;
}

.gate-bits span {
    display: block;
    animation: gate-scroll 90s linear infinite;
}

/* Two identical blocks; scrolling one block's height loops seamlessly. */
@keyframes gate-scroll {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

.gate-body {
    position: relative;
    max-width: 34rem;
    margin: 0 auto;
    text-shadow: 0 0 8px #050805, 0 0 3px #050805;
}

.gate-prompt { color: #d8f5c0; margin: 0 0 14px; }
.gate-prompt .user { color: #8ae234; font-weight: 700; }
.gate-prompt .path { color: #729fcf; font-weight: 700; }

.gate-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    vertical-align: text-bottom;
    background: #8ae234;
    animation: blink 1s step-end infinite;
}

.mobile-gate h1 {
    font-size: 24px;
    line-height: 1.3;
    margin: 0 0 14px;
    color: #b6ff5c;
    text-shadow: 0 0 12px rgba(138, 226, 52, 0.45);
}

.mobile-gate p { margin: 0 0 8px; }

.gate-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 26px;
}

.gate-links a {
    color: #050805;
    background: #8ae234;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 4px;
    min-width: 96px;
    text-align: center;
}

.gate-links a:active { background: #b6ff5c; }

.gate-anyway {
    display: inline-block;
    margin-top: 28px;
    color: rgba(138, 226, 52, 0.55);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .gate-bits span, .gate-cursor { animation: none; }
}
