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

:root {
  --accent: #FF6701;
  --bg: #000;
  --fg: #999;
  --fg-bright: #ddd;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --type-project: #FF6701;
  --type-text: #3fd0ff;
  --type-3d: #b86bff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky footer: .site-body grows to fill the viewport, so .site-footer
   never ends up stranded mid-page on short-content pages like Kontakt. */
.site-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.site-body > .desktop,
.site-body > .page-content {
  flex: 1 0 auto;
}

/* =========================================
   Reticle cursor (fine pointers only — leave touch alone)
   ========================================= */
@media (pointer: fine) {
  html {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='7' fill='none' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='12' y1='0' x2='12' y2='5' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='12' y1='19' x2='12' y2='24' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='0' y1='12' x2='5' y2='12' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='19' y1='12' x2='24' y2='12' stroke='%23FF6701' stroke-width='1.3'/%3E%3C/svg%3E") 12 12, crosshair;
  }

  a, button, .desktop-icon, .win-btn, .burger, .window-body img, input[type="submit"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='7' fill='none' stroke='%23FF6701' stroke-width='1.3'/%3E%3Ccircle cx='12' cy='12' r='2' fill='%23FF6701'/%3E%3Cline x1='12' y1='0' x2='12' y2='5' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='12' y1='19' x2='12' y2='24' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='0' y1='12' x2='5' y2='12' stroke='%23FF6701' stroke-width='1.3'/%3E%3Cline x1='19' y1='12' x2='24' y2='12' stroke='%23FF6701' stroke-width='1.3'/%3E%3C/svg%3E") 12 12, pointer;
  }
}

body {
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.618;
  color: var(--fg);
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
}

@media (max-width: 767px) {
  body { font-size: 1rem; }
}

h1, h2, h3, h4 {
  font-family: var(--mono);
  color: var(--fg-bright);
  letter-spacing: 0.02em;
}

h1 { text-transform: lowercase; }
h1::before { content: "// "; color: var(--accent); }

.page-content, [data-field], article {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

img { max-width: 100%; height: auto; }

.flex-video, .responsive-video, iframe {
  max-width: 100%;
}

/* =========================================
   Links
   ========================================= */
a {
  text-decoration: none;
  color: var(--accent);
}
a:hover {
  color: var(--bg);
  background: var(--accent);
}

/* =========================================
   Nav bar — game-menu styling
   ========================================= */
.site-header {
  border-bottom: 1px solid #222;
  background: rgba(0,0,0,0.9);
  position: relative;
  z-index: 10;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  text-transform: lowercase;
  justify-content: center;
}

.menu li {
  position: relative;
  margin: 0;
  font-weight: bold;
  font-family: var(--mono);
}

.menu li a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--fg-bright);
  border-right: 1px solid #222;
  transition: background 0.1s, color 0.1s;
}

.menu li:first-child a { border-left: 1px solid #222; }

.menu li a::before { content: "[ "; color: var(--accent); }
.menu li a::after { content: " ]"; color: var(--accent); }

.menu li a:hover,
.menu li.active > a {
  color: var(--bg);
  background: var(--accent);
}
.menu li a:hover::before,
.menu li a:hover::after,
.menu li.active > a::before,
.menu li.active > a::after { color: var(--bg); }

/* =========================================
   Submenu
   ========================================= */
.menu .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  background: #000;
  border: 1px solid #222;
  border-top: none;
  z-index: 1000;
  padding: 0;
  list-style: none;
}

