/* Nogard OS – plocha s obvodovým „N“ na pozadí, matně průhledná okna,
   barvy převzaté z tapety: světle modrá (cyan) a fialová. */
:root {
  /* Světlý režim */
  --bg: #e9eff6;
  --fg: #16203a;
  --muted: #56647e;
  --glass: rgba(246, 250, 255, .52);
  --glass-bar: rgba(255, 255, 255, .45);
  --panel: rgba(255, 255, 255, .55);
  --line: rgba(70, 100, 160, .18);
  --cyan: #1fa6d9;
  --violet: #6c5ce7;
  --accent: #1a8fc4;          /* odkazy a text v akcentu – čitelné na světlé */
  --glow: rgba(56, 189, 248, .35);
  --topbar: rgba(240, 245, 252, .62);
  --icon-tile: linear-gradient(160deg, rgba(255,255,255,.85), rgba(225,234,246,.75));
  --shadow: 0 24px 60px rgba(30, 50, 90, .22);
  --logo-fill: #ffffff;
  --logo-stroke: #262a33;
  --wall: url("assets/bg-light.jpg");
  --wall-mobile: url("assets/bg-light-mobile.jpg");

  --f-ui: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
  --topbar-h: 38px;
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1420;
  --fg: #e6edf8;
  --muted: #93a2bd;
  --glass: rgba(14, 22, 36, .5);
  --glass-bar: rgba(20, 30, 48, .45);
  --panel: rgba(255, 255, 255, .05);
  --line: rgba(140, 170, 220, .16);
  --cyan: #4cc9f0;
  --violet: #8f7cff;
  --accent: #5fd0f5;
  --glow: rgba(76, 201, 240, .35);
  --topbar: rgba(8, 13, 22, .6);
  --icon-tile: linear-gradient(160deg, rgba(40,55,85,.85), rgba(18,26,42,.85));
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --logo-fill: transparent;
  --logo-stroke: #d7e3f4;
  --wall: url("assets/bg-dark.jpg");
  --wall-mobile: url("assets/bg-dark-mobile.jpg");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg) var(--wall) center / cover no-repeat;
  color: var(--fg);
  font: 15px/1.55 var(--f-body);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color .3s;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button { font: inherit; color: inherit; }

/* Logo – výplň a obrys podle režimu */
.logo-mark { fill: var(--logo-fill); stroke: var(--logo-stroke); stroke-width: 26; overflow: visible; }

