
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Bold.woff2') format('woff2');
}

:root {
  
  --white: #ffffff;
  --light-grey: #e0e0e0;
  --medium-grey: #c0c0c0;
  --dark-grey: #808080;
  --black: #000000;

  --primary-bg: var(--white);
  --secondary-bg: var(--light-grey);
  --tertiary-bg: var(--medium-grey);
  --text-color: var(--black);
  --border-color: var(--black);
  --accent-color: var(--dark-grey);
  --selected-bg: var(--black);
  --selected-text: var(--white);
  --logo-filter: none;   

  --system-font: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  --scale-factor: 1;

  --font-size-small: calc(11px * var(--scale-factor));
  --font-size-normal: calc(13px * var(--scale-factor));
  --font-size-base: var(--font-size-normal);
  --font-size-large: calc(15px * var(--scale-factor));
  --font-size-title: calc(18px * var(--scale-factor));

  --menubar-height: calc(18px * var(--scale-factor));
  --taskbar-height: calc(18px * var(--scale-factor));
  --window-header-height: calc(28px * var(--scale-factor));
  --window-border: 1px;
  --icon-size: calc(34px * var(--scale-factor));

  --space-xs: calc(2px * var(--scale-factor));
  --space-sm: calc(4px * var(--scale-factor));
  --space-md: calc(8px * var(--scale-factor));
  --space-lg: calc(16px * var(--scale-factor));
  --space-xl: calc(24px * var(--scale-factor));

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --hard-shadow: 3px 3px 0 var(--black);

  --cat-installations-sculptures: rgb(238, 249, 49);   
  --cat-objects: rgb(178, 186, 202);                   
  --cat-music-performances: rgb(111, 133, 255);        
  --cat-graphics-prints: rgb(248, 0, 0);                
  --cat-default: rgb(116, 125, 145);                   
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-bg: #000000;
    --secondary-bg: #1c1c1c;
    --tertiary-bg: #2e2e2e;
    --text-color: #ffffff;
    --border-color: #ffffff;
    --accent-color: #9a9a9a;
    --selected-bg: #ffffff;
    --selected-text: #000000;
    --hard-shadow: 3px 3px 0 var(--border-color);
    --logo-filter: invert(1);
  }
}
:root[data-theme="dark"] {
  --primary-bg: #000000;
  --secondary-bg: #1c1c1c;
  --tertiary-bg: #2e2e2e;
  --text-color: #ffffff;
  --border-color: #ffffff;
  --accent-color: #9a9a9a;
  --selected-bg: #ffffff;
  --selected-text: #000000;
  --hard-shadow: 3px 3px 0 var(--border-color);
  --logo-filter: invert(1);
}

@media (pointer: coarse) {
  :root {
    --menubar-height: 26px;
    --taskbar-height: 26px;
    --window-header-height: 40px;
    --font-size-small: 12px;
    --font-size-normal: 14px;
    --font-size-large: 16px;
  }
}

@media (pointer: coarse) and (max-height: 520px) {
  :root {
    --menubar-height: 18px;
    --taskbar-height: 18px;
    --window-header-height: 28px;
  }
}

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

html {
  height: 100%;
  height: 100dvh;   
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--system-font);
  font-size: var(--font-size-normal);
  line-height: 1.35;
  background: var(--primary-bg);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; }

img { max-width: 100%; }

* { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background-color: var(--border-color); border: 2px solid var(--primary-bg); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--accent-color); }
*::-webkit-scrollbar-corner { background: transparent; }

:focus-visible {
  outline: 2px solid var(--border-color);
  outline-offset: 2px;
}

.selected-inverse:focus-visible,
.menu-item:focus-visible {
  outline-color: var(--accent-color);
  outline-offset: -3px;
}

.skip-link {
  position: fixed;
  left: 8px;
  top: -60px;
  z-index: 5000;
  background: var(--black);
  color: var(--white);
  padding: 6px 10px;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--menubar-height) + var(--safe-top));
  padding: var(--safe-top) calc(var(--space-md) + var(--safe-right)) 0 calc(var(--space-md) + var(--safe-left));
  background: var(--primary-bg);
  border-bottom: var(--window-border) solid var(--border-color);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--space-md);
  z-index: 1001;
  user-select: none;
  -webkit-user-select: none;
}

.menu-items {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  height: calc(100% - 2px);
  aspect-ratio: 1;
  margin-right: var(--space-sm);
  border: 1px solid transparent;
}
.logo-container:hover { background: var(--light-grey); border-color: var(--border-color); }
.logo-container:active { background: var(--selected-bg); }
.logo-container:active .desktop-logo { filter: invert(1); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-container:active .desktop-logo { filter: none; }
}
:root[data-theme="dark"] .logo-container:active .desktop-logo { filter: none; }

.desktop-logo {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: var(--logo-filter);
}

.menu-item {
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: calc(100% - 2px);
  padding: 0 var(--space-sm);
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.02em;
  border: var(--window-border) solid transparent;
  white-space: nowrap;
  cursor: pointer;
}