.menu .submenu li a {
  color: var(--fg);
  padding: 0.6rem 1.2rem;
  display: block;
  white-space: nowrap;
  border: none;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.menu .submenu li a::before { content: "> "; }
.menu .submenu li a::after { content: ""; }
.menu .submenu li a:hover { background: var(--accent); color: var(--bg); }

.menu li.has-submenu.submenu-open > .submenu,
.menu li.has-submenu:hover > .submenu {
  display: block;
}

/* =========================================
   Mobile / Responsive
   ========================================= */
.burger {
  display: none;
  cursor: pointer;
  font-size: 2rem;
  color: var(--accent);
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 2000;
  font-family: var(--mono);
}

@media (max-width: 767px) {
  .burger { display: block; }

  .menu {
    flex-direction: column;
    justify-content: flex-start;
    display: none;
    width: 100%;
    background-color: #000;
    position: fixed;
    top: 0;
    left: 0;
    padding-top: 60px;
    min-height: 100vh;
    z-index: 1500;
  }

  .menu.open { display: flex; }

  .menu li { width: 100%; text-align: center; margin: 0; }
  .menu li a { border-right: none; border-bottom: 1px solid #222; }

  .menu .submenu li a { white-space: normal; }

  .menu .submenu {
    position: relative;
    background-color: #111;
    min-width: 100%;
  }

  .desktop { padding: 1.5rem 0.75rem 3rem; }
  .window { margin: 1rem auto; box-shadow: none; }
  .window-body { padding: 1rem; }
  .window-titlebar { padding: 0.4rem 0.6rem; }
  .breadcrumbs { font-size: 0.7rem; padding: 0.5rem 0.75rem; }
  .statusbar { font-size: 0.65rem; padding: 0.4rem 0.6rem; }
}

/* =========================================
   Footer / status bar
   ========================================= */
.site-footer {
  border-top: 1px solid #222;
  margin-top: 3rem;
  padding: 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: #555;
}

.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  border: 1px solid #222;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--fg);
  text-transform: lowercase;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3f3;
  box-shadow: 0 0 6px #3f3;
  display: inline-block;
}
.status-sep { color: #333; }
.status-clock { color: var(--accent); }

.status-ticker span { font-weight: bold; }
.status-ticker .up { color: #3f3; }
.status-ticker .down { color: #f55; }

.status-tz {
  background: #000;
  color: var(--fg);
  border: 1px solid #222;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  cursor: pointer;
}

.footer-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  text-transform: lowercase;
  margin: 0 0 1rem;
}
.footer-menu a { color: var(--fg); }
.footer-menu a::before { content: "/"; color: #333; margin-right: 0.3rem; }
.footer-menu a:hover { color: var(--accent); background: none; }

.footer-credit { margin: 0; color: #444; }
.footer-credit a { color: #666; }

/* =========================================
   Language switch
   ========================================= */
.lang-switch {
  position: absolute;
  top: 0.9rem;
  right: 1.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: lowercase;
  z-index: 20;
}
.lang-switch a { color: #555; }
.lang-switch a.active { color: var(--accent); }
.lang-sep { color: #333; margin: 0 0.2rem; }

@media (max-width: 767px) {
  .lang-switch { top: 1.1rem; right: 4.2rem; }
}

/* =========================================
   Breadcrumbs — fake file path
   ========================================= */
.breadcrumbs {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #555;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #161616;
  max-width: 1200px;
  margin: 0 auto;
}
.bc-root { color: var(--accent); }
.bc-sep { color: #333; margin: 0 0.3rem; }
.breadcrumbs a { color: #777; }
.breadcrumbs a:hover { color: var(--bg); background: var(--accent); }
.bc-current { color: var(--fg-bright); }
.bc-cursor { color: var(--accent); animation: blink 1s steps(2, start) infinite; }

/* =========================================
   Desktop (listing as icon grid)
   ========================================= */
.desktop {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.desktop h1 { text-align: center; margin-bottom: 0.3rem; }
.desktop-meta {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #555;
  margin: 0;
}

/* =========================================
   Finder toolbar
   ========================================= */
.finder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 0.6rem 1rem;
  margin: 1rem 0 0;
  border: 1px solid #222;
  background: #0a0a0a;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: lowercase;
  color: var(--fg);
}

.finder-group { display: flex; align-items: center; gap: 0.4rem; }

.finder-btn, .finder-chip {
  background: #000;
  border: 1px solid #222;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: lowercase;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
.finder-btn.active, .finder-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.finder-size input[type="range"] { accent-color: var(--accent); }

.finder-sort {
  background: #000;
  color: var(--fg);
  border: 1px solid #222;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: lowercase;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
}

.desktop-grid {
  --icon-size: 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 2rem 1rem;
  padding: 2rem 0;
}

.filtered-out { display: none !important; }

.desktop-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.desktop-grid.list-view .desktop-icon {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 1rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #161616;
}
.desktop-grid.list-view .icon-glyph {
  width: 36px !important;
  height: 36px !important;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.desktop-grid.list-view .icon-label {
  text-align: left;
  padding: 0;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  color: var(--fg-bright);
}

.desktop-icon .icon-glyph {
  width: var(--icon-size, 80px);
  height: var(--icon-size, 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #222;
  background: #050505;
  font-size: 2.2rem;
  color: var(--accent);
  overflow: hidden;
}
.desktop-icon .icon-glyph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.desktop-icon .icon-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.15rem 0.4rem;
  text-transform: lowercase;
  line-height: 1.3;
}

.desktop-icon:hover .icon-glyph,
.desktop-icon:focus .icon-glyph {
  outline: 1px dashed var(--accent);
  outline-offset: 3px;
}
.desktop-icon:hover .icon-label,
.desktop-icon:focus .icon-label {
  background: var(--accent);
  color: #000;
}

/* =========================================
   Window chrome (item detail)
   ========================================= */
.window {
  border: 1px solid #333;
  background: #080808;
  margin: 2rem auto;
  max-width: 1200px;
  box-shadow: 4px 4px 0 rgba(255,103,1,0.15);
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #151515;
  border-bottom: 1px solid #333;
  padding: 0.5rem 0.8rem;
  font-family: var(--mono);
}

.window-title {
  color: var(--fg-bright);
  font-size: 0.95rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.window-controls { display: flex; gap: 0.4rem; }
.win-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #333;
  color: var(--fg);
  font-size: 0.8rem;
  text-decoration: none;
}
.win-close:hover { background: var(--accent); color: #000; border-color: var(--accent); }

.window--minimized .window-body { display: none; }

.window--maximized {
  position: fixed;
  inset: 1.5rem;
  max-width: none;
  margin: 0;
  z-index: 4000;
  overflow-y: auto;
}

/* Maximize doubles as a large-print / low-vision mode: bigger text and
   full-width content, not just a bigger empty frame. */
.window--maximized .window-body {
  font-size: 1.35em;
}
.window--maximized .window-body.page-content > p,
.window--maximized .window-body.page-content > ul,
.window--maximized .window-body.page-content > ol,
.window--maximized .credits-block,
.window--maximized .empty-note {
  max-width: 100%;
}
.window--maximized .window-body iframe {
  max-width: 100%;
}
.window--maximized .window-body .gallery {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.window--maximized .window-body .gallery img {
  height: 320px;
}

.window-body { padding: 1.5rem; }

.empty-note {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--mono);
  color: #555;
  font-style: italic;
}

.credits-block {
  max-width: 760px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px dashed #222;
}
.credits-block h4 { font-size: 0.85rem; margin: 0 0 0.6rem; color: var(--accent); }
.credits-block dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.credits-block dt { color: #666; text-transform: lowercase; }
.credits-block dd { margin: 0; color: var(--fg-bright); }
.window-body.page-content { max-width: none; margin: 0; }

.window-body.page-content > p,
.window-body.page-content > ul,
.window-body.page-content > ol {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.window-body .hero-image,
.window-body .gallery {
  width: 100%;
  margin: 1.5rem 0;
}
.window-body .hero-image img {
  width: 100%;
  display: block;
}

.window-body .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}
.window-body .gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.window-body iframe {
  display: block;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.5rem auto;
}

/* =========================================
   Lightbox
   ========================================= */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }

.lightbox-frame {
  max-width: 92vw;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border: 1px solid #333;
  user-select: none;
  touch-action: none;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 2rem;
  cursor: pointer;
  z-index: 1;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-bright);
  font-size: 2.2rem;
  font-family: var(--mono);
  border: 1px solid #333;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
  z-index: 1;
}
.lightbox-nav:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-counter {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--fg);
  background: rgba(0,0,0,0.6);
  padding: 0.3rem 0.8rem;
  border: 1px solid #333;
}

@media (max-width: 767px) {
  .lightbox-nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

/* =========================================
   3D tiles — small cloned-model viewers embedded as desktop icons
   ========================================= */
.tile-3d .icon-glyph {
  position: relative;
  background: #000;
  padding: 0;
}
.tile-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-loading {
  text-transform: lowercase;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--accent);
  background: #000;
  padding: 0.3rem;
  word-break: break-all;
  line-height: 1.4;
}

.home-grid { --icon-size: 110px; }

/* =========================================
   Type colors — reads like a folder filtered by kind
   ========================================= */
.home-grid .desktop-icon[data-type="project"] .icon-glyph { border-color: var(--type-project); }
.home-grid .desktop-icon[data-type="project"] .icon-label { color: var(--type-project); }

.home-grid .desktop-icon[data-type="text"] .icon-glyph { border-color: var(--type-text); color: var(--type-text); }
.home-grid .desktop-icon[data-type="text"] .icon-label { color: var(--type-text); }

.home-grid .desktop-icon[data-type="3d"] .icon-glyph { border-color: var(--type-3d); }
.home-grid .desktop-icon[data-type="3d"] .icon-label { color: var(--type-3d); }

.home-grid .desktop-icon:hover .icon-label,
.home-grid .desktop-icon:focus .icon-label {
  background: currentColor;
  color: #000 !important;
}

/* =========================================
   3D "mini editor" window — opens on click, desktop only (see JS)
   ========================================= */
.os-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 5000;
  align-items: center;
  justify-content: center;
}
.os-overlay.open { display: flex; }

.os-modal-window {
  width: min(90vw, 700px);
  margin: 0;
}
.os-modal-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
}
.os-modal-canvas-wrap .tile-loading { font-size: 0.85rem; }
.os-modal-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.os-modal-caption {
  padding: 1rem 1.2rem;
  border-top: 1px solid #222;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--fg);
  max-height: 180px;
  overflow-y: auto;
}
.os-modal-caption strong {
  display: block;
  color: var(--fg-bright);
  text-transform: none;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.os-modal-caption p { margin: 0 0 0.6rem; }
.os-modal-caption p:last-child { margin-bottom: 0; }

@keyframes blink { to { opacity: 0.2; } }
