/* ── The Hyprland desktop (Catppuccin Mocha) ─────────────────────────────
   Designed at a fixed 1280×800 “resolution”; the 3D scene or the flat-mode
   scaler maps it to the viewport. gaps_in/out = 0, rounding = 0 — like the
   real rice. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../vendor/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../vendor/fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-crust: #11111b;
  --ctp-surface0: #313244;
  --ctp-surface1: #45475a;
  --ctp-overlay: #6c7086;
  --ctp-text: #cdd6f4;
  --ctp-subtext: #a6adc8;
  --ctp-mauve: #cba6f7;
  --ctp-blue: #89b4fa;
  --ctp-green: #a6e3a1;
  --ctp-peach: #fab387;
  --ctp-red: #f38ba8;
  --ctp-yellow: #f9e2af;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

#desktop {
  width: 1280px;
  height: 800px;
  background: var(--ctp-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ctp-text);
  cursor: default;
  user-select: none;
}

/* ── waybar ── */

#waybar {
  height: 34px;
  flex: 0 0 34px;
  background: var(--ctp-crust);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--ctp-surface0);
}

.wb-left, .wb-right { display: flex; align-items: center; gap: 10px; }

.wb-ws {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--ctp-overlay);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.wb-ws:hover { color: var(--ctp-text); }
.wb-ws.active { background: var(--ctp-mauve); color: var(--ctp-crust); font-weight: 700; }
.wb-ws:focus-visible { outline: 1px solid var(--ctp-mauve); }

.wb-title { color: var(--ctp-subtext); margin-left: 8px; }

.wb-chip { color: var(--ctp-subtext); }
.wb-hint { color: var(--ctp-overlay); font-size: 12px; }
#wb-clock { color: var(--ctp-mauve); font-weight: 700; }

/* ── workspaces ── */

#tiles { flex: 1; position: relative; min-height: 0; }

.win {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--ctp-base);
  border: 1px solid var(--ctp-surface0);
}
#tiles[data-ws="1"] .ws-1,
#tiles[data-ws="2"] .ws-2,
#tiles[data-ws="3"] .ws-3 {
  display: flex;
  animation: ws-in 0.16s ease;
}
@keyframes ws-in { from { opacity: 0.35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #tiles[data-ws="1"] .ws-1, #tiles[data-ws="2"] .ws-2, #tiles[data-ws="3"] .ws-3 { animation: none; }
}

.win-bar {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--ctp-subtext);
  background: var(--ctp-mantle);
  border-bottom: 1px solid var(--ctp-surface0);
}

.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-term { background: var(--ctp-green); }
.dot-proj { background: var(--ctp-blue); }
.dot-about { background: var(--ctp-peach); }

.win-body {
  padding: 18px 22px;
  overflow-y: auto;
  min-height: 0;
  user-select: text;
  scrollbar-width: thin;
  scrollbar-color: var(--ctp-surface1) transparent;
}

/* ── terminal ── */

.term {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
  min-height: 0;
  cursor: text;
  font-size: 15px;
  line-height: 1.55;
  user-select: text;
  scrollbar-width: thin;
  scrollbar-color: var(--ctp-surface1) transparent;
}

#term-out { white-space: pre-wrap; word-break: break-word; }
#term-out a { color: var(--ctp-blue); text-decoration: underline; }
#term-out .t-mauve { color: var(--ctp-mauve); }
#term-out .t-green { color: var(--ctp-green); }
#term-out .t-blue { color: var(--ctp-blue); }
#term-out .t-peach { color: var(--ctp-peach); }
#term-out .t-red { color: var(--ctp-red); }
#term-out .t-yellow { color: var(--ctp-yellow); }
#term-out .t-dim { color: var(--ctp-overlay); }

.term-line { display: inline; }
.prompt { white-space: nowrap; }
.p-user { color: var(--ctp-green); font-weight: 700; }
.p-sep, .p-sym { color: var(--ctp-subtext); }
.p-path { color: var(--ctp-blue); font-weight: 700; }
.p-sym { margin-right: 8px; margin-left: 2px; }

#term-echo { white-space: pre-wrap; word-break: break-all; }

.caret {
  display: inline-block;
  width: 8px; height: 17px;
  background: var(--ctp-mauve);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

#term-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px; height: 1px;
}

/* ── projects window ── */

.proj {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  margin: 0 0 10px;
  border: 1px solid var(--ctp-surface0);
  text-decoration: none;
  color: var(--ctp-text);
  background: var(--ctp-mantle);
}
.proj:hover { border-color: var(--ctp-blue); }
.proj-name { font-weight: 700; color: var(--ctp-blue); font-size: 16px; }
.proj-desc { font-size: 13.5px; color: var(--ctp-subtext); }
.proj-tags { font-size: 12px; color: var(--ctp-mauve); }

/* ── about window ── */

.about p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ctp-subtext);
}
.about strong { color: var(--ctp-text); }
.about-meta { font-size: 12.5px; color: var(--ctp-mauve) !important; }

/* ── flat mode (mobile / no WebGL): desktop inline, content flows below ── */

body.flat #desktop-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: #0d0e16;
  overflow: hidden;
  padding: 3.2rem 0 0.5rem;
}

body.flat #desktop {
  transform: scale(var(--flat-scale, 0.5));
  transform-origin: center center;
}

/* small screens: reflow to a real mobile layout instead of scaling tiny */
@media (max-width: 700px) {
  body.flat #desktop-wrap { place-items: stretch; padding: 3.2rem 0 0; }
  body.flat #desktop {
    transform: none;
    width: 100%;
    height: auto;
    min-height: calc(100svh - 3.2rem);
    font-size: 14px;
  }
  body.flat #tiles { min-height: 70svh; }
  body.flat .wb-hint { display: none; }
  body.flat .wb-title { display: none; }
  body.flat .term { font-size: 13.5px; }
}
