/* ============================================
   MATURITNÝ ŤAHÁK – BRUTALIST / EDITORIAL
   ============================================ */

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

:root {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #666666;
  --dim: #333333;
  --rule: #333333;
  --rule-strong: #ffffff;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.header {
  background: var(--fg);
  color: var(--bg);
  padding: 2.5rem 2rem 2rem;
  border-bottom: 3px solid var(--fg);
  position: relative;
}

.header__icon { display: none; }

.header__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--bg);
  letter-spacing: -2px;
  line-height: 1;
  text-transform: uppercase;
}

.header__subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  color: #444;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--mono);
}

/* ===== TAB NAV ===== */
.tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.tabs__list {
  display: flex;
  list-style: none;
  max-width: none;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }

.tabs__btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.1s, background 0.1s;
  position: relative;
}

.tabs__btn:hover {
  color: var(--fg);
  background: #111;
}

.tabs__btn.active {
  color: var(--bg);
  background: var(--fg);
}

.tabs__btn.active::after { display: none; }
.tabs__icon { display: none; }

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  min-height: calc(100vh - 120px);
}

.layout > .main {
  flex: 1;
  min-width: 0;
  padding: 0;
  max-width: none;
  margin: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 47px;
  max-height: calc(100vh - 47px);
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  padding: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar__search {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.6rem 1rem;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar__search:focus { border-bottom-color: var(--fg); }
.sidebar__search::placeholder { color: var(--muted); }

.search-highlight {
  background: var(--fg);
  color: var(--bg);
  padding: 0 2px;
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  padding-top: 0.75rem;
}
.sidebar__group[hidden] { display: none; }

.sidebar__section-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 1rem 0.5rem;
  font-family: var(--mono);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: none;
  border-left: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
  font-family: var(--mono);
  white-space: nowrap;
}
.sidebar__link:hover {
  color: var(--fg);
  border-left-color: var(--dim);
}
.sidebar__link.active {
  color: var(--fg);
  border-left-color: var(--fg);
}

.sidebar__num {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--dim);
  min-width: 16px;
  transition: color 0.1s;
}
.sidebar__link:hover .sidebar__num,
.sidebar__link.active .sidebar__num {
  color: var(--fg);
}

.sidebar__divider {
  height: 1px;
  background: var(--rule);
  margin: 0.75rem 0;
}

.sidebar__bottom {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding-top: 0.5rem;
}

.sidebar__scroll-btn {
  display: block;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: left;
  transition: color 0.1s;
  width: 100%;
}
.sidebar__scroll-btn:hover { color: var(--fg); }

/* ===== MAIN CONTENT ===== */
.main {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ===== TAB CONTENT ===== */
.tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}
.tab-content.active { display: block; }

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

/* ===== SUBNAV ===== */
.subnav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 47px;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  margin-left: -1rem;
  margin-right: -1rem;
}
.subnav::-webkit-scrollbar { display: none; }

.subnav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-right: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.1s, background 0.1s;
}
.subnav__link:hover {
  color: var(--fg);
  background: #111;
}
.subnav__link.active {
  color: var(--bg);
  background: var(--fg);
}

.subnav__num {
  font-size: 0.6rem;
  opacity: 0.6;
}
.subnav__link.active .subnav__num { opacity: 0.5; }

.subnav__empty {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
  padding: 0.65rem 1rem;
}

