/* =========================================
   LAYOUT
   The IDE chrome — topbar, sidebar, tabs, foot.
   ========================================= */

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  height: 32px;
  padding: 0 12px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .dots { display: flex; gap: 6px; }
.topbar .dots span {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--bg);
}
.topbar .dots span:nth-child(1) { background: var(--rose); }
.topbar .dots span:nth-child(2) { background: var(--orange); }
.topbar .dots span:nth-child(3) { background: var(--acid); }
.topbar .title { letter-spacing: 1px; opacity: 0.8; }
.topbar .menu { display: flex; gap: 18px; margin-left: auto; }
.topbar .menu span { opacity: 0.7; }

/* ---------- IDE GRID ---------- */
.ide {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 32px);
}
.main { display: flex; flex-direction: column; min-width: 0; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  border-right: 2px solid var(--ink);
  background: var(--paper);
  padding: 16px 0;
  position: sticky;
  top: 32px;
  height: calc(100vh - 32px);
  overflow-y: auto;
  font-size: 12px;
}
.sidebar-head {
  padding: 0 14px 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  border-bottom: 2px dashed var(--ink);
  margin-bottom: 8px;
}
.tree { padding: 4px 8px; }
.tree-folder {
  cursor: pointer;
  padding: 4px 6px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tree-folder:hover { background: var(--acid); }
.tree-folder .arrow {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 10px;
}
.tree-folder.open .arrow { transform: rotate(90deg); }
.tree-children { padding-left: 18px; display: none; }
.tree-folder.open + .tree-children { display: block; }
.tree-file {
  cursor: pointer;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 2px solid transparent;
}
.tree-file:hover {
  background: var(--bg);
  border-left-color: var(--rose);
}
.tree-file.active {
  background: var(--ink);
  color: var(--bg);
  border-left-color: var(--acid);
}
.tree-file .icon { font-size: 10px; opacity: 0.6; }
.sidebar-footer {
  margin-top: 32px;
  padding: 12px 14px;
  border-top: 2px dashed var(--ink);
  font-size: 10px;
  opacity: 0.6;
}
.sidebar-footer .blink {
  color: var(--rose);
  animation: blink 1s steps(2) infinite;
}

/* ---------- TABS ---------- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  overflow-x: auto;
  height: 36px;
}
.tab {
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  border-right: 1.5px solid var(--ink);
  white-space: nowrap;
}
.tab.active { background: var(--bg); font-weight: 500; }
.tab .x { opacity: 0.4; font-size: 10px; }

/* ---------- BLOCK SECTIONS ---------- */
.block {
  padding: 64px 48px;
  border-bottom: 2px solid var(--ink);
}
.block-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}
.block-num {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
}
.block-num.outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.block-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  flex: 1;
}
.block-title::after {
  content: '';
  display: inline-block;
  width: 60%;
  height: 2px;
  background: var(--ink);
  margin-left: 12px;
  vertical-align: middle;
}

/* ---------- FOOTER ---------- */
.foot {
  padding: 32px 48px;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.foot .blink {
  color: var(--acid);
  animation: blink 1s steps(2) infinite;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 880px) {
  .ide { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .block { padding: 40px 24px; }
  .foot {
    flex-direction: column;
    gap: 8px;
    padding: 24px;
  }
}