.menu-item:not(.menu-start):hover {
  background: var(--selected-bg);
  color: var(--selected-text);
  border-color: var(--border-color);
}

.menu-item.menu-start {
  border-color: var(--border-color);
  flex-shrink: 0;
  font-size: var(--font-size-normal);
  padding: 0 var(--space-md);
  letter-spacing: 0.04em;
}
.menu-item.menu-start:hover { background: var(--light-grey); }
.menu-item.menu-start:active,
.menu-item.menu-start[aria-expanded="true"] {
  background: var(--selected-bg);
  color: var(--selected-text);
}

.window-indicators {
  display: flex;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.window-indicators::-webkit-scrollbar { display: none; }

.window-indicator {
  flex: 0 0 auto;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: calc(var(--menubar-height) - 4px - 2 * var(--window-border));
  opacity: 0.55;
  border-bottom: 1px solid var(--text-color);
  align-self: center;
}
.window-indicator.indicator-focused { opacity: 1; }
.window-indicator:hover { opacity: 1; }

.menubar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--space-sm);
}

.menubar-clock {
  font-weight: 700;
  font-size: var(--font-size-small);
  font-variant-numeric: tabular-nums;
  padding: 0 var(--space-sm);
}

.theme-toggle {
  flex-shrink: 0;
  width: calc(var(--menubar-height) - 8px);
  height: calc(var(--menubar-height) - 8px);
  min-width: 12px;
  min-height: 12px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: linear-gradient(90deg, #000 50%, #fff 50%);
  padding: 0;
}
.theme-toggle:hover,
.theme-toggle:focus-visible { outline: 1px solid var(--border-color); outline-offset: 2px; }

.menubar-search-area { display: flex; align-items: center; }

.menubar-search-input {
  width: 84px;
  padding: 1px var(--space-sm);
  font-size: var(--font-size-small);
  background: transparent;
  border: var(--window-border) solid transparent;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.03em;
  outline: none;
  cursor: pointer;
  transition: width 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.menubar-search-input::-webkit-search-cancel-button,
.menubar-search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.menubar-search-input::placeholder { color: var(--text-color); opacity: 1; }
.menubar-search-input:focus {
  width: 220px;
  max-width: 55vw;
  text-align: left;
  cursor: text;
  background: var(--primary-bg);
  border-color: var(--border-color);
}
.menubar-search-input:focus::placeholder { opacity: 0.35; }

.menubar-search-results {
  position: fixed;
  top: calc(var(--menubar-height) + var(--safe-top));
  right: var(--safe-right);
  width: 340px;
  max-width: 100vw;
  max-height: 60%;
  overflow-y: auto;
  background: var(--primary-bg);
  border: var(--window-border) solid var(--border-color);
  border-top: 0;
  box-shadow: var(--hard-shadow);
  z-index: 1002;
  display: none;
}
.menubar-search-results.active { display: block; }

.msearch-hint {
  padding: 10px 12px;
  font-size: var(--font-size-small);
  opacity: 0.55;
  letter-spacing: 0.04em;
}

.msearch-item {
  display: block;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  outline: none;
}
.msearch-item:last-child { border-bottom: 0; }
.msearch-item:hover,
.msearch-item:focus { background: var(--selected-bg); color: var(--selected-text); }

.msearch-title {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msearch-meta {
  display: block;
  font-size: var(--font-size-small);
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msearch-mark { background: transparent; color: inherit; text-decoration: underline; font-weight: 700; }

.start-menu {
  position: fixed;
  top: calc(var(--menubar-height) + var(--safe-top));
  left: var(--safe-left);
  min-width: 190px;
  max-width: 80vw;
  max-height: 70vh;
  max-height: 70dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--primary-bg);
  border: var(--window-border) solid var(--border-color);
  border-left: 0;
  box-shadow: var(--hard-shadow);
  z-index: 1002;
}
.start-menu[hidden] { display: none; }

.start-menu-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  text-align: left;
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
  outline: none;
}
.start-menu-item:last-child { border-bottom: 0; }
.start-menu-item:hover,
.start-menu-item:focus-visible { background: var(--selected-bg); color: var(--selected-text); }
.start-menu-close { background: var(--secondary-bg); }

@media (pointer: coarse) { .start-menu-item { padding: 11px 16px; } }

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--taskbar-height) + var(--safe-bottom));
  padding: 0 calc(var(--space-md) + var(--safe-right)) var(--safe-bottom) calc(var(--space-md) + var(--safe-left));
  background: var(--primary-bg);
  border-top: var(--window-border) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 1000;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 767px) {
  .menubar-clock { display: none; }
  .menubar-search-input { width: 66px; padding-left: var(--space-sm); padding-right: var(--space-sm); }
  .menubar-search-input:focus { width: 150px; }
  .menubar-search-results { width: 100vw; border-left: 0; border-right: 0; }
  .window-indicator { max-width: 96px; }
}

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