/* ===== SECTIONS ===== */
.section {
  border: none;
  border-top: 1px solid var(--rule);
  border-left: none;
  border-radius: 0;
  padding: 2rem 0;
  margin-bottom: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.section:first-child { border-top: none; }

.section:hover { border-color: var(--rule); }

.section__number {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  margin-right: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section__title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
  line-height: 1.2;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 0.75rem;
}

.section__desc {
  color: #aaaaaa;
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

/* ===== SUBSECTIONS ===== */
.subsection {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.subsection__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}

.subsection__title::before {
  content: '//';
  color: var(--muted);
  font-size: 0.75rem;
}

.subsection__desc {
  color: #aaaaaa;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.7rem;
}

/* ===== CODE BLOCKS ===== */
.code-block {
  position: relative;
  margin: 0.75rem 0;
  border-radius: 0;
  overflow: hidden;
  border: none;
  border-left: 2px solid var(--dim);
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.8rem;
  background: #0d0d0d;
  border-bottom: 1px solid var(--rule);
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-block__lang {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.code-block__lang::before { display: none; }

.code-block__copy {
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.65rem;
  font-family: var(--mono);
  padding: 0.2rem 0.5rem;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.code-block__copy:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.code-block__copy.copied {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  background: #080808;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}
.code-block pre::-webkit-scrollbar { height: 3px; }
.code-block pre::-webkit-scrollbar-thumb {
  background: var(--dim);
  border-radius: 0;
}

.code-block code {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #cccccc;
  white-space: pre;
}

/* ===== SYNTAX HIGHLIGHTING ===== */
.code-block .kw  { color: #c9b8f0; }
.code-block .fn  { color: #9ab8d8; }
.code-block .st  { color: #a8c880; }
.code-block .cm  { color: #505050; font-style: italic; }
.code-block .nb  { color: #d4a87a; }
.code-block .op  { color: #888888; }
.code-block .var { color: #e8e8e8; }
.code-block .cls { color: #d8c880; }
.code-block .dec { color: #c9b8f0; }
.code-block .param { color: #d09090; }
.code-block .bi  { color: #9ab8d8; }

/* ===== ALERTS ===== */
.alert {
  display: flex;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 0;
  margin: 0.8rem 0;
  font-size: 0.83rem;
  line-height: 1.55;
  border: none;
  border-left: 2px solid;
}

.alert__icon { flex-shrink: 0; font-size: 1rem; margin-top: 0.1rem; }

.alert--warning { border-color: #c8a05a; color: #c8a05a; background: rgba(200,160,90,0.05); }
.alert--tip     { border-color: var(--dim); color: #aaaaaa; background: transparent; }
.alert--info    { border-color: #7a8fa0; color: #7a8fa0; background: rgba(122,143,160,0.05); }
.alert--danger  { border-color: #bb6666; color: #bb6666; background: rgba(187,102,102,0.05); }

/* ===== INLINE CODE ===== */
.inline-code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: #111;
  color: #cccccc;
  padding: 0.1em 0.4em;
  border-radius: 0;
  border: 1px solid var(--rule);
}

/* ===== PLACEHOLDER ===== */
.placeholder {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}
.placeholder__icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; display: block; }
.placeholder__title { font-size: 1rem; font-weight: 700; color: var(--muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--mono); }
.placeholder__desc { font-size: 0.83rem; max-width: 300px; margin: 0 auto; line-height: 1.6; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #555; }

::selection { background: var(--fg); color: var(--bg); }

/* ===== SECTION COLORS (left accent on title underline) ===== */
#tk-kostra    { --section-color: #9ab0c8; }
#tk-kreslenie { --section-color: #a8c8a0; }
#tk-vstupy    { --section-color: #d4a87a; }
#tk-eventy    { --section-color: #d0c878; }
#tk-vzorec    { --section-color: #c0b0e0; }
#tk-animacie  { --section-color: #d0a0b8; }
#tk-objekty   { --section-color: #90c8a8; }
#tk-subory    { --section-color: #d0a878; }

.section__title {
  border-bottom-color: var(--section-color, var(--rule));
}
.section__number {
  color: var(--section-color, var(--muted));
}

.sidebar__nav .sidebar__link:nth-child(1) { --section-color: #9ab0c8; }
.sidebar__nav .sidebar__link:nth-child(2) { --section-color: #a8c8a0; }
.sidebar__nav .sidebar__link:nth-child(3) { --section-color: #d4a87a; }
.sidebar__nav .sidebar__link:nth-child(4) { --section-color: #d0c878; }
.sidebar__nav .sidebar__link:nth-child(5) { --section-color: #c0b0e0; }
.sidebar__nav .sidebar__link:nth-child(6) { --section-color: #d0a0b8; }
.sidebar__nav .sidebar__link:nth-child(7) { --section-color: #90c8a8; }
.sidebar__nav .sidebar__link:nth-child(8) { --section-color: #d0a878; }

.sidebar__link.active {
  border-left-color: var(--section-color, var(--fg));
  color: var(--section-color, var(--fg));
}
.sidebar__link:hover .sidebar__num,
.sidebar__link.active .sidebar__num {
  color: var(--section-color, var(--fg));
}

/* ===== SEARCH ===== */
.section--hidden { display: none !important; }

/* ===== SECRET MODAL ===== */
.secret-overlay[hidden] { display: none !important; }
.secret-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  animation: fadeIn 0.15s ease-out;
}

.secret-modal {
  background: #0d0d0d;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  box-shadow: none;
  width: min(960px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.5rem;
  color: var(--fg);
  animation: fadeIn 0.15s ease;
}

.secret-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.secret-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: -0.5px;
}
.secret-modal__close {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
  border-radius: 0;
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.1s;
  font-family: var(--mono);
}
.secret-modal__close:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.secret-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}
.secret-modal__hint kbd {
  background: #111;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg);
}

.secret-modal__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
@media (max-width: 720px) {
  .secret-modal__cols { grid-template-columns: 1fr; }
}

.secret-col {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.secret-col__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--mono);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
}

.secret-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.secret-list::-webkit-scrollbar { width: 3px; }
.secret-list::-webkit-scrollbar-thumb { background: var(--dim); }

.secret-list a {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.4rem 0;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.83rem;
  border: none;
  border-bottom: 1px solid transparent;
  transition: color 0.1s;
}
.secret-list a:hover {
  color: var(--fg);
  border-bottom-color: var(--rule);
  padding-left: 0.3rem;
}
.secret-list__num {
  color: var(--muted);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.72rem;
  min-width: 1.8rem;
  text-align: right;
}
.secret-list__name { flex: 1; }
.secret-list__tag {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 0;
  background: transparent;
  color: #c8a05a;
  border: 1px solid rgba(200,160,90,0.35);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .subnav  { display: flex; }
  .layout > .main { padding: 0 0.75rem 3rem; }
}
@media (max-width: 640px) {
  html { font-size: 14px; }
  .header { padding: 1.5rem 1rem; }
  .header__title { font-size: 1.8rem; }
  .layout > .main { padding: 0 0.5rem 3rem; }
  .section { padding: 1.5rem 0; }
}

/* ===== VIEWER MODAL ===== */
.viewer-overlay[hidden] { display: none !important; }
.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.viewer-modal {
  background: var(--bg-secondary, #141414);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  width: min(1100px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.4rem 1.4rem;
  color: var(--text-primary, #f0f0f0);
}
.viewer-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.8rem;
}
.viewer-modal__title {
  margin: 0; font-size: 1.05rem; font-weight: 700;
  color: var(--text-primary, #f0f0f0);
}
.viewer-tabs {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-bottom: 0.8rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}
.viewer-tabs:empty { display: none; }
.viewer__tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary, #888);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.78rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  cursor: pointer; transition: all 0.12s ease;
}
.viewer__tab:hover { background: rgba(255,255,255,0.1); color: var(--text-primary,#fff); }
.viewer__tab.active { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.4); }
.viewer-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.viewer__code {
  background: var(--bg-code, #111);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 6px);
  padding: 1rem 1.1rem; margin: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.82rem; line-height: 1.55;
  color: var(--text-code, #d4d4d4);
  white-space: pre; overflow: auto; max-height: 70vh;
}
.viewer__copy {
  position: sticky; top: 0; float: right;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff; padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.75rem; font-weight: 600;
  cursor: pointer; margin-bottom: 0.5rem; z-index: 2;
  transition: all 0.12s ease;
}
.viewer__copy:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.viewer__copy:disabled { opacity: 0.4; cursor: wait; }
.viewer__copy.copied { background: rgba(106, 154, 106, 0.4); border-color: rgba(106, 154, 106, 0.7); }
.viewer__image {
  max-width: 100%; height: auto; display: block; margin: 0 auto;
  border-radius: var(--radius-md, 6px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}
.viewer__empty { color: var(--text-muted, #555); text-align: center; padding: 2rem 0; font-style: italic; }