/* ---------- Horní lišta ---------- */
.topbar {
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  font-family: var(--f-ui); font-size: 13px; letter-spacing: .04em;
  position: relative; z-index: 1000; flex: none;
}
.topbar-left { display: flex; min-width: 0; }
.theme-toggle {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border: 1px solid transparent; background: none; cursor: pointer;
  padding: 4px 10px 4px 8px; border-radius: 9px; font-family: var(--f-ui); font-weight: 700;
}
.theme-toggle:hover { background: var(--panel); border-color: var(--line); }
.theme-toggle:hover .mode-icon { color: var(--accent); }
.brand { white-space: nowrap; }
.mode-icon { display: grid; place-items: center; width: 18px; height: 18px; color: var(--muted); flex: none; }
.mode-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
:root[data-theme="dark"] .i-sun, :root[data-theme="light"] .i-moon { display: none; }
.clock { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

/* ---------- Plocha ---------- */
.desktop { position: relative; flex: 1; min-height: 0; overflow: hidden; --side-w: calc(68px + env(safe-area-inset-left, 0px)); }

/* ---------- Ikony na ploše (vpravo, sloupce se přidávají zprava doleva) ---------- */
.icons {
  position: absolute; top: 18px; right: max(18px, env(safe-area-inset-right, 0px)); bottom: 18px;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 100px);
  grid-auto-columns: 92px; gap: 6px; align-content: start; z-index: 1;
  direction: rtl;
}
.icons > * { direction: ltr; }
.icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; border-radius: 10px; border: 1px solid transparent;
  background: none; cursor: pointer; text-decoration: none; color: var(--fg);
  font-family: var(--f-ui); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2;
}
.icon:hover { background: var(--glass); border-color: var(--line); backdrop-filter: blur(10px); }
.icon-glyph {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  background: var(--icon-tile); color: var(--accent);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.icon-glyph svg { width: 26px; height: 26px; }
.icon[data-kind="link"] .icon-glyph,
.side-item[data-kind="link"] {
  background: linear-gradient(140deg, var(--cyan), var(--violet)); border-color: transparent; color: #fff;
  box-shadow: 0 6px 20px var(--glow);
}
.icon[data-kind="soon"] { color: var(--muted); }
.icon[data-kind="soon"] .icon-glyph { border-style: dashed; background: var(--glass); box-shadow: none; color: var(--muted); }
.icon-label {
  padding: 1px 6px; border-radius: 6px;
  background: var(--glass); backdrop-filter: blur(6px);
}

/* ---------- Okna (matné sklo s modro-fialovým rámečkem) ---------- */
.windows { position: absolute; inset: 0 0 0 var(--side-w); pointer-events: none; z-index: 10; }
.win {
  position: absolute; pointer-events: auto;
  width: min(580px, calc(100% - 32px));
  max-height: calc(100% - 120px);
  display: flex; flex-direction: column;
  background: var(--glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  animation: win-in .18s ease-out;
}
/* Gradientní rámeček – cyan → fialová */
.win::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 55%, var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .45; transition: opacity .15s;
}
.win.is-active::before { opacity: 1; }
.win.is-active { box-shadow: var(--shadow), 0 0 40px -10px var(--glow); }
.win[hidden] { display: none; }
@keyframes win-in { from { opacity: 0; transform: scale(.97) translateY(6px); } }

.win-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--glass-bar); border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: .04em;
  cursor: grab; user-select: none; touch-action: none; flex: none;
}
.win.is-dragging .win-bar { cursor: grabbing; }
.win-bar > svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.win-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btn {
  width: 28px; height: 24px; border-radius: 7px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.win-btn:hover { background: var(--panel); color: var(--fg); }
.win-btn.close:hover { background: linear-gradient(140deg, var(--cyan), var(--violet)); color: #fff; }
.win-body { padding: 22px 24px 24px; overflow: auto; min-height: 0; }

/* ---------- Obsah: O mně ---------- */
.about-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.avatar {
  width: 66px; height: 66px; border-radius: 18px; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(76, 201, 240, .22), rgba(143, 124, 255, .22));
  border: 1px solid var(--line);
}
.avatar .logo-mark { width: 40px; height: 40px; stroke-width: 20; }
.about h1 { font-family: var(--f-ui); font-size: clamp(1.35rem, 3.5vw, 1.8rem); line-height: 1.15; margin: 0; text-wrap: balance; }
.nick {
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.about p { margin: 0 0 10px; max-width: 62ch; }
.about h2 {
  font-family: var(--f-ui); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 8px;
}
.proj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.proj-list li > a, .proj-list li.soon {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  text-decoration: none; color: var(--fg);
}
.proj-list li > a:hover { border-color: var(--cyan); }
.proj-list span { color: var(--muted); font-family: var(--f-mono); font-size: 12px; }
.proj-list li.soon { color: var(--muted); border-style: dashed; background: transparent; }
.about-actions { margin-top: 18px; display: flex; gap: 8px; }
.btn {
  border: 0; color: #fff; padding: 9px 18px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(140deg, var(--cyan), var(--violet));
  font-family: var(--f-ui); font-weight: 600; letter-spacing: .03em;
  box-shadow: 0 6px 18px var(--glow);
}
.btn:hover { filter: brightness(1.08); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-size: 13px; }

/* ---------- Obsah: Kontakt ---------- */
.contact p { margin: 0 0 14px; }
.contact-list { margin: 0 0 14px; display: grid; gap: 8px; }
.contact-list > div {
  display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.contact-list dt { color: var(--muted); font-size: 13px; }
.contact-list dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.contact-list code { font-family: var(--f-mono); font-size: 13px; word-break: break-all; }
.copy {
  border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 2px 8px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.copy:hover { color: var(--fg); border-color: var(--cyan); }
.soon-win p { margin: 0 0 12px; }


/* ---------- Boční pruh vlevo (matné sklo, ikony bez popisků) ---------- */
.sidebar {
  position: absolute; top: 0; left: 0; bottom: 0; z-index: 900;
  width: var(--side-w);
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--topbar);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  overflow-y: auto; overflow-x: visible;
}
.side-item {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 13px; border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer; text-decoration: none; color: var(--accent);
  background: var(--icon-tile);
  transition: transform .12s ease, box-shadow .12s ease;
}
.side-item:hover { transform: scale(1.08); }
.side-item svg { width: 22px; height: 22px; }
.side-item[data-kind="soon"] { border-style: dashed; background: transparent; color: var(--muted); }
/* Indikátor otevřeného okna – svislá čárka u levé hrany pruhu */
.side-item::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 4px; height: 0; margin-top: 0;
  border-radius: 4px; background: linear-gradient(var(--cyan), var(--violet));
  transition: height .15s ease, margin-top .15s ease;
}
.side-item.is-open::before { height: 18px; margin-top: -9px; box-shadow: 0 0 8px var(--glow); }
.side-item.is-open.is-min::before { height: 6px; margin-top: -3px; opacity: .7; }
.side-item.is-active { box-shadow: 0 0 0 2px var(--cyan), 0 6px 20px var(--glow); }
.side-sep { width: 32px; height: 1px; background: var(--line); flex: none; margin: 2px 0; }

/* Název jen při najetí myší – bublina vpravo od ikony (je mimo pruh, proto fixed) */
.side-tip {
  position: fixed; z-index: 2000; transform: translate(14px, -50%);
  background: var(--topbar); color: var(--fg); border: 1px solid var(--line); padding: 4px 10px; border-radius: 7px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: var(--f-ui); font-size: 12px; font-weight: 600; letter-spacing: .03em; white-space: nowrap;
  pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.side-tip[hidden] { display: none; }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  body { background-image: var(--wall-mobile); }
  .desktop { --side-w: calc(60px + env(safe-area-inset-left, 0px)); }
  .icons { top: 12px; right: max(10px, env(safe-area-inset-right, 0px)); bottom: 12px; grid-template-rows: repeat(auto-fill, 96px); grid-auto-columns: 84px; }
  .side-item { width: 42px; height: 42px; }
  .win {
    left: 0 !important; top: 0 !important; width: 100%; height: 100%;
    max-height: none; border-radius: 0;
  }
  .win-bar { cursor: default; border-radius: 0; }
  .win-body { padding: 20px max(16px, env(safe-area-inset-left, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)); }
  .contact-list > div { grid-template-columns: 1fr; gap: 4px; }
}
@media (hover: none) { .side-tip { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .win { animation: none; }
  body, .side-item, .side-item::before, .win::before { transition: none; animation: none; }
}
